/* =====================================================
   Variáveis e reset
   ===================================================== */
:root {
    --primary:        #1e40af;
    --primary-dark:   #1e3a8a;
    --primary-light:  #dbeafe;
    --primary-xlight: #eff6ff;
    --accent:         #f59e0b;
    --bg:             #f1f5f9;
    --surface:        #ffffff;
    --border:         #e2e8f0;
    --border-light:   #f1f5f9;
    --text:           #0f172a;
    --text-2:         #475569;
    --text-3:         #94a3b8;
    --success:        #16a34a;
    --success-bg:     #dcfce7;
    --success-border: #86efac;
    --danger:         #dc2626;
    --danger-bg:      #fee2e2;
    --danger-border:  #fca5a5;
    --warn:           #d97706;
    --warn-bg:        #fef3c7;
    --warn-border:    #fcd34d;
    --shadow-sm:      0 1px 2px rgba(0,0,0,.06);
    --shadow:         0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md:      0 4px 8px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
    --shadow-lg:      0 10px 20px rgba(0,0,0,.08), 0 4px 8px rgba(0,0,0,.06);
    --r-sm:    6px;
    --r:       10px;
    --r-lg:    14px;
    --bnav-h:  60px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
input, button, select, textarea { font-family: inherit; }
input[type="datetime-local"],
input[type="date"],
input[type="time"] {
    width: 100%;
    box-sizing: border-box;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* =====================================================
   Topbar e menu
   ===================================================== */
.topbar {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    color: #fff;
    padding: 0 1rem;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(30,58,138,.25);
    position: sticky;
    top: 0;
    z-index: 100;
}
.brand {
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}
.brand:hover { text-decoration: none; }
.brand-logo { height: 38px; width: 38px; flex-shrink: 0; border-radius: 6px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-line-1 {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    opacity: 0.7;
    text-transform: uppercase;
}
.brand-line-2 { font-weight: 700; font-size: 0.95rem; margin-top: 2px; }

.menu-btn {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.25);
    color: #fff;
    font-size: 1.1rem;
    padding: 0.3rem 0.7rem;
    border-radius: var(--r-sm);
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s;
}
.menu-btn:hover { background: rgba(255,255,255,.2); }

.menu {
    display: none;
    position: fixed;
    top: 58px;
    left: 0; right: 0;
    background: var(--primary-dark);
    flex-direction: column;
    padding: 0.75rem 0;
    box-shadow: var(--shadow-lg);
    z-index: 99;
}
.menu.open { display: flex; }
.menu a {
    color: rgba(255,255,255,.9);
    padding: 0.65rem 1.25rem;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
    transition: background 0.12s, border-color 0.12s;
}
.menu a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.menu a.ativo { background: rgba(255,255,255,.1); border-left-color: var(--accent); color: #fff; font-weight: 600; }
.menu-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.65rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,.1);
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: rgba(255,255,255,.85);
}
.menu-user-text { display: flex; flex-direction: column; line-height: 1.25; }
.menu-user-text small { opacity: .7; font-size: .72rem; }
.menu-logout {
    color: rgba(255,255,255,.75) !important;
    font-size: 0.875rem;
    padding: 0.5rem 1.25rem;
}

@media (min-width: 720px) {
    .topbar { padding: 0 1.5rem; }
    .menu-btn { display: none; }
    .menu {
        display: flex !important;
        position: static;
        flex-direction: row;
        background: transparent;
        padding: 0;
        box-shadow: none;
        align-items: center;
        gap: 0.1rem;
    }
    .menu a {
        border: none;
        border-radius: var(--r-sm);
        padding: 0.3rem 0.65rem;
        font-size: 0.875rem;
        border-left: none !important;
        border-bottom: 2px solid transparent;
        border-radius: 0;
        padding: 0.3rem 0.6rem;
        font-size: .875rem;
    }
    .menu a:hover { background: rgba(255,255,255,.12); }
    .menu a.ativo { background: rgba(255,255,255,.12); border-bottom-color: var(--accent); }
    .menu-user {
        border-top: none;
        border-left: 1px solid rgba(255,255,255,.2);
        margin-top: 0;
        margin-left: 0.5rem;
        padding: 0.25rem 0.75rem;
        font-size: .82rem;
    }
    .menu-logout {
        padding: 0.25rem 0.6rem !important;
        border: 1px solid rgba(255,255,255,.3) !important;
        border-radius: var(--r-sm) !important;
        margin-left: 0.25rem;
        font-size: .82rem !important;
    }
    .menu-logout:hover { background: rgba(255,255,255,.12) !important; }
}

/* =====================================================
   Bottom Navigation (mobile PWA)
   ===================================================== */
.bnav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--bnav-h);
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 12px rgba(0,0,0,.08);
    z-index: 98;
}
.bnav-inner {
    display: flex;
    height: 100%;
    width: 100%;
    align-items: stretch;
}
.bnav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-3);
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 6px 4px;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.bnav-item svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.bnav-item.ativo { color: var(--primary); }
.bnav-item.bnav-nova { color: var(--primary); }
.bnav-nova-icon {
    width: 40px; height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(30,64,175,.4);
}
.bnav-nova-icon svg { stroke: #fff; width: 20px; height: 20px; }

@media (max-width: 719px) {
    .bnav { display: flex; }
    .main { padding-bottom: calc(var(--bnav-h) + 1rem); }
}

/* =====================================================
   Main e footer
   ===================================================== */
.main {
    max-width: 960px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}
.footer {
    text-align: center;
    padding: 1.5rem 1rem calc(var(--bnav-h) + 1.5rem);
    color: var(--text-3);
    font-size: 0.8rem;
}
@media (min-width: 720px) {
    .footer { padding-bottom: 1.5rem; }
}

/* =====================================================
   Headings
   ===================================================== */
h1 { font-size: 1.5rem; margin: 0 0 1rem; font-weight: 700; color: var(--text); }
h2 { font-size: 1.15rem; margin: 1.5rem 0 0.75rem; font-weight: 600; color: var(--text); }
h3 { font-size: 1rem; margin: 0 0 0.4rem; font-weight: 600; }
.muted { color: var(--text-2); font-size: 0.875rem; }
.vazio { color: var(--text-3); font-style: italic; padding: 1.25rem 0; text-align: center; }

/* =====================================================
   Flash messages
   ===================================================== */
.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--r);
    margin-bottom: 1rem;
    border: 1px solid;
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}
.flash-ok    { background: var(--success-bg); border-color: var(--success-border); color: #14532d; }
.flash-erro  { background: var(--danger-bg);  border-color: var(--danger-border);  color: #7f1d1d; }
.flash-aviso { background: #fef3c7; border-color: #fbbf24; color: #92400e; }

/* Overlay de "enviando arquivos" — aparece durante submit de forms multipart */
.upload-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, .55);
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.upload-overlay[hidden] { display: none; }
.upload-overlay-box {
    background: #fff;
    border-radius: 12px;
    padding: 28px 32px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
    max-width: 320px;
    width: 100%;
}
.upload-spinner {
    width: 48px; height: 48px;
    margin: 0 auto 16px;
    border: 4px solid #e5e7eb;
    border-top-color: var(--primary, #1e40af);
    border-radius: 50%;
    animation: upload-spin 0.8s linear infinite;
}
@keyframes upload-spin { to { transform: rotate(360deg); } }
.upload-overlay-msg {
    margin: 0 0 4px;
    font-weight: 600;
    color: #111827;
    font-size: 1rem;
}
.upload-overlay-hint {
    margin: 0;
    font-size: .85rem;
    color: #6b7280;
}
body.upload-overlay-active { overflow: hidden; }

/* =====================================================
   Cards
   ===================================================== */
.card {
    background: var(--surface);
    border-radius: var(--r);
    padding: 1.1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}
.card-alerta {
    background: var(--warn-bg);
    border: 1px solid var(--warn-border);
    border-left: 4px solid var(--accent);
}
.card-alerta h2 { color: #92400e; }

/* =====================================================
   Ações rápidas (grid de botões grandes)
   ===================================================== */
.acoes-rapidas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin: 0.5rem 0 1.75rem;
}
.card-acao {
    background: var(--surface);
    border-radius: var(--r);
    padding: 1.25rem 1.1rem;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.card-acao:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
    text-decoration: none;
}
.card-acao-icon {
    font-size: 1.5rem;
    margin-bottom: 2px;
    line-height: 1;
}
.card-acao h3 { color: var(--primary); font-size: 0.95rem; }
.card-acao p  { color: var(--text-2); font-size: 0.82rem; margin: 0; }

/* =====================================================
   Dashboard — hero e seções
   ===================================================== */
.dashboard-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--r-lg);
    padding: 1.5rem;
    color: #fff;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
}
.ola-usuario {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 0;
}
.ola-usuario h1 { margin: 0; color: #fff; font-size: 1.35rem; }
.ola-usuario .ola-sub { color: rgba(255,255,255,.75); font-size: .85rem; margin: 2px 0 0; }

.secao { margin: 1.75rem 0; }
.secao-titulo {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.secao-titulo::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* =====================================================
   Card cinza (dashboard — andamento e últimas viagens)
   ===================================================== */
.card-dash {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
}
.card-dash strong { display: block; font-size: .95rem; color: var(--text); margin-bottom: 3px; }
.card-dash-meta { margin: 0 0 10px; font-size: .82rem; color: var(--text-2); }
.card-dash .card-acoes { margin-top: 10px; }

.card-dash-link {
    display: block;
    text-decoration: none;
    transition: background 0.12s, border-color 0.12s;
}
.card-dash-link:hover {
    background: var(--bg);
    border-color: var(--primary-light);
    text-decoration: none;
}
.card-dash-link .card-dash-meta { margin-bottom: 0; }

/* =====================================================
   Botões
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0.55rem 1.2rem;
    border-radius: var(--r-sm);
    border: 1.5px solid transparent;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 6px rgba(30,64,175,.3);
}
.btn-primary:hover { background: var(--primary-dark); color: #fff; box-shadow: 0 4px 10px rgba(30,64,175,.35); }
.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg); }
.btn-danger  { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 1.75rem; font-size: 1rem; }

/* =====================================================
   Cards de viagem
   ===================================================== */
.lista-cards { display: flex; flex-direction: column; gap: 0.75rem; }
.card-viagem {
    background: var(--surface);
    border-radius: var(--r);
    padding: 1rem 1.15rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}
.card-viagem-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}
.card-acoes {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

/* =====================================================
   Badges (status)
   ===================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.badge-pendente   { background: var(--warn-bg);     color: #92400e; }
.badge-aprovada   { background: var(--success-bg);  color: #14532d; }
.badge-negada     { background: var(--danger-bg);   color: #7f1d1d; }
.badge-cancelada  { background: #f1f5f9;            color: #475569; }
.badge-concluida  { background: var(--primary-light); color: var(--primary-dark); }
.badge-em_uso     { background: #ede9fe;            color: #5b21b6; }
.badge-aguardando_retirada { background: var(--warn-bg); color: #92400e; }
.badge-ativo      { background: var(--success-bg);  color: #14532d; }
.badge-manutencao { background: var(--warn-bg);     color: #92400e; }
.badge-inativo    { background: var(--danger-bg);   color: #7f1d1d; }

/* =====================================================
   Tabelas (compartilhada — telas fora do painel admin,
   ex.: Patrimônio, que usam o layout principal)
   ===================================================== */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
    font-size: 0.9rem;
}
.table th,
.table td {
    padding: 0.6rem 0.8rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.table th {
    background: var(--bg);
    color: var(--text-2);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table .empty,
.table .vazio { text-align: center; color: var(--text-3); padding: 1.5rem; font-style: italic; }

/* =====================================================
   Lista simples
   ===================================================== */
.lista-simples { list-style: none; padding: 0; margin: 0; }
.lista-simples li { border-bottom: 1px solid var(--border); }
.lista-simples li:last-child { border-bottom: none; }
.lista-simples a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    color: var(--text);
    gap: 0.5rem;
}
.lista-simples a:hover { color: var(--primary); text-decoration: none; }

/* =====================================================
   Formulários
   ===================================================== */
.form-grupo { margin-bottom: 1.1rem; }
.form-grupo label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-2);
    margin-bottom: 0.4rem;
}
.form-grupo input,
.form-grupo select,
.form-grupo textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: var(--r-sm);
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-grupo input:focus,
.form-grupo select:focus,
.form-grupo textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30,64,175,.1);
}
.form-grupo .ajuda {
    display: block;
    color: var(--text-3);
    font-size: 0.8rem;
    margin-top: 0.3rem;
}
.form-grupo-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

