/* ============================================================================
   Identidade visual Equilio — FIXA, alinhada ao site institucional.
   Paleta: teal (#0E7C7B) · mint (#17A398) · âmbar (#F2B705) · ink (#0B2027).
   A plataforma NÃO é mais white-label: as cores, a tipografia, o logotipo e o
   nome do produto são da marca Equilio e não podem ser alterados por tenant.
   ============================================================================ */
:root {
    /* Marca Equilio (identidade única do produto) */
    --brand-primary: #0E7C7B;     /* teal — marca principal */
    --brand-secondary: #17A398;   /* mint — realce/hover */
    --brand-accent: #F2B705;      /* âmbar — destaque/CTA */
    --brand-bg: #F2F7F7;
    --brand-text: #1A2A2E;
    --brand-font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

    /* Tokens de produto */
    --ink: #0B2027;
    --muted-c: #5B6B70;
    --line: #e4eded;
    --surface: #ffffff;
    --tint: color-mix(in srgb, var(--brand-primary) 8%, white);
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 10px 30px rgba(11, 32, 39, .08);
    --shadow-sm: 0 2px 8px rgba(11, 32, 39, .05);
    --ok: #16A34A;
    --warn: #D97706;
    --danger: #DC2626;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--brand-font);
    background: var(--brand-bg);
    color: var(--brand-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.layout { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
    width: 248px;
    min-width: 248px;
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--brand-primary) 45%, #07171C) 0%,
        #07171C 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 1.1rem 0 1rem;
}

.brand {
    padding: 0 1.25rem 1.1rem;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -.3px;
    display: flex;
    align-items: center;
    gap: .6rem;
}
.brand-name { color: #fff; }

/* Marca visual: dois círculos sobrepostos (equilíbrio) — mesmo símbolo do site */
.brand-mark {
    position: relative;
    width: 32px; height: 20px;
    flex: 0 0 32px;
}
.brand-mark i {
    position: absolute; top: 0;
    width: 20px; height: 20px;
    border-radius: 50%;
    display: block;
}
.brand-mark i:first-child { left: 0; background: var(--brand-secondary); }
.brand-mark i:last-child { left: 11px; background: var(--brand-accent); mix-blend-mode: screen; }

.sidebar nav { flex: 1; display: flex; flex-direction: column; overflow-y: auto; padding: 0 .6rem; }
.sidebar nav a {
    color: rgba(255, 255, 255, .82);
    text-decoration: none;
    padding: .5rem .75rem;
    margin-bottom: 2px;
    font-size: .9rem;
    border-radius: 10px;
    transition: background .15s, color .15s;
}
.sidebar nav a:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.sidebar nav a.active {
    background: color-mix(in srgb, var(--brand-secondary) 26%, transparent);
    color: #fff;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-secondary) 40%, transparent);
}
.nav-section {
    padding: 1rem .75rem .35rem;
    font-size: .68rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--brand-secondary) 75%, white);
    font-weight: 700;
}
.sidebar-footer {
    padding: .85rem 1.25rem 0;
    margin-top: .5rem;
    border-top: 1px solid rgba(255, 255, 255, .14);
    font-size: .85rem;
}
.user-name { display: block; margin-bottom: .25rem; opacity: .9; }
.btn-link {
    background: none; border: none; color: var(--brand-accent);
    cursor: pointer; padding: 0; font-size: .85rem; font-family: inherit; font-weight: 600;
}
.btn-link:hover { text-decoration: underline; }

