/* ============================================================
   CAMPO BRANCO — sistema de design
   Paleta pastel, cantos arredondados, motivo de sulcos de campo
   ============================================================ */

:root {
    /* cores base */
    --bg: #F4F8F2;
    --surface: #FFFFFF;
    --surface-soft: #EFF5EC;

    /* sálvia (primária) */
    --sage-100: #E3EEE3;
    --sage-300: #B7D2BC;
    --sage-500: #6B9C77;
    --sage-600: #4F7A5B;
    --sage-700: #3B5D45;
    --sage-900: #24382A;

    /* céu pastel (secundária / links) */
    --sky-100: #E8F0F9;
    --sky-300: #C3D9EF;
    --sky-500: #7FA8D1;
    --sky-700: #4E749E;

    /* rosa empoeirado (em uso) */
    --blush-100: #FBEBEC;
    --blush-300: #EFC7CA;
    --blush-500: #D993A0;
    --blush-700: #A15D6C;

    /* areia (avisos) */
    --sand-100: #FBF3E4;
    --sand-300: #EAD3A0;
    --sand-500: #C99A4E;
    --sand-700: #93672B;

    /* dourado da marca oficial (Campo Branco), usado como destaque de identidade */
    --gold-100: #F2D98B;
    --gold-300: #E6CA62;
    --gold-400: #E0C25A;
    --gold-500: #D9B53C;
    --gold-600: #C9A227;
    --gold-700: #9A7A1D;

    /* neutros quentes da marca, usados junto dos neutros verdes */
    --cream-100: #FFFFFF;
    --cream-200: #F4EFE4;
    --cream-300: #E3DCC8;

    /* neutros / texto */
    --ink-900: #263229;
    --ink-700: #435046;
    --ink-500: #6D7A70;
    --ink-300: #A9B5AC;
    --line: #DEE8DA;

    /* whatsapp */
    --whatsapp: #4FAE7E;
    --whatsapp-dark: #3B8E64;

    /* raios */
    --r-sm: 10px;
    --r-md: 16px;
    --r-lg: 24px;
    --r-pill: 999px;

    /* sombras */
    --shadow-sm: 0 1px 3px rgba(38, 50, 41, 0.06), 0 1px 2px rgba(38, 50, 41, 0.04);
    --shadow-md: 0 8px 24px rgba(38, 50, 41, 0.09), 0 2px 6px rgba(38, 50, 41, 0.05);
    --shadow-lift: 0 14px 34px rgba(38, 50, 41, 0.14);

    /* movimento */
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --t-fast: 160ms;
    --t-med: 280ms;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--ink-900);
    -webkit-font-smoothing: antialiased;
}

h1, h2, .brand {
    font-family: "Fraunces", Georgia, serif;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--sage-900);
}

h1 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); margin: 0 0 6px; }
h2 { font-size: clamp(1.1rem, 1rem + 0.4vw, 1.35rem); margin: 0 0 14px; }

a { color: var(--sky-700); }

:focus-visible {
    outline: 2px solid var(--sage-500);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================================
   FUNDO DE SULCOS DE CAMPO — elemento de assinatura
   ============================================================ */

.campo-textura {
    position: relative;
    overflow: hidden;
}
.campo-textura::before {
    content: "";
    position: absolute;
    inset: -20% -10%;
    background-image:
        repeating-linear-gradient(
            100deg,
            rgba(107, 156, 119, 0.10) 0px,
            rgba(107, 156, 119, 0.10) 2px,
            transparent 2px,
            transparent 34px
        );
    background-size: 140% 140%;
    animation: sulcos-deriva 26s linear infinite;
    pointer-events: none;
    opacity: 0.9;
}
@keyframes sulcos-deriva {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-60px, 24px, 0); }
}

/* Versao usada dentro da navbar: fica num elemento proprio, sem cortar
   o menu suspenso do celular, que precisa transbordar para fora da faixa */
.navbar-textura {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}
.navbar-textura::before {
    content: "";
    position: absolute;
    inset: -20% -10%;
    background-image:
        repeating-linear-gradient(
            100deg,
            rgba(255, 255, 255, 0.06) 0px,
            rgba(255, 255, 255, 0.06) 2px,
            transparent 2px,
            transparent 34px
        );
    background-size: 140% 140%;
    animation: sulcos-deriva 26s linear infinite;
}

/* ============================================================
   NAVBAR
   ============================================================ */

