/* ═══════════════════════════════════════════════
   Finanças Cloud — Design System v7 (Notion Minimal + Dark Mode)
   ═══════════════════════════════════════════════ */
:root {
    --bg: #ffffff;
    --bg-2: #f7f7f5;
    --panel: #ffffff;
    --panel-2: #fbfbfa;
    --line: rgba(55, 53, 47, .09);
    --text: #37352f;
    --muted: #787774;
    --green: #0f7b6c;
    --red: #e03e3e;
    --blue: #2383e2;
    --blue-2: #529CCA;
    --yellow: #cb912f;
    --purple: #6940a5;
    --teal: #0f7b6c;
    --shadow: 0 1px 3px rgba(0,0,0,.04), 0 0 0 1px var(--line);
    --radius-xl: 12px;
    --radius-lg: 10px;
    --radius-md: 8px;
    --radius-sm: 6px;
    --transition: .15s ease;
    --skeleton-base: #ebebea;
    --skeleton-shine: #f7f7f5;
    --input-bg: #f7f7f5;
}

/* ─── DARK MODE ─── */
[data-theme="dark"] {
    --bg: #191919;
    --bg-2: #141414;
    --panel: #202020;
    --panel-2: #252525;
    --line: rgba(255, 255, 255, .07);
    --text: #e6e3de;
    --muted: #7f7f7f;
    --green: #4fad95;
    --red: #f04747;
    --blue: #4f9cf9;
    --blue-2: #6aafdb;
    --yellow: #e8b85e;
    --purple: #9b72d2;
    --teal: #4fad95;
    --shadow: 0 1px 4px rgba(0,0,0,.3), 0 0 0 1px var(--line);
    --skeleton-base: #2a2a2a;
    --skeleton-shine: #333333;
    --input-bg: #2a2a2a;
}

[data-theme="dark"] body {
    background: var(--bg-2);
}

[data-theme="dark"] input,
[data-theme="dark"] select {
    background: #2a2a2a; /* Mais suave que o preto puro */
    color: var(--text);
    border: 1px solid var(--line);
    transition: all .2s;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus {
    background: #323232;
    border-color: var(--blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(35, 131, 226, 0.15);
}

[data-theme="dark"] .quick-btn {
    background: var(--panel);
}

[data-theme="dark"] .table-shell {
    border-color: var(--line);
}

[data-theme="dark"] thead {
    background: var(--bg-2);
}

/* ─── DARK MODE TOGGLE ─── */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--bg-2);
    cursor: pointer;
    font-size: 16px;
    transition: all var(--transition);
    flex-shrink: 0;
}
.theme-toggle:hover {
    background: var(--panel);
    border-color: var(--muted);
}

/* ─── TOAST NOTIFICATIONS ─── */
#toastContainer {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: var(--panel);
    box-shadow: 0 4px 16px rgba(0,0,0,.12), 0 0 0 1px var(--line);
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    max-width: 320px;
    pointer-events: all;
    animation: toastIn .22s ease forwards;
    transition: opacity .2s ease, transform .2s ease;
}
.toast.removing {
    animation: toastOut .2s ease forwards;
}
.toast-icon { font-size: 15px; flex-shrink: 0; }
.toast-success { border-left: 3px solid var(--green); }
.toast-error { border-left: 3px solid var(--red); }
.toast-info { border-left: 3px solid var(--blue); }
.toast-warning { border-left: 3px solid var(--yellow); }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(12px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(8px) scale(.97); }
}

/* ─── LOADING SHIMMER ─── */
@keyframes shimmer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.loading-shimmer {
    animation: shimmer 1.2s infinite ease-in-out;
    pointer-events: none;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg-2);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ─── SHELL ─── */
.shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 32px;
    width: 100%;
    box-sizing: border-box;
}

/* ─── HERO ─── */
.hero {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 24px 0;
    border-bottom: 1px solid var(--line);
    margin-bottom: 24px;
}
.hero-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.hero-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.logo {
    font-size: 28px;
    line-height: 1;
}
.hero h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text);
}
.hero .sub {
    font-size: 13px;
    color: var(--muted);
    margin-top: 2px;
    max-width: 460px;
}
.hero-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(255,255,255,0.03);
    padding: 8px 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    width: 100%;
    box-sizing: border-box;
}
.actions-left, .actions-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.profile-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ─── CARDS ─── */
.card {
    background: var(--panel);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: box-shadow var(--transition);
}