/* ---------- Conteúdo ---------- */
.content { flex: 1; padding: 1.75rem 2.25rem; max-width: 1280px; }
h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.5px; margin: 0 0 1rem; }
h2 { font-size: 1.2rem; font-weight: 700; letter-spacing: -.2px; margin: 1.75rem 0 .8rem; }
h3 { font-size: 1.02rem; font-weight: 700; margin: 1rem 0 .5rem; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.15rem 1.35rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.cards-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.stat {
    flex: 1; min-width: 160px; text-align: left;
    border-radius: var(--radius);
    transition: transform .18s, box-shadow .18s;
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat .value {
    font-size: 2rem; font-weight: 800; line-height: 1.15;
    color: var(--brand-primary); letter-spacing: -1px;
}
.stat .label { font-size: .8rem; color: var(--muted-c); font-weight: 500; margin-top: .15rem; }

/* ---------- Tabelas ---------- */
table {
    width: 100%; border-collapse: collapse; background: var(--surface);
    border-radius: var(--radius-sm); overflow: hidden;
}
th, td {
    text-align: left; padding: .65rem .85rem;
    border-bottom: 1px solid var(--line); font-size: .9rem;
}
th {
    background: var(--tint);
    font-weight: 700; font-size: .78rem;
    text-transform: uppercase; letter-spacing: .04em;
    color: color-mix(in srgb, var(--brand-primary) 80%, black);
}
tbody tr:last-child td { border-bottom: none; }
tr:hover td { background: color-mix(in srgb, var(--brand-primary) 4%, white); }

/* ---------- Formulários ---------- */
input, select, textarea {
    width: 100%;
    padding: .6rem .8rem;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: .9rem;
    margin-bottom: .6rem;
    background: #fff;
    color: inherit;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand-secondary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-secondary) 18%, transparent);
}
label { font-size: .82rem; font-weight: 600; display: block; margin-bottom: .25rem; }

button, .btn {
    background: var(--brand-primary);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: .55rem 1.15rem;
    font-size: .88rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, filter .15s;
}
button:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(11, 32, 39, .14); }
button:active { transform: none; }
button.secondary {
    background: #fff; color: var(--brand-primary);
    border: 1.5px solid color-mix(in srgb, var(--brand-primary) 35%, white);
}
button.secondary:hover { border-color: var(--brand-primary); background: var(--tint); }
button.accent { background: var(--brand-accent); color: var(--ink); }
button.danger { background: var(--danger); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; filter: none; }

.form-row { display: flex; gap: 1rem; }
.form-row > div { flex: 1; }