/* =====================================================
   Tela de login
   ===================================================== */
.login-container {
    min-height: calc(100vh - 58px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: linear-gradient(160deg, #eff6ff 0%, #f1f5f9 60%);
}
.login-card {
    background: var(--surface);
    border-radius: var(--r-lg);
    padding: 2.5rem 2rem;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}
.login-logo { width: 100px; height: 100px; margin: 0 auto 1.25rem; display: block; }
.login-titulo small {
    display: block;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--text-3);
    text-transform: uppercase;
}
.login-titulo h1 { margin: .3rem 0 0; font-size: 1.6rem; color: var(--primary); }
.login-sub { color: var(--text-2); font-size: 0.875rem; margin-top: -0.25rem; margin-bottom: 1.75rem; }
.login-info {
    background: var(--primary-xlight);
    border: 1px solid var(--primary-light);
    border-radius: var(--r-sm);
    padding: 0.65rem 1rem;
    font-size: 0.875rem;
    color: var(--primary-dark);
    margin: 1.25rem 0;
}
.btn-google {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--r);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.12s, box-shadow 0.12s;
    box-shadow: var(--shadow-sm);
}
.btn-google:hover {
    background: var(--bg);
    box-shadow: var(--shadow);
    text-decoration: none;
}
.login-help {
    margin-top: 2rem;
    color: var(--text-3);
    font-size: 0.8rem;
}