/* ─── METRICS GRID ─── */
.top-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.metric {
    padding: 16px 18px;
}
.metric .label {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: 4px;
}
.metric .value {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}
.metric .hint {
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
}
.green { color: var(--green); }
.red { color: var(--red); }
.yellow { color: var(--yellow); }

/* ─── BUTTONS ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    padding: 7px 14px;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}
.btn-primary {
    background: var(--blue);
    color: #fff;
}
.btn-primary:hover { background: #1b6ec2; }
.btn-secondary {
    background: var(--input-bg);
    color: var(--text);
    border: 1px solid var(--line);
}
.btn-secondary:hover { 
    background: var(--line);
    transform: translateY(-1px);
}
[data-theme="dark"] .btn-secondary:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.btn-danger {
    background: rgba(224,62,62,.08);
    color: var(--red);
    border: 1px solid rgba(224,62,62,.15);
}
.btn-danger:hover { background: rgba(224,62,62,.14); }
.btn-purple {
    background: rgba(105,64,165,.1);
    color: var(--purple);
    border: 1px solid rgba(105,64,165,.15);
}
.btn-purple:hover { background: rgba(105,64,165,.16); }
.btn-small {
    padding: 4px 10px;
    font-size: 12px;
}
.btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ─── FORMS ─── */
.form-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.field label, label {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
}
input, select, textarea {
    font-family: inherit;
    font-size: 14px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    color: var(--text);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    width: 100%;
    box-sizing: border-box; /* Garante que o padding não estoure a largura */
    color-scheme: dark;
}
input[type="checkbox"], input[type="radio"] {
    width: auto; /* Impede que o checkbox tente ocupar 100% do espaço */
}
input:focus, select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(35,131,226,.12);
}
input::placeholder { color: #c4c4c0; }
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.check-label {
    display: flex;
    align-items: center;
    gap: 8px; /* Espaço entre o box e o texto */
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
}
.manage-row {
    display: flex;
    gap: 8px;
    padding-top: 4px;
}
.inline-save {
    display: flex;
    gap: 8px;
}
.inline-save input { flex: 1; }

/* ─── PANEL TITLES ─── */
.panel-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}
.panel-title h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.panel-sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

/* ─── DASHBOARD ROW ─── */
.dashboard-row {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 14px;
    margin-bottom: 20px;
}

/* ─── HEALTH SCORE ─── */
.health-card {
    display: flex;
    gap: 16px;
    align-items: center;
}
.health-ring-wrap { flex-shrink: 0; }
.health-svg {
    width: 100px;
    height: 100px;
}
.health-info h2 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
}
.health-label {
    font-size: 16px;
    font-weight: 700;
}
.health-tip {
    font-size: 12px;
    color: var(--muted);
    margin: 4px 0 0;
    line-height: 1.4;
}

/* ─── RULE 50-30-20 ─── */
.rule-card {}
.rule-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.rule-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.rule-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
}
.rule-info strong {
    margin-left: auto;
    font-size: 13px;
}
.rule-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.dot-need { background: var(--blue); }
.dot-want { background: var(--purple); }
.dot-obj { background: var(--green); }
.rule-val {
    font-size: 11px;
    color: var(--muted);
}