.navbar {
    background: var(--sage-900);
    background-image: linear-gradient(135deg, var(--sage-900), var(--sage-700));
    color: white;
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: var(--shadow-sm);
    border-bottom: 2px solid var(--gold-500);
}
.navbar-inner {
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}
.brand {
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 9px;
    letter-spacing: -0.01em;
}
.brand-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 8px;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 22px;
}
.nav-links a:not(.btn-link) {
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    position: relative;
    padding: 6px 2px;
    transition: color var(--t-fast) var(--ease);
}
.nav-links a:not(.btn-link)::after {
    content: "";
    position: absolute;
    left: 0; right: 100%;
    bottom: 0;
    height: 2px;
    background: var(--gold-400);
    border-radius: var(--r-pill);
    transition: right var(--t-med) var(--ease);
}
.nav-links a:not(.btn-link):hover { color: white; }
.nav-links a:not(.btn-link):hover::after { right: 0; }

.nav-user {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 6px;
}
.badge {
    background: rgba(255, 255, 255, 0.16);
    padding: 3px 11px;
    border-radius: var(--r-pill);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.btn-link {
    color: var(--blush-300) !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: opacity var(--t-fast) var(--ease);
}
.btn-link:hover { opacity: 0.75; }

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 6px;
}
.nav-toggle svg { width: 24px; height: 24px; }

/* ============================================================
   LAYOUT
   ============================================================ */

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 32px 20px 64px;
    animation: entrada-suave var(--t-med) var(--ease) both;
}
@keyframes entrada-suave {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   FLASH MESSAGES
   ============================================================ */

.flash-container { margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.flash {
    padding: 12px 16px;
    border-radius: var(--r-md);
    font-size: 0.92rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: flash-entra var(--t-med) var(--ease) both;
    border: 1px solid transparent;
}
.flash svg { width: 18px; height: 18px; flex-shrink: 0; }
@keyframes flash-entra {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.flash-success { background: var(--sage-100); color: var(--sage-700); border-color: var(--sage-300); }
.flash-danger { background: var(--blush-100); color: var(--blush-700); border-color: var(--blush-300); }
.flash-warning { background: var(--sand-100); color: var(--sand-700); border-color: var(--sand-300); }
.flash-info { background: var(--sky-100); color: var(--sky-700); border-color: var(--sky-300); }

/* ============================================================
   CARDS
   ============================================================ */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 24px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--t-med) var(--ease);
}
.card:hover { box-shadow: var(--shadow-md); }

/* ============================================================
   GRID DE TERRITORIOS
   ============================================================ */

.grid-territorios {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}

.territorio-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
    box-shadow: var(--shadow-sm);
    transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease), border-color var(--t-med) var(--ease);
    animation: cartao-entra var(--t-med) var(--ease) both;
}
@keyframes cartao-entra {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.territorio-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lift);
    border-color: var(--sage-300);
}
.territorio-thumb {
    width: 100%;
    height: 148px;
    object-fit: cover;
    background: var(--sage-100);
    display: block;
    transition: transform var(--t-med) var(--ease);
}
.territorio-card:hover .territorio-thumb { transform: scale(1.04); }
.territorio-thumb-placeholder {
    width: 100%;
    height: 148px;
    background: var(--sage-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sage-500);
}
.territorio-thumb-placeholder svg { width: 34px; height: 34px; }
.territorio-info { padding: 14px 16px 16px; }
.territorio-numero { font-weight: 800; font-size: 1.02rem; color: var(--sage-900); }
.territorio-nome { font-size: 0.85rem; color: var(--ink-500); margin-top: 2px; }

.status-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: var(--r-pill);
    font-size: 0.74rem;
    font-weight: 700;
    margin-top: 9px;
    letter-spacing: 0.01em;
}
.status-tag::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
}
.status-disponivel { background: var(--sage-100); color: var(--sage-700); }
.status-disponivel::before { background: var(--sage-600); animation: pulso-suave 2.4s ease-in-out infinite; }
.status-em_uso { background: var(--blush-100); color: var(--blush-700); }
.status-em_uso::before { background: var(--blush-500); }
@keyframes pulso-suave {
    0%, 100% { box-shadow: 0 0 0 0 rgba(107, 156, 119, 0.45); }
    50% { box-shadow: 0 0 0 4px rgba(107, 156, 119, 0); }
}

/* ============================================================
   FILTROS
   ============================================================ */