/* =====================================================
   Avatar
   ===================================================== */
.avatar {
    display: inline-block;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
    background: var(--border);
    flex-shrink: 0;
    max-width: none;
}
.avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    border-radius: 50%;
}
.avatar-28 { width: 28px; height: 28px; font-size: .7rem; }
.avatar-36 { width: 36px; height: 36px; font-size: .82rem; }
.avatar-40 { width: 40px; height: 40px; font-size: .9rem; }
.avatar-56 { width: 56px; height: 56px; font-size: 1.1rem; }

/* =====================================================
   Condutor (cadastro / status)
   ===================================================== */
.condutor-status, .cond-cadastro { max-width: 640px; margin: 0 auto; }
.cond-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 20px;
    margin: 16px 0;
    box-shadow: var(--shadow-sm);
}
.cond-card h2 { margin: 0 0 12px; font-size: 1.1rem; }
.cond-card-ok   { border-left: 4px solid var(--success); }
.cond-card-warn { border-left: 4px solid var(--warn); }
.cond-card-erro { border-left: 4px solid var(--danger); }
.cond-card dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.cond-card dt { color: var(--text-2); font-size: .82rem; }
.cond-card dd { margin: 0; font-weight: 600; }
.cond-hint { color: var(--text-2); font-size: .875rem; }