/* ─── BARS ─── */
.bar-track {
    position: relative;
    height: 6px;
    background: var(--bg-2);
    border-radius: 99px;
    overflow: hidden;
}
.bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width .4s ease;
}
.bar-entrada { background: var(--green); }
.bar-saida { background: var(--red); }
.bar-need { background: linear-gradient(90deg, #5b9bd5, #2383e2); }
.bar-want { background: linear-gradient(90deg, #9b7dd4, #6940a5); }
.bar-goal { background: linear-gradient(90deg, #5cc4b0, #0f7b6c); }
.bar-meta { background: var(--purple); }
.bar-reserva { background: var(--teal); }
.bar-target {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background: rgba(55,53,47,.25);
}
.bar-wrap { display: flex; flex-direction: column; gap: 8px; }
.bar-row {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
}

/* ─── GOAL ─── */
.goal-progress {
    margin-top: 12px;
}
.goal-numbers {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--muted);
    margin-top: 6px;
}
.goal-numbers strong {
    color: var(--text);
    font-size: 13px;
}

/* ─── LAYOUT SIDEBAR + MAIN ─── */
.layout {
    display: grid;
    grid-template-columns: minmax(280px, 340px) 1fr;
    gap: 16px;
    align-items: start;
}
.layout > * {
    min-width: 0;
}

/* ─── SIDEBAR TABS ─── */
.sidebar-tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-2);
    border-radius: var(--radius-md);
    padding: 3px;
    margin-bottom: 12px;
}
.stab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 7px 6px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}
.stab.active {
    background: var(--panel);
    color: var(--text);
    box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.stab:hover:not(.active) {
    color: var(--text);
}
.stab-panel { display: none; }
.stab-panel.active { display: block; }

/* ─── CATEGORIES ─── */
.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}
.category-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 12px;
    background: var(--bg-2);
    border: 1px solid var(--line);
    color: var(--text);
}
.cat-group-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}
.mini-x {
    background: none;
    border: none;
    font-size: 11px;
    color: var(--muted);
    cursor: pointer;
    padding: 0;
    margin-left: 2px;
    line-height: 1;
}
.mini-x:hover { color: var(--red); }

/* ─── BUDGET EDITOR ─── */
.budget-editor {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.budget-editor-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}
.budget-editor-row input {
    width: 110px;
    text-align: right;
}
.budget-overview-card {}
.budget-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.budget-bar-item {}
.budget-bar-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 4px;
    color: var(--text);
}
.budget-bar-info .over { color: var(--red); font-weight: 600; }
.budget-bar-track {
    height: 5px;
    background: var(--bg-2);
    border-radius: 99px;
    overflow: hidden;
}
.budget-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width .4s ease;
}

/* ─── SUMMARY STRIP ─── */
.summary-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}
.mini-card {
    background: var(--panel);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    box-shadow: var(--shadow);
}
.mini-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .3px;
    margin-bottom: 10px;
}

/* ─── CHARTS ─── */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}
.chart-card {
    padding: 16px;
    min-width: 0; /* Previne que o grid estoure */
}
.chart-container-wrap {
    position: relative;
    width: 100%;
    height: 240px;
    margin-top: 10px;
}
.chart-card canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ─── TABLE ─── */
.filters {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.filters input {
    flex: 1;
    min-width: 180px;
}
.filters select {
    min-width: 130px;
}
.table-shell {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
thead {
    background: var(--bg-2);
}
th {
    text-align: left;
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .4px;
    border-bottom: 1px solid var(--line);
}
td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
}
tr:last-child td { border-bottom: none; }
tr:hover { background: rgba(55,53,47,.02); }
.desc { max-width: 260px; }
.row-actions {
    display: flex;
    gap: 4px;
}
.empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

/* ─── TAGS ─── */
.tag {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .2px;
}
.tag-entrada {
    background: rgba(15,123,108,.1);
    color: var(--green);
}
.tag-saida {
    background: rgba(224,62,62,.08);
    color: var(--red);
}
.tag-recorrente {
    background: rgba(35,131,226,.08);
    color: var(--blue);
    font-size: 10px;
    padding: 1px 5px;
    margin-left: 4px;
}

/* ─── DEBTS ─── */
.debts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}
.debt-card {
    padding: 14px;
    border-radius: var(--radius-md);
    background: var(--bg-2);
    border: 1px solid var(--line);
}
.debt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.debt-name {
    font-weight: 600;
    font-size: 13px;
}
.debt-priority {
    font-size: 11px;
    color: var(--yellow);
    font-weight: 600;
}
.debt-rate {
    font-size: 12px;
    color: var(--muted);
}
.debt-details {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.debt-summary {
    margin-top: 14px;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
}

/* ─── QUICK PRESETS ─── */
.quick-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}
.quick-btn {
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    text-align: left;
}
.quick-btn strong {
    font-size: 12px;
    color: var(--text);
    font-weight: 600;
}
.quick-btn span {
    font-size: 11px;
    color: var(--muted);
}
.quick-btn:hover {
    background: var(--bg-2);
    border-color: var(--blue);
}

/* ─── ALERTS ─── */
.alerts-bar {
    margin-bottom: 14px;
}
.alert-item {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    margin-bottom: 6px;
}
.alert-danger {
    background: rgba(224,62,62,.06);
    color: var(--red);
    border: 1px solid rgba(224,62,62,.12);
}

