/* ============================================================
   BECAPE — Design System "Solo e Fruto"
   Paleta: verde-profundo (solo fértil) + âmbar dourado (fruto)
   ============================================================ */

:root {
    /* Cores base */
    --green-950: #071f18;
    --green-900: #0c2f24;
    --green-800: #124534;
    --green-700: #1b5e46;
    --green-600: #24775a;
    --green-500: #2f9770;
    --green-400: #4db98d;
    --green-300: #86d5b2;
    --green-100: #dcf2e7;
    --green-50:  #eef9f3;

    --amber-500: #e0a63d;
    --amber-400: #ecbb5f;
    --amber-100: #faf0d7;

    --paper:     #f6f4ed;
    --paper-2:   #efece2;
    --card:      #ffffff;
    --ink:       #1d2521;
    --ink-soft:  #52605a;
    --ink-faint: #8a968f;
    --line:      #e4e1d6;

    --danger:    #c2503d;
    --danger-bg: #fbeae7;
    --success:   #2f9770;
    --success-bg:#e3f5ec;

    /* Perfis do quiz */
    --caminho:  #a08c6b;
    --pedras:   #b7793b;
    --espinhos: #6b7d3f;
    --terraboa: #2f9770;

    --radius: 18px;
    --radius-lg: 26px;
    --shadow-sm: 0 1px 2px rgba(18, 37, 28, .05), 0 2px 8px rgba(18, 37, 28, .05);
    --shadow-md: 0 2px 6px rgba(18, 37, 28, .06), 0 12px 32px rgba(18, 37, 28, .10);
    --shadow-lg: 0 4px 12px rgba(7, 31, 24, .12), 0 24px 60px rgba(7, 31, 24, .18);

    --font-display: "Fraunces", Georgia, "Times New Roman", serif;
    --font-body: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;

    --sidebar-w: 264px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--paper);
    min-height: 100vh;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--green-600); text-decoration: none; }
a:hover { color: var(--green-700); }

h1, h2, h3, .display { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; }

/* ---------- Animações ---------- */

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.anim-1, .anim-2, .anim-3, .anim-4 { animation: fadeUp .55s cubic-bezier(.22,.8,.36,1) both; }
.anim-2 { animation-delay: .08s; }
.anim-3 { animation-delay: .16s; }
.anim-4 { animation-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

/* ============================================================
   AUTH (login / recuperação)
   ============================================================ */

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
}

.auth-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 56px;
    color: #f2f8f4;
    background:
        radial-gradient(1100px 600px at -10% 110%, rgba(224, 166, 61, .28), transparent 55%),
        radial-gradient(900px 700px at 110% -10%, rgba(77, 185, 141, .25), transparent 55%),
        linear-gradient(160deg, var(--green-900) 0%, var(--green-950) 100%);
}

.auth-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 26px 26px;
    pointer-events: none;
}

.auth-hero .brand { position: relative; z-index: 1; }

.auth-hero blockquote {
    position: relative;
    z-index: 1;
    max-width: 30rem;
}

.auth-hero blockquote p {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 2.6vw, 2.3rem);
    line-height: 1.3;
    font-weight: 500;
}

.auth-hero blockquote p em { color: var(--amber-400); font-style: normal; }

.auth-hero blockquote footer {
    margin-top: 18px;
    font-size: .9rem;
    color: rgba(242, 248, 244, .65);
    letter-spacing: .12em;
    text-transform: uppercase;
}

.auth-hero .hero-foot {
    position: relative;
    z-index: 1;
    font-size: .85rem;
    color: rgba(242, 248, 244, .55);
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: var(--paper);
}

.auth-card {
    width: 100%;
    max-width: 400px;
}

.auth-card h1 {
    font-size: 1.9rem;
    margin-bottom: 6px;
}

.auth-card .subtitle {
    color: var(--ink-soft);
    margin-bottom: 30px;
}

@media (max-width: 900px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-hero { display: none; }
    .auth-panel {
        background:
            radial-gradient(700px 380px at 50% -10%, rgba(47, 151, 112, .12), transparent 60%),
            var(--paper);
    }
}

/* ---------- Marca ---------- */

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: inherit;
}

.brand .brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, var(--green-500), var(--green-700));
    box-shadow: 0 6px 16px rgba(47, 151, 112, .35);
    color: #fff;
    flex: none;
}

.brand .brand-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: .04em;
}

.brand .brand-tag {
    display: block;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: .68rem;
    letter-spacing: .22em;
    text-transform: uppercase;
    opacity: .6;
}

/* ---------- Formulários ---------- */

.field { margin-bottom: 18px; }

.field label {
    display: block;
    font-weight: 600;
    font-size: .86rem;
    margin-bottom: 7px;
    color: var(--ink);
}

.input {
    width: 100%;
    padding: 13px 16px;
    font: inherit;
    color: var(--ink);
    background: var(--card);
    border: 1.5px solid var(--line);
    border-radius: 14px;
    transition: border-color .18s, box-shadow .18s;
}