.filtros { margin-bottom: 20px; display: flex; gap: 8px; flex-wrap: wrap; }
.filtros a {
    padding: 8px 16px;
    border-radius: var(--r-pill);
    border: 1px solid var(--line);
    text-decoration: none;
    color: var(--ink-700);
    font-size: 0.88rem;
    font-weight: 600;
    background: var(--surface);
    transition: all var(--t-fast) var(--ease);
}
.filtros a:hover { border-color: var(--sage-300); background: var(--sage-100); }
.filtros a.ativo { background: var(--sage-600); color: white; border-color: var(--sage-600); }

/* ============================================================
   BOTOES
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: var(--r-pill);
    border: none;
    background: var(--sage-600);
    color: white;
    text-decoration: none;
    font-size: 0.93rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.btn:hover { background: var(--sage-700); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }

.btn-secundario { background: var(--surface); color: var(--sage-700); border: 1.5px solid var(--sage-300); box-shadow: none; }
.btn-secundario:hover { background: var(--sage-100); border-color: var(--sage-500); }

.btn-perigo { background: var(--blush-500); }
.btn-perigo:hover { background: var(--blush-700); }

.btn-whatsapp { background: var(--whatsapp); }
.btn-whatsapp:hover { background: var(--whatsapp-dark); }

.btn-pequeno { padding: 7px 14px; font-size: 0.8rem; }
.btn-bloco { display: flex; width: 100%; }

.btn-icone {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: var(--r-pill);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1.5px solid var(--line);
    color: var(--ink-700);
    cursor: pointer;
    transition: all var(--t-fast) var(--ease);
}
.btn-icone:hover { border-color: var(--blush-500); color: var(--blush-700); background: var(--blush-100); }
.btn-icone svg { width: 16px; height: 16px; }

/* ============================================================
   FORMULARIOS
   ============================================================ */

.form-grupo { margin-bottom: 16px; }
.form-grupo label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: var(--ink-700);
}
.form-grupo input,
.form-grupo select,
.form-grupo textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--line);
    border-radius: var(--r-md);
    font-size: 0.94rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--ink-900);
    transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.form-grupo input:focus,
.form-grupo select:focus,
.form-grupo textarea:focus {
    outline: none;
    border-color: var(--sage-500);
    box-shadow: 0 0 0 4px var(--sage-100);
}
.form-grupo input[type="file"] { padding: 9px 10px; cursor: pointer; }
.form-linha { display: flex; gap: 14px; flex-wrap: wrap; }
.form-linha > div { flex: 1; min-width: 200px; }

/* ============================================================
   PAGINA DE LOGIN
   ============================================================ */

.login-shell {
    min-height: calc(100vh - 0px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.login-box {
    max-width: 400px;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 36px 32px;
    box-shadow: var(--shadow-md);
    animation: cartao-entra var(--t-med) var(--ease) both;
}
.login-topo { text-align: center; margin-bottom: 22px; }
.login-icone {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    background: var(--sage-100);
    border-radius: var(--r-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-icone svg { width: 28px; height: 28px; color: var(--sage-600); }
.login-icone-logo {
    background: var(--gold-100);
    overflow: hidden;
}
.login-icone-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-lg); }
.login-box h1 { text-align: center; margin-bottom: 4px; }
.login-sub { text-align: center; color: var(--ink-500); font-size: 0.88rem; margin: 0 0 24px; }

.divisor {
    text-align: center;
    color: var(--ink-300);
    margin: 18px 0;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 12px;
}
.divisor::before, .divisor::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}
.btn-google {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 11px; border-radius: var(--r-pill);
    border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-700);
    text-decoration: none; font-size: 0.92rem; font-weight: 700;
    transition: all var(--t-fast) var(--ease);
}
.btn-google:hover { border-color: var(--sky-300); background: var(--sky-100); }
.btn-google svg { width: 18px; height: 18px; }

.texto-pequeno { font-size: 0.85rem; color: var(--ink-500); text-align: center; margin-top: 18px; line-height: 1.5; }
.texto-pequeno a { color: var(--sage-600); font-weight: 700; text-decoration: none; }
.texto-pequeno a:hover { text-decoration: underline; }

/* ============================================================
   DETALHE DE TERRITORIO
   ============================================================ */

