/* ═══════════════════════════════════════════════════════════
   AgendeiComVocê — Design System
   Dark premium com acento verde-esmeralda
   Base: WuzManager visual language
═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --sidebar-w: 240px;

    --bg:         #08090e;
    --bg-card:    #0f1117;
    --bg-input:   #151720;
    --bg-hover:   #151720;

    --border:     rgba(255,255,255,.06);
    --border-md:  rgba(255,255,255,.10);

    --txt:        #e8eaf0;
    --txt-2:      #8b8fa8;
    --txt-3:      #3d4060;

    --accent:        #10b981;
    --accent-2:      #059669;
    --accent-glow:   rgba(16,185,129,.10);
    --accent-border: rgba(16,185,129,.28);

    --violet:        #7c6af7;
    --violet-2:      #6355e0;
    --violet-glow:   rgba(124,106,247,.12);
    --violet-border: rgba(124,106,247,.30);

    --green:  #22c55e;
    --red:    #ef4444;
    --yellow: #f59e0b;
    --blue:   #3b82f6;

    --r:  8px;
    --rl: 14px;
    --rx: 20px;
}

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

html, body {
    height: 100%;
    font-size: 15px;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    background: var(--bg);
    color: var(--txt);
    -webkit-font-smoothing: antialiased;
}

.mono { font-family: 'JetBrains Mono', monospace; }

/* ── LAYOUT ───────────────────────────────────────────────── */
.layout {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
}

/* ── SIDEBAR ──────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 22px 20px 18px;
    border-bottom: 1px solid var(--border);
}

.brand-icon {
    width: 34px; height: 34px;
    background: var(--accent-glow);
    border: 1px solid var(--accent-border);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
}

.brand-name { font-size: 13px; font-weight: 700; color: #ffffff; line-height: 1; letter-spacing: -0.01em; }
.brand-sub  { font-size: 10.5px; color: #ffffff; margin-top: 3px; }

.sidebar-nav {
    flex: 1;
    padding: 16px 10px;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--txt-3);
    padding: 0 10px;
    margin-bottom: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--r);
    color: var(--txt-2);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: all .15s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    margin-bottom: 2px;
}

.nav-item:hover { background: var(--bg-hover); color: var(--txt); }

.nav-item.active {
    background: var(--accent-glow);
    color: var(--accent);
    border: 1px solid var(--accent-border);
}

.nav-item.nav-sair:hover { background: rgba(239,68,68,.08); color: var(--red); }

.nav-icon {
    width: 16px; height: 16px;
    flex-shrink: 0;
    opacity: .7;
}
.nav-item.active .nav-icon,
.nav-item:hover  .nav-icon { opacity: 1; }

.sidebar-footer {
    padding: 14px 12px;
    border-top: 1px solid var(--border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--bg-input);
    border-radius: var(--r);
    margin-bottom: 4px;
}

.sidebar-avatar {
    width: 32px; height: 32px;
    background: var(--accent-glow);
    border: 1px solid var(--accent-border);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
    color: var(--accent);
    flex-shrink: 0;
}

.sidebar-user-name { font-size: 13px; font-weight: 600; }
.sidebar-user-role { font-size: 11px; color: var(--txt-3); margin-top: 2px; }

/* ── PAGE WRAP ────────────────────────────────────────────── */
.page-wrap { padding: 24px 28px; }