.input::placeholder { color: var(--ink-faint); }

.input:focus {
    outline: none;
    border-color: var(--green-500);
    box-shadow: 0 0 0 4px rgba(47, 151, 112, .14);
}

.input-wrap { position: relative; }

.input-wrap .toggle-pass {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: none;
    cursor: pointer;
    padding: 8px;
    color: var(--ink-faint);
    border-radius: 10px;
}
.input-wrap .toggle-pass:hover { color: var(--green-600); background: var(--green-50); }

.hp-field {
    position: absolute !important;
    left: -9999px;
    width: 1px; height: 1px;
    overflow: hidden;
}

/* ---------- Botões ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 13px 22px;
    font: inherit;
    font-weight: 600;
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    transition: transform .16s, box-shadow .16s, background .16s;
    text-decoration: none;
}

.btn-primary {
    width: 100%;
    color: #fff;
    background: linear-gradient(145deg, var(--green-500), var(--green-700));
    box-shadow: 0 8px 20px rgba(47, 151, 112, .32);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(47, 151, 112, .4);
    color: #fff;
}

.btn-primary:active { transform: translateY(0); }

.btn-ghost {
    color: var(--ink-soft);
    background: transparent;
    border: 1.5px solid var(--line);
}
.btn-ghost:hover { border-color: var(--green-400); color: var(--green-700); }

/* ---------- Alertas / flash ---------- */

.alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 13px 16px;
    border-radius: 14px;
    font-size: .9rem;
    margin-bottom: 20px;
    animation: fadeUp .4s both;
}

.alert-error   { background: var(--danger-bg);  color: var(--danger); }
.alert-success { background: var(--success-bg); color: var(--green-700); }

/* ============================================================
   APP SHELL (admin)
   ============================================================ */

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

/* ---------- Sidebar ---------- */

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    padding: 26px 18px;
    color: #dfeee6;
    background:
        radial-gradient(500px 300px at -20% 110%, rgba(224, 166, 61, .16), transparent 60%),
        linear-gradient(170deg, var(--green-900), var(--green-950));
    z-index: 50;
    transition: transform .25s ease;
}

.sidebar .brand { margin: 0 8px 30px; color: #fff; }

.side-nav { flex: 1; display: flex; flex-direction: column; gap: 4px; }

.side-nav .nav-label {
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: rgba(223, 238, 230, .45);
    margin: 18px 12px 8px;
}

.side-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    color: rgba(223, 238, 230, .78);
    font-weight: 500;
    font-size: .93rem;
    transition: background .15s, color .15s;
}

.side-nav a svg { flex: none; opacity: .8; }

.side-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }

.side-nav a.active {
    background: linear-gradient(120deg, rgba(77, 185, 141, .22), rgba(77, 185, 141, .1));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(77, 185, 141, .28);
}

.side-nav a.active svg { opacity: 1; color: var(--green-300); }

.side-nav a .soon {
    margin-left: auto;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .08em;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(224, 166, 61, .18);
    color: var(--amber-400);
    text-transform: uppercase;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: 18px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .06);
}

.avatar {
    width: 38px;
    height: 38px;
    flex: none;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: .9rem;
    color: var(--green-900);
    background: linear-gradient(145deg, var(--amber-400), var(--amber-500));
}

.sidebar-user .u-name { font-size: .88rem; font-weight: 600; color: #fff; line-height: 1.2; }
.sidebar-user .u-role { font-size: .74rem; color: rgba(223, 238, 230, .55); }

.sidebar-user form { margin-left: auto; }

.btn-logout {
    border: 0;
    background: none;
    color: rgba(223, 238, 230, .6);
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    display: grid;
    place-items: center;
}
.btn-logout:hover { color: #fff; background: rgba(255, 255, 255, .1); }

/* ---------- Conteúdo ---------- */

.main {
    flex: 1;
    margin-left: var(--sidebar-w);
    padding: 34px 40px 60px;
    min-width: 0;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
}

.page-head h1 { font-size: 1.75rem; }

.page-head .crumb {
    font-size: .82rem;
    color: var(--ink-faint);
    margin-bottom: 4px;
    letter-spacing: .06em;
    text-transform: uppercase;
    font-weight: 600;
}

.page-head .greeting { color: var(--ink-soft); font-size: .95rem; margin-top: 4px; }

/* ---------- Cards / stats ---------- */

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(228, 225, 214, .7);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
    gap: 18px;
    margin-bottom: 30px;
}

.stat-card {
    position: relative;
    overflow: hidden;
    padding: 22px;
    transition: transform .18s, box-shadow .18s;
}

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    margin-bottom: 16px;
}