/* ---------- Badges e utilidades ---------- */
.badge {
    display: inline-block; padding: .2rem .65rem; border-radius: 999px;
    font-size: .73rem; font-weight: 700; letter-spacing: .01em;
}
.badge.green { background: #dcfce7; color: #166534; }
.badge.yellow { background: #fef3c7; color: #92400e; }
.badge.red { background: #fee2e2; color: #991b1b; }
.badge.blue { background: color-mix(in srgb, var(--brand-primary) 14%, white); color: color-mix(in srgb, var(--brand-primary) 85%, black); }
.badge.gray { background: #eef2f2; color: var(--muted-c); }

.muted { color: var(--muted-c); font-size: .85rem; }
.error-text { color: var(--danger); font-size: .85rem; }
.success-text { color: var(--ok); font-size: .85rem; }
.toolbar { display: flex; gap: .55rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.toolbar input { margin-bottom: 0; max-width: 280px; }

/* ---------- Login (compatibilidade: página de convite) ---------- */
.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
}
.login-card {
    background: #fff; border-radius: var(--radius); padding: 2rem; width: 380px;
    box-shadow: 0 20px 50px rgba(11, 32, 39, .28);
}
.login-card h1 { text-align: center; color: var(--brand-primary); }

/* ---------- Login dividido (form + carrossel) ---------- */
.login-split { display: flex; min-height: 100vh; }

/* Carrossel desativado em /admin/carrossel: o painel do formulário ocupa a tela toda */
.login-split.no-carousel .login-left { flex: 1; }

.login-left {
    position: relative;
    flex: 0 0 44%;
    background: linear-gradient(160deg,
        color-mix(in srgb, var(--brand-primary) 55%, #07171C) 0%,
        #07171C 100%);
    color: #fff;
    display: flex;
    overflow: hidden;
}
.login-left-bg {
    position: absolute; inset: 0;
    background: url('login-bg.svg') no-repeat bottom center / cover;
    opacity: .5;
    pointer-events: none;
}
.login-left-content {
    position: relative; z-index: 1;
    display: flex; flex-direction: column;
    width: 100%; padding: 2rem 2.5rem;
}
.login-brand {
    display: flex; align-items: center; gap: .6rem;
    font-size: 1.4rem; font-weight: 800; flex-wrap: wrap; letter-spacing: -.4px;
}
.login-brand small { display: block; width: 100%; font-size: .78rem; font-weight: 400; opacity: .8; letter-spacing: 0; }

.login-form-box {
    margin: auto; width: 100%; max-width: 370px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: var(--radius);
    padding: 1.9rem;
    backdrop-filter: blur(6px);
}
.login-form-box h1 { text-align: center; font-size: 1.7rem; margin: 0 0 .25rem; color: #fff; }
.login-hello { text-align: center; margin: 0 0 1.35rem; opacity: .82; font-size: .9rem; }
.login-form-box label { color: rgba(255, 255, 255, .92); }
.login-form-box input { background: #fff; border: none; color: var(--ink); }
.login-form-box a { color: #fff; }
/* Etapa de escolha da empresa no login (usuário vinculado a mais de um tenant) */
.tenant-choices { display: flex; flex-direction: column; gap: .55rem; margin-bottom: .35rem; }
.tenant-choice {
    display: flex; align-items: center; gap: .7rem; cursor: pointer;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: var(--radius);
    padding: .7rem .85rem;
    color: #fff;
    transition: background .15s, border-color .15s;
}
.tenant-choice:hover { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .4); }
.tenant-choice input[type="radio"] { width: auto; margin: 0; accent-color: var(--brand-accent); }
.tenant-choice strong { display: block; font-size: .95rem; }
.tenant-choice small { display: block; opacity: .75; font-size: .78rem; }

.login-submit {
    width: 100%;
    background: var(--brand-accent);
    color: var(--ink);
    font-weight: 700;
    padding: .72rem;
    margin-top: .5rem;
    box-shadow: 0 8px 22px rgba(242, 183, 5, .3);
}
.login-footer {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, .18);
    font-size: .85rem;
}
.nr1-check { font-weight: 700; }
.nr1-check .check {
    display: inline-block; background: var(--brand-secondary); color: #fff;
    border-radius: 50%; width: 18px; height: 18px; line-height: 18px;
    text-align: center; font-size: .65rem; margin-left: .25rem;
}
.site-link { color: var(--brand-secondary); font-weight: 600; }

.login-right {
    flex: 1;
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--brand-primary) 92%, white 8%) 0%,
        var(--brand-primary) 45%,
        color-mix(in srgb, var(--brand-primary) 60%, #07171C) 100%);
    color: #fff;
    display: flex; flex-direction: column; justify-content: center;
    padding: 3rem 4rem;
}

.carousel { position: relative; }
.carousel-slide { display: none; animation: slide-in .45s ease; }
.carousel-slide.active { display: block; }
@keyframes slide-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.slide-chip {
    display: inline-block;
    background: rgba(0, 0, 0, .25);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 999px;
    padding: .55rem 1.35rem;
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
}
.slide-headline { font-size: 1.35rem; line-height: 1.5; margin: 0 0 1.75rem; max-width: 640px; }
.slide-items { display: flex; flex-direction: column; gap: 1.1rem; }
.slide-item { display: flex; gap: 1rem; align-items: flex-start; max-width: 640px; font-size: 1.02rem; line-height: 1.45; }
.slide-item-icon {
    flex: 0 0 44px; height: 44px;
    background: var(--brand-accent);
    color: var(--ink); border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; font-weight: 700;
}
.carousel-dots { display: flex; gap: .5rem; justify-content: center; margin-top: 2rem; }
.dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: rgba(255, 255, 255, .35); cursor: pointer; transition: background .2s, transform .2s;
}
.dot.active { background: var(--brand-accent); transform: scale(1.2); }
.carousel-tagline { text-align: center; font-size: 1.3rem; font-weight: 800; margin-top: 2rem; }

@media (max-width: 960px) {
    .login-split { flex-direction: column; }
    .login-left { flex: none; min-height: 60vh; }
    .login-right { padding: 2rem 1.5rem; }
}

/* ---------- Nine-box ---------- */
.ninebox-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; }
.ninebox-cell {
    background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius-sm); min-height: 110px; padding: .55rem;
}
.ninebox-cell h4 { margin: 0 0 .4rem; font-size: .72rem; color: var(--muted-c); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.ninebox-cell .chip {
    display: inline-block; background: var(--tint);
    color: color-mix(in srgb, var(--brand-primary) 85%, black);
    border-radius: 999px; padding: .15rem .55rem; margin: .12rem; font-size: .75rem; font-weight: 600;
}

/* ---------- Timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: .75rem; padding: .55rem 0; border-bottom: 1px dashed var(--line); }
.timeline .when { min-width: 130px; font-size: .78rem; color: var(--muted-c); }

/* ---------- Mural ---------- */
.wall-item {
    border-left: 4px solid var(--brand-accent);
    padding: .7rem 1rem; background: #fff;
    border-radius: var(--radius-sm); margin-bottom: .6rem;
    box-shadow: var(--shadow-sm);
}

/* NOTE: a adaptação mobile completa (drawer, top bar, bottom nav, tabelas em
   cards, touch-first, etc.) fica no bloco "ADAPTAÇÃO MOBILE" ao final do arquivo. */

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(11, 32, 39, .55);
    backdrop-filter: blur(2px);
    z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal-dialog {
    background: #fff; border-radius: var(--radius); width: 100%; max-height: 90vh;
    overflow: auto; padding: 1.4rem 1.6rem; box-shadow: 0 24px 60px rgba(11, 32, 39, .3);
}
.pagination { display: flex; gap: .5rem; align-items: center; justify-content: flex-end; margin-top: .75rem; }
.pagination .muted { font-size: .8rem; }

/* ============================================================================
   ADAPTAÇÃO MOBILE / TABLET  —  Touch First, app-like
   ----------------------------------------------------------------------------
   Estratégia de breakpoints:
     • Desktop  (> 900px) ............. layout original intacto (sidebar + conteúdo)
     • Tablet/Mobile (<= 900px) ....... shell app-like: top bar + drawer + bottom nav
     • Smartphone (<= 640px) .......... tabelas viram cards, formulários em coluna
   O JS (site.js) marca <html data-device="desktop|tablet|mobile"> para regras/JS
   que precisem do tipo de dispositivo além do tamanho da tela.
   ============================================================================ */

/* Elementos do shell mobile ficam ocultos no desktop */
.mobile-topbar,
.mobile-bottom-nav,
.drawer-backdrop,
.nav-drawer-toggle { display: none; }

/* Utilitário: Floating Action Button (uso por página; ex.: <button class="fab">＋</button>) */
.fab {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right));
    bottom: calc(1.25rem + env(safe-area-inset-bottom));
    width: 56px; height: 56px; padding: 0;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; line-height: 1;
    box-shadow: 0 8px 24px rgba(11, 32, 39, .28);
    z-index: 900;
}

/* FAB global "voltar ao topo" (injetado por site.js apenas no mobile) */
#scroll-top-fab {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right));
    bottom: calc(76px + env(safe-area-inset-bottom));
    width: 46px; height: 46px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--brand-primary);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: none;
    align-items: center; justify-content: center;
    font-size: 1.2rem; z-index: 890;
    opacity: 0; transform: translateY(8px);
    transition: opacity .2s, transform .2s;
}
#scroll-top-fab.show { display: flex; opacity: 1; transform: translateY(0); }

