/* ============================================================
   RP Assessoria — Portal do Cliente
   CSS Mobile-First: base = 360px, desktop via @media (min-width)
   ============================================================ */

/* ── Reset & tokens ───────────────────────────────────────── */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{font-size:16px;-webkit-text-size-adjust:100%;scroll-behavior:smooth}
body{
    font-family:var(--font-body);
    background:var(--bg);
    color:var(--text);
    line-height:1.6;
    min-height:100dvh;
    -webkit-font-smoothing:antialiased;
    /* espaço para bottom nav fixo em mobile */
    padding-bottom:calc(64px + env(safe-area-inset-bottom));
    -webkit-tap-highlight-color:transparent;
}

/* ── Tipografia ───────────────────────────────────────────── */
h1,h2,h3,h4{
    font-family:var(--font-display);
    line-height:1.25;
    font-weight:600;
    color:var(--text);
}
h1{font-size:1.65rem}
h2{font-size:1.3rem}
h3{font-size:1.05rem}
h4{font-size:.95rem}
p{color:var(--text-muted);line-height:1.7}
a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}
small,.text-xs{font-size:.75rem}
.text-sm{font-size:.875rem}
.text-center{text-align:center}
.muted{color:var(--text-muted)}
.fw-600{font-weight:600}
.fw-500{font-weight:500}

/* ── Layout ───────────────────────────────────────────────── */
.page-wrap{padding:1rem 1rem 1.5rem;max-width:680px;margin:0 auto}
.w-full{width:100%}
.d-flex{display:flex}
.flex-col{flex-direction:column}
.items-center{align-items:center}
.justify-between{justify-content:space-between}
.justify-center{justify-content:center}
.gap-1{gap:.5rem}.gap-2{gap:1rem}.gap-3{gap:1.5rem}
.mt-1{margin-top:.5rem}.mt-2{margin-top:1rem}.mt-3{margin-top:1.5rem}
.mb-1{margin-bottom:.5rem}.mb-2{margin-bottom:1rem}.mb-3{margin-bottom:1.5rem}

/* ── @keyframes ──────────────────────────────────────────── */
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes fadeUp{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes slideUp{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:none}}
@keyframes toastIn{from{opacity:0;transform:translateX(20px)}to{opacity:1;transform:none}}

/* ── Topbar ───────────────────────────────────────────────── */
.topbar{
    position:sticky;top:0;z-index:100;
    background:var(--primary);
    display:flex;align-items:center;justify-content:space-between;
    padding:0 1rem;
    height:54px;
    box-shadow:0 2px 12px rgba(0,0,0,.25);
}
.topbar-brand{display:flex;align-items:center;gap:.55rem;text-decoration:none}
.topbar-logo{font-size:1.3rem;line-height:1}
.topbar-name{
    font-family:var(--font-display);
    font-size:1.05rem;font-weight:600;
    color:white;letter-spacing:.02em;
    /* oculto em telas muito pequenas */
    display:none;
}
.topbar-actions{display:flex;align-items:center;gap:.5rem}
.topbar-avatar{
    width:34px;height:34px;border-radius:50%;
    background:var(--secondary);color:var(--primary);
    display:flex;align-items:center;justify-content:center;
    font-weight:700;font-size:.85rem;flex-shrink:0;
}
.topbar-user{
    display:flex;align-items:center;gap:.4rem;
    color:rgba(255,255,255,.85);text-decoration:none;
}
.topbar-uname{font-size:.8rem;color:rgba(255,255,255,.8);display:none}
.topbar-logout{
    color:rgba(255,255,255,.65);
    display:flex;align-items:center;
    padding:.4rem;border-radius:.5rem;
    transition:color .2s,background .2s;
    min-width:44px;min-height:44px;justify-content:center;
}
.topbar-logout:hover{color:white;background:rgba(255,255,255,.1);text-decoration:none}