.stat-card .stat-value {
    font-family: var(--font-display);
    font-size: 2.1rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-label {
    margin-top: 6px;
    font-size: .86rem;
    color: var(--ink-soft);
    font-weight: 500;
}

.tint-green  { background: var(--green-100); color: var(--green-700); }
.tint-amber  { background: var(--amber-100); color: var(--amber-500); }
.tint-olive  { background: #eef0dd; color: var(--espinhos); }
.tint-stone  { background: #f2ead9; color: var(--pedras); }

/* ---------- Painel de boas-vindas ---------- */

.welcome-panel {
    position: relative;
    overflow: hidden;
    padding: 30px 34px;
    border-radius: var(--radius-lg);
    color: #f2f8f4;
    background:
        radial-gradient(700px 320px at 105% -30%, rgba(224, 166, 61, .3), transparent 60%),
        linear-gradient(150deg, var(--green-800), var(--green-950));
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
}

.welcome-panel h2 { font-size: 1.5rem; margin-bottom: 8px; }
.welcome-panel h2 em { color: var(--amber-400); font-style: normal; }
.welcome-panel p { max-width: 46rem; color: rgba(242, 248, 244, .78); font-size: .95rem; }

.welcome-panel .verse {
    margin-top: 16px;
    font-size: .82rem;
    color: rgba(242, 248, 244, .55);
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 600;
}

/* ---------- Placeholder de módulos ---------- */

.empty-state {
    padding: 46px 30px;
    text-align: center;
    color: var(--ink-soft);
}

.empty-state .empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    background: var(--green-50);
    color: var(--green-500);
}

.empty-state h3 { color: var(--ink); margin-bottom: 6px; }
.empty-state p { max-width: 30rem; margin: 0 auto; font-size: .92rem; }

/* ---------- Topbar mobile ---------- */

.mobile-topbar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 40;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: rgba(246, 244, 237, .9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.burger {
    border: 0;
    background: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    color: var(--ink);
}
.burger:hover { background: var(--paper-2); }

.scrim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(7, 31, 24, .5);
    z-index: 45;
}

@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .scrim { display: block; animation: fadeIn .2s both; }
    .main { margin-left: 0; padding: 24px 18px 48px; }
    .mobile-topbar { display: flex; }
    .page-head { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ---------- Página de erro ---------- */

.error-page {
    text-align: center;
    padding: 40px 20px;
}
.error-page .code {
    font-family: var(--font-display);
    font-size: 5rem;
    font-weight: 700;
    color: var(--green-300);
    line-height: 1;
}
.error-page h1 { font-size: 1.5rem; margin: 10px 0 8px; }
.error-page p { color: var(--ink-soft); margin-bottom: 24px; }

/* ============================================================
   MÓDULO 2 — Usuários, perfis, meu perfil, auth extra
   ============================================================ */

.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn-auto { width: auto; }

.btn-wa {
    color: #fff;
    background: #1fa855;
    box-shadow: 0 6px 16px rgba(31, 168, 85, .3);
}
.btn-wa:hover { color: #fff; background: #178a45; transform: translateY(-1px); }

.link-btn {
    border: 0;
    background: none;
    color: var(--green-600);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
}
.link-btn:hover { color: var(--green-700); text-decoration: underline; }

.auth-alt { margin-top: 22px; text-align: center; font-size: .92rem; }

.input-code {
    text-align: center;
    font-size: 1.7rem;
    letter-spacing: .5em;
    font-weight: 700;
    padding-left: calc(16px + .25em);
}

/* ---------- Toolbar de listagem ---------- */

.toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.toolbar-search {
    position: relative;
    flex: 1;
    min-width: 220px;
}

.toolbar-search svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink-faint);
    pointer-events: none;
}

.toolbar-search .input { padding-left: 42px; }

.toolbar .select { width: auto; min-width: 160px; }

.select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2352605a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

/* ---------- Tabelas ---------- */

.table-card { overflow: hidden; }

.table-scroll { overflow-x: auto; }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: .92rem;
    min-width: 720px;
}

.table thead th {
    text-align: left;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-faint);
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    background: #fbfaf6;
}

.table tbody td {
    padding: 13px 18px;
    border-bottom: 1px solid #f0eee5;
    vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #fbfaf5; }

.t-right { text-align: right; }
.t-sub { color: var(--ink-faint); font-size: .84rem; }
.t-name { font-weight: 600; }
.t-empty { text-align: center; color: var(--ink-faint); padding: 36px !important; }

.t-user { display: flex; align-items: center; gap: 12px; }

.avatar-sm { width: 34px; height: 34px; border-radius: 10px; font-size: .78rem; }

.t-actions { display: inline-flex; gap: 6px; align-items: center; }
.t-actions form { display: inline-flex; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ink-soft);
    cursor: pointer;
    transition: background .14s, color .14s;
}
.icon-btn:hover { background: var(--green-50); color: var(--green-700); }
.icon-danger:hover { background: var(--danger-bg); color: var(--danger); }

/* ---------- Chips ---------- */

