/* ==========================================================
   My Expense Manager — premium, minimal, mobile-first
   Ink navy + emerald accent · Plus Jakarta Sans · tabular numbers
   ========================================================== */
:root {
    --ink: #0f1b2d;
    --ink-2: #16253b;
    --ink-3: #22344f;
    --brand: #0e7c5a;
    --brand-600: #0a6a4c;
    --brand-50: #e9f6f0;
    --bg: #f3f5f8;
    --surface: #ffffff;
    --border: #e4e8ee;
    --border-2: #edf0f4;
    --text: #0f1b2d;
    --muted: #64748b;
    --muted-2: #94a3b8;

    --paid: #0f8a5f;
    --paid-bg: #e7f6ef;
    --partial: #c46a08;
    --partial-bg: #fff3e2;
    --unpaid: #d92d4b;
    --unpaid-bg: #fdecef;

    --radius: 16px;
    --radius-sm: 11px;
    --shadow-sm: 0 1px 2px rgba(15, 27, 45, .05);
    --shadow: 0 1px 2px rgba(15, 27, 45, .04), 0 8px 24px -12px rgba(15, 27, 45, .12);
    --shadow-lg: 0 24px 60px -20px rgba(15, 27, 45, .35);
    --sidebar-w: 264px;
    --bottom-nav-h: 66px;

    --bs-body-font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --bs-body-color: var(--text);
    --bs-border-color: var(--border);
    --bs-link-color: var(--brand);
    --bs-link-hover-color: var(--brand-600);
    --bs-link-color-rgb: 14, 124, 90;
    --bs-success-rgb: 15, 138, 95;
    --bs-danger-rgb: 217, 45, 75;
    --bs-warning-rgb: 196, 106, 8;
}

html { -webkit-text-size-adjust: 100%; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--bs-body-font-family);
    font-size: 15.5px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.num, .stat-value, .amount, td, .exp-card strong, .pay-summary strong, .mini-stat strong { font-variant-numeric: tabular-nums; }