/* ─── TIPS ─── */
.tips-section { margin-top: 16px; }
.tips-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tip-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-2);
    font-size: 13px;
    color: var(--text);
    line-height: 1.5;
}
.tip-icon {
    font-size: 15px;
    flex-shrink: 0;
}

/* ─── AUTH SETTINGS ─── */
.auth-overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
    background: var(--bg-2);
}
.auth-card {
    max-width: 380px;
    width: 100%;
    padding: 36px 28px;
    text-align: center;
}
.auth-card .form-group {
    text-align: left;
}
.auth-card .form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 5px;
    color: var(--muted);
}

/* ─── AVATAR BUTTON ─── */
.avatar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--bg-2);
    cursor: pointer;
    font-size: 16px;
    transition: all var(--transition);
    flex-shrink: 0;
}
.avatar-btn:hover {
    background: var(--panel);
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(35,131,226,.12);
}

/* ─── MODAL ─── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,.35);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
    animation: fadeIn .18s ease;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.modal-card {
    width: 100%;
    max-width: 460px;
    max-height: 88vh;
    overflow-y: auto;
    padding: 24px;
    animation: slideUp .2s ease;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.modal-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}
.modal-close {
    background: none;
    border: none;
    font-size: 16px;
    color: var(--muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.modal-close:hover { background: var(--bg-2); color: var(--red); }

/* ─── PROFILE MODAL INTERNALS ─── */
.profile-section {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-2);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}
.profile-avatar-large {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.avatar-upload-hint {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    opacity: 0;
    transition: opacity .2s;
}
.profile-avatar-large:hover .avatar-upload-hint {
    opacity: 1;
}
/* btn-purple for invite */
.btn-purple {
    background: var(--purple);
    color: #fff;
    border: none;
}
.btn-purple:hover { opacity: .85; }
.profile-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}
.profile-email {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}
.profile-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.profile-divider {
    height: 1px;
    background: var(--line);
}
.profile-status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.status-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    background: var(--bg-2);
    border-radius: var(--radius-sm);
}
.status-label {
    font-size: 11px;
    color: var(--muted);
    font-weight: 500;
}
.status-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.share-section h3 {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 6px;
}