.chip {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .02em;
    vertical-align: middle;
}
.chip-green   { background: var(--success-bg); color: var(--green-700); }
.chip-red     { background: var(--danger-bg); color: var(--danger); }
.chip-neutral { background: var(--paper-2); color: var(--ink-soft); }

/* ---------- Paginação ---------- */

.pagination {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    padding: 14px 18px;
    border-top: 1px solid var(--line);
    background: #fbfaf6;
}

.page-link {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: 10px;
    font-size: .88rem;
    font-weight: 600;
    color: var(--ink-soft);
}
.page-link:hover { background: var(--green-50); color: var(--green-700); }
.page-link.current { background: var(--green-700); color: #fff; }

/* ---------- Formulários (cards) ---------- */

.form-card { padding: 26px 28px; max-width: 860px; }

.card-title {
    font-size: 1.15rem;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 22px;
}

@media (max-width: 720px) {
    .form-grid { grid-template-columns: 1fr; }
}

.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }
.input-group .btn { padding: 0 16px; flex: none; }

.field-check { display: flex; align-items: flex-end; padding-bottom: 12px; }

.check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: .92rem;
    padding: 5px 0;
}

.check input {
    width: 18px;
    height: 18px;
    accent-color: var(--green-600);
    cursor: pointer;
    flex: none;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 24px;
    padding: 18px 20px;
    border-radius: 14px;
    background: var(--amber-100);
    border: 1px dashed var(--amber-500);
}
.form-footer p { margin-top: 2px; }

/* ---------- Compartilhar link de reset ---------- */

.reset-share { padding: 18px 20px; margin-bottom: 20px; border: 1.5px solid var(--green-300); }
.reset-share-head { font-weight: 600; font-size: .9rem; margin-bottom: 10px; }
.reset-share-row { display: flex; gap: 8px; flex-wrap: wrap; }
.reset-share-row .input { flex: 1; min-width: 240px; font-size: .84rem; }

/* ---------- Perfis (roles) ---------- */

.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
    align-items: start;
}

.role-card { padding: 22px 24px; }

.role-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
}

.role-head h3 { font-size: 1.1rem; }

.role-note {
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--green-50);
    color: var(--green-700);
    font-size: .88rem;
}

.perm-group { margin-bottom: 12px; }

.perm-module {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 4px;
}

.role-new { border: 1.5px dashed var(--green-300); background: var(--green-50); }

/* ---------- Meu perfil ---------- */

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
    align-items: start;
}
.profile-grid .form-card { max-width: none; }

/* ============================================================
   MÓDULO 3 — Construtor de quizzes
   ============================================================ */

.chip-amber { background: var(--amber-100); color: #9a7420; }

.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 18px;
}

.quiz-card { padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; transition: transform .18s, box-shadow .18s; }
.quiz-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.quiz-card-head { display: flex; justify-content: space-between; align-items: center; }

.quiz-card-title { font-size: 1.15rem; line-height: 1.3; }
.quiz-card-title a { color: var(--ink); }
.quiz-card-title a:hover { color: var(--green-700); }

.quiz-card-desc { color: var(--ink-soft); font-size: .88rem; flex: 1; }

.quiz-card-meta { display: flex; gap: 16px; font-size: .82rem; color: var(--ink-faint); }
.quiz-card-meta span { display: inline-flex; align-items: center; gap: 6px; }

.quiz-card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

/* ---------- Builder ---------- */

.builder-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
    gap: 18px;
    align-items: start;
}

.builder-main, .builder-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

@media (max-width: 1100px) {
    .builder-grid { grid-template-columns: 1fr; }
}

.count-pill {
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    height: 24px;
    padding: 0 8px;
    margin-left: 6px;
    border-radius: 999px;
    background: var(--green-100);
    color: var(--green-700);
    font-family: var(--font-body);
    font-size: .78rem;
    font-weight: 700;
    vertical-align: middle;
}

/* Perguntas (lista) */

.question-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }

.question-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fbfaf6;
}

.q-pos {
    flex: none;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: linear-gradient(145deg, var(--green-500), var(--green-700));
    color: #fff;
    font-weight: 700;
    font-size: .82rem;
}

.q-text { flex: 1; min-width: 0; color: var(--ink); font-weight: 500; font-size: .92rem; line-height: 1.35; }
.q-text .t-sub { display: block; font-weight: 400; }
.q-text:hover { color: var(--green-700); }

.question-item .icon-btn[disabled] { opacity: .3; pointer-events: none; }

.add-inline { display: flex; gap: 10px; }
.add-inline .input { flex: 1; }

/* Resultados (outcomes) */

.outcome-item {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fbfaf6;
    margin-bottom: 10px;
    overflow: hidden;
}

.outcome-item summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    cursor: pointer;
    list-style: none;
    font-size: .95rem;
}
.outcome-item summary::-webkit-details-marker { display: none; }
.outcome-item summary:hover { background: var(--green-50); }
.outcome-item[open] summary { border-bottom: 1px solid var(--line); }

.color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex: none;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,.6);
}