.top-acoes {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.mapa-grande {
    max-width: 100%;
    border-radius: var(--r-md);
    border: 1px solid var(--line);
    margin: 4px 0 16px;
    display: block;
}

.info-linha {
    margin: 10px 0;
    font-size: 0.94rem;
    display: flex;
    gap: 8px;
    align-items: baseline;
}
.info-linha strong { color: var(--sage-700); min-width: 150px; display: inline-block; }

.historico-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.87rem;
    color: var(--ink-700);
    display: flex;
    align-items: center;
    gap: 10px;
}
.historico-item:last-child { border-bottom: none; }
.historico-icone {
    width: 30px;
    height: 30px;
    border-radius: var(--r-pill);
    background: var(--sage-100);
    color: var(--sage-600);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.historico-icone svg { width: 15px; height: 15px; }
.historico-icone.devolucao { background: var(--sky-100); color: var(--sky-700); }

/* ============================================================
   TABELAS
   ============================================================ */

.tabela-wrap {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 13px 16px; border-bottom: 1px solid var(--line); text-align: left; font-size: 0.88rem; }
table th { background: var(--sage-100); color: var(--sage-700); font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
table tr:last-child td { border-bottom: none; }
table tr { transition: background var(--t-fast) var(--ease); }
table tbody tr:hover { background: var(--surface-soft); }

.lista-vazia {
    color: var(--ink-500);
    text-align: center;
    padding: 44px 20px;
    font-size: 0.92rem;
    background: var(--surface-soft);
    border-radius: var(--r-lg);
    border: 1.5px dashed var(--line);
}

hr.divisoria { border: none; border-top: 1px solid var(--line); margin: 22px 0; }

/* ============================================================
   CAMPO DE TRIGOS — pagina inicial do Guardiao
   ============================================================ */

.campo-cabecalho {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 12px;
}

.campo-trigos {
    position: relative;
    background: linear-gradient(180deg, var(--cream-200) 0%, var(--gold-100) 68%, var(--gold-300) 100%);
    border: 1px solid var(--gold-400);
    border-radius: var(--r-lg);
    padding: 40px 32px 0;
    min-height: 320px;
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 6px;
    row-gap: 0;
    box-shadow: var(--shadow-sm);
}
.campo-trigos::before {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 46px;
    background: linear-gradient(180deg, transparent, rgba(154, 122, 29, 0.28));
    border-radius: 0 0 var(--r-lg) var(--r-lg);
    pointer-events: none;
    z-index: 0;
}

.trigo-item {
    position: relative;
    width: 46px;
    flex-shrink: 0;
    text-decoration: none;
    color: inherit;
    display: block;
    padding-bottom: 14px;
    animation: trigo-cresce 560ms var(--ease) both;
    transform-origin: bottom center;
}
@keyframes trigo-cresce {
    from { opacity: 0; transform: scaleY(0.4) translateY(14px); }
    to { opacity: 1; transform: scaleY(1) translateY(0); }
}
.trigo-item img {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 3px 3px rgba(90, 68, 12, 0.18));
    transition: transform var(--t-med) var(--ease);
}
.trigo-item:hover img { transform: translateY(-6px) rotate(-2deg) scale(1.05); }
.trigo-item:nth-child(3n) { transform: translateY(-6px); }
.trigo-item:nth-child(5n) { transform: translateY(4px); }
.trigo-item:nth-child(7n) img { transform: rotate(-3deg); }
.trigo-item:nth-child(4n) img { transform: rotate(2deg); }

.trigo-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--sage-900);
    color: white;
    padding: 12px 14px;
    border-radius: var(--r-md);
    width: 200px;
    box-shadow: var(--shadow-lift);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
    z-index: 10;
}
.trigo-item:hover .trigo-tooltip,
.trigo-item:focus-visible .trigo-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
.trigo-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--sage-900);
}
.trigo-tooltip-nome { font-family: "Fraunces", serif; font-weight: 600; font-size: 0.98rem; margin-bottom: 6px; color: var(--gold-100); }
.trigo-tooltip-linha { font-size: 0.78rem; color: rgba(255,255,255,0.85); display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }

.campo-vazio {
    width: 100%;
    text-align: center;
    padding: 60px 20px;
    color: var(--sand-700);
}