h1, h2, h3, h4, h5, h6, .fw-bold { letter-spacing: -.01em; }
::selection { background: #cdeee0; }

/* ---------- Bootstrap refinements ---------- */
.btn { border-radius: var(--radius-sm); font-weight: 600; letter-spacing: -.005em; padding: .55rem 1rem; transition: background-color .15s, border-color .15s, box-shadow .15s, color .15s; }
.btn-lg { font-size: 1rem; padding: .75rem 1.25rem; border-radius: 13px; }
.btn-sm { border-radius: 9px; padding: .35rem .65rem; font-size: .82rem; }
.btn:focus-visible { box-shadow: 0 0 0 .2rem rgba(14, 124, 90, .25); }

.btn-brand, .btn-success {
    --bs-btn-color: #fff; --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--brand-600); --bs-btn-hover-border-color: var(--brand-600);
    --bs-btn-active-bg: var(--brand-600); --bs-btn-active-border-color: var(--brand-600);
    --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
    box-shadow: 0 1px 2px rgba(14, 124, 90, .25), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.btn-brand { color: #fff; background: var(--brand); border-color: var(--brand); }
.btn-brand:hover { color: #fff; background: var(--brand-600); }
.btn-primary {
    --bs-btn-color: #fff; --bs-btn-bg: var(--ink); --bs-btn-border-color: var(--ink);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--ink-3); --bs-btn-hover-border-color: var(--ink-3);
    --bs-btn-active-bg: var(--ink-2); --bs-btn-active-border-color: var(--ink-2);
    --bs-btn-disabled-bg: var(--ink); --bs-btn-disabled-border-color: var(--ink);
}
.btn-light {
    --bs-btn-bg: #fff; --bs-btn-border-color: var(--border); --bs-btn-color: var(--text);
    --bs-btn-hover-bg: #f6f8fb; --bs-btn-hover-border-color: #d5dbe3; --bs-btn-active-bg: #eef1f5;
}
.btn-light.border { border-color: var(--border) !important; }
.btn-outline-success { --bs-btn-color: var(--brand); --bs-btn-border-color: #bfe3d3; --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-hover-color: #fff; }
.btn-outline-secondary { --bs-btn-color: var(--text); --bs-btn-border-color: var(--border); --bs-btn-hover-bg: #f6f8fb; --bs-btn-hover-color: var(--text); --bs-btn-hover-border-color: #d5dbe3; --bs-btn-active-bg: #eef1f5; --bs-btn-active-color: var(--text); }
.btn-outline-primary { --bs-btn-color: var(--ink); --bs-btn-border-color: var(--border); --bs-btn-hover-bg: var(--ink); --bs-btn-hover-border-color: var(--ink); --bs-btn-hover-color: #fff; }
.btn-danger { --bs-btn-bg: var(--unpaid); --bs-btn-border-color: var(--unpaid); --bs-btn-hover-bg: #bf2340; --bs-btn-hover-border-color: #bf2340; }
.btn-outline-danger { --bs-btn-color: var(--unpaid); --bs-btn-border-color: #f3c3cc; --bs-btn-hover-bg: var(--unpaid); --bs-btn-hover-border-color: var(--unpaid); }

.form-control, .form-select { border-radius: var(--radius-sm); border-color: var(--border); padding: .62rem .85rem; font-size: .97rem; background-color: #fff; }
.form-control-lg, .form-select-lg { padding: .78rem 1rem; font-size: 1.02rem; border-radius: 13px; }
.form-control:focus, .form-select:focus { border-color: #7cc7a8; box-shadow: 0 0 0 .22rem rgba(14, 124, 90, .13); }
.form-control::placeholder { color: var(--muted-2); }
.input-group-text { border-radius: var(--radius-sm); border-color: var(--border); background: #f7f9fb; color: var(--muted); font-weight: 600; }
.input-group > :not(:first-child) { border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }
.input-group > :not(:last-child) { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.form-label { font-size: .86rem; font-weight: 600; color: #334155; margin-bottom: .4rem; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 .2rem rgba(14, 124, 90, .18); border-color: #7cc7a8; }
.progress { background: #edf0f4; border-radius: 99px; }
.progress-bar { border-radius: 99px; }
.bg-success { background-color: var(--paid) !important; }
.text-success { color: var(--paid) !important; }
.text-danger { color: var(--unpaid) !important; }
.text-secondary { color: var(--muted) !important; }
.alert { border-radius: 12px; border: 0; }
.alert-danger { background: var(--unpaid-bg); color: #9f1c35; }
.alert-warning { background: var(--partial-bg); color: #7c4205; }
.alert-success { background: var(--paid-bg); color: #0b5e41; }
.alert-info { background: #eaf2ff; color: #1e3a8a; }
.dropdown-menu { border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: .4rem; }
.dropdown-item { border-radius: 9px; padding: .5rem .75rem; font-weight: 500; }
.card { border-radius: var(--radius); border: 1px solid var(--border) !important; box-shadow: var(--shadow) !important; }
.card-header:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.table { --bs-table-hover-bg: #f8fafc; }

/* ---------- App shell ---------- */
.app-shell { min-height: 100vh; }
.app-content { min-width: 0; }
.app-main { padding: 18px 16px calc(var(--bottom-nav-h) + 96px); max-width: 1320px; margin: 0 auto; }
@media (min-width: 992px) {
    .app-content { margin-left: var(--sidebar-w); }
    .app-main { padding: 26px 32px 48px; }
}

/* Sidebar */
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 1035;
    flex-direction: column; padding: 22px 18px;
    background: var(--ink); color: #c9d3e1;
    background-image: radial-gradient(120% 60% at 0% 0%, rgba(14, 124, 90, .22), transparent 60%);
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; margin: 2px 6px 26px; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(145deg, #13a173, var(--brand)); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; box-shadow: 0 6px 16px -6px rgba(19, 161, 115, .7); flex-shrink: 0; }
.brand-mark.sm { width: 34px; height: 34px; border-radius: 10px; font-size: 15px; }
.brand-name { font-weight: 800; font-size: 1.02rem; letter-spacing: -.02em; }
.brand-sub { font-size: .74rem; color: #8ea0b8; font-weight: 500; }
.sidebar .btn-brand { padding: .7rem 1rem; }
.sidebar-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: #6f819b; font-weight: 700; margin: 0 10px 8px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 3px; }
.sidebar-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 11px; color: #b7c3d4; text-decoration: none; font-weight: 600; font-size: .93rem; transition: background .15s, color .15s; }
.sidebar-nav a i { width: 18px; text-align: center; font-size: .95rem; color: #7e91ab; }
.sidebar-nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.sidebar-nav a.active { background: rgba(255, 255, 255, .09); color: #fff; box-shadow: inset 3px 0 0 #2fd19a; }
.sidebar-nav a.active i { color: #2fd19a; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .06); color: #e5ebf3; font-size: .9rem; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(145deg, #2fd19a, var(--brand)); color: #fff; font-weight: 800; flex-shrink: 0; }
.btn-icon-dark { width: 34px; height: 34px; padding: 0; border-radius: 10px; color: #a9b7ca; background: transparent; border: 0; }
.btn-icon-dark:hover { color: #fff; background: rgba(255, 255, 255, .08); }

/* Top bar */
.topbar {
    position: sticky; top: 0; z-index: 1030;
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top));
    background: rgba(243, 245, 248, .86); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid rgba(228, 232, 238, .8);
}
@media (min-width: 992px) { .topbar { padding: 16px 32px; } }
.topbar-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-name-dark { color: var(--ink); font-weight: 800; letter-spacing: -.02em; font-size: 1.08rem; }
.topbar-eyebrow { font-size: .8rem; color: var(--muted); font-weight: 500; }
.topbar-title { font-size: 1.45rem; font-weight: 800; letter-spacing: -.025em; margin: 0; color: var(--ink); }
.icon-btn { width: 42px; height: 42px; padding: 0; border-radius: 12px; background: #fff; border: 1px solid var(--border); color: var(--ink); font-size: 17px; box-shadow: var(--shadow-sm); }
.icon-btn:hover { background: #f8fafc; border-color: #d5dbe3; }
.avatar-btn { width: 42px; height: 42px; padding: 0; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 800; border: 0; }
.avatar-btn:hover, .avatar-btn:focus { background: var(--ink-3); color: #fff; }
.bell-badge { position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--unpaid); color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg); }
.bell-dot { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--unpaid); border: 2px solid #fff; }
#bellBtn.ring i { animation: ring .9s ease 2; transform-origin: 50% 0; }
@keyframes ring { 0%,100%{transform:rotate(0)} 20%{transform:rotate(15deg)} 40%{transform:rotate(-13deg)} 60%{transform:rotate(9deg)} 80%{transform:rotate(-5deg)} }

/* Brand icon (login/install pages) */
.brand-icon { width: 60px; height: 60px; border-radius: 18px; background: linear-gradient(145deg, #13a173, var(--brand)); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 26px; box-shadow: 0 12px 26px -10px rgba(14, 124, 90, .6); }

/* ---------- Month bar ---------- */
.month-bar { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border); border-radius: 15px; padding: 7px; box-shadow: var(--shadow-sm); }
.mb-btn { width: 42px; height: 42px; padding: 0; border-radius: 11px; color: var(--ink); background: #f5f7fa; border: 0; flex-shrink: 0; }
.mb-btn:hover { background: #eaeef3; color: var(--ink); }
.mb-select { border: 0; background-color: transparent; font-weight: 700; font-size: 1.06rem; color: var(--ink); padding: .5rem 2.2rem .5rem .75rem; box-shadow: none !important; cursor: pointer; }
.mb-select:hover { background-color: #f5f7fa; }
.month-select { flex: 1 1 auto; min-width: 0; }
.year-select { flex: 0 0 auto; width: 110px; }
.mb-today { margin-left: 4px; background: var(--brand-50); color: var(--brand); border: 0; font-size: .87rem; white-space: nowrap; }
.mb-today:hover { background: #d8efe4; color: var(--brand-600); }
@media (max-width: 575.98px) {
    .month-bar { gap: 4px; padding: 6px; }
    .mb-select { font-size: 1rem; padding-left: .55rem; padding-right: 1.9rem; background-position: right .5rem center; }
    .year-select { width: 92px; }
    .mb-today { display: none; }
    .mb-btn { width: 40px; height: 40px; }
}

/* ---------- Summary cards ---------- */
.stat-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px 16px; height: 100%; box-shadow: var(--shadow); overflow: hidden; }
.stat-label { color: var(--muted); font-size: .84rem; font-weight: 600; display: flex; gap: 9px; align-items: center; margin-bottom: 10px; }
.stat-icon { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; background: #f1f4f8; color: var(--ink); }
.stat-value { font-size: 1.55rem; font-weight: 800; line-height: 1.1; letter-spacing: -.03em; word-break: break-word; }
.stat-sub { color: var(--muted); font-size: .8rem; margin-top: 6px; font-weight: 500; }
.stat-card.paid .stat-value { color: var(--paid); }
.stat-card.paid .stat-icon { background: var(--paid-bg); color: var(--paid); }
.stat-card.unpaid .stat-value { color: var(--unpaid); }
.stat-card.unpaid .stat-icon { background: var(--unpaid-bg); color: var(--unpaid); }
.stat-card.hero {
    background: var(--ink); color: #fff; border-color: var(--ink);
    background-image: radial-gradient(90% 120% at 100% 0%, rgba(47, 209, 154, .22), transparent 55%);
    box-shadow: 0 18px 40px -22px rgba(15, 27, 45, .7);
}
.stat-card.hero .stat-label { color: #b7c3d4; }
.stat-card.hero .stat-icon { background: rgba(255, 255, 255, .1); color: #2fd19a; }
.stat-card.hero .stat-value { font-size: 2.1rem; color: #fff; margin-top: 4px; }
.hero-period { font-size: .74rem; font-weight: 700; color: #2fd19a; background: rgba(47, 209, 154, .12); padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.hero-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; color: #9fb0c6; font-size: .82rem; font-weight: 500; }
.hero-dot { width: 4px; height: 4px; border-radius: 50%; background: #4b5f7c; }
.progress-card { display: flex; align-items: center; gap: 14px; }
.ring { --p: 0; --size: 74px; width: var(--size); height: var(--size); border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; background: conic-gradient(var(--paid) calc(var(--p) * 1%), #e9edf2 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #fff; }
.ring span { position: relative; font-weight: 800; font-size: .86rem; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
@media (min-width: 1200px) { .progress-card { flex-direction: column; align-items: flex-start; } .progress-card .ring { --size: 80px; } .progress-card .ring span { font-size: .82rem; } }
@media (min-width: 768px) { .stat-value { font-size: 1.75rem; } .stat-card.hero .stat-value { font-size: 2.35rem; } }

/* ---------- Solid colour cards (whole card in its colour) ---------- */
@property --p { syntax: '<number>'; inherits: true; initial-value: 0; }
.stat-card.solid {
    --c1: #16253b; --c2: #0b1424; --glow: rgba(47, 209, 154, .28);
    color: #fff; border: 0; isolation: isolate;
    background: linear-gradient(140deg, var(--c1) 0%, var(--c2) 100%);
    box-shadow: 0 18px 36px -20px var(--shadow-c, rgba(15, 27, 45, .75)), inset 0 1px 0 rgba(255, 255, 255, .12);
    transition: transform .25s ease, box-shadow .25s ease, background .5s ease;
}
.stat-card.solid::before {           /* soft light glow, top-right */
    content: ""; position: absolute; z-index: -1; width: 220px; height: 220px; right: -70px; top: -90px; border-radius: 50%;
    background: radial-gradient(circle, var(--glow), transparent 70%);
}
.stat-card.solid::after {            /* fine ring decoration, bottom-left */
    content: ""; position: absolute; z-index: -1; width: 160px; height: 160px; left: -60px; bottom: -90px; border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .12);
}
@media (hover: hover) { .stat-card.solid:hover { transform: translateY(-3px); box-shadow: 0 26px 44px -22px var(--shadow-c, rgba(15, 27, 45, .8)), inset 0 1px 0 rgba(255, 255, 255, .14); } }
.stat-card.solid .stat-label { color: rgba(255, 255, 255, .86); white-space: nowrap; }
.stat-card.solid .stat-icon { background: rgba(255, 255, 255, .16); color: #fff; backdrop-filter: blur(4px); }
.stat-card.solid .stat-value { color: #fff; font-size: 1.9rem; text-shadow: 0 1px 0 rgba(0, 0, 0, .06); }
.stat-card.solid .stat-sub, .stat-card.solid .stat-foot { color: rgba(255, 255, 255, .78); }
.stat-bg-icon { position: absolute; right: 14px; bottom: 6px; font-size: 74px; color: #fff; opacity: .08; z-index: -1; transform: rotate(-12deg); pointer-events: none; }
.stat-pill { font-size: .72rem; font-weight: 700; color: #fff; background: rgba(255, 255, 255, .14); padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.stat-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: .8rem; font-weight: 600; flex-wrap: wrap; }
.stat-foot .sep { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .5; }
.mini-bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .22); overflow: hidden; margin-top: 12px; }
.mini-bar span { display: block; height: 100%; border-radius: 99px; background: #fff; transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.mini-bar + .stat-foot { margin-top: 8px; }
@media (min-width: 768px) { .stat-card.solid .stat-value { font-size: 2.05rem; } }

/* Colour themes */
.stat-card.solid.c-ink   { --c1: #1d3050; --c2: #0c1626; --glow: rgba(47, 209, 154, .30); --shadow-c: rgba(15, 27, 45, .8); }
.stat-card.solid.c-green { --c1: #19b07a; --c2: #0a7352; --glow: rgba(190, 255, 225, .35); --shadow-c: rgba(10, 115, 82, .75); }
.stat-card.solid.c-red   { --c1: #f0566e; --c2: #b81d3d; --glow: rgba(255, 210, 220, .35); --shadow-c: rgba(184, 29, 61, .7); }
.stat-card.solid.c-amber { --c1: #f6a83b; --c2: #c56a06; --glow: rgba(255, 236, 200, .4); --shadow-c: rgba(197, 106, 6, .7); }
.stat-card.solid.c-blue  { --c1: #5b7cfa; --c2: #2f3fc4; --glow: rgba(210, 220, 255, .35); --shadow-c: rgba(47, 63, 196, .7); }

/* Progress ring on a coloured card: white arc, see-through centre */
.stat-card.solid .ring { background: none; transition: --p 1s cubic-bezier(.2, .8, .2, 1); }
.stat-card.solid .ring::before {
    inset: 0; background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255, 255, 255, .22) 0);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px));
}
.stat-card.solid .ring span { color: #fff; }
.progress-msg { font-weight: 800; font-size: 1.02rem; letter-spacing: -.01em; line-height: 1.25; }
.progress-card.solid { gap: 16px; }
@media (min-width: 1200px) { .progress-card.solid { flex-direction: row; align-items: center; } .progress-card.solid .ring { --size: 78px; } }

@media (prefers-reduced-motion: reduce) {
    .stat-card.solid, .mini-bar span, .stat-card.solid .ring { transition: none; }
}
/* Cards adapt to their own width (container queries) */
#summaryCards > div { container-type: inline-size; }
@container (max-width: 270px) {
    .stat-pill { display: none; }
    .stat-card.solid .stat-value { font-size: 1.7rem; }
}
@container (max-width: 300px) {
    .progress-card.solid { flex-direction: column !important; align-items: flex-start !important; gap: 10px; }
    .progress-card.solid .ring { --size: 68px !important; }
    .progress-card.solid .ring span { font-size: .72rem !important; }
    .progress-card.solid .stat-label { white-space: normal; }
}

/* ---------- Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 6px; flex-wrap: wrap; }
.panel-title { font-size: 1.05rem; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.panel-sub { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.panel-body { padding: 10px 20px 20px; }
@media (max-width: 575.98px) { .panel-head { padding: 16px 14px 4px; } .panel-body { padding: 8px 12px 14px; } }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 20px 4px; }
@media (max-width: 575.98px) { .toolbar { padding: 10px 12px 2px; } }
.search-box { position: relative; flex: 1 1 240px; max-width: 360px; }
.search-box i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted-2); font-size: .9rem; }
.search-box .form-control { padding-left: 2.4rem; background: #f7f9fb; border-color: var(--border-2); }
.search-box .form-control:focus { background: #fff; }
.segmented { display: inline-flex; background: #f1f4f8; border-radius: 12px; padding: 4px; gap: 2px; overflow-x: auto; max-width: 100%; }
.segmented button { border: 0; background: transparent; border-radius: 9px; padding: .42rem .85rem; font-weight: 600; font-size: .86rem; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.segmented button:hover { color: var(--ink); }
.segmented button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15, 27, 45, .12); }

/* ---------- Status ---------- */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot.paid { background: var(--paid); } .dot.partial { background: var(--partial); } .dot.unpaid { background: var(--unpaid); }
.badge-status { display: inline-flex; align-items: center; gap: 6px; font-size: .7rem; font-weight: 800; letter-spacing: .06em; padding: .38em .7em; border-radius: 99px; }
.badge-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-PAID { background: var(--paid-bg); color: var(--paid); }
.badge-PARTIAL { background: var(--partial-bg); color: var(--partial); }
.badge-UNPAID { background: var(--unpaid-bg); color: var(--unpaid); }
.text-paid { color: var(--paid) !important; }
.text-partial { color: var(--partial) !important; }
.text-unpaid { color: var(--unpaid) !important; }
.status-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.status-chips .chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; background: #f4f6f9; font-size: .78rem; font-weight: 600; color: #334155; }
.status-chips .chip b { font-weight: 800; color: var(--ink); }
.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 4px; vertical-align: middle; }

/* ---------- Expense table (desktop) ---------- */
.expense-table { margin: 0; }
.expense-table thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--border); background: transparent; white-space: nowrap; padding: 10px 12px; }
.expense-table td { vertical-align: middle; padding: 15px 12px; border-color: var(--border-2); }
.expense-table tbody tr:last-child td { border-bottom: 0; }
/* Zebra rows: white, grey, white, grey... (also report tables) */
.expense-table tbody tr:nth-child(even) > td,
#monthReportTable .table tbody tr:nth-child(even) > td,
#yearTable tr:nth-child(even) > td { --bs-table-bg: #e9edf2; background-color: #e9edf2; }
.expense-table tbody tr:nth-child(odd) > td { --bs-table-bg: #ffffff; background-color: #ffffff; }
.expense-table tbody tr:nth-child(even) > td { border-color: #dde3ea; }
.expense-table.table-hover tbody tr:hover > td { --bs-table-bg: #eaf5ef; --bs-table-hover-bg: #eaf5ef; }

/* PAID rows: the whole strip turns green, text stays dark and readable */
.expense-table tbody tr.row-PAID > td,
#monthReportTable .table tbody tr.row-PAID > td {
    --bs-table-bg: #d9f2e4; background-color: #d9f2e4; border-color: #b9e3cb; color: #0f2a1e;
}
.expense-table tbody tr.row-PAID .exp-name { color: #0b3d2a; }
.expense-table tbody tr.row-PAID .exp-meta { color: #2f6b52; }
.expense-table tbody tr.row-PAID .text-paid,
#monthReportTable tr.row-PAID .text-paid { color: #066b45 !important; font-weight: 700; }
.expense-table tbody tr.row-PAID .badge-PAID,
#monthReportTable tr.row-PAID .badge-PAID { background: var(--paid); color: #fff; }
.expense-table.table-hover tbody tr.row-PAID:hover > td { --bs-table-hover-bg: #c9ecd8; }
.expense-table tbody tr.row-PAID .btn-light { --bs-btn-bg: rgba(255, 255, 255, .75); --bs-btn-border-color: #b9e3cb; }
.expense-table tbody tr td:first-child { position: relative; padding-left: 18px; }
.expense-table tbody tr td:first-child::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--unpaid); }
.expense-table tr.row-PAID td:first-child::before { background: var(--paid); }
.expense-table tr.row-PARTIAL td:first-child::before { background: var(--partial); }
.expense-table tfoot td { font-weight: 800; background: var(--ink); --bs-table-bg: var(--ink); color: #fff; border: 0; padding-top: 14px; padding-bottom: 14px; }
.expense-table tfoot td.text-paid { color: #3ee0a6 !important; }
.expense-table tfoot td.text-unpaid { color: #ff8da0 !important; }
.expense-table tfoot td:first-child { border-bottom-left-radius: 12px; }
.expense-table tfoot td:last-child { border-bottom-right-radius: 12px; }
.exp-name { font-weight: 700; letter-spacing: -.01em; }
.exp-meta { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.exp-meta .overdue { color: var(--unpaid); font-weight: 700; }
.actions { white-space: nowrap; }
.actions .btn { padding: .4rem .7rem; }
.actions .btn-icon { width: 34px; padding-left: 0; padding-right: 0; }
.actions .btn + .btn { margin-left: 2px; }
.expense-table td:first-child { min-width: 150px; }
.expense-table td, .expense-table thead th { padding-left: 9px; padding-right: 9px; }
tr.highlight td, .exp-card.highlight { animation: flash 2.4s ease; }
@keyframes flash { 0%,40% { background: #fff6dc; } 100% { background: transparent; } }

/* ---------- Expense cards (mobile) ---------- */
.exp-card { position: relative; border: 1px solid var(--border); border-radius: 14px; padding: 14px 14px 12px 17px; margin-bottom: 10px; background: #fff; box-shadow: var(--shadow-sm); overflow: hidden; }
.exp-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--unpaid); }
.exp-card.PAID::before { background: var(--paid); }
.exp-card.PAID { background: #d9f2e4; border-color: #b9e3cb; }
.exp-card.PAID .exp-name { color: #0b3d2a; }
.exp-card.PAID .exp-meta { color: #2f6b52; }
.exp-card.PAID .amounts div { background: rgba(255, 255, 255, .7); }
.exp-card.PAID .text-paid { color: #066b45 !important; }
.exp-card.PAID .badge-PAID { background: var(--paid); color: #fff; }
.exp-card.PAID .btn-light { --bs-btn-bg: rgba(255, 255, 255, .75); --bs-btn-border-color: #b9e3cb; }
.exp-card.PARTIAL::before { background: var(--partial); }
.exp-card .amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0; }
.exp-card .amounts div { background: #f6f8fa; border-radius: 10px; padding: 7px 9px; }
.exp-card .amounts small { display: block; color: var(--muted); font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.exp-card .amounts strong { font-size: .98rem; font-weight: 800; }
.exp-card .btns { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; }
.exp-card .btns .btn { padding: .6rem .8rem; font-size: .9rem; }
.mobile-total { border-radius: 14px; background: var(--ink); color: #fff; padding: 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background-image: radial-gradient(90% 120% at 100% 0%, rgba(47, 209, 154, .18), transparent 55%); }
.mobile-total small { display: block; color: #9fb0c6; font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.mobile-total strong { font-weight: 800; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 40px 14px; color: var(--muted); }
.empty-state > i { font-size: 26px; color: var(--brand); width: 60px; height: 60px; border-radius: 18px; background: var(--brand-50); display: inline-flex !important; align-items: center; justify-content: center; margin: 0 auto 12px; }
.empty-state .fw-semibold { color: var(--ink); }

/* ---------- Budget ---------- */
.budget-box { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow-sm); }
.budget-box.over { border-color: #f6cbd3; background: linear-gradient(0deg, #fff, #fff7f8); }
.budget-box .progress { height: 7px; }
.budget-link { color: var(--muted); font-weight: 600; font-size: .86rem; text-decoration: none; }
.budget-link:hover { color: var(--brand); }

/* ---------- Upcoming ---------- */
.upcoming-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 13px; border: 1px solid var(--border-2); margin-bottom: 8px; cursor: pointer; background: #fff; transition: border-color .15s, box-shadow .15s, transform .15s; }
.upcoming-item:hover { border-color: #d5dbe3; box-shadow: var(--shadow); }
.upcoming-item.overdue { border-color: #f6cbd3; background: #fff8f9; }
.upcoming-item.today { border-color: #f6dfb6; background: #fffaf1; }
.upcoming-item .when { font-size: .74rem; font-weight: 700; }

/* ---------- Modals ---------- */
.modal-content { border-radius: 22px; border: 0; box-shadow: var(--shadow-lg); }
.modal-header { border-bottom: 0; padding: 20px 22px 8px; }
.modal-title { font-weight: 800; letter-spacing: -.02em; }
.modal-body { padding: 10px 22px 18px; }
.modal-footer { border-top: 1px solid var(--border-2); padding: 14px 22px; }
.modal-backdrop.show { opacity: .45; }
.modal-backdrop { background: var(--ink); }
@media (max-width: 575.98px) { .modal-fullscreen-sm-down .modal-content { border-radius: 0; } }
.repeat-box { background: #f4f8ff; border: 1px solid #e1ebfb; border-radius: 12px; padding: 11px 12px 11px 2.3rem; }
.confirm-icon { width: 64px; height: 64px; margin: 0 auto; border-radius: 20px; background: var(--unpaid-bg); color: var(--unpaid); display: flex; align-items: center; justify-content: center; font-size: 26px; }

/* Payment modal */
.pay-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pay-summary > div { background: #f6f8fa; border-radius: 12px; padding: 10px 12px; }
.pay-summary small { display: block; color: var(--muted); font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.pay-summary strong { font-size: 1.08rem; font-weight: 800; }
.pay-summary .full { grid-column: 1 / -1; background: transparent; padding: 2px 0 0; }
.pay-form { background: #fbfcfd; border: 1px solid var(--border); border-radius: 16px; padding: 14px; }
.pay-history-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.pay-history-item:last-child { border-bottom: 0; }

/* ---------- Bottom nav + FAB (mobile) ---------- */
.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, .94); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid var(--border);
    display: grid; grid-template-columns: repeat(6, 1fr);
}
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-decoration: none; color: var(--muted-2); font-size: .68rem; font-weight: 700; position: relative; white-space: nowrap; min-width: 0; }
.bottom-nav a i { font-size: 1.15rem; }
.bottom-nav a.active { color: var(--ink); }
.bottom-nav a.active i { color: var(--brand); }
.bottom-nav a.active::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
.fab {
    position: fixed; right: 18px; bottom: calc(var(--bottom-nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 1031;
    width: 60px; height: 60px; border-radius: 20px; border: 0;
    background: var(--ink); color: #fff; font-size: 22px;
    box-shadow: 0 14px 30px -10px rgba(15, 27, 45, .6);
}
.fab i { color: #2fd19a; }
.fab:active { transform: scale(.96); }

/* ---------- Toasts ---------- */
.app-toasts { bottom: calc(var(--bottom-nav-h) + 10px + env(safe-area-inset-bottom)); z-index: 2000; width: min(440px, 100%); }
@media (min-width: 992px) { .app-toasts { bottom: 14px; margin-left: calc(var(--sidebar-w) / 2); } }
.app-toasts .toast { border: 0; border-radius: 14px; box-shadow: var(--shadow-lg); }
.app-toasts .text-bg-success { background: var(--ink) !important; color: #fff !important; }
.app-toasts .text-bg-success i { color: #2fd19a; }
.app-toasts .text-bg-info { background: var(--ink-2) !important; color: #fff !important; }
.app-toasts .text-bg-info .btn-close, .app-toasts .text-bg-success .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
.app-toasts .text-bg-warning { background: #fff7e8 !important; color: #6b3a03 !important; }

/* ---------- Notification center ---------- */
#notifPanel { --bs-offcanvas-width: 410px; border-left: 0; box-shadow: var(--shadow-lg); }
#notifPanel .offcanvas-header { padding: 18px 20px; }
#notifPanel .offcanvas-title { font-weight: 800; letter-spacing: -.02em; }
.notif-item { cursor: pointer; padding: 14px 20px; border-color: var(--border-2); }
.notif-item:hover { background: #f8fafc; }
.notif-item.unread { background: #fffbf3; box-shadow: inset 3px 0 0 var(--partial); }
.notif-item .t { font-weight: 700; font-size: .9rem; }
.notif-item .m { font-size: .86rem; color: #334155; }
.notif-item .time { font-size: .73rem; color: var(--muted-2); margin-top: 3px; font-weight: 500; }
.notif-icon { width: 36px; height: 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: .9rem; }
.notif-icon.reminder { background: var(--partial-bg); color: var(--partial); }
.notif-icon.due_today { background: #fff3cd; color: #a06b00; }
.notif-icon.overdue { background: var(--unpaid-bg); color: var(--unpaid); }
.notif-icon.payment { background: var(--paid-bg); color: var(--paid); }
.notif-icon.system { background: #eaf2ff; color: #1d4ed8; }

/* ---------- Reports ---------- */
.report-tabs { gap: 6px; background: #e9edf2; padding: 4px; border-radius: 13px; display: inline-flex; }
.report-tabs .nav-link { border-radius: 10px; font-weight: 700; color: var(--muted); padding: .5rem 1rem; font-size: .9rem; }
.report-tabs .nav-link.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15, 27, 45, .12); }
.report-summary th { width: 55%; color: var(--muted); font-weight: 600; font-size: .9rem; }
.report-summary td { font-weight: 800; text-align: right; }
.report-summary th, .report-summary td { padding: 11px 4px; border-color: var(--border-2); }
.year-chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; align-items: end; height: 210px; padding-top: 10px; border-bottom: 1px solid var(--border); }
.year-chart .bar-wrap { display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.year-chart .bar { width: 100%; max-width: 34px; display: flex; flex-direction: column-reverse; border-radius: 8px 8px 0 0; overflow: hidden; min-height: 3px; background: #edf0f4; }
.year-chart .bar .p { background: var(--brand); }
.year-chart .bar .r { background: #f9c9d2; }
.year-chart .lbl { font-size: .68rem; color: var(--muted); margin-top: 6px; font-weight: 600; }
.mini-stat { background: #f6f8fa; border-radius: 13px; padding: 12px 14px; }
.mini-stat small { color: var(--muted); font-weight: 600; display: block; font-size: .74rem; }
.mini-stat strong { font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; }

/* ---------- Settings ---------- */
.settings-accordion .accordion-item { border-radius: var(--radius) !important; overflow: hidden; margin-bottom: 12px; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.settings-accordion .accordion-button { font-weight: 700; padding: 1.05rem 1.2rem; letter-spacing: -.01em; }
.settings-accordion .accordion-button:not(.collapsed) { background: #fff; color: var(--ink); box-shadow: inset 0 -1px 0 var(--border-2); }
.settings-accordion .accordion-button:focus { box-shadow: none; }
.settings-accordion .accordion-button i { width: 30px; height: 30px; border-radius: 9px; background: #f1f4f8; display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; }
.settings-form .form-switch .form-check-input { width: 2.7em; height: 1.45em; margin-top: .05em; }
.settings-form .form-switch .form-check-label { padding-left: .45rem; }
.push-status { border-radius: 13px; padding: 13px 15px; background: #f6f8fa; font-size: .9rem; }
.push-status.on { background: var(--paid-bg); color: #0b5e41; }
.push-status.off { background: var(--partial-bg); color: #7c4205; }
.push-status.bad { background: var(--unpaid-bg); color: #9f1c35; }
.help-box { background: #f8fafc; border-radius: 13px; padding: 12px 14px; }
.help-box summary { cursor: pointer; }
.recurring-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 13px; padding: 12px 14px; margin-bottom: 8px; }
.recurring-item.paused { opacity: .55; }
.list-group-item { border-color: var(--border-2); }

/* ---------- Len-Den (lend / borrow) ---------- */
.min-w-0 { min-width: 0; }
.tiny { font-size: .72rem; font-weight: 600; white-space: nowrap; }
.stat-card.ld-get .stat-value { color: var(--paid); }
.stat-card.ld-get .stat-icon { background: var(--paid-bg); color: var(--paid); }
.stat-card.ld-give .stat-value { color: var(--unpaid); }
.stat-card.ld-give .stat-icon { background: var(--unpaid-bg); color: var(--unpaid); }
.person-row { display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-radius: 13px; cursor: pointer; border-bottom: 1px solid var(--border-2); transition: background .15s; }
.person-row:last-child { border-bottom: 0; }
.person-row:hover, .person-row:focus { background: #f6f8fa; outline: none; }
.avatar.get { background: linear-gradient(145deg, #34c58f, var(--paid)); }
.avatar.give { background: linear-gradient(145deg, #f2687f, var(--unpaid)); }
.avatar.settled { background: linear-gradient(145deg, #94a3b8, #64748b); }
.avatar.lg { width: 52px; height: 52px; font-size: 1.15rem; background: rgba(255, 255, 255, .14); }
.person-hero { background: var(--ink); color: #fff; border-radius: 20px; padding: 18px; box-shadow: 0 18px 40px -22px rgba(15, 27, 45, .7); background-image: radial-gradient(90% 120% at 100% 0%, rgba(47, 209, 154, .2), transparent 55%); }
.person-name { font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; }
.person-phone { font-size: .85rem; color: #a9b7ca; }
.person-balance { margin: 18px 0 14px; }
.person-balance .lbl { font-size: .8rem; color: #a9b7ca; font-weight: 600; }
.person-balance .val { font-size: 2.2rem; font-weight: 800; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.person-balance .val.get { color: #3ee0a6; }
.person-balance .val.give { color: #ff8da0; }
.person-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pa-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 13px; background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; font-size: .78rem; font-weight: 700; transition: background .15s; }
.pa-btn i { font-size: 1.15rem; color: #3ee0a6; }
.pa-btn:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.pa-btn.disabled { opacity: .45; }
.gave-got { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-gave, .btn-got { padding: 14px 10px; border-radius: 15px; font-size: 1.02rem; font-weight: 800; color: #fff; border: 0; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; }
.btn-gave small, .btn-got small { width: 100%; font-size: .72rem; font-weight: 600; opacity: .85; }
.btn-gave { background: var(--unpaid); box-shadow: 0 10px 22px -12px rgba(217, 45, 75, .8); }
.btn-gave:hover { background: #bf2340; color: #fff; }
.btn-got { background: var(--paid); box-shadow: 0 10px 22px -12px rgba(15, 138, 95, .8); }
.btn-got:hover { background: #0b744f; color: #fff; }
.entry-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--border-2); }
.entry-row:last-child { border-bottom: 0; }
.entry-date { width: 48px; flex-shrink: 0; text-align: center; background: #f4f6f9; border-radius: 11px; padding: 6px 0; line-height: 1.1; }
.entry-date b { display: block; font-size: 1.05rem; font-weight: 800; }
.entry-date span { font-size: .66rem; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.entry-amt { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.entry-amt .tiny { letter-spacing: .08em; }
.entry-amt.gave { color: var(--unpaid); }
.entry-amt.got { color: var(--paid); }
.type-toggle button { justify-content: center; padding: .6rem .5rem; }
.type-toggle button[data-etype="gave"].active, .type-toggle button[data-ftype="gave"].active { background: var(--unpaid); color: #fff; }
.type-toggle button[data-etype="got"].active, .type-toggle button[data-ftype="got"].active { background: var(--paid); color: #fff; }
.amount-xl .form-control { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.amount-xl .input-group-text { font-size: 1.3rem; }
.sms-after { background: var(--paid-bg); border-radius: 12px; padding: 10px 12px 10px 2.3rem; }
.sms-text { font-size: 1rem; line-height: 1.5; background: #f7fbf9; border-color: #cfe9dd; }
.btn-whatsapp { background: #25d366; border-color: #25d366; color: #fff; }
.btn-whatsapp:hover { background: #1ebe5b; border-color: #1ebe5b; color: #fff; }

/* ---------- Copy to another month ---------- */
.copy-route { font-size: .85rem; font-weight: 700; color: var(--brand); }
.copy-route i { color: var(--muted-2); font-size: .75rem; }
.copy-list { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.copy-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--border-2); cursor: pointer; margin: 0; }
.copy-item:last-child { border-bottom: 0; }
.copy-item:hover { background: #f8fafc; }
.copy-item .form-check-input { margin: 0; width: 1.2em; height: 1.2em; flex-shrink: 0; }
.copy-item.disabled { opacity: .5; cursor: not-allowed; background: #fafbfc; }
.copy-item .amt { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.copy-hint { border: 1px dashed #bfe3d3; background: var(--brand-50); border-radius: 14px; padding: 14px; margin-top: 14px; display: flex; align-items: center; gap: 12px; text-align: left; }
.copy-hint i.big { font-size: 1.3rem; color: var(--brand); }
.copy-next-btn.d-none { display: none !important; }

/* ---------- Notes (personal notebook) ---------- */
.note-c-default { --n-bg: #ffffff; --n-bd: var(--border); --n-dot: #ffffff; }
.note-c-yellow  { --n-bg: #fff8d6; --n-bd: #f3e3a0; --n-dot: #f5d453; }
.note-c-green   { --n-bg: #e4f6ec; --n-bd: #bfe6cf; --n-dot: #3cc183; }
.note-c-blue    { --n-bg: #e6efff; --n-bd: #c5d6fb; --n-dot: #5b8af5; }
.note-c-purple  { --n-bg: #f0e9ff; --n-bd: #d9c9fb; --n-dot: #9a6bf2; }
.note-c-pink    { --n-bg: #ffe9f1; --n-bd: #f8c6d8; --n-dot: #ef6b9a; }
.note-c-orange  { --n-bg: #ffeedd; --n-bd: #f8d2ac; --n-dot: #f39a3d; }
.note-c-gray    { --n-bg: #eef1f5; --n-bd: #d7dde5; --n-dot: #8a97a8; }

.note-quick { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); color: var(--muted); font-weight: 600; cursor: text; max-width: 720px; transition: box-shadow .2s, border-color .2s; }
.note-quick:hover, .note-quick:focus { border-color: #bfe3d3; box-shadow: 0 0 0 4px rgba(14, 124, 90, .08), var(--shadow); outline: none; }
.note-quick-icon { width: 38px; height: 38px; border-radius: 11px; background: var(--brand-50); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; }

.notes-section-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; color: var(--muted); margin: 6px 2px 10px; }
.notes-grid { column-gap: 14px; columns: 1; }
@media (min-width: 576px) { .notes-grid { columns: 2; } }
@media (min-width: 1100px) { .notes-grid { columns: 3; } }
@media (min-width: 1500px) { .notes-grid { columns: 4; } }
.note-card {
    break-inside: avoid; display: block; width: 100%; margin-bottom: 14px; text-align: left;
    background: var(--n-bg); border: 1px solid var(--n-bd); border-radius: 16px; padding: 14px 16px 10px;
    box-shadow: var(--shadow-sm); cursor: pointer; position: relative; transition: transform .18s ease, box-shadow .18s ease;
}
@media (hover: hover) { .note-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); } }
.note-card .n-title { font-weight: 800; font-size: 1rem; letter-spacing: -.01em; margin-bottom: 6px; padding-right: 26px; word-break: break-word; }
.note-card .n-body { white-space: pre-wrap; word-break: break-word; font-size: .92rem; color: #334155; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 12; -webkit-box-orient: vertical; overflow: hidden; }
.note-card .n-body.private { filter: blur(5px); user-select: none; }
.note-card .n-lock { position: absolute; inset: auto 0 38px 0; text-align: center; font-size: .78rem; font-weight: 700; color: var(--ink); }
.note-card .n-lock span { background: rgba(255, 255, 255, .9); padding: 4px 10px; border-radius: 99px; box-shadow: var(--shadow-sm); }
.note-card .n-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: .72rem; color: var(--muted); font-weight: 600; }
.note-card .n-pin { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 9px; border: 0; background: transparent; color: var(--muted-2); opacity: 0; transition: opacity .15s, background .15s; }
.note-card:hover .n-pin, .note-card .n-pin.on { opacity: 1; }
.note-card .n-pin.on { color: var(--ink); }
.note-card .n-pin:hover { background: rgba(15, 27, 45, .07); }
@media (hover: none) { .note-card .n-pin { opacity: 1; } }
mark.hl { background: #ffe58a; padding: 0 1px; border-radius: 3px; }

.note-editor { background: var(--n-bg, #fff); border: 1px solid var(--n-bd, transparent); overflow: hidden; transition: background .25s; }
.note-editor-top { display: flex; align-items: center; gap: 6px; padding: 16px 16px 4px 20px; }
.note-title-input { flex: 1; border: 0; background: transparent; font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink); outline: none; min-width: 0; }
.note-body-input { border: 0; background: transparent; outline: none; resize: none; width: 100%; min-height: 280px; padding: 8px 20px 16px; font-size: 1rem; line-height: 1.6; color: #1f2d3d; }
@media (max-width: 575.98px) { .note-body-input { min-height: calc(100vh - 190px); } }
.note-editor-bottom { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid rgba(15, 27, 45, .07); background: rgba(255, 255, 255, .45); }
.note-icon-btn { width: 38px; height: 38px; border-radius: 11px; border: 0; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.note-icon-btn:hover { background: rgba(15, 27, 45, .07); color: var(--ink); }
.note-icon-btn.on { color: var(--ink); background: rgba(15, 27, 45, .09); }
.note-colors { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(15, 27, 45, .12); background: var(--n-dot); padding: 0; }
.swatch.active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.private-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 700; color: var(--muted); cursor: pointer; padding: 6px 10px; border-radius: 10px; margin: 0; }
.private-toggle input { display: none; }
.private-toggle:has(input:checked) { background: var(--ink); color: #fff; }

/* ---------- Install banner + guide ---------- */
.install-banner { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow-sm); }
.install-banner.d-none { display: none !important; }
.install-banner img { border-radius: 12px; flex-shrink: 0; }
.install-steps { padding-left: 1.2rem; }
.install-steps li { margin-bottom: .65rem; }
.step-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; background: #eaf2ff; color: #1d4ed8; margin: 0 2px; }

/* ---------- Login / install pages ---------- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--bg); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--border); border-radius: 22px; padding: 30px 24px; box-shadow: var(--shadow); }

.auth-split { min-height: 100vh; display: grid; grid-template-columns: 1fr; background: #fff; }
@media (min-width: 992px) { .auth-split { grid-template-columns: 1.05fr 1fr; } }
.auth-aside {
    display: none; position: relative; overflow: hidden;
    background: var(--ink); color: #fff; padding: 48px 56px;
    background-image: radial-gradient(70% 60% at 0% 0%, rgba(47, 209, 154, .25), transparent 60%), radial-gradient(60% 50% at 100% 100%, rgba(14, 124, 90, .35), transparent 60%);
}
@media (min-width: 992px) { .auth-aside { display: flex; flex-direction: column; } }
.auth-aside h2 { font-size: 2.3rem; font-weight: 800; letter-spacing: -.035em; line-height: 1.12; max-width: 460px; }
.auth-aside p { color: #a9b7ca; max-width: 420px; }
.auth-feature { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; color: #dbe3ee; font-size: .95rem; }
.auth-feature i { width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .08); color: #2fd19a; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.auth-preview { margin-top: auto; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); border-radius: 18px; padding: 18px 20px; max-width: 380px; backdrop-filter: blur(6px); }
.auth-preview .lbl { font-size: .76rem; color: #9fb0c6; font-weight: 600; }
.auth-preview .val { font-size: 1.8rem; font-weight: 800; letter-spacing: -.03em; }
.auth-preview .bar { height: 7px; border-radius: 99px; background: rgba(255, 255, 255, .12); overflow: hidden; margin-top: 12px; }
.auth-preview .bar span { display: block; height: 100%; width: 87%; background: #2fd19a; border-radius: 99px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-form { width: 100%; max-width: 400px; }
.auth-form h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em; }

/* ---------- Print ---------- */
@media print {
    .sidebar, .topbar, .bottom-nav, .fab, .no-print, .month-bar, .report-tabs, .app-toasts, .install-banner { display: none !important; }
    .app-content { margin: 0 !important; }
    body { background: #fff; }
    .card, .panel { box-shadow: none !important; border: 0 !important; }
    .app-main { padding: 0 !important; }
}