.outcome-form { padding: 16px; }
.outcome-inline { display: flex; gap: 14px; }
.outcome-inline > div { flex: 1; }
.input-color { padding: 4px; height: 48px; cursor: pointer; }
.outcome-actions { display: flex; justify-content: flex-end; }
.outcome-delete { padding: 0 16px 14px; }
.link-danger { color: var(--danger); }
.link-danger:hover { color: #a03a29; }

.outcome-new { border-style: dashed; background: var(--green-50); }

/* Acesso */

.access-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f0eee5;
}
.access-row:last-of-type { border-bottom: 0; }
.access-row .select { width: auto; min-width: 140px; }

/* Alternativas (editor) */

.option-row {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fbfaf6;
    padding: 12px;
    margin-bottom: 10px;
}

.option-head { display: flex; gap: 10px; align-items: center; }
.option-head .input[type="text"] { flex: 1; min-width: 140px; }
.option-head .select { width: auto; min-width: 160px; flex: none; }
.input-points { width: 76px; flex: none; text-align: center; }

.option-letter {
    flex: none;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: var(--paper-2);
    color: var(--ink-soft);
    font-weight: 700;
    font-size: .82rem;
}

.option-study { margin-top: 10px; }
.option-study summary {
    cursor: pointer;
    font-size: .84rem;
    color: var(--ink-soft);
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}
.option-study summary::-webkit-details-marker { display: none; }
.option-study summary:hover { color: var(--green-700); }
.option-study textarea { margin-top: 10px; font-size: .88rem; }

@media (max-width: 760px) {
    .option-head { flex-wrap: wrap; }
    .add-inline { flex-direction: column; }
}

/* ============================================================
   MÓDULO 4 — Quiz público (participante)
   ============================================================ */

.public-body {
    background:
        radial-gradient(900px 500px at 85% -10%, rgba(224, 166, 61, .12), transparent 60%),
        radial-gradient(800px 500px at -10% 110%, rgba(47, 151, 112, .10), transparent 60%),
        var(--paper);
    min-height: 100vh;
}

.pq-shell {
    max-width: 560px;
    margin: 0 auto;
    padding: 28px 18px 60px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pq-stage { animation: fadeUp .45s cubic-bezier(.22,.8,.36,1) both; }

.pq-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(228, 225, 214, .7);
    padding: 30px 26px;
}

@keyframes pqSlide {
    from { opacity: 0; transform: translateX(26px); }
    to   { opacity: 1; transform: translateX(0); }
}
.pq-slide-in { animation: pqSlide .3s ease both; }

/* Boas-vindas */

.pq-welcome { text-align: center; padding: 44px 28px; }

.pq-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    color: var(--green-800);
}
.pq-brand .brand-name { font-size: 1.2rem; letter-spacing: .06em; }

.pq-title { font-size: clamp(1.7rem, 5.5vw, 2.2rem); margin: 18px 0 10px; line-height: 1.2; }
.pq-desc { color: var(--ink-soft); line-height: 1.6; }
.pq-meta {
    margin: 16px 0 26px;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.pq-btn { width: 100%; padding: 15px 22px; font-size: 1rem; }

/* Progresso */

.pq-progress-wrap { margin-bottom: 16px; }

.pq-progress-info {
    display: flex;
    justify-content: space-between;
    font-size: .8rem;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 8px;
}

.pq-progress {
    height: 8px;
    border-radius: 999px;
    background: var(--paper-2);
    overflow: hidden;
}

.pq-progress-bar {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--green-500), var(--green-400));
    transition: width .35s ease;
}

/* Pergunta e alternativas */

.pq-question { font-size: 1.3rem; line-height: 1.35; margin-bottom: 20px; }

.pq-options { display: flex; flex-direction: column; gap: 10px; }

.pq-option {
    display: flex;
    align-items: center;
    gap: 13px;
    width: 100%;
    text-align: left;
    padding: 15px 16px;
    font: inherit;
    font-size: .95rem;
    line-height: 1.4;
    color: var(--ink);
    background: #fbfaf6;
    border: 1.5px solid var(--line);
    border-radius: 16px;
    cursor: pointer;
    transition: border-color .15s, background .15s, transform .12s;
}

.pq-option:hover { border-color: var(--green-400); background: var(--green-50); }
.pq-option:active { transform: scale(.985); }

.pq-option.selected {
    border-color: var(--green-500);
    background: var(--green-50);
    box-shadow: 0 0 0 3px rgba(47, 151, 112, .15);
}

.pq-option-letter {
    flex: none;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--paper-2);
    color: var(--ink-soft);
    font-weight: 700;
    font-size: .85rem;
    transition: background .15s, color .15s;
}

.pq-option.selected .pq-option-letter,
.pq-option:hover .pq-option-letter { background: var(--green-600); color: #fff; }

.pq-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    border: 0;
    background: none;
    color: var(--ink-soft);
    font: inherit;
    font-size: .9rem;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 4px;
}
.pq-back:hover { color: var(--green-700); }