/* ── MAIN CONTENT ─────────────────────────────────────────── */
.main-content {
    min-width: 0;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ── PAGE HEADER ──────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-title { font-size: 16px; font-weight: 600; }
.page-sub   { font-size: 13px; color: var(--txt-2); margin-top: 3px; }

/* ── CARDS ────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--rl);
    padding: 22px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

/* ── STATS ────────────────────────────────────────────────── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--rl);
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
    transition: border-color .2s;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    border-radius: var(--rl) var(--rl) 0 0;
}

.stat-card.verde::before   { background: var(--green); }
.stat-card.violeta::before { background: var(--violet); }
.stat-card.azul::before    { background: var(--blue); }
.stat-card.vermelho::before{ background: var(--red); }
.stat-card.accent::before  { background: var(--accent); }

.stat-card:hover { border-color: var(--border-md); }

.stat-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--txt-3); margin-bottom: 10px; }
.stat-value { font-family: 'JetBrains Mono', monospace; font-size: 28px; font-weight: 700; line-height: 1; }
.stat-card.verde   .stat-value { color: var(--green); }
.stat-card.violeta .stat-value { color: var(--violet); }
.stat-card.azul    .stat-value { color: var(--blue); }
.stat-card.vermelho .stat-value { color: var(--red); }
.stat-card.accent  .stat-value { color: var(--accent); }
.stat-desc { font-size: 12px; color: var(--txt-3); margin-top: 5px; }

/* ── PROGRESS ─────────────────────────────────────────────── */
.progress-bar {
    height: 4px;
    background: var(--bg-hover);
    border-radius: 20px;
    overflow: hidden;
    margin-top: 6px;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 20px;
    transition: width .4s ease;
}
.progress-fill.warn   { background: var(--yellow); }
.progress-fill.danger { background: var(--red); }

/* ── HERO CARD ────────────────────────────────────────────── */
.hero-card {
    background: var(--bg-card);
    border: 1px solid var(--accent-border);
    border-radius: var(--rl);
    padding: 28px;
    text-align: center;
    text-decoration: none;
    display: block;
    color: var(--txt);
    transition: all .2s;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

.hero-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--accent);
}

.hero-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(16,185,129,.12);
}

.hero-icon {
    width: 52px; height: 52px;
    background: var(--accent-glow);
    border: 1px solid var(--accent-border);
    border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 22px; margin-bottom: 12px;
}

.hero-title { font-size: 17px; font-weight: 700; margin-bottom: 5px; }
.hero-sub   { font-size: 13px; color: var(--txt-2); }

/* ── FORMULÁRIOS ──────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--txt-2);
    margin-bottom: 7px;
}

input[type=text], input[type=email], input[type=password],
input[type=date], input[type=time], input[type=number],
input[type=url], select, textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-md);
    border-radius: var(--r);
    padding: 10px 13px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    color: var(--txt);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    appearance: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

input::placeholder, textarea::placeholder { color: var(--txt-3); }
textarea { resize: vertical; min-height: 90px; }
select { cursor: pointer; }
.form-hint { font-size: 11.5px; color: var(--txt-3); margin-top: 5px; }

/* ── BOTÕES ───────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--r);
    border: 1px solid transparent;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all .15s;
    white-space: nowrap;
    line-height: 1;
}

.btn-primary   { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); transform: translateY(-1px); }

.btn-secondary { background: transparent; color: var(--txt-2); border-color: var(--border-md); }
.btn-secondary:hover { background: var(--bg-hover); color: var(--txt); border-color: var(--border-md); }

.btn-danger    { background: rgba(239,68,68,.1); color: var(--red); border-color: rgba(239,68,68,.25); }
.btn-danger:hover { background: rgba(239,68,68,.2); }

.btn-violet    { background: var(--violet-glow); color: var(--violet); border-color: var(--violet-border); }
.btn-violet:hover { background: rgba(124,106,247,.2); }

.btn-sm  { padding: 5px 12px; font-size: 12.5px; }
.btn-sm.btn-danger { padding: 4px 10px; font-size: 12px; }

.btn:disabled { opacity: .4; pointer-events: none; }

/* ── BADGES ───────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    border: 1px solid transparent;
}

.badge-ativo      { background: rgba(34,197,94,.1);   color: var(--green);  border-color: rgba(34,197,94,.25); }
.badge-pendente   { background: rgba(245,158,11,.1);  color: var(--yellow); border-color: rgba(245,158,11,.25); }
.badge-enviado    { background: rgba(59,130,246,.1);  color: var(--blue);   border-color: rgba(59,130,246,.25); }
.badge-confirmado { background: rgba(34,197,94,.1);   color: var(--green);  border-color: rgba(34,197,94,.25); }
.badge-cancelado  { background: rgba(239,68,68,.1);   color: var(--red);    border-color: rgba(239,68,68,.25); }
.badge-bloqueado  { background: rgba(239,68,68,.1);   color: var(--red);    border-color: rgba(239,68,68,.25); }
.badge-suspenso   { background: rgba(245,158,11,.1);  color: var(--yellow); border-color: rgba(245,158,11,.25); }
.badge-superadmin { background: var(--violet-glow);   color: var(--violet); border-color: var(--violet-border); }

/* ── TABELAS ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

thead th {
    padding: 10px 14px;
    text-align: left;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--txt-3);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody tr { border-bottom: 1px solid var(--border); transition: background .12s; }
tbody tr:hover { background: var(--bg-hover); }
tbody tr:last-child { border-bottom: none; }
tbody td { padding: 12px 14px; vertical-align: middle; }

.td-muted { color: var(--txt-2); }

/* ── FILTROS ──────────────────────────────────────────────── */
.filter-tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }

.filter-tab {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-md);
    background: transparent;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    color: var(--txt-2);
    text-decoration: none;
    transition: all .15s;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.filter-tab:hover { border-color: var(--accent); color: var(--accent); }
.filter-tab.active { background: var(--accent-glow); border-color: var(--accent-border); color: var(--accent); }

/* ── CONFIG TABS ──────────────────────────────────────────── */
.config-tabs {
    display: flex; gap: 6px; flex-wrap: wrap;
    margin-bottom: 22px; padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.config-tab {
    padding: 7px 15px;
    border-radius: var(--r);
    border: 1px solid var(--border-md);
    background: transparent;
    font-size: 13px; font-weight: 500;
    cursor: pointer; color: var(--txt-2);
    text-decoration: none; transition: all .15s;
    display: flex; align-items: center; gap: 6px;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.config-tab:hover { color: var(--txt); border-color: var(--border-md); }
.config-tab.active { background: var(--accent-glow); border-color: var(--accent-border); color: var(--accent); }

/* ── MODAL ────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.75);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border-md);
    border-radius: var(--rx);
    width: 100%; max-width: 480px;
    overflow: hidden;
}

.modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}

.modal-header h3 { font-size: 15px; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--txt-2); cursor: pointer; font-size: 18px; padding: 0 4px; line-height: 1; }
.modal-close:hover { color: var(--txt); }
.modal-body { padding: 22px; }

/* ── USER CARD ────────────────────────────────────────────── */
.user-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--rl);
    padding: 18px 20px;
    margin-bottom: 10px;
    transition: border-color .15s;
}
.user-card:hover { border-color: var(--border-md); }

.user-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    background: var(--bg-input);
    border-radius: var(--r);
    padding: 14px;
    margin: 12px 0;
}