/* ============================================================
   DASHBOARD DA CONGREGACAO
   ============================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--stat-cor, var(--gold-500));
}
.stat-numero {
    font-family: "Fraunces", serif;
    font-size: 2.1rem;
    font-weight: 600;
    color: var(--sage-900);
    line-height: 1;
}
.stat-label {
    font-size: 0.82rem;
    color: var(--ink-500);
    margin-top: 8px;
    font-weight: 600;
}
.stat-card.stat-dourado { --stat-cor: var(--gold-500); }
.stat-card.stat-sage { --stat-cor: var(--sage-500); }
.stat-card.stat-blush { --stat-cor: var(--blush-500); }
.stat-card.stat-sky { --stat-cor: var(--sky-500); }

.progresso-barra {
    height: 8px;
    background: var(--cream-300);
    border-radius: var(--r-pill);
    overflow: hidden;
    margin-top: 10px;
}
.progresso-barra-preenchimento {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-500), var(--gold-300));
    border-radius: var(--r-pill);
    transition: width 700ms var(--ease);
}

.acessos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
}
.acesso-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 24px 22px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease), border-color var(--t-med) var(--ease);
}
.acesso-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lift);
    border-color: var(--gold-400);
}
.acesso-icone {
    width: 46px;
    height: 46px;
    border-radius: var(--r-md);
    background: var(--gold-100);
    color: var(--gold-700);
    display: flex;
    align-items: center;
    justify-content: center;
}
.acesso-icone svg { width: 22px; height: 22px; }
.acesso-card.acesso-sage .acesso-icone { background: var(--sage-100); color: var(--sage-700); }
.acesso-card.acesso-sky .acesso-icone { background: var(--sky-100); color: var(--sky-700); }
.acesso-card.acesso-blush .acesso-icone { background: var(--blush-100); color: var(--blush-700); }
.acesso-titulo { font-family: "Fraunces", serif; font-weight: 600; font-size: 1.08rem; color: var(--sage-900); }
.acesso-descricao { font-size: 0.85rem; color: var(--ink-500); line-height: 1.4; }
.acesso-seta { margin-top: auto; display: flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 700; color: var(--gold-700); }
.acesso-seta svg { width: 15px; height: 15px; transition: transform var(--t-fast) var(--ease); }
.acesso-card:hover .acesso-seta svg { transform: translateX(3px); }

/* ============================================================
   HISTORICO DE TERRITORIOS / RELATORIOS
   ============================================================ */

.exportar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}
.exportar-opcao {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--r-md);
    border: 1.5px solid var(--line);
    background: var(--surface);
    text-decoration: none;
    color: inherit;
    transition: all var(--t-fast) var(--ease);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    width: 100%;
    text-align: left;
}
.exportar-opcao:hover { border-color: var(--gold-400); background: var(--gold-100); }
.exportar-opcao-icone {
    width: 36px;
    height: 36px;
    border-radius: var(--r-pill);
    background: var(--gold-100);
    color: var(--gold-700);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.exportar-opcao-icone svg { width: 17px; height: 17px; }
.exportar-opcao-texto { display: flex; flex-direction: column; gap: 1px; }
.exportar-opcao-sub { font-size: 0.76rem; font-weight: 500; color: var(--ink-500); }

.tag-status-hist {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--r-pill);
    font-size: 0.72rem;
    font-weight: 700;
}
.tag-concluido { background: var(--sage-100); color: var(--sage-700); }
.tag-andamento { background: var(--sand-100); color: var(--sand-700); }
.tag-sem-mov { background: var(--cream-300); color: var(--ink-500); }

/* ============================================================
   BOTOES DOURADOS (identidade oficial)
   ============================================================ */

.btn-dourado {
    background: var(--gold-600);
    color: var(--sage-900);
}
.btn-dourado:hover { background: var(--gold-700); color: white; }

/* ============================================================
   RESPONSIVO
   ============================================================ */

@media (max-width: 720px) {
    .nav-toggle { display: inline-flex; }

    .nav-links {
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--sage-900);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 6px 20px 16px;
        max-height: 0;
        overflow: hidden;
        transition: max-height var(--t-med) var(--ease);
        box-shadow: var(--shadow-md);
    }
    .nav-links.aberto { max-height: 320px; }
    .nav-links a:not(.btn-link) { padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
    .nav-links a:not(.btn-link)::after { display: none; }
    .nav-user { padding: 10px 0; }

    .container { padding: 22px 16px 48px; }

    .top-acoes { flex-direction: column; align-items: stretch; }
    .top-acoes .btn { width: 100%; }

    .grid-territorios { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
    .territorio-thumb, .territorio-thumb-placeholder { height: 118px; }

    .info-linha { flex-direction: column; gap: 2px; }
    .info-linha strong { min-width: 0; }

    table th, table td { padding: 10px 12px; font-size: 0.82rem; }

    .login-box { padding: 28px 22px; }

    .campo-trigos { padding: 26px 16px 0; min-height: 220px; }
    .trigo-item { width: 32px; }
    .trigo-tooltip { width: 168px; font-size: 0.78rem; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .acessos-grid { grid-template-columns: 1fr; }
}