.btn-cond {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 18px;
    border-radius: var(--r-sm);
    background: var(--bg);
    color: var(--text);
    text-decoration: none;
    border: 1.5px solid var(--border);
    cursor: pointer;
    font-size: .95rem;
    font-family: inherit;
    font-weight: 600;
    transition: background 0.15s;
}
.btn-cond-primary {
    background: var(--primary);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 6px rgba(30,64,175,.3);
}
.btn-cond-primary:disabled { background: var(--text-3); cursor: not-allowed; box-shadow: none; }
.btn-cond-primary:not(:disabled):hover { background: var(--primary-dark); }

.cond-form fieldset {
    border: 1.5px solid var(--border);
    border-radius: var(--r);
    padding: 16px;
    margin: 16px 0;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.cond-form legend { padding: 0 8px; font-weight: 700; color: var(--primary); font-size: .9rem; }
.cond-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 10px 0;
    font-size: .875rem;
    color: var(--text-2);
    font-weight: 600;
}
.cond-form input[type=text],
.cond-form input[type=date],
.cond-form select {
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--r-sm);
    font-size: .95rem;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.cond-form input:focus, .cond-form select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30,64,175,.1);
}
.cond-form input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.cond-upload { position: relative; display: block; }
.cond-upload-btn {
    display: block;
    padding: 14px 16px;
    background: var(--primary-xlight);
    border: 1.5px dashed var(--primary);
    border-radius: var(--r);
    color: var(--primary);
    text-align: center;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.cond-upload-btn:hover { background: var(--primary-light); }
.cond-preview {
    display: block;
    width: 100%;
    margin-top: 12px;
    max-height: 280px;
    object-fit: cover;
    border-radius: var(--r);
    border: 1px solid var(--border);
}
.cond-preview-pdf {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 14px;
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: var(--r);
    color: var(--text-2);
    font-size: .9rem;
    text-align: center;
}
.cond-preview-pdf span { color: var(--primary); font-weight: 600; }
.cond-termo {
    background: var(--bg);
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    padding: 12px;
    font-size: .875rem;
    max-height: 180px;
    overflow-y: auto;
    color: var(--text-2);
}
.cond-checkbox {
    flex-direction: row !important;
    align-items: flex-start;
    gap: 10px;
    font-weight: 500;
    margin-top: 12px;
    line-height: 1.4;
}
.cond-checkbox input { margin-top: 3px; }
.cond-actions {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    margin-top: 20px;
}

.gps-status {
    padding: 10px 12px;
    background: var(--bg);
    border-radius: var(--r-sm);
    font-size: .875rem;
    color: var(--text-2);
    border: 1px solid var(--border);
}
.gps-status-ok   { background: var(--success-bg);  color: #14532d; border-color: var(--success-border); }
.gps-status-erro { background: var(--danger-bg);   color: #7f1d1d; border-color: var(--danger-border); }

/* =====================================================
   Abas
   ===================================================== */
.abas {
    display: flex;
    gap: 2px;
    margin: 0 0 1rem;
    border-bottom: 2px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.abas::-webkit-scrollbar { display: none; }
.aba {
    padding: 8px 14px;
    color: var(--text-2);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    font-weight: 600;
    font-size: .875rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.15s;
}
.aba:hover { color: var(--primary); text-decoration: none; }
.aba-ativa { color: var(--primary); border-bottom-color: var(--primary); }
.aba-count {
    background: var(--border);
    color: var(--text-2);
    padding: 1px 7px;
    border-radius: 999px;
    font-size: .72rem;
}
.aba-ativa .aba-count { background: var(--primary); color: #fff; }

/* =====================================================
   Combobox de passageiros internos
   ===================================================== */
.pax-combobox {
    border: 1.5px solid var(--border);
    border-radius: var(--r);
    background: var(--surface);
    padding: 6px;
    position: relative;
}
.pax-combobox:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,64,175,.1); }
.pax-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.pax-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 999px;
    padding: 3px 10px 3px 12px;
    font-size: .82rem;
    font-weight: 600;
}
.pax-chip-nome { white-space: nowrap; }
.pax-chip-rm {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    opacity: .7;
}
.pax-chip-rm:hover { opacity: 1; }
.pax-input-wrap { display: flex; align-items: center; }
.pax-input {
    border: none;
    outline: none;
    width: 100%;
    padding: 6px 4px;
    font-size: .9rem;
    font-family: inherit;
    background: transparent;
    color: var(--text);
}
.pax-dropdown {
    position: absolute;
    left: 0; right: 0;
    top: calc(100% + 4px);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    max-height: 240px;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    padding: 4px 0;
}
.pax-dropdown-item {
    display: flex;
    flex-direction: column;
    padding: 8px 14px;
    cursor: pointer;
    font-size: .875rem;
}
.pax-dropdown-item:hover { background: var(--primary-xlight); }
.pax-dropdown-item strong { color: var(--text); }
.pax-dropdown-item small { color: var(--text-2); font-size: .75rem; margin-top: 1px; }
.pax-dropdown-vazio { padding: 10px 14px; color: var(--text-3); font-size: .875rem; font-style: italic; }

.terceiro-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    background: var(--warn-bg);
    border-radius: var(--r-sm);
    margin-bottom: 8px;
    border-left: 3px solid var(--warn);
}
.terceiro-item input,
.terceiro-item textarea {
    padding: 8px 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--r-sm);
    font-size: .9rem;
    font-family: inherit;
    background: var(--surface);
}
.terceiro-item .btn-remove-terceiro {
    align-self: flex-end;
    background: transparent;
    color: var(--danger);
    padding: 4px 8px;
    font-size: .82rem;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
}