/* Formulário final */

.pq-optional { font-weight: 400; color: var(--ink-faint); font-size: .8rem; }
.pq-check { margin-bottom: 12px; align-items: flex-start; }
.pq-check input { margin-top: 2px; }
.pq-consent { font-size: .84rem; color: var(--ink-soft); margin: 18px 0; }
.pq-charcount { text-align: right; font-size: .76rem; color: var(--ink-faint); margin-top: 4px; }

/* Resultado */

.pq-result { text-align: center; padding: 40px 28px; }

.pq-result-badge {
    width: 76px;
    height: 76px;
    margin: 0 auto 18px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--green-600);
    box-shadow: 0 12px 30px rgba(18, 37, 28, .25);
}

.pq-result-label {
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.pq-result-title { font-size: 2rem; margin: 6px 0 12px; }

.pq-result-message {
    color: var(--ink-soft);
    line-height: 1.65;
    max-width: 26rem;
    margin: 0 auto 22px;
}

.pq-dist { margin: 0 auto 20px; max-width: 24rem; text-align: left; }

.pq-dist-row {
    display: grid;
    grid-template-columns: 84px 1fr 30px;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: .82rem;
}

.pq-dist-label { font-weight: 600; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pq-dist-track {
    display: block;
    height: 9px;
    border-radius: 999px;
    background: var(--paper-2);
    overflow: hidden;
}

.pq-dist-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    transition: width .6s ease;
}

.pq-dist-score { text-align: right; font-weight: 700; color: var(--ink-soft); }

.pq-email-note { font-size: .86rem; color: var(--green-700); margin-bottom: 18px; }

.pq-result-actions { display: flex; flex-direction: column; gap: 10px; }

.pq-foot {
    text-align: center;
    margin-top: 22px;
    font-size: .82rem;
    color: var(--ink-faint);
}

/* Política de privacidade */

.pq-privacy h3 { margin: 20px 0 6px; font-size: 1.05rem; }
.pq-privacy p { color: var(--ink-soft); line-height: 1.65; font-size: .93rem; }

@media (max-width: 480px) {
    .pq-shell { padding: 18px 12px 40px; justify-content: flex-start; }
    .pq-card { padding: 24px 18px; }
}

/* ============================================================
   MÓDULO 5 — Dashboard completo
   ============================================================ */

.dash-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
    gap: 18px;
    align-items: start;
    margin-bottom: 24px;
}

@media (max-width: 1100px) {
    .dash-grid { grid-template-columns: 1fr; }
}

.dash-dist-row {
    display: grid;
    grid-template-columns: 92px 1fr 34px;
    align-items: center;
    gap: 10px;
    margin-bottom: 9px;
    font-size: .84rem;
}

.dash-dist-label {
    font-weight: 600;
    color: var(--ink-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-dist-track {
    display: block;
    height: 10px;
    border-radius: 999px;
    background: var(--paper-2);
    overflow: hidden;
}

.dash-dist-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    transition: width .6s ease;
}

.dash-dist-score { text-align: right; font-weight: 700; color: var(--ink-soft); }

.dash-top-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid #f0eee5;
    font-size: .9rem;
}
.dash-top-row:last-child { border-bottom: 0; }
.dash-top-row a { font-weight: 600; color: var(--ink); }
.dash-top-row a:hover { color: var(--green-700); }

.table-card .card-title { padding-bottom: 12px !important; }

/* ============================================================
   MÓDULO 6 — Auditoria
   ============================================================ */

.toolbar-date { width: auto; min-width: 140px; }
.audit-details { max-width: 320px; }

/* ============================================================
   MÓDULO 7 — Central de Relatórios
   ============================================================ */

.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
}

.report-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px;
    color: var(--ink);
    transition: transform .18s, box-shadow .18s;
}
.report-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); color: var(--ink); }
.report-card:hover .report-arrow { transform: translateX(4px); color: var(--green-600); }

.report-card .stat-icon { margin: 0; flex: none; }
.report-title { display: block; font-weight: 700; font-size: 1.02rem; margin-bottom: 3px; font-family: var(--font-display); }
.report-desc { display: block; font-size: .84rem; color: var(--ink-soft); line-height: 1.45; }
.report-arrow { flex: none; margin-left: auto; color: var(--ink-faint); transition: transform .18s, color .18s; }

.toolbar .check { padding: 0 4px; white-space: nowrap; }