/* ── Bottom Nav ───────────────────────────────────────────── */
.bottom-nav{
    position:fixed;bottom:0;left:0;right:0;z-index:100;
    background:var(--primary);
    display:flex;
    height:calc(60px + env(safe-area-inset-bottom));
    padding-bottom:env(safe-area-inset-bottom);
    box-shadow:0 -2px 16px rgba(0,0,0,.18);
}
.bottom-nav-item{
    flex:1;
    display:flex;flex-direction:column;
    align-items:center;justify-content:center;
    color:rgba(255,255,255,.5);
    text-decoration:none;
    gap:.15rem;
    padding:.5rem .2rem;
    font-size:.6rem;font-weight:600;
    letter-spacing:.02em;
    text-transform:uppercase;
    transition:color .2s;
    position:relative;
    -webkit-tap-highlight-color:transparent;
    min-width:44px;
}
.bottom-nav-item svg{width:22px;height:22px;flex-shrink:0}
.bottom-nav-item.is-active{color:var(--secondary)}
.bottom-nav-item.is-active::before{
    content:'';
    position:absolute;top:0;left:50%;transform:translateX(-50%);
    width:28px;height:3px;
    background:var(--secondary);
    border-radius:0 0 4px 4px;
}

/* ── Cards ────────────────────────────────────────────────── */
.card{
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:12px;
    padding:1rem;
    transition:box-shadow .2s,transform .2s;
}
.card.card-link{cursor:pointer;display:block;color:inherit;text-decoration:none}
.card.card-link:active{transform:scale(.99)}
.card-sm{padding:.75rem}

