/* =========================================================================
   Hidrossolo — Design System (CSS próprio, sem frameworks)
   Fonte: Tahoma (com fallback para sistema)
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Tokens
   ------------------------------------------------------------------------- */
:root {
    /* Tipografia — Tahoma com fallback */
    --font-sans: Tahoma, Verdana, "Segoe UI", Geneva, "DejaVu Sans", sans-serif;
    --font-mono: "Consolas", "Courier New", monospace;

    --fs-xs: .75rem;
    --fs-sm: .875rem;
    --fs-base: 1rem;
    --fs-lg: 1.125rem;
    --fs-xl: 1.35rem;
    --fs-2xl: 1.75rem;
    --fs-3xl: 2.25rem;
    --fs-4xl: 2.85rem;

    --fw-normal: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    --fw-black: 800;

    --lh-tight: 1.2;
    --lh-base: 1.6;

    /* Cores de marca */
    --primary: #1e40af;
    --primary-dark: #1e3a8a;
    --primary-light: #3b82f6;
    --primary-soft: #eff4ff;
    --secondary: #0891b2;
    --secondary-light: #06b6d4;
    --accent: #f59e0b;

    --success: #059669;
    --success-soft: #ecfdf5;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --warning: #d97706;
    --warning-soft: #fffbeb;
    --info: #0284c7;
    --info-soft: #f0f9ff;

    --text: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --heading: #0b1f3a;

    --bg: #f6f8fc;
    --bg-alt: #eef2f9;
    --surface: #ffffff;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    /* Gradientes */
    --gradient: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    --gradient-deep: linear-gradient(135deg, #0b1f3a 0%, #1e40af 55%, #0891b2 100%);
    --gradient-secondary: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);

    /* Raios */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --radius-xl: 26px;
    --radius-pill: 999px;

    /* Sombras */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, .07);
    --shadow: 0 8px 24px rgba(15, 23, 42, .09);
    --shadow-lg: 0 18px 45px rgba(15, 23, 42, .14);

    --transition: .22s cubic-bezier(.4, 0, .2, 1);

    --header-height: 74px;
}

/* -------------------------------------------------------------------------
   2. Reset / Base
   ------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

/* Rolagem suave apenas onde for explicitamente pedido (evita instabilidade em automação) */
.smooth-scroll { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    line-height: var(--lh-base);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 .6rem;
    font-family: var(--font-sans);
    font-weight: var(--fw-bold);
    line-height: var(--lh-tight);
    color: var(--heading);
    letter-spacing: -.01em;
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5 { font-size: 1.05rem; }
h6 { font-size: var(--fs-sm); }

p { margin: 0 0 1rem; }

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }

small, .small { font-size: var(--fs-sm); }

ul, ol { margin: 0 0 1rem; }