.detail-answer { padding: 12px 0; border-bottom: 1px solid #f0eee5; }
.detail-answer:last-child { border-bottom: 0; }
.detail-q { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: .93rem; margin-bottom: 8px; }
.detail-q .q-pos { width: 26px; height: 26px; font-size: .76rem; flex: none; }
.detail-a { margin-left: 36px; font-size: .92rem; color: var(--ink-soft); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   MÓDULO 8 — PWA
   ============================================================ */

.pq-install {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 14px;
    width: 100%;
    padding: 13px 20px;
    font: inherit;
    font-weight: 600;
    font-size: .92rem;
    color: var(--green-700);
    background: var(--green-50);
    border: 1.5px dashed var(--green-400);
    border-radius: 14px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.pq-install:hover { background: var(--green-100); border-color: var(--green-500); }

.pq-ios-hint {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--amber-100);
    color: #6b5320;
    font-size: .84rem;
    line-height: 1.5;
    text-align: left;
}

/* ---------- Dashboard BI ---------- */

.bi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
    align-items: start;
}

.bi-donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.bi-donut { width: 150px; height: 150px; flex: none; }

.bi-legend { display: flex; flex-direction: column; gap: 7px; font-size: .84rem; color: var(--ink-soft); }
.bi-legend i {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 4px;
    margin-right: 7px;
    vertical-align: -1px;
}

.bi-week {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 150px;
    padding-top: 10px;
}

.bi-week-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    gap: 5px;
}

.bi-week-value { font-size: .74rem; font-weight: 700; color: var(--ink-soft); min-height: 1em; }

.bi-week-bar {
    width: 100%;
    max-width: 34px;
    border-radius: 8px 8px 4px 4px;
    background: linear-gradient(180deg, var(--green-400), var(--green-600));
    transition: height .4s ease;
}

.bi-week-label { font-size: .72rem; font-weight: 600; color: var(--ink-faint); }

.icon-play { color: var(--green-600); }
.icon-play:hover { background: var(--green-100); }

/* Formulário público: grade 2 colunas (localização) */
.pq-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 480px) { .pq-grid2 { grid-template-columns: 1fr; } }

/* ============================================================
   Menu recolhível + BI ampliado
   ============================================================ */

.sidebar { transition: width .25s ease, transform .25s ease; }

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 8px 30px;
}
.sidebar-head .brand { margin: 0; }

.sidebar-toggle {
    flex: none;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .08);
    color: rgba(223, 238, 230, .75);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.sidebar-toggle:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.sidebar-toggle svg { transition: transform .25s ease; }

/* ---- Estado recolhido (somente desktop) ---- */
@media (min-width: 1025px) {
    body.sidebar-collapsed { --sidebar-w: 92px; }

    body.sidebar-collapsed .sidebar { padding: 26px 14px; }

    body.sidebar-collapsed .sidebar-head {
        flex-direction: column;
        gap: 14px;
        margin: 0 0 22px;
    }

    /* Logo mantém o tamanho cheio quando recolhido */
    body.sidebar-collapsed .brand .brand-icon { width: 48px; height: 48px; border-radius: 15px; }
    body.sidebar-collapsed .brand .brand-icon svg { width: 26px; height: 26px; }
    body.sidebar-collapsed .brand-text,
    body.sidebar-collapsed .nav-label,
    body.sidebar-collapsed .nav-text,
    body.sidebar-collapsed .soon { display: none; }

    body.sidebar-collapsed .sidebar-toggle svg { transform: rotate(180deg); }

    body.sidebar-collapsed .side-nav a {
        justify-content: center;
        padding: 13px 0;
    }
    body.sidebar-collapsed .side-nav a svg { width: 22px; height: 22px; }

    body.sidebar-collapsed .sidebar-user {
        flex-direction: column;
        gap: 10px;
        padding: 12px 8px;
    }
    body.sidebar-collapsed .sidebar-user > span:not(.avatar) { display: none; }
    body.sidebar-collapsed .sidebar-user form { margin: 0; }
}

/* ---- BI ampliado: informações maiores e legíveis ---- */

.bi-grid { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.bi-grid .card-title { font-size: 1.2rem; }

.bi-grid .dash-dist-row {
    grid-template-columns: 130px 1fr 44px;
    font-size: 1rem;
    margin-bottom: 13px;
}
.bi-grid .dash-dist-track { height: 16px; border-radius: 999px; }
.bi-grid .dash-dist-score { font-size: 1.05rem; }

.bi-donut { width: 200px; height: 200px; }
.bi-legend { font-size: 1rem; gap: 10px; }
.bi-legend i { width: 14px; height: 14px; }

.bi-week { height: 200px; }
.bi-week-bar { max-width: 44px; }
.bi-week-value { font-size: .95rem; }
.bi-week-label { font-size: .88rem; }

@media (max-width: 700px) {
    .bi-grid { grid-template-columns: 1fr; }
    .bi-grid .dash-dist-row { grid-template-columns: 105px 1fr 38px; }
}

/* ============================================================
   Topbar com chip do usuário
   ============================================================ */

.topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    position: relative;
    z-index: 45;
}

.topbar .burger, .topbar-brand { display: none; }

.user-chip { position: relative; margin-left: auto; }

.user-chip-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px 7px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    font: inherit;
    color: var(--ink);
    transition: box-shadow .15s, border-color .15s;
}
.user-chip-btn:hover { border-color: var(--green-400); box-shadow: var(--shadow-md); }