/* Rolagem horizontal segura para conteúdos largos que não devam virar card */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------------------------------------------------------------------------
   <= 900px : SHELL APP-LIKE (tablets em retrato e smartphones)
   --------------------------------------------------------------------------- */
@media (max-width: 900px) {
    /* Top app bar fixa */
    .mobile-topbar {
        display: flex; align-items: center; gap: .75rem;
        position: fixed; top: 0; left: 0; right: 0;
        height: calc(56px + env(safe-area-inset-top));
        padding: env(safe-area-inset-top) 1rem 0;
        background: linear-gradient(180deg,
            color-mix(in srgb, var(--brand-primary) 45%, #07171C) 0%,
            #07171C 100%);
        color: #fff; z-index: 1300;
        box-shadow: 0 2px 12px rgba(11, 32, 39, .18);
    }
    .mobile-topbar .brand-name { font-size: 1.1rem; font-weight: 800; }
    .mobile-topbar .mobile-brand { display: flex; align-items: center; gap: .5rem; }

    /* Botão hambúrguer (área de toque >= 44px) */
    .hamburger {
        width: 44px; height: 44px; margin-left: -.5rem;
        display: flex; flex-direction: column; justify-content: center; gap: 5px;
        cursor: pointer; border-radius: 10px;
    }
    .hamburger span {
        display: block; height: 2.5px; width: 24px; border-radius: 2px;
        background: #fff; transition: transform .28s, opacity .2s;
    }
    /* Anima para "X" quando o drawer está aberto */
    .nav-drawer-toggle:checked ~ .mobile-topbar .hamburger span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
    .nav-drawer-toggle:checked ~ .mobile-topbar .hamburger span:nth-child(2) { opacity: 0; }
    .nav-drawer-toggle:checked ~ .mobile-topbar .hamburger span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

    /* A sidebar vira Drawer off-canvas */
    .layout { display: block; }
    .sidebar {
        position: fixed; top: 0; bottom: 0; left: 0;
        width: 84vw; max-width: 320px; min-width: 0;
        padding-top: calc(1.1rem + env(safe-area-inset-top));
        z-index: 1400;
        transform: translateX(-102%);
        transition: transform .3s cubic-bezier(.4, 0, .2, 1);
        will-change: transform;
        box-shadow: 8px 0 40px rgba(11, 32, 39, .4);
    }
    .nav-drawer-toggle:checked ~ .sidebar { transform: translateX(0); }

    /* Fundo escurecido atrás do drawer */
    .drawer-backdrop {
        display: block; position: fixed; inset: 0;
        background: rgba(11, 32, 39, .55);
        opacity: 0; pointer-events: none;
        transition: opacity .3s; z-index: 1350;
    }
    .nav-drawer-toggle:checked ~ .drawer-backdrop { opacity: 1; pointer-events: auto; }
    /* Trava a rolagem do fundo quando o drawer está aberto */
    .nav-drawer-toggle:checked ~ .content { overflow: hidden; }

    /* Links do drawer com alvos de toque confortáveis */
    .sidebar nav a { padding: .75rem .85rem; font-size: .95rem; min-height: 44px; display: flex; align-items: center; }
    .sidebar-footer { padding-bottom: calc(.85rem + env(safe-area-inset-bottom)); }

    /* Conteúdo: espaço para top bar e bottom nav */
    .content {
        padding: calc(56px + env(safe-area-inset-top) + 1rem) 1rem
                 calc(64px + env(safe-area-inset-bottom) + 1rem);
        max-width: none;
        animation: page-fade .28s ease;
    }

    /* Bottom Navigation */
    .mobile-bottom-nav {
        display: flex;
        position: fixed; left: 0; right: 0; bottom: 0;
        height: calc(60px + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        background: var(--surface);
        border-top: 1px solid var(--line);
        box-shadow: 0 -2px 16px rgba(11, 32, 39, .1);
        z-index: 1200;
    }
    .bn-item {
        flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
        gap: 2px; text-decoration: none; cursor: pointer;
        color: var(--muted-c); font-size: .68rem; font-weight: 600;
        padding: .35rem 0; min-height: 44px;
        transition: color .15s, background .15s;
        -webkit-tap-highlight-color: transparent;
    }
    .bn-item .bn-ico { font-size: 1.25rem; line-height: 1; }
    .bn-item.active { color: var(--brand-primary); }
    .bn-item.active .bn-ico { transform: translateY(-1px); }
    .bn-item:active { background: var(--tint); }

    /* Dashboards fluidos: cartões de estatística ocupam a largura melhor */
    .cards-row { gap: .6rem; }
    .stat { min-width: calc(50% - .3rem); }
    .stat .value { font-size: 1.6rem; }

    /* Modais coladas às bordas em telas pequenas */
    .modal-dialog { padding: 1.1rem 1rem; border-radius: 14px 14px 0 0; }

    /* Toolbar quebra bem e o campo de busca ocupa a linha toda */
    .toolbar input { max-width: none; flex: 1 1 100%; }
}

/* ---------------------------------------------------------------------------
   <= 640px : SMARTPHONE — tabelas viram cards, formulários em coluna
   --------------------------------------------------------------------------- */
@media (max-width: 640px) {
    h1 { font-size: 1.35rem; }
    h2 { font-size: 1.08rem; }

    /* Formulários: um campo por linha, sem rolagem horizontal */
    .form-row { flex-direction: column; gap: 0; }

    /* Cartões de estatística: um por linha, mais legíveis */
    .stat { min-width: 100%; }

    /* Botões e campos: alvo de toque + evita zoom automático do iOS (font >= 16px) */
    button, .btn { min-height: 44px; padding: .7rem 1.15rem; }
    input, select, textarea { font-size: 16px; padding: .7rem .85rem; min-height: 44px; }
    textarea { min-height: 96px; }

    /* -------- Tabelas viram CARDS --------
       site.js adiciona a classe .cardify e o atributo data-label em cada célula
       (a partir do cabeçalho da coluna). Aqui só cuidamos da apresentação. */
    table.cardify { background: transparent; border-radius: 0; overflow: visible; }
    table.cardify thead {
        position: absolute; width: 1px; height: 1px;
        padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0;
    }
    table.cardify tbody tr {
        display: block;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
        box-shadow: var(--shadow-sm);
        padding: .55rem .85rem;
        margin-bottom: .6rem;
    }
    table.cardify tbody td {
        display: flex; justify-content: space-between; align-items: center; gap: 1rem;
        padding: .4rem 0; border: none; font-size: .9rem; text-align: right;
    }
    table.cardify tbody td::before {
        content: attr(data-label);
        flex: 0 0 42%; text-align: left;
        font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
        color: var(--muted-c);
    }
    table.cardify tbody td:last-child { border-bottom: none; }
    table.cardify tbody td:empty { display: none; }
    table.cardify tbody tr:hover td { background: transparent; }
    /* Células sem rótulo (ex.: coluna de ações) ocupam a linha inteira */
    table.cardify tbody td[data-label=""]::before,
    table.cardify tbody td.actions::before { content: none; }
    table.cardify tbody td.actions { justify-content: flex-end; }

    /* Login dividido: some com o painel do carrossel, foco no formulário */
    .login-right { display: none; }
    .login-left { flex: 1; min-height: 100vh; }

    /* Nine-box continua em grade, porém compacto */
    .ninebox-cell { min-height: 88px; }
}

/* Animação de entrada do conteúdo ao navegar */
@keyframes page-fade {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Respeita quem prefere menos movimento (acessibilidade) */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