.user-stat { text-align: center; }
.user-stat-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--txt-3); margin-bottom: 5px; }
.user-stat-value { font-size: 18px; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.user-stat-limit { font-size: 11px; color: var(--txt-3); }

/* ── QR CODE ──────────────────────────────────────────────── */
.qr-box {
    width: 220px; height: 220px;
    background: #fff;
    border-radius: var(--r);
    margin: 14px auto;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.qr-box img { width: 200px; height: 200px; display: block; }

/* ── AUTH PAGES ───────────────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg);
    padding: 20px;
}

.auth-card {
    width: 100%; max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--rx);
    padding: 40px 36px;
}

.auth-logo { text-align: center; margin-bottom: 28px; }

.auth-logo-icon {
    width: 56px; height: 56px;
    background: var(--accent-glow);
    border: 1px solid var(--accent-border);
    border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 12px; font-size: 24px;
}

.auth-title { font-size: 21px; font-weight: 700; letter-spacing: -.3px; }
.auth-sub   { font-size: 13px; color: var(--txt-2); margin-top: 4px; }

/* ── CÓDIGO DE VERIFICAÇÃO ────────────────────────────────── */
.codigo-inputs { display: flex; gap: 8px; justify-content: center; margin: 20px 0; }

.codigo-input {
    width: 46px; height: 54px;
    text-align: center;
    font-size: 22px; font-weight: 700;
    background: var(--bg-input);
    border: 1.5px solid var(--border-md);
    border-radius: 10px;
    color: var(--txt);
    outline: none; transition: all .15s;
    font-family: 'JetBrains Mono', monospace;
}

.codigo-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── STEPS ────────────────────────────────────────────────── */
.step-indicator { display: flex; align-items: center; margin-bottom: 24px; }
.si-step { flex: 1; text-align: center; font-size: 11.5px; font-weight: 600; color: var(--txt-3); }
.si-step.ativo { color: var(--accent); }
.si-step.ok    { color: var(--green); }
.si-num {
    width: 28px; height: 28px; border-radius: 50%;
    border: 2px solid currentColor;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 5px; font-size: 12px; font-weight: 700;
}
.si-step.ativo .si-num { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.si-step.ok    .si-num { background: var(--green);  border-color: var(--green);  color: var(--bg); }
.si-line { height: 2px; flex: 1; background: var(--border); margin-top: -16px; }

/* ── INFO / WARN BOXES ────────────────────────────────────── */
.info-box {
    background: var(--accent-glow);
    border: 1px solid var(--accent-border);
    border-radius: var(--r);
    padding: 11px 14px; font-size: 13px; color: var(--accent);
    margin-bottom: 16px; display: flex; gap: 8px; align-items: flex-start;
}

.warn-box {
    background: rgba(245,158,11,.08);
    border: 1px solid rgba(245,158,11,.25);
    border-radius: var(--r);
    padding: 11px 14px; font-size: 13px; color: var(--yellow);
    margin-bottom: 16px; display: flex; gap: 8px; align-items: flex-start;
}

/* ── FLASH ────────────────────────────────────────────────── */
.flash {
    padding: 11px 16px; border-radius: var(--r);
    display: flex; align-items: center; justify-content: space-between;
    font-size: 13.5px; font-weight: 500; margin-bottom: 16px;
    animation: slideDown .3s ease;
}

.flash-sucesso { background: rgba(34,197,94,.1);  border: 1px solid rgba(34,197,94,.25);  color: var(--green); }
.flash-erro    { background: rgba(239,68,68,.1);  border: 1px solid rgba(239,68,68,.25);  color: var(--red); }
.flash-info    { background: var(--accent-glow);  border: 1px solid var(--accent-border); color: var(--accent); }
.flash button  { background: none; border: none; color: inherit; cursor: pointer; opacity: .6; font-size: 16px; }

/* ── TOAST ────────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 9999; max-width: 460px; }

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-md);
    border-radius: var(--rl);
    padding: 14px 16px; font-size: 13px; font-weight: 500;
    display: flex; align-items: flex-start; gap: 10px;
    width: 440px; max-width: calc(100vw - 32px);
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
    animation: toastIn .3s ease;
    color: var(--txt);
    line-height: 1.5;
}

.toast.ok   { border-left: 4px solid var(--green); }
.toast.erro { border-left: 4px solid var(--red); }
.toast.info { border-left: 4px solid var(--accent); }
.toast.warn { border-left: 4px solid #f59e0b; }
.toast.saindo { animation: toastOut .3s ease forwards; }

/* ── EMPTY STATE ──────────────────────────────────────────── */
.empty-state { text-align: center; padding: 50px 20px; color: var(--txt-3); }
.empty-state .icon { font-size: 40px; margin-bottom: 12px; opacity: .3; display: block; }
.empty-state h3 { font-size: 15px; color: var(--txt-2); margin-bottom: 6px; }

/* ── SPINNER ──────────────────────────────────────────────── */
.spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.2);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: inline-block; vertical-align: middle;
}

/* ── ANIMAÇÕES ────────────────────────────────────────────── */
@keyframes spin     { to { transform: rotate(360deg); } }
@keyframes slideDown{ from { opacity:0;transform:translateY(-8px); } to { opacity:1;transform:translateY(0); } }
@keyframes toastIn  { from { opacity:0;transform:translateX(16px); } to { opacity:1;transform:translateX(0); } }
@keyframes toastOut { from { opacity:1; } to { opacity:0;transform:translateX(16px); } }
@keyframes fadeUp   { from { opacity:0;transform:translateY(8px); } to { opacity:1;transform:translateY(0); } }
.fade-up { animation: fadeUp .3s ease; }

/* ── WA STATUS ────────────────────────────────────────────── */
.wa-status { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--bg-input); border-radius: var(--r); }
.wa-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.wa-dot.online  { background: var(--green); box-shadow: 0 0 8px var(--green); }
.wa-dot.offline { background: var(--txt-3); }