.user-chip-info { text-align: left; line-height: 1.15; }
.user-chip-info .u-name { display: block; font-weight: 600; font-size: .88rem; color: var(--ink); }
.user-chip-info .u-role { display: block; font-size: .72rem; color: var(--ink-faint); }

.user-chip-caret { color: var(--ink-faint); transition: transform .18s; }
.user-chip:hover .user-chip-caret, .user-chip.open .user-chip-caret { transform: rotate(180deg); }

.user-menu {
    position: absolute;
    right: 0;
    top: 100%;
    padding-top: 8px;
    min-width: 200px;
    display: none;
    z-index: 60;
}
.user-chip:hover .user-menu, .user-chip.open .user-menu { display: block; animation: fadeUp .18s ease both; }

.user-menu-box {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    padding: 8px;
}

.user-menu-box a, .user-menu-box button {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 11px 13px;
    border: 0;
    border-radius: 11px;
    background: none;
    font: inherit;
    font-weight: 500;
    font-size: .92rem;
    color: var(--ink);
    cursor: pointer;
    text-align: left;
    transition: background .13s, color .13s;
}
.user-menu-box a:hover { background: var(--green-50); color: var(--green-700); }
.user-menu-box button:hover { background: var(--danger-bg); color: var(--danger); }
.user-menu-box svg { flex: none; color: var(--ink-faint); }
.user-menu-box a:hover svg { color: var(--green-600); }
.user-menu-box button:hover svg { color: var(--danger); }

@media (max-width: 1024px) {
    .topbar {
        position: sticky;
        top: 0;
        margin: -24px -18px 18px;
        padding: 12px 18px;
        background: rgba(246, 244, 237, .92);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--line);
    }
    .topbar .burger { display: grid; }
    .topbar-brand { display: inline; }
    .user-chip-info { display: none; }
    .user-chip-btn { padding: 5px; border-radius: 14px; }
}

/* ---- Ajuste do cabeçalho: compacto, com data à esquerda ---- */

@media (min-width: 1025px) {
    .main { padding-top: 18px; }
    .topbar {
        margin-bottom: 24px;
        padding-bottom: 14px;
        border-bottom: 1px solid var(--line);
    }
}

.topbar-date {
    display: none;
    align-items: center;
    gap: 8px;
    font-size: .88rem;
    font-weight: 500;
    color: var(--ink-soft);
    text-transform: capitalize;
}
.topbar-date svg { color: var(--ink-faint); }

@media (min-width: 1025px) {
    .topbar-date { display: inline-flex; }
}

/* ---- Correção: menu com rolagem e usuário sem sobreposição ---- */

.sidebar { overflow: hidden; }

.side-nav {
    overflow-y: auto;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.18) transparent;
    padding-bottom: 6px;
}

.sidebar-user {
    flex: none;
    margin-top: 14px;
    min-width: 0;
}

.sidebar-user > span:not(.avatar) {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.sidebar-user .u-name,
.sidebar-user .u-role {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.field-hint { font-size: .8rem; color: var(--ink-faint); margin-top: 5px; line-height: 1.45; }
.form-card code { background: var(--paper-2); padding: 2px 7px; border-radius: 6px; font-size: .84em; }

/* ---------- Campo de CEP com preenchimento automático ---------- */

.pq-zip-status {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    pointer-events: none;
}
.pq-zip-status.is-ok { color: var(--green-600); font-weight: 700; }

.pq-zip-hint {
    margin-top: 6px;
    font-size: .82rem;
    line-height: 1.45;
}
.pq-zip-hint.is-ok { color: var(--green-700); }
.pq-zip-hint.is-error { color: var(--danger); }

/* ---------- Marca e instalação do app na tela de login (mobile) ---------- */

.auth-brand-mobile { display: none; }
.auth-install { display: none; }

@media (max-width: 900px) {
    .auth-panel {
        flex-direction: column;
        justify-content: center;
        gap: 24px;
        padding: 36px 22px 30px;
    }
    .auth-brand-mobile {
        display: inline-flex;
        color: var(--green-900);
    }
    .auth-brand-mobile .brand-name { font-size: 1.45rem; }
    .auth-card { max-width: 420px; }
    .auth-install {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 9px;
        width: 100%;
        max-width: 420px;
        padding: 13px 20px;
        font: inherit;
        font-weight: 600;
        font-size: .92rem;
        color: var(--green-700);
        background: var(--green-50);
        border: 1.5px dashed var(--green-400);
        border-radius: 14px;
        cursor: pointer;
    }
    .auth-install[hidden] { display: none; }
    .auth-ios-hint {
        max-width: 420px;
        padding: 12px 14px;
        border-radius: 12px;
        background: var(--amber-100);
        color: #6b5320;
        font-size: .84rem;
        line-height: 1.5;
    }
    .auth-ios-hint[hidden] { display: none; }
}
