:root {
    --carai-navy: #0f1c2e;
    --carai-navy-light: #16283f;
    --carai-primary: #2f6fed;
    --carai-primary-dark: #2559c4;
    --carai-bg: #f4f6fa;
    --carai-border: #e4e8f0;
    --carai-text-muted: #7c8aa0;
}

html, body {
    height: 100%;
    background-color: var(--carai-bg);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: #1b2733;
}

.loading-splash {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    height: 100vh;
    color: var(--carai-text-muted);
    background-color: var(--carai-navy);
}

.loading-splash i {
    font-size: 2.5rem;
    color: var(--carai-primary);
}

.btn-primary {
    background-color: var(--carai-primary);
    border-color: var(--carai-primary);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--carai-primary-dark) !important;
    border-color: var(--carai-primary-dark) !important;
}

.text-primary {
    color: var(--carai-primary) !important;
}

.bg-primary-subtle {
    background-color: rgba(47, 111, 237, 0.12) !important;
}

/* ---- Login split screen ---- */
.login-page {
    min-height: 100vh;
    display: flex;
}

.login-hero {
    flex: 1.1;
    background: linear-gradient(160deg, var(--carai-navy) 0%, #163257 65%, #1c4680 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.login-hero::after {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: rgba(47, 111, 237, 0.18);
    right: -140px;
    bottom: -140px;
}

.login-hero-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.4rem;
    font-weight: 700;
    z-index: 1;
}

.login-hero-copy {
    z-index: 1;
    max-width: 380px;
}

.login-hero-copy h2 {
    color: #fff;
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.login-hero-copy p {
    color: rgba(255, 255, 255, 0.75);
}

.login-hero-footer {
    z-index: 1;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.85rem;
}

.login-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background-color: #fff;
}

.login-form-wrapper {
    width: 100%;
    max-width: 380px;
}

@media (max-width: 767.98px) {
    .login-page {
        flex-direction: column;
    }

    .login-hero {
        padding: 2rem;
        min-height: 240px;
    }

    .login-hero-copy {
        display: none;
    }
}

/* ---- Dashboard ---- */
.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.card {
    border-radius: 0.75rem;
}

.badge-status-em-breve {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.2rem 0.5rem;
}

/* ---- Topbar ---- */
.topbar-search {
    max-width: 320px;
}

.topbar-search .form-control {
    background-color: var(--carai-bg);
    border: 1px solid var(--carai-border);
}

.topbar-icon-btn {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--carai-bg);
    color: #4a5568;
    border: none;
    position: relative;
}

.topbar-icon-btn .notif-dot {
    position: absolute;
    top: 0.35rem;
    right: 0.5rem;
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background-color: #e5484d;
}

.avatar-circle {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    background-color: var(--carai-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

/* ---- Carro photo thumb ---- */
.carro-thumb {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    object-fit: cover;
    background-color: var(--carai-bg);
    flex-shrink: 0;
}

.carro-thumb-placeholder {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    background-color: var(--carai-bg);
    color: var(--carai-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.carro-row {
    cursor: pointer;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ---- Faixa de alerta (dias em estoque) ---- */
.text-orange {
    color: #e08b17 !important;
}

.faixa-dot {
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    margin-right: 0.4rem;
}

.faixa-dot-verde { background-color: #2fb380; }
.faixa-dot-amarelo { background-color: #e0b217; }
.faixa-dot-laranja { background-color: #e08b17; }
.faixa-dot-vermelho { background-color: #e5484d; }

.kpi-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.alerta-card {
    background-color: #fdecea;
    border: 1px solid #f5c2c0;
    border-radius: 0.75rem;
}

/* ---- Histórico do veículo (timeline) ---- */
.historico-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.historico-timeline li {
    position: relative;
}

.historico-timeline li:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 1.1rem;
    top: 2.25rem;
    bottom: 0;
    width: 2px;
    background-color: var(--carai-border);
}

/* ---- Upload/gerenciamento de fotos ---- */
.foto-remove-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.foto-remove-btn-sm {
    position: absolute;
    top: -0.35rem;
    right: -0.35rem;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.foto-thumb-selecionavel {
    cursor: pointer;
    border: 2px solid transparent;
}

.foto-thumb-selecionavel:hover {
    border-color: var(--carai-primary);
}