/* ══════════════════════════════════════════════════════════
   MOBILE MENU BUTTON & OVERLAY
══════════════════════════════════════════════════════════ */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 9999;
    background: var(--bg-card);
    border: 1px solid var(--border-md);
    border-radius: 10px;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    color: var(--txt);
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,.6);
    padding: 0;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    z-index: 8888;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ══════════════════════════════════════════════════════════
   TABLET (≤900px)
══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .layout { grid-template-columns: 60px 1fr; }
    .sidebar { width: 60px; }
    .brand-name, .brand-sub, .nav-item span, .nav-section-label,
    .sidebar-user-info { display: none; }
    .brand-icon { margin: 0 auto; }
    .sidebar-brand { justify-content: center; padding: 16px 10px; }
    .nav-item { justify-content: center; padding: 10px; }
    .stats-row { grid-template-columns: 1fr 1fr; }
    .user-stats-grid { grid-template-columns: repeat(2,1fr); }
}

/* ══════════════════════════════════════════════════════════
   MOBILE (≤640px)
══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {

    /* Layout vira bloco simples */
    .layout { display: block; }

    /* Botão menu aparece */
    .mobile-menu-btn { display: flex; }

    /* Sidebar: sai completamente do fluxo, vira drawer */
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -280px !important;
        width: 265px !important;
        height: 100% !important;
        height: 100dvh !important;
        z-index: 9000 !important;
        transition: left .25s ease !important;
        overflow-y: auto !important;
    }

    /* Quando aberto */
    .sidebar.aberto {
        left: 0 !important;
        overflow-x: visible !important;
    }

    /* Restaurar textos dentro do drawer */
    .sidebar .brand-name      { display: block !important; }
    .sidebar .brand-sub       { display: block !important; }
    .sidebar .nav-item span   { display: inline !important; }
    .sidebar .nav-section-label { display: block !important; }
    .sidebar .sidebar-user-info { display: block !important; }
    .sidebar .brand-icon      { margin: 0 !important; }
    .sidebar .sidebar-brand   { justify-content: flex-start !important; padding: 22px 20px 18px !important; }
    .sidebar .nav-item        { justify-content: flex-start !important; padding: 11px 12px !important; }

    /* Main content — espaço para o botão hamburger */
    .main-content { padding-top: 68px; }

    /* Page wrap */
    .page-wrap { padding: 16px !important; }

    /* Grids */
    .stats-row { grid-template-columns: 1fr; }
    .user-stats-grid { grid-template-columns: repeat(2,1fr); }
    .grid-dash-main { grid-template-columns: 1fr !important; }

    /* Tabelas */
    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { min-width: 460px; }

    /* Inputs — sem zoom no iOS */
    input[type=text], input[type=email], input[type=password],
    input[type=date], input[type=time], input[type=number],
    input[type=url], select, textarea { font-size: 16px; }

    /* Modal bottom sheet */
    .modal-overlay { padding: 0; align-items: flex-end; }
    .modal-box { border-radius: var(--rl) var(--rl) 0 0; max-width: 100%; max-height: 90dvh; overflow-y: auto; }

    /* Toasts full width */
    .toast-container { bottom: 0; right: 0; left: 0; max-width: 100%; padding: 0 10px 10px; }
    .toast { width: 100%; }

    /* Tabs scroll */
    .config-tabs, .filter-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .config-tab, .filter-tab { white-space: nowrap; flex-shrink: 0; }

    /* Auth */
    .auth-card { padding: 28px 18px; }
    .card-header { flex-wrap: wrap; gap: 8px; }
}