::selection { background: var(--primary); color: #fff; }

:focus-visible { outline: 3px solid rgba(59, 130, 246, .45); outline-offset: 2px; }

/* -------------------------------------------------------------------------
   3. Grid / Container
   ------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 1.15rem;
}

.container-fluid { width: 100%; padding-inline: 1.15rem; }

.row {
    display: flex;
    flex-wrap: wrap;
    --gutter: 1.5rem;
    gap: var(--gutter);
    margin: 0;
}

.g-0 { --gutter: 0; }
.g-1 { --gutter: .25rem; }
.g-2 { --gutter: .5rem; }
.g-3 { --gutter: 1rem; }
.g-4 { --gutter: 1.5rem; }
.g-5 { --gutter: 2.5rem; }

.row > * { min-width: 0; }

.col-12 { flex: 0 0 100%; }

@media (min-width: 768px) {
    .col-md-2 { flex: 0 0 calc(16.6667% - var(--gutter) * 10 / 12); }
    .col-md-3 { flex: 0 0 calc(25% - var(--gutter) * 9 / 12); }
    .col-md-4 { flex: 0 0 calc(33.3333% - var(--gutter) * 8 / 12); }
    .col-md-5 { flex: 0 0 calc(41.6667% - var(--gutter) * 7 / 12); }
    .col-md-6 { flex: 0 0 calc(50% - var(--gutter) * 6 / 12); }
    .col-md-8 { flex: 0 0 calc(66.6667% - var(--gutter) * 4 / 12); }
}

@media (min-width: 992px) {
    .col-lg-2 { flex: 0 0 calc(16.6667% - var(--gutter) * 10 / 12); }
    .col-lg-3 { flex: 0 0 calc(25% - var(--gutter) * 9 / 12); }
    .col-lg-4 { flex: 0 0 calc(33.3333% - var(--gutter) * 8 / 12); }
    .col-lg-5 { flex: 0 0 calc(41.6667% - var(--gutter) * 7 / 12); }
    .col-lg-6 { flex: 0 0 calc(50% - var(--gutter) * 6 / 12); }
    .col-lg-7 { flex: 0 0 calc(58.3333% - var(--gutter) * 5 / 12); }
    .col-lg-8 { flex: 0 0 calc(66.6667% - var(--gutter) * 4 / 12); }
}

/* -------------------------------------------------------------------------
   4. Utilitários de layout
   ------------------------------------------------------------------------- */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.align-items-center { align-items: center !important; }
.align-items-end { align-items: flex-end !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }

@media (min-width: 768px) { .d-md-inline { display: inline !important; } }
@media (min-width: 992px) {
    .d-lg-flex { display: flex !important; }
    .d-lg-inline-block { display: inline-block !important; }
    .d-lg-none { display: none !important; }
}

.gap-2 { gap: .5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }

.w-100 { width: 100% !important; }
.w-auto { width: auto !important; }
.h-100 { height: 100% !important; }
.mw-100 { max-width: 100% !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.my-2 { margin-top: .5rem !important; margin-bottom: .5rem !important; }
.mt-auto { margin-top: auto !important; }
.ms-auto { margin-left: auto !important; }

/* Espaçamentos */
.m-0 { margin: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: .25rem !important; }
.mb-2 { margin-bottom: .5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }
.mt-1 { margin-top: .25rem !important; }
.mt-2 { margin-top: .5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }
.me-1 { margin-right: .25rem !important; }
.me-2 { margin-right: .5rem !important; }
.me-3 { margin-right: 1rem !important; }
.ms-1 { margin-left: .25rem !important; }
.ms-2 { margin-left: .5rem !important; }
.ms-3 { margin-left: 1rem !important; }
.p-0 { padding: 0 !important; }
.p-2 { padding: .5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 3rem !important; }
.pt-4 { padding-top: 1.5rem !important; }
.pb-2 { padding-bottom: .5rem !important; }
.pb-3 { padding-bottom: 1rem !important; }
.py-1 { padding-top: .25rem !important; padding-bottom: .25rem !important; }
.py-2 { padding-top: .5rem !important; padding-bottom: .5rem !important; }
.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.py-5 { padding-top: 3.5rem !important; padding-bottom: 3.5rem !important; }

/* Posicionamento */
.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }
.fixed-top { position: fixed; top: 0; right: 0; left: 0; z-index: 1030; }
.sticky-top { position: sticky; top: 0; z-index: 1020; }
.top-0 { top: 0 !important; }
.start-100 { left: 100% !important; }
.translate-middle { transform: translate(-50%, -50%) !important; }
.overflow-hidden { overflow: hidden !important; }

/* -------------------------------------------------------------------------
   5. Utilitários de texto e cor
   ------------------------------------------------------------------------- */
.text-center { text-align: center !important; }
.text-end { text-align: right !important; }
.text-start { text-align: left !important; }
.text-muted { color: var(--text-muted) !important; }
.text-light { color: var(--text-light) !important; }
.text-dark { color: var(--text) !important; }
.text-white { color: #fff !important; }
.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--secondary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-info { color: var(--info) !important; }
.text-decoration-none { text-decoration: none !important; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.fw-normal { font-weight: var(--fw-normal) !important; }
.fw-medium { font-weight: var(--fw-medium) !important; }
.fw-semibold { font-weight: var(--fw-semibold) !important; }
.fw-bold { font-weight: var(--fw-bold) !important; }
.fst-italic { font-style: italic !important; }
.fs-1 { font-size: var(--fs-3xl) !important; }
.fs-5 { font-size: var(--fs-lg) !important; }
.font-monospace { font-family: var(--font-mono) !important; }
.lead { font-size: 1.14rem; font-weight: var(--fw-normal); color: var(--text-muted); }
.display-1 { font-size: 3.6rem; font-weight: var(--fw-black); line-height: 1.1; }

.bg-white { background-color: var(--surface) !important; }
.bg-light { background-color: var(--bg-alt) !important; }
.bg-dark { background-color: #0f172a !important; }
.bg-primary { --bg-rgb: 30, 64, 175; background-color: var(--primary) !important; }
.bg-secondary { --bg-rgb: 8, 145, 178; background-color: var(--secondary) !important; }
.bg-success { --bg-rgb: 5, 150, 105; background-color: var(--success) !important; }
.bg-danger { --bg-rgb: 220, 38, 38; background-color: var(--danger) !important; }
.bg-warning { --bg-rgb: 217, 119, 6; background-color: var(--warning) !important; }
.bg-info { --bg-rgb: 2, 132, 199; background-color: var(--info) !important; }

.bg-opacity-10 { background-color: rgba(var(--bg-rgb, 15, 23, 42), .1) !important; }
.bg-opacity-25 { background-color: rgba(var(--bg-rgb, 15, 23, 42), .25) !important; }

/* -------------------------------------------------------------------------
   6. Bordas / sombras / raios
   ------------------------------------------------------------------------- */
.border-top { border-top: 1px solid var(--border) !important; }
.border-bottom { border-bottom: 1px solid var(--border) !important; }
.border-primary { border-color: var(--primary) !important; }
.border-secondary { border-color: var(--border-strong) !important; }
.border-warning { border-color: var(--warning) !important; }
.border-bottom-0 { border-bottom: 0 !important; }

.rounded { border-radius: var(--radius-sm) !important; }
.rounded-3 { border-radius: var(--radius) !important; }
.rounded-4 { border-radius: var(--radius-lg) !important; }
.rounded-circle { border-radius: 50% !important; }
.rounded-pill { border-radius: var(--radius-pill) !important; }

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow { box-shadow: var(--shadow) !important; }

/* -------------------------------------------------------------------------
   7. Botões
   ------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .68rem 1.5rem;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
    background: var(--bg-alt);
    color: var(--text);
}

.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; }

.btn-primary { background: var(--gradient); color: #fff; }
.btn-primary:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(30, 64, 175, .32); }

.btn-secondary { background: #475569; color: #fff; }
.btn-secondary:hover { color: #fff; background: #334155; }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { color: #fff; filter: brightness(1.08); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { color: #fff; filter: brightness(1.08); }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { color: #fff; filter: brightness(1.08); }

.btn-light { background: #fff; color: var(--text); border-color: var(--border); }
.btn-light:hover { background: var(--bg-alt); }

.btn-outline-primary { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline-primary:hover { background: var(--gradient); color: #fff; border-color: transparent; }

.btn-outline-secondary { background: transparent; border-color: var(--border-strong); color: #475569; }
.btn-outline-secondary:hover { background: #475569; color: #fff; border-color: #475569; }

.btn-outline-success { background: transparent; border-color: var(--success); color: var(--success); }
.btn-outline-success:hover { background: var(--success); color: #fff; }

.btn-outline-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-outline-danger:hover { background: var(--danger); color: #fff; }

.btn-outline-light { background: transparent; border-color: rgba(255, 255, 255, .6); color: #fff; }
.btn-outline-light:hover { background: #fff; color: var(--primary); }

.btn-lg { padding: .95rem 2.2rem; font-size: var(--fs-base); border-radius: var(--radius); }
.btn-sm { padding: .4rem .85rem; font-size: var(--fs-xs); border-radius: 7px; }

.btn-close {
    width: 1.15rem; height: 1.15rem;
    padding: 0; margin-left: .75rem;
    border: 0; border-radius: 50%;
    background: transparent;
    color: inherit; opacity: .55;
    cursor: pointer; font-size: 1rem; line-height: 1;
}
.btn-close::before { content: "✕"; }
.btn-close:hover { opacity: 1; }

/* -------------------------------------------------------------------------
   8. Formulários
   ------------------------------------------------------------------------- */
.form-label {
    display: block;
    margin-bottom: .4rem;
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: #334155;
}

.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: .68rem .9rem;
    font-family: var(--font-sans);
    font-size: var(--fs-sm);
    color: var(--text);
    background: #fff;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none;
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%2364748b' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .9rem center;
    padding-right: 2.2rem;
}

.form-control:focus,
.form-select:focus {
    outline: 0;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .15);
}

.form-control::placeholder { color: var(--text-light); }

textarea.form-control { min-height: 130px; resize: vertical; }

.form-control-sm { padding: .42rem .7rem; font-size: var(--fs-xs); }

.form-check { display: flex; align-items: center; gap: .55rem; padding-left: 0; margin-bottom: .5rem; }
.form-check-input {
    width: 1.05rem; height: 1.05rem;
    margin: 0;
    accent-color: var(--primary);
    cursor: pointer;
}
.form-check-label { margin: 0; font-size: var(--fs-sm); cursor: pointer; }

.input-group { display: flex; width: 100%; }
.input-group > .form-control,
.input-group > .form-select { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group > .btn,
.input-group > .form-control + * { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group > *:not(:first-child) { margin-left: -1.5px; }
.input-group > *:not(:first-child):not(.btn) { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group-sm > .form-control,
.input-group-sm > .btn { padding: .35rem .6rem; font-size: var(--fs-xs); }

/* -------------------------------------------------------------------------
   9. Cards
   ------------------------------------------------------------------------- */
.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #dbe4f0; }

.card-body { padding: 1.6rem; flex: 1 1 auto; }
.card-title { font-size: var(--fs-lg); font-weight: var(--fw-bold); margin-bottom: .5rem; }
.card-text { color: var(--text-muted); font-size: var(--fs-sm); }
.card-header {
    padding: 1rem 1.4rem;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    font-weight: var(--fw-semibold);
}
.card-img-top { width: 100%; height: 220px; object-fit: cover; }

/* -------------------------------------------------------------------------
   10. Tabelas
   ------------------------------------------------------------------------- */
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
}

.table th,
.table td { padding: .8rem .9rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }

.table thead th {
    background: var(--bg-alt);
    color: #475569;
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}

.table tbody tr { transition: background var(--transition); }
.table-hover tbody tr:hover { background: var(--primary-soft); }
.table-light { background: var(--bg-alt) !important; }
.table-warning { background: var(--warning-soft) !important; }
.table-active { background: var(--primary-soft) !important; }
.table-sm th, .table-sm td { padding: .5rem .65rem; }

/* -------------------------------------------------------------------------
   11. Alertas / badges / listas
   ------------------------------------------------------------------------- */
/* Bloco (não flex): com flex, textos com <strong>/<a> quebravam em colunas estreitas no celular */
.alert {
    position: relative;
    padding: .9rem 1.15rem;
    margin-bottom: 1rem;
    border-radius: var(--radius);
    border-left: 4px solid currentColor;
    font-size: var(--fs-sm);
    line-height: 1.5;
}
.alert > i:first-child { margin-right: .35rem; }
.alert p:last-child { margin-bottom: 0; }
.alert-success { background: var(--success-soft); color: #047857; }
.alert-danger { background: var(--danger-soft); color: #b91c1c; }
.alert-warning { background: var(--warning-soft); color: #b45309; }
.alert-info { background: var(--info-soft); color: #0369a1; }
.alert-dismissible { padding-right: 2.9rem; }
.alert-dismissible .btn-close {
    position: absolute;
    top: .7rem;
    right: .8rem;
    margin: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: .3em .7em;
    border-radius: var(--radius-pill);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    line-height: 1;
    color: #fff;
    background: var(--text-muted);
}
.badge.bg-success { background: var(--success) !important; }
.badge.bg-danger { background: var(--danger) !important; }
.badge.bg-warning { background: var(--warning) !important; }
.badge.bg-info { background: var(--info) !important; }
.badge.bg-primary { background: var(--primary) !important; }
.badge.bg-secondary { background: #64748b !important; }

.list-unstyled { list-style: none; padding-left: 0; }

.list-group { display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; }
.list-group-item {
    padding: .9rem 1.15rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom: 0;
    color: inherit;
}
.list-group-item:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.list-group-item:last-child { border-bottom: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
.list-group-flush .list-group-item { border-left: 0; border-right: 0; }
.list-group-item-action { cursor: pointer; transition: background var(--transition); }
.list-group-item-action:hover { background: var(--primary-soft); }

/* -------------------------------------------------------------------------
   12. Navegação
   ------------------------------------------------------------------------- */
.nav { display: flex; flex-wrap: wrap; list-style: none; padding-left: 0; margin: 0; gap: .25rem; }
.nav-item { list-style: none; }
.nav-link {
    display: block;
    padding: .55rem .9rem;
    color: var(--text-muted);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
}
.nav-link:hover { color: var(--primary); background: var(--primary-soft); }

.nav-tabs { border-bottom: 1px solid var(--border); gap: .3rem; }
.nav-tabs .nav-link { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.nav-tabs .nav-link.active { color: var(--primary); background: var(--surface); border-bottom: 2px solid var(--primary); }

.tab-content > .tab-pane { display: none; }
.tab-content > .tab-pane.active { display: block; }

/* Navbar institucional */
.navbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .65rem 0;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(12px);
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--transition), background var(--transition);
}
.navbar.fixed-top { padding: .65rem 0; }
.navbar.navbar-scrolled { box-shadow: var(--shadow-sm); }
.navbar .container { display: flex; align-items: center; gap: 1rem; width: 100%; }
.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    font-size: 1.3rem;
    font-weight: var(--fw-bold);
    color: var(--primary);
}
.navbar-brand:hover { color: var(--primary-dark); }
.navbar-brand img { height: 42px; }

.navbar-nav { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; gap: .15rem; }
.navbar-nav .nav-link { font-weight: var(--fw-medium); color: #334155; }
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active { color: var(--primary); background: var(--primary-soft); }

.navbar-collapse { display: none; flex-basis: 100%; flex-grow: 1; }
.navbar-collapse.show { display: block; }

.navbar-toggler {
    margin-left: auto;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 46px; height: 42px;
    padding: 0 11px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.navbar-toggler-icon { display: block; height: 2px; background: #475569; border-radius: 2px; }

@media (min-width: 992px) {
    .navbar-expand-lg .navbar-toggler { display: none; }
    .navbar-expand-lg .navbar-collapse { display: flex !important; flex-basis: auto; align-items: center; }
}

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute;
    top: calc(100% + .4rem);
    right: 0;
    min-width: 200px;
    padding: .45rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    list-style: none;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
    z-index: 1050;
}
.dropdown-menu.show { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-menu-end { right: 0; }
.dropdown-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .52rem .75rem;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: var(--fs-sm);
    transition: background var(--transition), color var(--transition);
}
.dropdown-item:hover { background: var(--primary-soft); color: var(--primary); }
.dropdown-divider { border-top: 1px solid var(--border); margin: .35rem 0; }

/* -------------------------------------------------------------------------
   13. Modal / accordion / paginação / spinner
   ------------------------------------------------------------------------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: none;
    overflow-y: auto;
    padding: 2rem 1rem;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(3px);
}
.modal.show { display: block; }
.modal-dialog { max-width: 620px; margin: 3rem auto; }
.modal-content {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modal-in .25s ease;
}
@keyframes modal-in {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to { opacity: 1; transform: none; }
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--border); }
.modal-title { margin: 0; font-size: var(--fs-lg); }
.modal-body { padding: 1.4rem; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: .6rem; padding: 1rem 1.4rem; background: var(--bg-alt); border-top: 1px solid var(--border); }

.accordion-item { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: .65rem; overflow: hidden; }
.accordion-header { margin: 0; }
.accordion-button {
    width: 100%;
    padding: 1rem 1.15rem;
    background: #fff;
    border: 0;
    text-align: left;
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    cursor: pointer;
}
.accordion-button::after { content: "+"; float: right; font-weight: var(--fw-bold); color: var(--primary); }
.accordion-button:not(.collapsed)::after { content: "−"; }
.accordion-body { padding: 0 1.15rem 1.15rem; color: var(--text-muted); font-size: var(--fs-sm); }
.accordion-flush .accordion-item { border-radius: 0; margin: 0; border-left: 0; border-right: 0; }

.pagination { display: flex; flex-wrap: wrap; gap: .3rem; list-style: none; padding-left: 0; margin: 1.5rem 0 0; }
.page-item .page-link {
    display: block;
    padding: .5rem .85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: var(--fs-sm);
    background: #fff;
}
.page-item .page-link:hover { background: var(--primary-soft); color: var(--primary); }
.page-item.active .page-link { background: var(--gradient); color: #fff; border-color: transparent; }

.spinner {
    display: inline-block;
    width: 1.5rem; height: 1.5rem;
    border: 3px solid rgba(30, 64, 175, .2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.collapse { display: none; }
.collapse.show { display: block; }
.fade { transition: opacity var(--transition); }

/* -------------------------------------------------------------------------
   14. Site institucional — Hero e seções
   ------------------------------------------------------------------------- */
.page-hero {
    position: relative;
    padding: calc(var(--header-height) + 3.5rem) 0 3.5rem;
    background: var(--gradient-deep);
    color: #fff;
    overflow: hidden;
}
.page-hero::after {
    content: "";
    position: absolute;
    right: -140px; top: -140px;
    width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 68%);
    border-radius: 50%;
}
.page-hero h1 { color: #fff; font-size: var(--fs-3xl); }
.page-hero p { color: rgba(255, 255, 255, .88); max-width: 62ch; }
.page-hero .lead { color: rgba(255, 255, 255, .92); }

.hero {
    position: relative;
    padding: calc(var(--header-height) + 5rem) 0 5.5rem;
    background: var(--gradient-deep);
    color: #fff;
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1px);
    background-size: 26px 26px;
    opacity: .8;
}
.hero::after {
    content: "";
    position: absolute;
    left: -120px; bottom: -180px;
    width: 460px; height: 460px;
    background: radial-gradient(circle, rgba(6, 182, 212, .35), transparent 70%);
    border-radius: 50%;
}
.hero > .container { position: relative; z-index: 2; }
.hero h1 { color: #fff; font-size: var(--fs-4xl); font-weight: var(--fw-black); margin-bottom: 1rem; }
.hero p { color: rgba(255, 255, 255, .9); }
.hero .lead { color: rgba(255, 255, 255, .92); font-size: 1.2rem; }

.section { padding: 4.5rem 0; }
.section-alt { background: var(--surface); }

/* Faixa de estatísticas que "flutua" sobre o hero.
   O z-index garante que os cards fiquem acima do hero (que é position:relative). */
.section-stats { position: relative; z-index: 2; padding-top: 0; }
.stats-overlap { margin-top: -3rem; }
.section-title {
    font-size: var(--fs-2xl);
    color: var(--heading);
    margin-bottom: .5rem;
}
.section-subtitle {
    color: var(--text-muted);
    font-size: var(--fs-lg);
    max-width: 62ch;
    margin-bottom: 2.5rem;
}
.text-center .section-subtitle { margin-inline: auto; }

/* Faixa de destaque */
.eyebrow {
    display: inline-block;
    margin-bottom: .85rem;
    padding: .3rem .9rem;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: var(--radius-pill);
    color: #fff;
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: .08em;
    text-transform: uppercase;
}
.eyebrow-dark {
    background: var(--primary-soft);
    border-color: #dbe6ff;
    color: var(--primary);
}

/* Cards de serviço/estatística */
.service-card {
    height: 100%;
    padding: 2rem 1.6rem;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: #cfdffb; }
.service-card .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 68px; height: 68px;
    margin-bottom: 1.1rem;
    border-radius: var(--radius);
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 1.9rem;
}
.service-card h3 { font-size: var(--fs-lg); margin-bottom: .6rem; }
.service-card p { color: var(--text-muted); font-size: var(--fs-sm); margin-bottom: 0; }

.stat-card {
    padding: 1.6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
}
.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px; height: 52px;
    border-radius: var(--radius);
    font-size: 1.5rem;
}
.stat-value { font-size: var(--fs-2xl); font-weight: var(--fw-bold); color: var(--heading); line-height: 1.1; }
.stat-label { color: var(--text-muted); font-size: var(--fs-sm); }

.banner-card {
    background: var(--gradient);
    color: #fff;
    border-radius: var(--radius-xl);
    padding: 3rem;
    box-shadow: var(--shadow-lg);
}
.banner-card h2, .banner-card h3 { color: #fff; }

.banner-item { display: flex; align-items: center; gap: 1rem; padding: 1rem; border-radius: var(--radius); background: var(--bg-alt); }

/* WhatsApp flutuante — sobe quando o banner de cookies está visível */
.whatsapp-float {
    position: fixed;
    right: 26px;
    bottom: calc(var(--cookie-h, 0px) + 26px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px; height: 58px;
    background: #25d366;
    color: #fff;
    border-radius: 50%;
    box-shadow: 0 10px 26px rgba(37, 211, 102, .45);
    font-size: 1.7rem;
    transition: transform var(--transition), box-shadow var(--transition);
}
.whatsapp-float:hover { color: #fff; transform: scale(1.08); box-shadow: 0 14px 32px rgba(37, 211, 102, .55); }

/* Rodapé */
.site-footer {
    background: #0b1220;
    color: #94a3b8;
    padding: 4rem 0 1.5rem;
}
.site-footer h5 { color: #fff; font-size: var(--fs-base); margin-bottom: 1.1rem; }
.site-footer a { color: #94a3b8; }
.site-footer a:hover { color: #fff; }
.site-footer .footer-bottom {
    margin-top: 2.5rem;
    padding-top: 1.4rem;
    border-top: 1px solid rgba(148, 163, 184, .18);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    font-size: var(--fs-sm);
}
.footer-bottom { margin-top: 2.5rem; padding-top: 1.4rem; border-top: 1px solid rgba(148, 163, 184, .18); font-size: var(--fs-sm); }

/* Links do rodapé (privacidade + área restrita) */
.footer-bottom-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem;
}

.footer-divider { color: #475569; }

.footer-admin-link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .25rem .75rem;
    border: 1px solid rgba(148, 163, 184, .3);
    border-radius: var(--radius-pill);
    color: #cbd5e1;
    font-size: .82rem;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.footer-admin-link:hover {
    background: rgba(148, 163, 184, .16);
    border-color: var(--primary-light);
    color: #fff;
}

/* Imagens e conteúdo */
.img-fluid { max-width: 100%; height: auto; }
.content :is(h2, h3) { margin-top: 1.8rem; }
.content img { border-radius: var(--radius); }

/* -------------------------------------------------------------------------
   15. Admin — layout
   ------------------------------------------------------------------------- */
body.admin { background: #eef2f9; }

.main-content {
    min-height: 100vh;
    margin-left: 270px;
    padding: 1.6rem 2rem 3rem;
    transition: margin var(--transition), background var(--transition);
}

.topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.6rem;
    padding: .85rem 1.2rem;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
}
.topbar h1, .topbar h5 { margin: 0; font-size: var(--fs-lg); }
.user-menu { display: flex; align-items: center; gap: .6rem; margin-left: auto; }

.btn-menu { display: none; padding: .45rem .7rem; }

/* Sidebar */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 1030;
    background: rgba(15, 23, 42, .5);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
}
.sidebar-overlay.show { opacity: 1; visibility: visible; }

.sidebar {
    position: fixed;
    top: 0; left: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    width: 270px;
    height: 100vh;
    background: linear-gradient(180deg, #101a2e 0%, #0b1220 100%);
    box-shadow: 2px 0 24px rgba(15, 23, 42, .18);
    transform: translateX(0);
    transition: transform var(--transition);
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: 1.15rem 1.4rem;
    color: #fff;
    font-size: 1.1rem;
    font-weight: var(--fw-bold);
    border-bottom: 1px solid rgba(148, 163, 184, .14);
    flex-shrink: 0;
}
.sidebar-brand img { height: 34px; }
.sidebar-close {
    display: none;
    margin-left: auto;
    padding: 0;
    background: none;
    border: 0;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
}
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: .6rem 0 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, .25) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, .25); border-radius: 10px; }
.sidebar-nav .nav-item { list-style: none; }
.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .68rem 1.4rem;
    color: #94a3b8;
    font-size: var(--fs-sm);
    border-left: 3px solid transparent;
    border-radius: 0;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.sidebar-nav .nav-link:hover { background: rgba(148, 163, 184, .12); color: #e2e8f0; }
.sidebar-nav .nav-link.active {
    background: rgba(59, 130, 246, .16);
    color: #fff;
    border-left-color: var(--primary-light);
}
.sidebar-nav .nav-link i { width: 22px; font-size: 1.1rem; text-align: center; }
.sidebar-nav .section-title {
    padding: 1.15rem 1.4rem .35rem;
    color: #64748b;
    font-size: .68rem;
    font-weight: var(--fw-bold);
    letter-spacing: .16em;
    text-transform: uppercase;
}

/* Login / perfil */
.login-card {
    max-width: 420px;
    margin: 0 auto;
    padding: 2.4rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}
.login-logo { height: 62px; margin-bottom: 1rem; }
.btn-login { width: 100%; padding: .85rem; font-size: var(--fs-base); }

/* Listas de itens admin */
.dep-item, .dif-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .7rem .95rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: .5rem;
}
.dep-item { border-left: 3px solid var(--success); }
.dif-item { border-left: 3px solid var(--danger); }

.editor { min-height: 320px; }

/* -------------------------------------------------------------------------
   16. Dark mode (admin)
   ------------------------------------------------------------------------- */
body.dark-mode { background: #0b1220; color: #e2e8f0; }
body.dark-mode .main-content { background: #0b1220; }
body.dark-mode .topbar { background: rgba(15, 23, 42, .85); border-color: #1e293b; }
body.dark-mode .card,
body.dark-mode .stat-card,
body.dark-mode .login-card,
body.dark-mode .bg-white { background: #131f36 !important; border-color: #1e293b; }
body.dark-mode .card-header { background: #0f1a2e; border-color: #1e293b; }
body.dark-mode h1, body.dark-mode h2, body.dark-mode h3,
body.dark-mode h4, body.dark-mode h5, body.dark-mode h6 { color: #e2e8f0; }
body.dark-mode .text-dark { color: #e2e8f0 !important; }
body.dark-mode .text-muted { color: #94a3b8 !important; }
body.dark-mode .table { color: #e2e8f0; }
body.dark-mode .table thead th { background: #0f1a2e; color: #94a3b8; }
body.dark-mode .table th, body.dark-mode .table td { border-color: #1e293b; }
body.dark-mode .table-hover tbody tr:hover { background: rgba(59, 130, 246, .1); }
body.dark-mode .form-control,
body.dark-mode .form-select { background: #0f1a2e; color: #e2e8f0; border-color: #24344f; }
body.dark-mode .dropdown-menu { background: #131f36; border-color: #1e293b; }
body.dark-mode .dropdown-item { color: #e2e8f0; }
body.dark-mode .btn-light { background: #1b2942; color: #e2e8f0; border-color: #24344f; }
body.dark-mode .list-group-item { background: #131f36; border-color: #1e293b; color: #e2e8f0; }
body.dark-mode .modal-content { background: #131f36; }

/* -------------------------------------------------------------------------
   17. Responsivo
   ------------------------------------------------------------------------- */
/* =========================================================================
   Repetidores de itens / despesas (usados no admin e na área do motorista)
   ========================================================================= */
.driver-repeater {
    padding: .9rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.driver-repeater-row {
    display: grid;
    grid-template-columns: 1fr 88px 40px;
    gap: .4rem;
    margin-bottom: .4rem;
    align-items: center;
}

.driver-repeater-row.has-three { grid-template-columns: 1fr 64px 88px 40px; }

.driver-extras {
    list-style: none;
    margin: .4rem 0 0;
    padding: 0;
    font-size: .78rem;
    color: var(--text-muted);
}

.driver-extras li { display: flex; align-items: center; gap: .35rem; margin-bottom: .15rem; }
.driver-extras li i { color: var(--primary-light); font-size: .8rem; }
.driver-extras li span { margin-left: auto; color: var(--text); font-weight: 600; }

@media (max-width: 575.98px) {
    .driver-repeater-row,
    .driver-repeater-row.has-three { grid-template-columns: 1fr 40px; }
    .driver-repeater-row > *:nth-child(2),
    .driver-repeater-row > *:nth-child(3) { grid-column: span 1; }
}

/* =========================================================================
   PWA do gestor: convite para instalar no celular
   ========================================================================= */
.admin-pwa-install {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .65rem .9rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: #fff;
    border-radius: var(--radius);
    font-size: .84rem;
    box-shadow: var(--shadow-sm);
}

.admin-pwa-install i { font-size: 1.15rem; flex-shrink: 0; }
.admin-pwa-install span { flex: 1 1 auto; min-width: 0; }

.admin-pwa-install button {
    flex-shrink: 0;
    padding: .35rem .85rem;
    border: 0;
    border-radius: 8px;
    background: #fff;
    color: #1e40af;
    font-family: inherit;
    font-weight: 700;
    font-size: .78rem;
    cursor: pointer;
}

.admin-pwa-install .close {
    margin-left: 0;
    padding: .25rem .4rem;
    background: transparent;
    color: #fff;
    font-size: .95rem;
}

@media (max-width: 575.98px) {
    .admin-pwa-install { align-items: flex-start; font-size: .78rem; }
    .admin-pwa-install i { margin-top: .15rem; }
}

@media (max-width: 991.98px) {
    .main-content { margin-left: 0; padding: 1.1rem 1rem 3rem; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .sidebar-close { display: block; }
    .btn-menu { display: inline-flex; }

    .navbar-nav { flex-direction: column; align-items: stretch; width: 100%; padding-top: .6rem; }
    .navbar-nav .nav-link { padding: .7rem .8rem; }
    .navbar .container { flex-wrap: wrap; }
}

@media (max-width: 767.98px) {
    :root { --fs-3xl: 1.9rem; --fs-4xl: 2.15rem; }

    /* Topbar do admin: evita estouro horizontal em telas estreitas */
    .topbar { padding: .7rem .85rem; gap: .5rem; }
    .topbar > div { min-width: 0; }
    .topbar h1, .topbar h5 {
        font-size: 1.05rem;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .user-menu { gap: .35rem; flex-shrink: 0; }
    .user-menu .user-name { display: none; }

    .hero { padding: calc(var(--header-height) + 3rem) 0 3.5rem; }
    .section { padding: 3rem 0; }
    .banner-card { padding: 1.8rem; }
    .card-img-top { height: 180px; }
    .whatsapp-float { right: 16px; bottom: calc(var(--cookie-h, 0px) + 16px); width: 52px; height: 52px; }
    .stats-overlap { margin-top: -1.25rem; }
    .section-title { font-size: 1.6rem; }
    .section-subtitle { font-size: 1rem; margin-bottom: 1.75rem; }
    .display-1 { font-size: 2.4rem; }
}

@media (max-width: 575.98px) {
    /* Estatísticas: ícone acima do número para caberem 2 por linha */
    .stat-card { padding: 1.1rem; }
    .stat-card > .d-flex { flex-direction: column; align-items: flex-start !important; gap: .5rem !important; }
    .stat-value { font-size: 1.4rem; }
    .stat-label { font-size: .8rem; }
    .stat-icon { width: 42px; height: 42px; font-size: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