/* ─── BOT LOG ─── */
.bot-log-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.bot-log-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-2);
    font-size: 12px;
}
.bot-log-icon { font-size: 14px; flex-shrink: 0; }
.bot-log-desc {
    flex: 1;
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bot-log-meta { color: var(--muted); font-size: 11px; white-space: nowrap; }
.bot-log-val { font-weight: 700; white-space: nowrap; }

/* ═══════════════════════════════════════════════
   RESPONSIVE — TABLET (< 1024px)
   ═══════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .shell { padding: 20px; }
    .layout {
        grid-template-columns: 300px 1fr;
    }
    .top-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .dashboard-row {
        grid-template-columns: 1fr 1fr;
    }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — MOBILE (< 768px)
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
    .shell { padding: 14px; }
    
    /* HERO */
    .hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px 0 18px;
    }
    .hero h1 { font-size: 19px; }
    .hero .sub { font-size: 12px; }
    .hero-actions {
        width: 100%;
        justify-content: flex-start;
        gap: 6px;
        flex-wrap: wrap;
    }
    .hero-actions .btn { font-size: 12px; padding: 6px 10px; }
    .hero-actions .divider { display: none; }
    
    /* METRICS */
    .top-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .metric { padding: 12px 14px; }
    .metric .value { font-size: 18px; }
    .metric .label { font-size: 11px; }
    .metric .hint { font-size: 10px; }
    
    /* DASHBOARD */
    .dashboard-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .health-card {
        flex-direction: row;
        text-align: left;
    }
    .health-svg { width: 80px; height: 80px; }

    /* LAYOUT */
    .layout {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* SIDEBAR TABS */
    .sidebar-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .sidebar-tabs::-webkit-scrollbar { display: none; }
    .stab { font-size: 11px; padding: 6px 8px; min-width: max-content; }

    /* STRIPS */
    .summary-strip { grid-template-columns: 1fr; gap: 8px; }
    .charts-row { grid-template-columns: 1fr; gap: 10px; }
    .chart-card canvas { max-height: 200px; }

    /* TABLE */
    .filters {
        flex-direction: column;
        gap: 6px;
    }
    .filters input, .filters select {
        width: 100%;
        min-width: unset;
    }
    th, td { padding: 8px 10px; font-size: 12px; }
    th:nth-child(3), td:nth-child(3) { display: none; }
    .desc { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .row-actions { flex-direction: column; gap: 3px; }
    .row-actions .btn { font-size: 11px; padding: 3px 8px; }

    /* FORMS */
    .two-col { grid-template-columns: 1fr 1fr; gap: 8px; }
    
    /* CARDS */
    .card { padding: 16px; border-radius: var(--radius-md); }
    .mini-card { padding: 14px; }
    .panel-title h2 { font-size: 14px; }

    /* DEBT */
    .debt-details { gap: 8px; }

    /* QUICK */
    .quick-grid { gap: 5px; }
    .quick-btn { padding: 8px 10px; }
    .quick-btn strong { font-size: 11px; }

    /* AUTH */
    .auth-card { padding: 28px 20px; }
    .auth-card h2 { font-size: 20px; }

    /* BUDGET */
    .budget-editor-row { flex-direction: column; align-items: flex-start; gap: 4px; }
    .budget-editor-row input { width: 100%; text-align: left; }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — TABLET & SMALL DESKTOP (< 1024px)
   ═══════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .shell { padding: 20px; }
    .top-grid { grid-template-columns: repeat(3, 1fr); }
    .dashboard-row { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — TABLET / MOBILE STACK (< 860px)
   ═══════════════════════════════════════════════ */
@media (max-width: 860px) {
    .layout { grid-template-columns: 1fr; }
    .hero { flex-direction: column; align-items: flex-start; gap: 12px; }
    .hero-actions { width: 100%; justify-content: flex-start; }
    .top-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — MOBILE PHONE (< 768px)
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
    .shell { padding: 16px; }
    .hero h1 { font-size: 19px; }
    .top-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    
    /* TABLE */
    .table-shell {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    th, td { padding: 8px 10px; font-size: 12px; }
    th:nth-child(3), td:nth-child(3) { display: none; }
    .desc { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .row-actions { flex-direction: column; gap: 3px; }
    .row-actions .btn { font-size: 11px; padding: 3px 8px; }

    /* FORMS */
    .two-col { grid-template-columns: 1fr 1fr; gap: 8px; }
    
    /* CARDS */
    .card { padding: 16px; border-radius: var(--radius-md); }
    .mini-card { padding: 14px; }
    .panel-title h2 { font-size: 14px; }

    /* BUDGET */
    .budget-editor-row { flex-direction: column; align-items: flex-start; gap: 4px; }
    .budget-editor-row input { width: 100%; text-align: left; }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — SMALL PHONE (< 480px)
   ═══════════════════════════════════════════════ */
@media (max-width: 480px) {
    .shell { padding: 10px; }
    .hero h1 { font-size: 17px; }
    .logo { font-size: 24px; }
    
    /* Stack metrics to single column */
    .top-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    .metric .value { font-size: 16px; }
    .metric { padding: 10px 12px; }
    
    /* Health card stacks vertically */
    .health-card {
        flex-direction: column;
        text-align: center;
    }
    .health-ring-wrap { margin: 0 auto; }
    .health-svg { width: 70px; height: 70px; }
    
    /* Two col forms become single on very small */
    .two-col { grid-template-columns: 1fr; }
    
    /* Table compacts further */
    th:nth-child(4), td:nth-child(4) { display: none; }
    th, td { padding: 6px 8px; font-size: 11px; }
    .desc { max-width: 100px; }
    
    .btn { font-size: 12px; padding: 6px 10px; }
    
    /* Charts even smaller */
    .chart-card canvas { max-height: 160px; }
    
    /* Quick grid single col */
    .quick-grid { grid-template-columns: 1fr; }
    
    /* Auth full width */
    .auth-overlay { padding: 16px; }
    .auth-card { padding: 24px 16px; border-radius: var(--radius-md); }
}


/* ═══════════════════════════════════════════════
   SAFE AREA (notch phones)
   ═══════════════════════════════════════════════ */
@supports (padding: env(safe-area-inset-bottom)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
        padding-bottom: env(safe-area-inset-bottom);
    }
}