/* ── Badges ───────────────────────────────────────────────── */
.badge{
    display:inline-flex;align-items:center;gap:.3rem;
    padding:.2rem .6rem;border-radius:99px;
    font-size:.7rem;font-weight:700;letter-spacing:.02em;white-space:nowrap;
}
.badge-pago          {background:#d1fae5;color:#065f46}
.badge-pendente      {background:#fef3c7;color:#92400e}
.badge-atrasado      {background:#fee2e2;color:#991b1b}
.badge-aberto        {background:#dbeafe;color:#1e40af}
.badge-em_atendimento{background:#e0e7ff;color:#3730a3}
.badge-encerrado     {background:#f3f4f6;color:#374151}

/* ── Buttons — tamanho mínimo 44px para touch ────────────── */
.btn{
    display:inline-flex;align-items:center;justify-content:center;gap:.5rem;
    padding:.75rem 1.25rem;border-radius:10px;
    font-family:var(--font-body);font-size:.9rem;font-weight:600;
    cursor:pointer;border:none;transition:all .2s;
    text-decoration:none;white-space:nowrap;
    min-height:44px;
    -webkit-tap-highlight-color:transparent;
}
.btn:disabled{opacity:.55;cursor:not-allowed}
.btn-primary{background:var(--primary);color:white}
.btn-primary:hover{background:var(--primary-soft);text-decoration:none}
.btn-secondary{background:var(--secondary);color:var(--primary)}
.btn-secondary:hover{filter:brightness(1.08);text-decoration:none}
.btn-ghost{background:transparent;color:var(--text);border:1.5px solid var(--border)}
.btn-ghost:hover{background:var(--bg);text-decoration:none}
.btn-danger{background:var(--danger);color:white}
.btn-success{background:var(--success);color:white}
.btn-whatsapp{background:#25d366;color:white}
.btn-whatsapp:hover{background:#1ebe57;text-decoration:none}
.btn-lg{padding:.875rem 1.75rem;font-size:1rem;border-radius:12px;min-height:52px}
.btn-block{width:100%}
.btn-sm{padding:.5rem .875rem;font-size:.8rem;border-radius:8px;min-height:36px}

/* ── Forms ────────────────────────────────────────────────── */
.field{display:flex;flex-direction:column;gap:.4rem}
.field label{font-size:.875rem;font-weight:600;color:var(--text)}
input,textarea,select{
    font-family:var(--font-body);
    font-size:1rem; /* 16px — evita zoom no iOS */
    padding:.875rem 1rem;
    border-radius:10px;
    border:1.5px solid var(--border);
    background:var(--surface);
    color:var(--text);
    width:100%;
    transition:border-color .2s,box-shadow .2s;
    -webkit-appearance:none;
    min-height:52px;
}
input:focus,textarea:focus,select:focus{
    outline:none;
    border-color:var(--primary);
    box-shadow:0 0 0 3px rgba(15,27,45,.1);
}
input::placeholder,textarea::placeholder{color:var(--text-muted);opacity:.7}
textarea{resize:vertical;min-height:100px}
select{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235A6478' d='M6 8L0 0h12z'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 1rem center;padding-right:2.5rem}

/* ── Alerts ───────────────────────────────────────────────── */
.alert{
    padding:.875rem 1rem;border-radius:10px;
    font-size:.875rem;display:flex;gap:.75rem;align-items:flex-start;
}
.alert-info   {background:#eff6ff;border:1px solid #bfdbfe;color:#1e40af}
.alert-warning{background:#fffbeb;border:1px solid #fde68a;color:#92400e}
.alert-danger {background:#fef2f2;border:1px solid #fecaca;color:#991b1b}
.alert-success{background:#f0fdf4;border:1px solid #bbf7d0;color:#065f46}
.alert-icon{font-size:1.1rem;margin-top:.05rem;flex-shrink:0}

/* ── Auth page ────────────────────────────────────────────── */
body[data-page="login"]{background:var(--primary)}
.auth-wrap{
    min-height:100dvh;
    display:flex;flex-direction:column;
}
.auth-hero{
    background:var(--primary);
    padding:2.5rem 1.5rem 2rem;
    position:relative;overflow:hidden;
    flex-shrink:0;
}
.auth-hero::after{
    content:'⚖️';
    position:absolute;right:-1rem;top:50%;transform:translateY(-50%);
    font-size:9rem;opacity:.07;pointer-events:none;
}
.auth-hero h1{
    font-family:var(--font-display);
    font-size:clamp(1.6rem,5vw,2.4rem);
    color:white;font-weight:500;
    margin-bottom:.875rem;line-height:1.2;
}
.auth-hero h1 em{color:var(--secondary);font-style:italic}
.auth-hero p{color:rgba(255,255,255,.75);font-size:.9rem;line-height:1.6;max-width:36ch}
.auth-form{
    background:var(--surface);
    flex:1;
    display:flex;align-items:flex-start;justify-content:center;
    padding:2rem 1.25rem 2rem;
    border-radius:16px 16px 0 0;
}
.auth-form-inner{width:100%;max-width:420px}
.auth-brand{display:flex;align-items:center;gap:.6rem;margin-bottom:1.75rem;text-decoration:none}
.auth-brand-logo{font-size:1.75rem}
.auth-brand-name{font-family:var(--font-display);font-size:1.2rem;font-weight:600;color:var(--text)}
.auth-title{font-size:1.75rem;font-weight:400;margin-bottom:.3rem}
.auth-subtitle{font-size:.9rem;color:var(--text-muted);margin-bottom:1.75rem}
.auth-error{
    background:#fef2f2;border:1px solid #fecaca;color:#991b1b;
    padding:.75rem 1rem;border-radius:8px;font-size:.875rem;
    margin-bottom:1rem;display:none;
}
.auth-hint{
    margin-top:1.25rem;font-size:.8rem;
    color:var(--text-muted);text-align:center;
}
.auth-hint code{
    background:var(--bg);
    padding:.15rem .4rem;border-radius:4px;
    font-size:.8rem;color:var(--text);font-family:monospace;
}

/* ── Page hero (dashboard etc.) ───────────────────────────── */
.page-hero{
    background:linear-gradient(135deg,var(--primary) 0%,var(--primary-soft) 100%);
    padding:1.5rem 1rem 1.75rem;
    position:relative;overflow:hidden;
}
.page-hero::after{
    content:'⚖️';
    position:absolute;right:.5rem;top:50%;transform:translateY(-50%);
    font-size:5rem;opacity:.07;pointer-events:none;
}
.page-hero-greeting{font-size:.8rem;color:rgba(255,255,255,.65);margin-bottom:.2rem}
.page-hero-name{font-family:var(--font-display);font-size:1.4rem;color:white;font-weight:500}
.page-hero-sub{font-size:.78rem;color:rgba(255,255,255,.6);margin-top:.25rem}
.page-hero-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:.625rem;margin-top:1.1rem}
.stat-card{
    background:rgba(255,255,255,.1);
    border:1px solid rgba(255,255,255,.15);
    border-radius:10px;padding:.65rem .5rem;text-align:center;
}
.stat-card-value{font-size:1.35rem;font-weight:700;font-family:var(--font-display);color:var(--secondary)}
.stat-card-label{font-size:.62rem;color:rgba(255,255,255,.65);margin-top:.1rem;text-transform:uppercase;letter-spacing:.04em}

/* ── Section titles ───────────────────────────────────────── */
.section-title{
    font-size:.72rem;font-weight:700;
    color:var(--text-muted);
    text-transform:uppercase;letter-spacing:.08em;
    margin-bottom:.75rem;
}
.section-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:.75rem}
.section-header .section-title{margin-bottom:0}
.see-all{font-size:.8rem;color:var(--accent);font-weight:600}

/* ── Process cards ────────────────────────────────────────── */
.proc-card{display:flex;flex-direction:column;gap:.45rem}
.proc-card-tipo{font-size:.72rem;color:var(--accent);font-weight:700;letter-spacing:.03em}
.proc-card-code{font-size:.72rem;color:var(--text-muted);font-weight:600}
.proc-card-title{font-family:var(--font-display);font-size:.95rem;font-weight:600;line-height:1.3;color:var(--text)}
.proc-card-fase{
    display:inline-flex;align-items:center;gap:.3rem;
    font-size:.72rem;font-weight:700;color:white;
    padding:.2rem .6rem;border-radius:99px;
}
.proc-card-fase::before{content:'';width:6px;height:6px;border-radius:50%;background:rgba(255,255,255,.65)}
.proc-card-meta{display:flex;flex-wrap:wrap;gap:.4rem .75rem;margin-top:.15rem}
.proc-card-meta-item{font-size:.75rem;color:var(--text-muted);display:flex;align-items:center;gap:.3rem}
.proc-card-meta-item svg{width:13px;height:13px;flex-shrink:0}
.proc-card-prazo{font-size:.75rem;font-weight:600;color:var(--warning);display:flex;align-items:center;gap:.3rem}
.proc-card-arrow{
    flex-shrink:0;width:30px;height:30px;border-radius:50%;
    background:var(--bg);display:flex;align-items:center;justify-content:center;
    color:var(--text-muted);align-self:flex-start;margin-top:.15rem;
}
.proc-card-arrow svg{width:13px;height:13px}

/* ── Process detail header ────────────────────────────────── */
.proc-detail-header{background:var(--primary);padding:1.25rem 1rem}
.proc-detail-tipo{font-size:.72rem;color:var(--secondary);font-weight:700;letter-spacing:.05em;margin-bottom:.2rem}
.proc-detail-title{font-family:var(--font-display);font-size:1.15rem;color:white;font-weight:500;line-height:1.3}
.proc-detail-code{font-size:.72rem;color:rgba(255,255,255,.55);margin-top:.2rem}
.proc-detail-fase{
    display:inline-flex;align-items:center;gap:.35rem;margin-top:.65rem;
    padding:.3rem .75rem;border-radius:99px;
    font-size:.73rem;font-weight:700;color:white;
    background:rgba(255,255,255,.15);border:1px solid rgba(255,255,255,.2);
}
.proc-detail-meta{display:grid;grid-template-columns:1fr 1fr;gap:.5rem .75rem;margin-top:.875rem}
.proc-detail-meta-label{font-size:.65rem;color:rgba(255,255,255,.55);text-transform:uppercase;letter-spacing:.04em}
.proc-detail-meta-value{font-size:.8rem;color:white;font-weight:500;margin-top:.1rem}

/* ── Timeline ─────────────────────────────────────────────── */
.timeline{position:relative;padding-left:1.5rem}
.timeline::before{
    content:'';position:absolute;left:.3rem;top:.4rem;bottom:.4rem;
    width:2px;background:var(--border);border-radius:1px;
}
.timeline-item{position:relative;padding-bottom:1.375rem}
.timeline-item:last-child{padding-bottom:0}
.timeline-dot{
    position:absolute;left:-1.2rem;top:.3rem;
    width:12px;height:12px;border-radius:50%;
    background:var(--secondary);border:2px solid var(--surface);
    box-shadow:0 0 0 2px var(--secondary);
}
.timeline-dot.dot-warning{background:var(--warning);box-shadow:0 0 0 2px var(--warning)}
.timeline-dot.dot-success{background:var(--success);box-shadow:0 0 0 2px var(--success)}
.timeline-dot.dot-muted  {background:var(--border); box-shadow:0 0 0 2px var(--border)}
.timeline-date {font-size:.7rem;color:var(--text-muted);font-weight:600;margin-bottom:.15rem}
.timeline-title{font-size:.875rem;font-weight:600;color:var(--text);margin-bottom:.2rem}
.timeline-desc {font-size:.82rem;color:var(--text-muted);line-height:1.55}

/* ── Financial ────────────────────────────────────────────── */
.fin-summary{display:grid;grid-template-columns:repeat(2,1fr);gap:.625rem;margin-bottom:1.1rem}
.fin-sum-card{
    background:var(--surface);border:1px solid var(--border);
    border-radius:10px;padding:.75rem;text-align:center;
}
.fin-sum-value{font-size:1rem;font-weight:700;font-family:var(--font-display);word-break:break-all}
.fin-sum-label{font-size:.65rem;color:var(--text-muted);margin-top:.15rem;text-transform:uppercase;letter-spacing:.04em}
.fin-sum-card.atrasado .fin-sum-value{color:var(--danger)}
.fin-sum-card.pago     .fin-sum-value{color:var(--success)}
.fin-sum-card.pendente .fin-sum-value{color:var(--warning)}
.parcelas-list{display:flex;flex-direction:column;gap:.5rem}
.parcela-item{
    display:flex;align-items:center;justify-content:space-between;
    padding:.875rem;background:var(--surface);
    border:1px solid var(--border);border-radius:10px;gap:.75rem;
}
.parcela-item.is-atrasado{border-left:3px solid var(--danger)}
.parcela-item.is-pago{opacity:.7}
.parcela-info{flex:1;min-width:0}
.parcela-title{font-size:.875rem;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.parcela-sub{font-size:.72rem;color:var(--text-muted);margin-top:.1rem}
.parcela-value{font-size:.9rem;font-weight:700;font-family:var(--font-display);text-align:right;white-space:nowrap}
.parcela-value.atrasado{color:var(--danger)}
.parcela-value.pago    {color:var(--success)}
.parcela-value.pendente{color:var(--text-muted)}

/* ── Support ──────────────────────────────────────────────── */
.chamado-item{display:flex;gap:.875rem;align-items:flex-start}
.chamado-icon{
    width:42px;height:42px;border-radius:10px;flex-shrink:0;
    background:var(--bg);display:flex;align-items:center;justify-content:center;
    font-size:1.1rem;
}
.chamado-title{font-size:.9rem;font-weight:600;margin-bottom:.2rem}
.chamado-meta{font-size:.72rem;color:var(--text-muted)}
.chat-wrap{display:flex;flex-direction:column;gap:.75rem;padding:.5rem 0}
.chat-msg{display:flex;flex-direction:column;gap:.15rem;max-width:85%}
.chat-msg.from-me{align-self:flex-end;align-items:flex-end}
.chat-msg.from-office{align-self:flex-start}
.chat-bubble{padding:.65rem .875rem;border-radius:14px;font-size:.875rem;line-height:1.55}
.from-me .chat-bubble{background:var(--primary);color:white;border-radius:14px 14px 4px 14px}
.from-office .chat-bubble{background:var(--surface);border:1px solid var(--border);color:var(--text);border-radius:14px 14px 14px 4px}
.chat-meta{font-size:.67rem;color:var(--text-muted);padding:0 .2rem}

/* ── Documents ────────────────────────────────────────────── */
.doc-item{display:flex;align-items:center;gap:.875rem;padding:.75rem 0;border-bottom:1px solid var(--border)}
.doc-item:last-child{border-bottom:none}
.doc-icon{width:38px;height:38px;border-radius:8px;background:#fee2e2;display:flex;align-items:center;justify-content:center;font-size:1rem;flex-shrink:0;color:#b91c1c}
.doc-name{font-size:.875rem;font-weight:500}
.doc-meta{font-size:.72rem;color:var(--text-muted)}

/* ── Tabs ─────────────────────────────────────────────────── */
.tabs{display:flex;border-bottom:2px solid var(--border);gap:0;overflow-x:auto;-webkit-overflow-scrolling:touch}
.tab-btn{
    padding:.75rem .875rem;font-size:.85rem;font-weight:600;
    border:none;background:none;cursor:pointer;
    color:var(--text-muted);border-bottom:2px solid transparent;
    margin-bottom:-2px;transition:all .2s;white-space:nowrap;
    min-height:44px;-webkit-tap-highlight-color:transparent;
}
.tab-btn.is-active{color:var(--primary);border-bottom-color:var(--primary)}
.tab-content{display:none;padding-top:1.1rem}
.tab-content.is-active{display:block;animation:fadeUp .25s ease}

/* ── Contact / Areas ──────────────────────────────────────── */
.contact-info-item{display:flex;align-items:flex-start;gap:.875rem;padding:.875rem 0;border-bottom:1px solid var(--border)}
.contact-info-item:last-child{border-bottom:none}
.contact-icon{width:40px;height:40px;border-radius:10px;background:var(--bg);display:flex;align-items:center;justify-content:center;font-size:1.1rem;flex-shrink:0}
.contact-info-label{font-size:.7rem;color:var(--text-muted);text-transform:uppercase;letter-spacing:.04em;margin-bottom:.1rem}
.contact-info-value{font-size:.9rem;font-weight:500}
.contact-info-value a{color:var(--accent)}
.areas-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:.625rem}
.area-card{
    background:var(--surface);border:1px solid var(--border);border-radius:10px;
    padding:.875rem .5rem;text-align:center;text-decoration:none;color:var(--text);
    transition:all .2s;display:flex;flex-direction:column;align-items:center;gap:.35rem;
    min-height:80px;justify-content:center;
}
.area-card:active{border-color:var(--secondary);background:var(--bg);text-decoration:none}
.area-icon{font-size:1.5rem}
.area-name{font-size:.75rem;font-weight:600;line-height:1.3}

/* ── Policy pages ─────────────────────────────────────────── */
.policy-content{line-height:1.75}
.policy-content h2{font-size:1rem;margin:1.5rem 0 .5rem;color:var(--primary)}
.policy-content p{margin-bottom:.875rem;font-size:.875rem}

/* ── Toast ────────────────────────────────────────────────── */
.toast-stack{position:fixed;top:62px;right:.75rem;z-index:9999;display:flex;flex-direction:column;gap:.5rem;pointer-events:none}
.toast{
    min-width:220px;max-width:calc(100vw - 1.5rem);
    padding:.7rem 1rem;border-radius:10px;
    font-size:.875rem;font-weight:500;
    display:flex;align-items:center;gap:.6rem;
    box-shadow:0 8px 24px rgba(0,0,0,.22);
    animation:toastIn .3s ease;pointer-events:all;color:white;
}
.toast-success{background:var(--success)}
.toast-error  {background:var(--danger)}
.toast-warning{background:var(--warning);color:#1a1a1a}
.toast-info   {background:var(--primary)}

/* ── Empty state ──────────────────────────────────────────── */
.empty-state{text-align:center;padding:2.5rem 1rem}
.empty-icon{font-size:2.75rem;margin-bottom:.875rem;opacity:.55}
.empty-title{font-size:1.05rem;font-weight:600;margin-bottom:.4rem;color:var(--text)}
.empty-sub{font-size:.875rem;color:var(--text-muted);max-width:26ch;margin:0 auto .875rem}

/* ── Divider ──────────────────────────────────────────────── */
.divider{border:none;border-top:1px solid var(--border);margin:1.1rem 0}

/* ── Upload zone ──────────────────────────────────────────── */
.upload-zone{
    border:2px dashed var(--border);border-radius:10px;
    padding:1.375rem 1rem;text-align:center;cursor:pointer;
    transition:border-color .2s,background .2s;
}
.upload-zone:active,.upload-zone.drag-over{border-color:var(--primary);background:rgba(15,27,45,.03)}
.upload-zone input{display:none}
.upload-icon{font-size:1.75rem;margin-bottom:.4rem}

/* ── Profile ──────────────────────────────────────────────── */
.profile-avatar{
    width:72px;height:72px;border-radius:50%;
    background:linear-gradient(135deg,var(--primary),var(--primary-soft));
    color:white;display:flex;align-items:center;justify-content:center;
    font-size:1.75rem;font-weight:700;font-family:var(--font-display);
    border:3px solid var(--secondary);flex-shrink:0;
}

/* ── 2FA OTP ──────────────────────────────────────────────── */
.otp-input-wrap{display:flex;gap:.5rem;justify-content:center}
.otp-digit{
    width:44px;height:56px;border-radius:10px;
    border:2px solid var(--border);text-align:center;
    font-size:1.5rem;font-weight:700;color:var(--primary);
    font-family:var(--font-display);padding:0;min-height:0;
}
.otp-digit:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(15,27,45,.12);outline:none}

/* ── PWA Install banner ───────────────────────────────────── */
.install-banner{
    position:fixed;bottom:68px;left:.75rem;right:.75rem;
    background:var(--primary);color:white;
    border-radius:14px;padding:1rem;
    display:flex;align-items:center;gap:.875rem;
    box-shadow:0 8px 32px rgba(0,0,0,.28);
    z-index:200;animation:slideUp .4s ease;
    border:1px solid rgba(255,255,255,.12);
}
.install-banner h4{font-size:.875rem;color:white;margin-bottom:.1rem}
.install-banner p{font-size:.72rem;color:rgba(255,255,255,.7)}
.install-banner-text{flex:1}

/* ── Spinner ──────────────────────────────────────────────── */
.spinner{
    width:36px;height:36px;border-radius:50%;
    border:3px solid var(--border);
    border-top-color:var(--primary);
    animation:spin .7s linear infinite;
}
.loading-wrap{display:flex;align-items:center;justify-content:center;padding:3rem;flex-direction:column;gap:.75rem}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar{width:5px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}

/* ── Animations ───────────────────────────────────────────── */
.page-wrap{animation:fadeUp .28s ease}

/* =============================================================
   MEDIA QUERIES — progressive enhancement (min-width)
   ============================================================= */

/* Tablet: 480px+ */
@media(min-width:480px){
    h1{font-size:1.9rem}
    .fin-summary{grid-template-columns:repeat(4,1fr)}
    .areas-grid{grid-template-columns:repeat(3,1fr)}
    .topbar-name{display:block}
}

/* Tablet largo: 600px+ */
@media(min-width:600px){
    .page-wrap{padding:1.25rem 1.5rem 2rem}
    .auth-form{padding:2.5rem 2rem}
    .topbar-uname{display:block}
    .otp-digit{width:52px}
}

/* Desktop: 768px+ */
@media(min-width:768px){
    body{padding-bottom:0}
    .bottom-nav{display:none}
    .topbar{padding:0 2rem;height:60px}
    .page-wrap{padding:1.75rem 2rem 3rem}
    h1{font-size:2.2rem}
    h2{font-size:1.6rem}

    /* Auth: lado a lado */
    .auth-wrap{flex-direction:row}
    .auth-hero{
        flex:1;min-height:100dvh;
        display:flex;flex-direction:column;
        justify-content:flex-end;
        padding:4rem 3rem;
    }
    .auth-form{
        width:480px;flex:none;
        border-radius:0;
        align-items:center;
        overflow-y:auto;
    }

    /* Desktop: sem PWA banner */
    .install-banner{bottom:1.5rem}
}

/* Desktop large: 1024px+ */
@media(min-width:1024px){
    .areas-grid{grid-template-columns:repeat(4,1fr)}
    .fin-summary{gap:1rem}
    .fin-sum-value{font-size:1.2rem}
}