.grade-fotos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}
.grade-fotos-item {
    display: block;
    text-decoration: none;
    color: var(--text);
    background: var(--bg);
    border-radius: var(--r-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: box-shadow 0.15s;
}
.grade-fotos-item:hover { box-shadow: var(--shadow-md); }
.grade-fotos-item img { width: 100%; height: 120px; object-fit: cover; display: block; }
.grade-fotos-item small { display: block; padding: 6px 8px; font-size: .75rem; color: var(--text-2); }

/* =====================================================
   Responsivo — ajustes mobile
   ===================================================== */
/* Tabelas: em telas estreitas, rolam na horizontal em vez de espremer. */
@media (max-width: 640px) {
    .table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    .table thead,
    .table tbody { display: table; width: max-content; min-width: 100%; }
}

@media (max-width: 480px) {
    .acoes-rapidas { grid-template-columns: 1fr 1fr; }
    .form-grupo-2 { grid-template-columns: 1fr; }
    h1 { font-size: 1.3rem; }
    .main { margin-top: 1rem; }
    .card { padding: 0.9rem 1rem; }
    .cond-card { padding: 16px; }
    .cond-actions { flex-wrap: wrap; }
    .cond-actions .btn-cond { flex: 1 1 auto; text-align: center; }
    .dashboard-hero { padding: 1.1rem; }
    .ola-usuario h1 { font-size: 1.15rem; }
}
@media (max-width: 360px) {
    .acoes-rapidas { grid-template-columns: 1fr; }
}

/* Conforto em telas grandes: limita a largura de leitura e amplia o respiro. */
@media (min-width: 1024px) {
    .main { margin-top: 2rem; padding: 0 1.5rem; }
}
