:root {
    --bg: #070809;
    --panel: #111315;
    --muted-border: #2a2d31;
    --accent-green: #a7ff2f;
    --accent-blue: #c0cad4;
    --accent-yellow: #ffd147;
    --muted-text: #9a9a9a;
    --gap: 1rem;
    --radius: 12px;
    /* Larghezza colonna etichetta — usata sia nel calendario sia nelle band
       per garantire l'allineamento verticale colonna-per-colonna */
    --label-col: clamp(160px, 14vw, 230px);
}

* { box-sizing: border-box; }

html, body { height: 100%; width: 100%; margin: 0; background: var(--bg); color: #f5f5f5; }
body { font-family: 'Inter', Arial, sans-serif; font-size: clamp(14px, 1.6vw, 16px); line-height: 1.4; }

.app { display: block; min-height: 100vh; width: 100%; }

/* ── Sidebar ── */
.sidebar {
    width: 240px;
    position: fixed;
    left: 0; top: 0;
    height: 100vh;
    border-right: 1px solid var(--muted-border);
    background: linear-gradient(180deg, #0c0e10, var(--bg));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 100;
}

/* Nav scrollabile */
.sidebar-top {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1.5rem 1.25rem 1rem;
    scrollbar-width: thin;
    scrollbar-color: #1e2228 transparent;
}
.sidebar-top::-webkit-scrollbar { width: 4px; }
.sidebar-top::-webkit-scrollbar-thumb { background: #1e2228; border-radius: 4px; }

/* Account fisso in fondo */
.sidebar-bottom {
    flex-shrink: 0;
    padding: .6rem .85rem .85rem;
    position: relative;
}
.acct-box {
    /* nessun border/background: il separatore interno fa da divisore */
}
.acct-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--accent-green);
    color: #0a0a0a;
    display: grid; place-items: center;
    font-weight: 800; font-size: .82rem;
    flex-shrink: 0;
}

.brand { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.5rem; }
.logo { color: var(--accent-green); font-size: clamp(20px, 3.2vw, 34px); }

.nav { display: flex; flex-direction: column; gap: .5rem; }
.nav a {
    color: #c9c9c9;
    padding: .6rem .8rem;
    border-radius: 14px;
    text-decoration: none;
    font-size: .95rem;
    transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255,255,255,0.05); color: #f5f5f5; }
.nav a.active { color: var(--accent-green); background: rgba(167,255,47,0.08); }

.nav-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.nav-heading { color: #7f8a96; text-transform: uppercase; font-size: .75rem; letter-spacing: .08em; padding-left: .4rem; }
.nav-section a { padding-left: 1rem; }

.user-box {
    border: 1px solid #14171a;
    border-radius: 12px;
    background: #07090b;
    overflow: hidden;
}

.user-box-main {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .65rem .75rem .5rem;
}

.user-info { flex: 1; min-width: 0; }
.user-info strong {
    display: block;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-size: .82rem;
    font-weight: 600;
    color: #c0c8d4;
    letter-spacing: .01em;
}
.user-info span {
    display: block;
    color: #2e343c;
    font-size: .66rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-top: 2px;
}

.avatar {
    width: 32px; height: 32px; flex-shrink: 0;
    border-radius: 50%;
    background: var(--accent-green);
    color: #0a0a0a;
    display: grid; place-items: center;
    font-weight: 800; font-size: .8rem;
}

.user-box-actions {
    display: flex;
    gap: .3rem;
    padding: 0 .5rem .55rem;
}

.ub-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .28rem;
    padding: .32rem .4rem;
    border-radius: 6px;
    font-size: .66rem;
    font-weight: 700;
    font-family: 'Inter', Arial, sans-serif;
    letter-spacing: .05em;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s, border-color .15s;
    width: 100%;
}
.ub-btn svg { flex-shrink: 0; }

.ub-btn-switch {
    background: transparent;
    border: 1px solid #1a1e24;
    color: #2e343c;
}
.ub-btn-switch:hover {
    border-color: #2e3540;
    color: #5a6470;
    background: rgba(255,255,255,0.02);
}

.ub-btn-logout {
    background: rgba(160, 20, 20, 0.08);
    border: 1px solid rgba(160, 20, 20, 0.22);
    color: #4a1e1e;
}
.ub-btn-logout:hover {
    background: rgba(248, 81, 73, 0.14);
    border-color: rgba(248, 81, 73, 0.38);
    color: #f85149;
}

/* Dropdown panel — aperto verso l'alto dalla sidebar-bottom */
.user-switch-dropdown {
    position: absolute;
    left: 0; right: 0;
    bottom: 100%;
    margin-bottom: .4rem;
    background: #131519;
    border: 1px solid #2a2d32;
    border-radius: 14px;
    padding: .5rem;
    z-index: 200;
    box-shadow: 0 8px 32px rgba(0,0,0,.6);
}
.user-switch-dropdown[hidden] { display: none; }
.switch-label {
    font-size: .72rem;
    color: #555;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: .3rem .5rem .4rem;
    margin: 0;
}
.switch-user-item {
    display: flex;
    align-items: center;
    gap: .55rem;
    width: 100%;
    padding: .5rem .6rem;
    background: none;
    border: none;
    border-radius: 10px;
    color: #c0c0c0;
    font-size: .88rem;
    cursor: pointer;
    text-align: left;
    transition: background .12s;
}
.switch-user-item:hover { background: rgba(255,255,255,0.06); }
.switch-user-item.active { background: rgba(167,255,47,0.08); color: var(--accent-green); }
.switch-avatar {
    width: 28px; height: 28px; flex-shrink: 0;
    border-radius: 50%;
    background: #2a3a1a;
    color: var(--accent-green);
    display: grid; place-items: center;
    font-size: .8rem; font-weight: 700;
}
.switch-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.switch-role { font-size: .72rem; color: #555; flex-shrink: 0; }

/* Banner impersonazione */
.impersonate-banner {
    background: rgba(253,197,0,0.12);
    border: 1px solid rgba(253,197,0,0.3);
    border-radius: 10px;
    padding: .45rem .7rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    font-size: .78rem;
    color: var(--accent-yellow);
}
.impersonate-banner strong { color: #fff; }
.impersonate-exit {
    font-size: .75rem;
    font-weight: 700;
    color: var(--accent-yellow);
    text-decoration: none;
    background: rgba(253,197,0,0.15);
    border-radius: 6px;
    padding: 2px 7px;
    white-space: nowrap;
}
.impersonate-exit:hover { background: rgba(253,197,0,0.28); }

/* ── Main ── */
.main {
    margin-left: 240px;
    padding: calc(var(--gap) * 1.5);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; gap: 1rem; flex: 0 0 auto; }
.topbar h1 { margin: 0; font-size: clamp(1.25rem, 2.5vw, 1.9rem); }
.topbar p { margin: 6px 0 0; color: var(--muted-text); }

.actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* ── Buttons ── */
.button {
    background: #101214;
    color: #f5f5f5;
    border: 1px solid var(--muted-border);
    padding: .5rem .75rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: .95rem;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.button:hover { background: #181c1f; }
.button-small { background: rgba(255,255,255,0.05); color: #f5f5f5; border-color: rgba(255,255,255,0.12); padding: .35rem .6rem; font-size: .85rem; }
.add-button { background: var(--accent-green); color: #101010; border-color: var(--accent-green); }
.add-button:hover { background: #beff5a; border-color: #beff5a; }
.current-month { min-width: 120px; text-align: center; cursor: default; }

/* ── Badges ── */
.badge {
    display: inline-block;
    padding: .2rem .55rem;
    border-radius: 8px;
    font-size: .8rem;
    font-weight: 700;
    line-height: 1.4;
}
.badge-entrata    { background: rgba(167,255,47,0.13); color: var(--accent-green); }
.badge-uscita     { background: rgba(255,209,71,0.13); color: var(--accent-yellow); }
.badge-reale      { background: rgba(125,176,255,0.13); color: var(--accent-blue); }
.badge-previsionale { background: rgba(255,255,255,0.07); color: #c9c9c9; }
.badge-ok         { background: rgba(167,255,47,0.13); color: var(--accent-green); }
.badge-attenzione { background: rgba(255,209,71,0.13); color: var(--accent-yellow); }
.badge-critico    { background: rgba(255,80,80,0.13); color: #ff8080; }
.badge-alto       { background: rgba(255,80,80,0.13); color: #ff8080; }
.badge-medio      { background: rgba(255,209,71,0.13); color: var(--accent-yellow); }
.badge-basso      { background: rgba(167,255,47,0.13); color: var(--accent-green); }
.badge-attivo     { background: rgba(167,255,47,0.12); color: var(--accent-green); }
.badge-interrotto { background: rgba(255,255,255,0.06); color: #888; }

/* ── Barra filtri riusabile (movimenti, investitori, ecc.) ── */
.mov-filter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1rem;
    align-items: flex-end;
}
.mov-filter-field { display: flex; flex-direction: column; gap: .3rem; }
.mov-filter-search { flex: 1 1 200px; }
.mov-filter-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #555;
}
.mov-filter-input {
    background: #0d1117;
    border: 1px solid #21262d;
    border-radius: 6px;
    color: #e6edf3;
    padding: .42rem .65rem;
    font-size: .85rem;
    min-width: 110px;
    transition: border-color .15s;
}
.mov-filter-input:focus { outline: none; border-color: #388bfd; }
.mov-filter-actions { justify-content: flex-end; }

/* ── Tabelle e paginazione riusabili ── */
.mov-table  { width: 100%; }
.mov-table th { white-space: nowrap; }
.td-date    { white-space: nowrap; font-size: .85rem; color: #888; }
.td-utente  { font-size: .78rem; color: #666; white-space: nowrap; }
.mov-cat {
    font-size: .8rem;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 5px;
    padding: .1rem .45rem;
    color: #aaa;
}
.empty-row  { text-align: center; color: #555; padding: 2.5rem 1rem; }

.mov-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: .3rem;
    padding: 1rem 0 .5rem;
    flex-wrap: wrap;
}
.pag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: .3rem .55rem;
    border-radius: 6px;
    font-size: .85rem;
    background: #161b22;
    border: 1px solid #21262d;
    color: #aaa;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.pag-btn:hover { background: #21262d; color: #e6edf3; }
.pag-btn--active {
    background: #1f6feb;
    border-color: #388bfd;
    color: #fff;
    font-weight: 600;
    cursor: default;
    pointer-events: none;
}
.badge-viola             { background: rgba(177,125,255,0.15); color: #b17dff; }
.badge-arancione         { background: rgba(255,159,67,0.15); color: #ff9f43; }
.badge-grigio            { background: rgba(255,255,255,0.06); color: #9aa4b0; }
.badge-grigio-scuro      { background: rgba(255,255,255,0.04); color: #5a6470; }
.badge-futuro            { background: rgba(125,176,255,0.13); color: var(--accent-blue); }
.badge-non-previsto      { background: rgba(255,209,71,0.13); color: var(--accent-yellow); }
.badge-mancato-consuntivo{ background: rgba(255,255,255,0.08); color: #c9c9c9; }
.badge-dato-da-pulire    { background: rgba(255,80,80,0.13); color: #ff8080; }
.badge-da-verificare     { background: rgba(255,209,71,0.13); color: var(--accent-yellow); }

/* ── Analisi: helper ── */
.help-hint { cursor: help; border-bottom: 1px dotted #666; }
.kpi-link { text-decoration: none; color: inherit; display: block; }
.kpi-link:hover .stats-card { border-color: var(--accent-blue); }
.mini-link { font-size: .78rem; color: var(--accent-blue); text-decoration: none; }
.mini-link:hover { text-decoration: underline; }
.analysis-section-title { display: flex; align-items: center; gap: .5rem; justify-content: space-between; flex-wrap: wrap; }
.sintesi-list { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .4rem; }
.pulizia-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem; }
.pulizia-card { background: rgba(255,255,255,0.03); border: 1px solid var(--muted-border); border-radius: 12px; padding: .85rem 1rem; }
.pulizia-card h4 { margin: 0 0 .35rem; font-size: .85rem; color: #c9c9c9; }
.pulizia-card strong { font-size: 1.5rem; }
.equity-note { font-size: .8rem; color: var(--muted-text); margin-top: .5rem; }

/* ── Calendar ── */
.calendar-scroll {
    flex: 1 1 auto;
    min-height: 430px;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: .5rem;
}

/*
 * ALLINEAMENTO: tutte le sezioni usano la stessa --label-col come prima colonna.
 * Il calendario in testa e ogni banda (previsionale, reale, delta) condividono
 * la medesima larghezza per la colonna etichetta, così giorno 1 di ogni riga
 * è allineato verticalmente con il giorno 1 dell'header.
 */
.calendar-grid {
    display: grid;
    grid-template-columns: var(--label-col) repeat(var(--days), minmax(0, 1fr));
    width: 100%;
    min-width: 0;
}

.calendar-header {
    border: 1px solid var(--muted-border);
    border-radius: 16px;
    overflow: hidden;
    background: var(--panel);
    margin-bottom: .25rem;
    flex: 0 0 auto;
}
.empty-label { border-right: 1px solid var(--muted-border); }
.day-head {
    height: clamp(46px, 6.5vw, 60px);
    border-right: 1px solid var(--muted-border);
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    gap: 3px; padding: 0 2px;
}
.day-head span {
    color: #777;
    font-size: clamp(7px, 0.6vw, 10px);
    font-weight: 600;
    letter-spacing: .04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.day-head strong {
    font-size: clamp(11px, 1.1vw, 15px);
    font-weight: 700;
    white-space: nowrap;
    color: #d4d4d4;
}
.day-head.today {
    background: rgba(167,255,47,0.15);
}
.day-head.today span   { color: rgba(167,255,47,0.7); }
.day-head.today strong { color: var(--accent-green); }


/* ── Month overview (2 colonne: corrente + successivo) ── */
.month-overview {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .75rem;
    margin-top: 1rem;
    flex: 0 0 auto;
}
.month-card {
    padding: 1rem 1.1rem;
    border-radius: 16px;
    background: var(--panel);
    border: 1px solid var(--muted-border);
    display: flex;
    flex-direction: column;
    gap: 0;
}
.month-card.active { border-color: var(--accent-green); }
.month-card-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .07em;
    color: #555;
    text-transform: uppercase;
    margin-bottom: .3rem;
}
.month-card h4 { margin: 0 0 .65rem; font-size: 1rem; }
.month-card p  { display: flex; justify-content: space-between; color: #aaa; margin: .35rem 0; font-size: .88rem; }

/* ── Annual panel ── */
.annual-panel {
    background: var(--panel);
    border: 1px solid var(--muted-border);
    border-radius: 18px;
    padding: .75rem 1rem;
    margin-top: .75rem;
    flex: 0 0 auto;
}

.annual-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .4rem;
}
.annual-panel-header h3 {
    margin: 0;
    font-size: .95rem;
    font-weight: 700;
    color: #c9c9c9;
}
.annual-legend {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .78rem;
    color: #666;
}
.legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Period tabs (Mese / Settimana / Giorno) */
.period-tabs {
    display: flex;
    gap: 2px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 9px;
    padding: 3px;
}
.period-tab,
a.period-tab,
a.period-tab:visited {
    padding: .22rem .65rem;
    border-radius: 7px;
    font-size: .78rem;
    font-weight: 500;
    color: #484f58 !important;
    text-decoration: none !important;
    transition: background .15s, color .15s;
    white-space: nowrap;
    letter-spacing: .01em;
}
.period-tab:hover,
a.period-tab:hover { color: #9aa4b4 !important; }
.period-tab.active,
a.period-tab.active {
    background: rgba(255,255,255,0.09);
    color: #d4dae4 !important;
    font-weight: 600;
}

/* KPI strip */
.kpi-strip {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    margin-bottom: .6rem;
    padding-bottom: .55rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.kpi-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: .35rem .6rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    min-width: 80px;
    flex: 1;
}
.kpi-label {
    font-size: clamp(7px, 0.55vw, 9px);
    color: #555;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}
.kpi-val {
    font-size: clamp(11px, 1vw, 14px);
    font-weight: 800;
    color: #d0d0d0;
    white-space: nowrap;
}

/* Grafico annuale Chart.js — il canvas si adatta al container */
.annual-chart-wrap {
    width: 100%;
}

/* ── Colors ── */
.muted { opacity: .7; }
.green-text  { color: var(--accent-green); }
.blue-text   { color: var(--accent-blue); }
.yellow-text { color: var(--accent-yellow); }
.red-text    { color: #ff8080; }

/* ── Dashboard / Stats ── */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.investor-dashboard-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.investor-dashboard-panels > * { min-width: 0; }
.stats-card { background: var(--panel); border: 1px solid var(--muted-border); border-radius: 18px; padding: 1rem; display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.stats-card h3 { margin: 0; font-size: .95rem; color: #c9c9c9; }
.stats-card strong { font-size: clamp(1.3rem, 2.2vw, 2.1rem); line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.stats-card p { margin: 0; color: var(--muted-text); font-size: .875rem; }

.panel-card { background: var(--panel); border: 1px solid var(--muted-border); border-radius: 18px; padding: 1rem; margin-bottom: 1rem; }
.panel-card h2 { margin: 0 0 1rem; font-size: 1.1rem; }

/* ── Table ── */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { text-align: left; padding: .85rem; color: #bbb; font-size: .9rem; border-bottom: 1px solid rgba(255,255,255,.08); }
tbody td { padding: .85rem; border-bottom: 1px solid rgba(255,255,255,.06); color: #f5f5f5; vertical-align: middle; }
.row-actions { white-space: nowrap; width: 1%; }
.btn-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 8px;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    color: #888; font-size: .9rem; cursor: pointer;
    text-decoration: none; transition: background .12s, color .12s;
}
.btn-icon:hover { background: rgba(255,255,255,0.12); color: #ddd; }
.btn-danger:hover { background: rgba(255,80,80,0.18); color: #ff8080; border-color: rgba(255,80,80,0.3); }
.role-select {
    background: #1a1d22; border: 1px solid #2a2d32; border-radius: 8px;
    color: #c0c0c0; padding: .25rem .5rem; font-size: .82rem; cursor: pointer;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.03); }
.tag-color { display: inline-block; min-width: 64px; padding: .25rem .5rem; border-radius: 12px; color: #101010; font-weight: 700; text-align: center; }

/* ── Forms ── */
.form-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; background: var(--bg); }
.form-card { width: 100%; max-width: clamp(320px, 90%, 520px); background: var(--panel); border: 1px solid var(--muted-border); border-radius: 20px; padding: 1.5rem; }
.form-card h1 { margin: 0 0 .5rem; font-size: 1.4rem; }
.form-card > p { color: #999; margin: 0 0 1.25rem; }
.form-card form p { display: flex; flex-direction: column; gap: .5rem; }
.form-row { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .9rem; }
.form-row.checkbox-row { flex-direction: row; align-items: center; gap: .75rem; }
.form-card label { color: #aaa; font-size: .9rem; }
.form-card input,
.form-card select,
.form-card textarea {
    background: #08090a;
    border: 1px solid var(--muted-border);
    color: #f5f5f5;
    padding: .6rem .75rem;
    border-radius: 12px;
    width: 100%;
    font-size: .95rem;
    transition: border-color .15s;
}
.form-card input:focus,
.form-card select:focus,
.form-card textarea:focus {
    outline: none;
    border-color: rgba(167,255,47,0.5);
}
.errorlist { list-style: none; margin: .3rem 0 0; padding: 0; }
.errorlist li { color: #ff8080; font-size: .82rem; }
.form-errors-global {
    background: rgba(255,80,80,0.08);
    border: 1px solid rgba(255,80,80,0.3);
    border-radius: 12px;
    padding: .75rem 1rem;
    margin-bottom: 1rem;
    color: #ff8080;
    font-size: .9rem;
}
.recurring-section { display: none; padding: 1rem; border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; margin-top: 1rem; background: rgba(255,255,255,0.02); }
.recurring-section.active { display: block; }
.form-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.25rem; }

/* Sezioni nel form utente */
.form-section-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #555;
    margin: 1.1rem 0 .5rem;
    padding-bottom: .35rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.form-row.two-col {
    flex-direction: row;
    gap: .75rem;
}
.form-row.two-col > div {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.form-hint {
    font-size: .78rem;
    color: #444;
    margin-top: .2rem;
    line-height: 1.5;
}
.form-hint strong { color: #666; }
.form-hint-inline {
    font-size: .72rem;
    color: #444;
    font-weight: 400;
    margin-left: .5rem;
}

/* ── Widget frequenza ricorrenza ── */
.freq-presets {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: .5rem;
}
.freq-option {
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .75rem;
    border: 1px solid #2a2d32;
    border-radius: 20px;
    cursor: pointer;
    font-size: .85rem;
    color: #888;
    transition: border-color .12s, color .12s, background .12s;
    user-select: none;
}
.freq-option input[type="radio"] { display: none; }
.freq-option:has(input:checked) {
    border-color: var(--accent-green);
    color: var(--accent-green);
    background: rgba(167,255,47,0.07);
}
.freq-custom-row {
    display: none;
    align-items: center;
    gap: .5rem;
    margin-top: .4rem;
}
.freq-ogni-label { color: #888; font-size: .85rem; white-space: nowrap; }
.freq-value-input { width: 70px !important; }
.freq-unit-select { flex: 1; }
.row-muted td { opacity: .55; }

/* ══════════════════════════════════════════
   BUDGET BANDS  (Previsionale / Reale / Delta)
   ══════════════════════════════════════════ */

.budget-band {
    width: 100%;
    display: grid;
    /* Prima colonna = stessa larghezza del calendario → allineamento perfetto */
    grid-template-columns: var(--label-col) 1fr;
    flex: 1 1 0;
    min-height: 0;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: .4rem;
    background: linear-gradient(90deg, #111416, #141719);
    border: 1px solid #333;
}

.budget-band.forecast { border-color: rgba(167,255,47,0.55); }
.budget-band.real     { border-color: rgba(125,176,255,0.55); }

/* Delta band: altezza libera, determinata dal contenuto settimanale */
.budget-band.delta {
    border-color: rgba(255,209,71,0.55);
    flex: 0 0 auto;
    min-height: 130px;
}

/* ── Label panel (colonna sinistra di ogni band) ── */
.budget-label {
    padding: .8rem 1rem;
    border-right: 1px solid rgba(255,255,255,0.07);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    overflow: hidden;
    min-width: 0;
}

/* Titolo: piccolo, grigio, uppercase — ruolo di "etichetta" */
.budget-label h3 {
    margin: 0 0 2px;
    font-size: clamp(8px, 0.62vw, 10px);
    letter-spacing: .1em;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
}

/* Importo principale: elemento gerarchicamente dominante */
.band-total {
    font-size: clamp(16px, 1.4vw, 22px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.01em;
}

/* Media giornaliera: supporto, molto muto */
.band-media {
    font-size: clamp(8px, 0.6vw, 10px);
    color: #555;
    margin-top: 2px;
}

.forecast .band-total { color: var(--accent-green); }
.real     .band-total { color: var(--accent-blue); }
.delta    .band-total { color: var(--accent-yellow); }

/* ── Colonne giornaliere (Previsionale e Reale) ── */
.budget-track {
    display: grid;
    grid-template-columns: repeat(var(--days), minmax(0, 1fr));
    height: 100%;
    overflow-x: auto;
}

.budget-cell {
    position: relative;
    min-width: 0;
    border-right: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    padding-bottom: 36px;
}

.budget-cell::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 50%;
    height: 1px;
    background: rgba(255,255,255,0.06);
}

/* ── Pallini movimento ── */
.mov-dots {
    position: absolute;
    top: 5px; left: 2px; right: 2px; bottom: 36px;
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    align-content: start;
    justify-content: center;
    overflow: hidden;
    z-index: 2;
}

.mov-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    flex-shrink: 0;
    cursor: default;
    /* Ring bianco garantisce visibilità indipendentemente dal colore del tag */
    border: 1.5px solid rgba(255,255,255,0.45);
    box-shadow: 0 1px 4px rgba(0,0,0,0.6);
    transition: transform .12s;
    position: relative;
}
.mov-dot:hover { transform: scale(1.4); z-index: 5; }

/* Pallini ricorrenti — bordo tratteggiato per distinguerli */
.mov-dot--rec {
    cursor: pointer;
    border-style: dashed !important;
    border-width: 2px !important;
    border-color: rgba(255,255,255,0.6) !important;
}
.mov-dot--rec:hover { transform: scale(1.5); }

/* Popover elimina singola occorrenza */
.rec-popover {
    position: absolute;
    z-index: 10000;
    background: #1b1e22;
    border: 1px solid #383c42;
    border-radius: 14px;
    padding: .75rem 1rem;
    width: 270px;
    box-shadow: 0 10px 36px rgba(0,0,0,.7);
}
.rec-popover[hidden] { display: none; }
.rec-popover-label {
    font-size: .82rem;
    color: #c0c0c0;
    margin: 0 0 .6rem;
    line-height: 1.4;
}
.rec-popover-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

/* Tooltip custom (appeso al body via JS, non clippato da overflow) */
.mov-tooltip {
    position: fixed;
    z-index: 9999;
    background: #1b1e22;
    color: #f0f0f0;
    padding: 6px 10px;
    border-radius: 9px;
    font-size: 12px;
    font-family: 'Inter', Arial, sans-serif;
    border: 1px solid #383c42;
    pointer-events: none;
    white-space: pre;
    box-shadow: 0 6px 20px rgba(0,0,0,0.55);
    line-height: 1.6;
    max-width: 300px;
}

.budget-value {
    position: absolute;
    z-index: 4;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 5px;
    border-radius: 4px;
    font-size: clamp(6px, 0.52vw, 9px);
    font-weight: 800;
    white-space: nowrap;
}
.budget-value.positive { color: #101010; background: linear-gradient(180deg, #baff58, #6ca31f); }
.budget-value.negative { color: #ffffff; background: linear-gradient(180deg, #6e7a8a, #3a414d); }
.budget-value.warning  { color: #101010; background: linear-gradient(180deg, #ffd147, #a98213); }

.budget-day {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    color: #56606e;
    font-size: clamp(7px, 0.52vw, 9px);
    white-space: nowrap;
}
.budget-zero { z-index: 1; color: #454a52; font-size: clamp(8px, 0.65vw, 11px); }

/* ── Delta: track con colonne settimanali ── */
.delta-track {
    display: flex;
    align-self: stretch;
    align-items: stretch;
    padding: 5px;
    overflow: hidden;
}

.weekly-deltas {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(var(--days), minmax(0, 1fr));
    gap: 3px;
    align-items: stretch;
    align-content: stretch;
}

/* Ogni box occupa le colonne corrispondenti ai giorni della settimana */
.weekly-delta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 7px;
    border-radius: 10px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.11);
    overflow: hidden;
    min-width: 0;
}
.weekly-delta-item.pos { border-color: rgba(167,255,47,0.3); background: rgba(167,255,47,0.05); }
.weekly-delta-item.neg { border-color: rgba(255,209,71,0.3); background: rgba(255,209,71,0.04); }

.week-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 4px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    padding-bottom: 3px;
    flex-shrink: 0;
}

.week-label {
    font-size: clamp(8px, 0.62vw, 10px);
    color: #888;
    font-weight: 700;
    letter-spacing: .04em;
}

.week-total {
    font-size: clamp(9px, 0.72vw, 11px);
    font-weight: 800;
    white-space: nowrap;
}

.week-cats {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    min-height: 0;
}

.week-cat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 3px;
    overflow: hidden;
    line-height: 1.25;
}

.week-cat-name {
    font-size: clamp(7px, 0.57vw, 9px);
    color: #9a9a9a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.week-cat-val {
    font-size: clamp(7px, 0.57vw, 9px);
    font-weight: 700;
    flex-shrink: 0;
    white-space: nowrap;
}

/* ── Media queries — aggiornano anche --label-col ── */
@media (max-width: 1400px) {
    :root { --label-col: 210px; }
    .sidebar { width: 220px; }
    .main { margin-left: 220px; padding: 22px; }
    .calendar-grid { min-width: 1100px; }
    .budget-track { min-width: calc(1100px - 210px); }
    .topbar h1 { font-size: 26px; }
}

@media (max-width: 1100px) {
    :root { --label-col: 190px; }
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #24272b;
    }
    .sidebar-top { padding: 14px 18px; overflow: visible; }
    .sidebar-bottom { display: none; }
    .brand { margin-bottom: 14px; }
    .nav { flex-direction: row; overflow-x: auto; gap: 8px; padding-bottom: 6px; }
    .nav a { white-space: nowrap; padding: 10px 14px; font-size: 14px; }
    .main { margin-left: 0; padding: 18px; }
    .topbar { flex-direction: column; align-items: flex-start; }
    .actions { width: 100%; justify-content: flex-start; }
    .calendar-grid { min-width: 900px; }
}

@media (max-width: 900px) {
    :root { --label-col: 160px; }
    .sidebar { width: 100%; }
    .sidebar-top { display: flex; align-items: center; gap: 1rem; padding: .75rem 1rem; }
    .brand { margin-bottom: 0; }
    .nav { flex-direction: row; gap: .4rem; overflow: auto; padding: .25rem 0; flex: 1; }
    .calendar-grid { min-width: 800px; }
    .month-overview { grid-template-columns: 1fr; }
    .kpi-strip { gap: .35rem; }
    .kpi-item  { min-width: 70px; padding: .4rem .55rem; }
}

@media (max-width: 700px) {
    :root { --label-col: 140px; }
    .main { padding: 14px; }
    .topbar h1 { font-size: 24px; }
    .button { padding: 10px 12px; font-size: 13px; }
    .calendar-grid { min-width: 700px; }
    .month-overview { grid-template-columns: 1fr; min-width: 100%; }
    .investor-dashboard-panels { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
    .brand strong { display: none; }
    .user-box { position: static; margin-top: .75rem; }
    .day-head span { font-size: .7rem; }
    .topbar { flex-direction: column; align-items: flex-start; gap: .5rem; }
    .actions { width: 100%; justify-content: space-between; }
}

/* ── Logout ── */
.logout-btn {
    width: 100%;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    color: #484f58;
    font-size: .8rem;
    padding: .48rem .75rem;
    cursor: pointer;
    transition: color .15s, border-color .15s, background .15s;
    text-align: left;
    font-family: 'Inter', Arial, sans-serif;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.logout-btn:hover {
    color: #f85149;
    border-color: rgba(248,81,73,0.28);
    background: rgba(248,81,73,0.05);
}

/* ── Import estratti conto ─────────────────────────────────────────────── */

.import-upload-card {
    background: var(--panel);
    border: 1px solid var(--muted-border);
    border-radius: var(--radius);
    padding: 2rem 2rem 1.5rem;
    max-width: 640px;
    text-align: center;
}
.import-upload-icon { font-size: 2.5rem; margin-bottom: .5rem; }
.import-upload-card h2 { font-size: 1.2rem; margin: 0 0 .5rem; }
.import-upload-card p  { color: var(--muted-text); font-size: .9rem; margin-bottom: 1rem; }

.import-file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    border: 2px dashed var(--muted-border);
    border-radius: 10px;
    padding: 1.25rem 1rem;
    cursor: pointer;
    color: var(--muted-text);
    font-size: .9rem;
    transition: border-color .2s, color .2s;
    margin-bottom: 1rem;
}
.import-file-label:hover { border-color: var(--accent-blue); color: #fff; }
.import-file-label input[type="file"] { display: none; }

.import-submit-btn { width: 100%; margin-bottom: .75rem; }
.import-hint  { font-size: .78rem; color: #555; margin: 0; }
.import-error { color: #f85149; background: #1a0000; border-radius: 8px; padding: .5rem .75rem; margin-bottom: 1rem; font-size: .875rem; }
.import-note  { color: var(--accent-blue); cursor: default; }

.import-file-ext {
    display: inline-block;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    background: #1e2229;
    border-radius: 4px;
    padding: 1px 5px;
    color: var(--accent-blue);
    margin-right: .25rem;
}

/* ── Status bar su review ── */
.import-status-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--panel);
    border: 1px solid var(--muted-border);
    border-radius: var(--radius);
    padding: .75rem 1.25rem;
    margin-bottom: 1rem;
}
.import-stat { display: flex; flex-direction: column; align-items: center; gap: .1rem; }
.import-stat-num   { font-size: 1.4rem; font-weight: 700; line-height: 1; }
.import-stat-label { font-size: .72rem; color: var(--muted-text); text-transform: uppercase; letter-spacing: .05em; }
.import-stat--pending .import-stat-num { color: var(--accent-yellow); }
.import-stat--ok     .import-stat-num  { color: var(--accent-green); }
.import-stat--ko     .import-stat-num  { color: #f85149; }
.import-stat-note { font-size: .82rem; color: var(--muted-text); margin-left: auto; max-width: 320px; }

/* Pannello errore import (es. quota Gemini) */
.import-error-panel {
    background: rgba(248,81,73,0.07);
    border: 1px solid rgba(248,81,73,0.25);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    color: #e8a09c;
}
.import-error-panel strong { color: #f85149; display: block; margin-bottom: .4rem; font-size: .95rem; }
.import-error-panel p { margin: .3rem 0; font-size: .85rem; line-height: 1.5; }
.import-error-hint { color: var(--muted-text) !important; }
.import-error-hint a { color: #7db0ff; }

/* ── Tabella import ── */
.import-table-wrapper { overflow-x: auto; }
.import-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.import-table th {
    background: #1a1d21;
    color: var(--muted-text);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .5rem .75rem;
    text-align: left;
    border-bottom: 1px solid var(--muted-border);
    white-space: nowrap;
}
.import-table td {
    padding: .45rem .75rem;
    border-bottom: 1px solid #1a1d21;
    vertical-align: middle;
}
.import-row--approvato td { opacity: .6; }
.import-row--rifiutato td { opacity: .4; text-decoration: line-through; }
.th-raw { width: 60px; }
.td-raw { white-space: nowrap; }

/* Inline inputs nella tabella */
.import-inline-input,
.import-inline-select {
    background: #1a1d21;
    border: 1px solid #2d3139;
    border-radius: 6px;
    color: #eee;
    font-size: .85rem;
    padding: .25rem .4rem;
    outline: none;
    transition: border-color .15s;
}
.import-inline-input:focus,
.import-inline-select:focus { border-color: var(--accent-blue); }
.import-date-input   { width: 130px; }
.import-amount-input { width: 90px; }
.import-cat-input    { width: 110px; }
.import-desc-input   { width: 180px; }
.import-tag-select   { width: 100px; }

/* Testo grezzo tooltip */
.import-raw-toggle {
    cursor: help;
    color: var(--muted-text);
    font-size: 1rem;
    user-select: none;
}
.import-ai-note {
    cursor: help;
    font-size: .9rem;
    user-select: none;
    margin-left: .25rem;
}
.import-raw-tooltip {
    position: absolute;
    z-index: 9999;
    background: #1e2229;
    border: 1px solid var(--muted-border);
    border-radius: 8px;
    padding: .5rem .75rem;
    font-size: .8rem;
    color: #ccc;
    max-width: 360px;
    word-break: break-word;
    pointer-events: none;
    box-shadow: 0 4px 20px rgba(0,0,0,.5);
}

/* Pallino badge import nel calendario */
.mov-dot--import { outline: 2px solid var(--accent-blue); outline-offset: 1px; }

/* Colori generici */
.green-text  { color: var(--accent-green); }
.yellow-text { color: var(--accent-yellow); }

/* ── CRM (Investitori): toolbar compatta, KPI, chip, tabella cliccabile ── */
.crm-header-row {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem;
}
.crm-kpi-row { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.crm-kpi {
    display: flex; align-items: baseline; gap: .4rem;
    background: var(--panel); border: 1px solid var(--muted-border); border-radius: 10px;
    padding: .5rem .85rem; text-decoration: none; cursor: pointer;
    transition: border-color .15s, background .15s;
}
.crm-kpi:hover { border-color: #3a4048; background: rgba(255,255,255,0.03); }
.crm-kpi--active { border-color: var(--accent-green); background: rgba(167,255,47,0.06); }
.crm-kpi-num { font-size: 1.05rem; font-weight: 800; color: #e6edf3; font-variant-numeric: tabular-nums; }
.crm-kpi-label { font-size: .74rem; color: var(--muted-text); }
.crm-kpi--alert .crm-kpi-num { color: #ff8080; }

.crm-toolbar {
    display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
    background: var(--panel); border: 1px solid var(--muted-border); border-radius: 12px;
    padding: .6rem .75rem; margin-bottom: .6rem; position: relative;
}
.crm-toolbar-search { flex: 1 1 260px; min-width: 200px; }
.crm-toolbar input, .crm-toolbar select {
    height: 40px; box-sizing: border-box;
    background: #0d1117; border: 1px solid #21262d; border-radius: 7px;
    color: #e6edf3; padding: 0 .7rem; font-size: .85rem; width: 100%;
}
.crm-toolbar input:focus, .crm-toolbar select:focus { outline: none; border-color: #388bfd; }
.crm-toolbar-field { min-width: 150px; }
.crm-more-btn {
    height: 40px; padding: 0 .9rem; border-radius: 7px; background: transparent;
    border: 1px solid #21262d; color: #aaa; font-size: .82rem; cursor: pointer; font-family: inherit;
    white-space: nowrap;
}
.crm-more-btn:hover { background: rgba(255,255,255,0.04); color: #e6edf3; }
.crm-reset-btn {
    height: 40px; padding: 0 .8rem; border-radius: 7px; background: transparent;
    border: 1px solid transparent; color: #6a7280; font-size: .82rem; cursor: pointer; text-decoration: none;
    display: inline-flex; align-items: center;
}
.crm-reset-btn:hover { color: #ff8080; }
.crm-more-panel {
    position: absolute; top: calc(100% + .4rem); right: .75rem; z-index: 40;
    background: #0d1117; border: 1px solid #21262d; border-radius: 10px;
    padding: .85rem; width: min(520px, 90vw);
    box-shadow: 0 12px 32px rgba(0,0,0,.5);
    display: grid; grid-template-columns: 1fr 1fr; gap: .6rem .75rem;
}
.crm-more-panel .crm-toolbar-field { min-width: 0; }
.crm-more-panel label { font-size: .7rem; color: var(--muted-text); text-transform: uppercase; letter-spacing: .04em; display: block; margin-bottom: .25rem; }
.crm-more-panel .crm-more-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: .5rem; margin-top: .2rem; }

.crm-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.crm-chip {
    display: inline-flex; align-items: center; gap: .4rem;
    background: rgba(88,166,255,0.1); border: 1px solid rgba(88,166,255,0.25);
    color: #79b8ff; border-radius: 999px; padding: .25rem .7rem .25rem .8rem; font-size: .78rem;
    text-decoration: none;
}
.crm-chip:hover { background: rgba(88,166,255,0.18); }
.crm-chip span.x { font-weight: 700; opacity: .75; }

.crm-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    padding: 4rem 2rem; background: var(--panel); border: 1px solid var(--muted-border); border-radius: 16px;
}
.crm-empty h2 { margin: .25rem 0 .4rem; font-size: 1.15rem; }
.crm-empty p { margin: 0 0 1.25rem; color: var(--muted-text); max-width: 380px; }
.crm-empty-icon { font-size: 2.2rem; margin-bottom: .5rem; opacity: .6; }

.crm-table-wrapper { overflow-x: auto; }
.crm-row { cursor: pointer; transition: background .12s; }
.crm-row:hover { background: rgba(255,255,255,0.025); }
.crm-row td { vertical-align: middle; }
.crm-inv-name { font-weight: 700; color: #e6edf3; font-size: .92rem; }
.crm-inv-sub { font-size: .74rem; color: var(--muted-text); margin-top: 1px; }
.crm-followup-late { color: #ff8080; font-weight: 700; }
.crm-sortable { text-decoration: none; color: inherit; display: inline-flex; align-items: center; gap: .25rem; }
.crm-sortable:hover { color: #e6edf3; }
.crm-sort-arrow { font-size: .68rem; opacity: .7; }

.crm-row-menu { position: relative; display: inline-block; }
.crm-row-menu-btn {
    background: transparent; border: 1px solid transparent; color: #6a7280;
    font-size: 1rem; line-height: 1; padding: .3rem .5rem; border-radius: 6px; cursor: pointer; font-family: inherit;
}
.crm-row-menu-btn:hover { background: rgba(255,255,255,0.06); color: #e6edf3; }
.crm-row-menu-list {
    display: none; position: absolute; right: 0; top: calc(100% + .25rem); z-index: 30;
    background: #0d1117; border: 1px solid #21262d; border-radius: 8px; min-width: 180px;
    box-shadow: 0 10px 28px rgba(0,0,0,.5); overflow: hidden;
}
.crm-row-menu-list.open { display: block; }
.crm-row-menu-list a, .crm-row-menu-list button {
    display: block; width: 100%; text-align: left; padding: .5rem .75rem; font-size: .8rem;
    color: #c9c9c9; text-decoration: none; background: none; border: none; font-family: inherit; cursor: pointer;
}
.crm-row-menu-list a:hover, .crm-row-menu-list button:hover { background: rgba(255,255,255,0.06); color: #e6edf3; }

/* ── Zona account compatta (sidebar) ── */
.acct-compact { display: flex; align-items: center; gap: .6rem; padding: .5rem .1rem; position: relative; }
.acct-compact-menu {
    display: none; position: absolute; left: 0; bottom: calc(100% + .4rem); z-index: 40;
    background: #0d1014; border: 1px solid #1e2530; border-radius: 10px; min-width: 200px;
    box-shadow: 0 12px 32px rgba(0,0,0,.6); overflow: hidden;
}
.acct-compact-menu.open { display: block; }
.acct-compact-menu a, .acct-compact-menu button {
    display: flex; align-items: center; gap: .5rem; width: 100%; text-align: left;
    padding: .55rem .75rem; font-size: .78rem; color: #9aa4b0; text-decoration: none;
    background: none; border: none; font-family: inherit; cursor: pointer;
}
.acct-compact-menu a:hover, .acct-compact-menu button:hover { background: rgba(255,255,255,0.05); color: #e6edf3; }
.acct-compact-menu .danger:hover { background: rgba(248,81,73,0.1); color: #f85149; }
.acct-compact-menu-btn {
    background: transparent; border: 1px solid #181c21; border-radius: 7px; color: #6a7280;
    width: 28px; height: 28px; flex-shrink: 0; cursor: pointer; font-size: .95rem; line-height: 1;
}
.acct-compact-menu-btn:hover { background: rgba(255,255,255,0.05); color: #e6edf3; }
.red-text    { color: #f85149; }
