/* =============================================================
   EMI Wealth Tracker — Design system
   Premium fintech dashboard · light + dark · responsive
   ============================================================= */

:root {
  --bg: #f4f6fb;
  --bg-soft: #eef1f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eff2f9;
  --text: #0e1832;
  --text-2: #45506e;
  --text-3: #8a94ad;
  --border: #e6eaf4;
  --border-2: #d6dc f0;
  --primary: #6366f1;
  --primary-600: #4f46e5;
  --primary-soft: #eef0fe;
  --accent: #10b981;
  --accent-soft: #e7f8f1;
  --warn: #f59e0b;
  --warn-soft: #fdf3e2;
  --danger: #ef4444;
  --danger-soft: #fdecec;
  --info: #0ea5e9;
  --info-soft: #e7f4fd;
  --violet: #8b5cf6;
  --shadow-sm: 0 1px 2px rgba(14,24,50,.05), 0 4px 14px rgba(14,24,50,.05);
  --shadow-md: 0 4px 10px rgba(14,24,50,.06), 0 14px 40px rgba(14,24,50,.10);
  --shadow-lg: 0 10px 24px rgba(14,24,50,.10), 0 28px 70px rgba(14,24,50,.16);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 24px;
  --sidebar-w: 248px;
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --grad-soft: linear-gradient(135deg, #eef0fe, #f5f0ff);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --transition: cubic-bezier(.22,.61,.36,1);
}

[data-theme="dark"] {
  --bg: #0a0f1e;
  --bg-soft: #10172b;
  --surface: #131b33;
  --surface-2: #18213c;
  --surface-3: #1d2745;
  --text: #eef1fa;
  --text-2: #b4bdd4;
  --text-3: #7b86a4;
  --border: #24304f;
  --border-2: #2e3c62;
  --primary: #7c7dff;
  --primary-600: #8b8cf8;
  --primary-soft: #1c2350;
  --accent: #34d399;
  --accent-soft: #102a2b;
  --warn: #fbbf24;
  --warn-soft: #33281a;
  --danger: #f87171;
  --danger-soft: #3a1d24;
  --info: #38bdf8;
  --info-soft: #14293c;
  --violet: #a78bfa;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.28);
  --shadow-md: 0 6px 12px rgba(0,0,0,.32), 0 16px 44px rgba(0,0,0,.42);
  --shadow-lg: 0 12px 28px rgba(0,0,0,.4), 0 30px 80px rgba(0,0,0,.55);
  --border: 1px solid transparent;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background .3s var(--transition), color .3s var(--transition);
}

a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; }
button { font-family: inherit; }

h1,h2,h3,h4 { margin: 0 0 .4em; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.08rem; }
h4 { font-size: .95rem; }
p { margin: 0 0 .8em; }
.muted { color: var(--text-2); }
.hint { color: var(--text-3); font-size: .86rem; }
.small { font-size: .84rem; }
.mono { font-variant-numeric: tabular-nums; }

.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer; font-weight: 700; font-size: .92rem;
  padding: 11px 18px; border-radius: 12px; transition: all .22s var(--transition);
  background: var(--surface-3); color: var(--text); position: relative; overflow: hidden;
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--grad); color: #fff; box-shadow: 0 8px 20px rgba(99,102,241,.35);
}
.btn-primary:hover { box-shadow: 0 10px 26px rgba(99,102,241,.45); transform: translateY(-1px); }
.btn-accent { background: linear-gradient(135deg,#10b981,#0ea5e9); color: #fff; box-shadow: 0 8px 20px rgba(16,185,129,.3); }
.btn-accent:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(16,185,129,.4); }
.btn-ghost { background: transparent; color: var(--primary); box-shadow: inset 0 0 0 1.5px var(--primary); }
.btn-ghost:hover { background: var(--primary-soft); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost-danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px var(--danger); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover { filter: brightness(.97); }
.btn-sm { padding: 7px 12px; font-size: .82rem; border-radius: 10px; }
.btn-lg { padding: 14px 24px; font-size: 1rem; border-radius: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; pointer-events: none; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px; border: 0; cursor: pointer;
  background: var(--surface-2); color: var(--text-2); font-size: 1.05rem;
  transition: all .2s var(--transition); position: relative; text-decoration: none;
}
.icon-btn:hover { background: var(--surface-3); color: var(--primary); transform: translateY(-1px); }
.icon-btn .dot { position:absolute; top:8px; right:10px; width:8px; height:8px; border-radius:50%; background: var(--danger); box-shadow: 0 0 0 3px var(--surface); }

/* ------------------------------------------------------------- inputs */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: .84rem; font-weight: 700; color: var(--text-2); }
.field .req::after { content: " *"; color: var(--danger); }
.input, .select, .textarea {
  width: 100%; border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text); padding: 11px 14px; border-radius: 12px; font-size: .94rem;
  font-family: inherit; outline: none; transition: all .2s var(--transition);
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99,102,241,.14);
}
.input::placeholder { color: var(--text-3); }
.textarea { resize: vertical; min-height: 84px; }
.select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a94ad' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.check, .radio { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: .9rem; color: var(--text-2); }
.check input, .radio input { accent-color: var(--primary); width: 17px; height: 17px; }

/* ------------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 800;
  padding: 4px 10px; border-radius: 999px; letter-spacing: .02em; white-space: nowrap;
}
.badge-success { background: var(--accent-soft); color: var(--accent); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-muted { background: var(--surface-3); color: var(--text-3); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-violet { background: #f3eefe; color: var(--violet); }

/* ------------------------------------------------------------- cards */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 20px; transition: transform .3s var(--transition), box-shadow .3s var(--transition);
}
.card.hoverable:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-title h3 { margin: 0; font-size: 1rem; }
.card-title .sub { color: var(--text-3); font-size: .8rem; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.kpi { padding: 18px; }
.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.kpi .kpi-ico {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  font-size: 1.25rem; background: var(--primary-soft); color: var(--primary);
}
.kpi .kpi-ico.green { background: var(--accent-soft); color: var(--accent); }
.kpi .kpi-ico.amber { background: var(--warn-soft); color: var(--warn); }
.kpi .kpi-ico.red { background: var(--danger-soft); color: var(--danger); }
.kpi .kpi-ico.blue { background: var(--info-soft); color: var(--info); }
.kpi .kpi-ico.violet { background: #f3eefe; color: var(--violet); }
.kpi .kpi-label { font-size: .8rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.kpi .kpi-value { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .kpi-sub { font-size: .8rem; color: var(--text-3); margin-top: 3px; }

/* ------------------------------------------------------------- mini stats (horizontal row) */
.mini-stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.mini-stat {
  flex: 1 1 190px; min-width: 158px;
  display: flex; flex-direction: column; justify-content: center;
  padding: 14px 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: transform .25s var(--transition), box-shadow .25s var(--transition);
}
.mini-stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--grad); opacity: .85; }
.mini-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.ms-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin-bottom: 4px; }
.ms-val { font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.ms-val.green { color: var(--accent); }
.ms-val.red { color: var(--danger); }
.ms-val.amber { color: var(--warn); }

/* ------------------------------------------------------------- progress */
.progress-wrap { width: 100%; }
.progress { height: 10px; background: var(--surface-3); border-radius: 999px; overflow: hidden; position: relative; }
.progress-bar {
  height: 100%; border-radius: 999px; background: var(--grad);
  position: relative; transition: width 1.1s var(--transition);
}
.progress-bar.green { background: linear-gradient(90deg,#10b981,#34d399); }
.progress-bar.amber { background: linear-gradient(90deg,#f59e0b,#fbbf24); }
.progress-bar.striped::after {
  content: ""; position: absolute; inset: 0; background-size: 20px 20px;
  background-image: linear-gradient(45deg, rgba(255,255,255,.25) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.25) 50%, rgba(255,255,255,.25) 75%, transparent 75%, transparent);
  animation: stripeMove 1.2s linear infinite;
}
@keyframes stripeMove { to { background-position: 20px 0; } }

.freedom-ring { position: relative; width: 190px; height: 190px; }
.freedom-ring svg { transform: rotate(-90deg); }
.freedom-ring .ring-bg { stroke: var(--surface-3); }
.freedom-ring .ring-val { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset 1.4s var(--transition); }
.freedom-ring .ring-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.freedom-ring .ring-center .big { font-size: 1.6rem; font-weight: 800; }
.freedom-ring .ring-center .lbl { font-size: .76rem; color: var(--text-3); font-weight: 600; }

/* ------------------------------------------------------------- layout */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 18px 14px; z-index: 40;
  transition: transform .3s var(--transition);
}
.sidebar-head { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  background: var(--grad); color: #fff; font-weight: 800; font-size: 1.3rem;
  box-shadow: 0 8px 18px rgba(99,102,241,.4);
}
.brand-mark.small { width: 34px; height: 34px; border-radius: 11px; font-size: 1.1rem; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 800; font-size: 1.02rem; }
.brand-sub { font-size: .72rem; color: var(--text-3); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 13px;
  color: var(--text-2); font-weight: 700; font-size: .92rem; position: relative; transition: all .2s var(--transition);
}
.nav-item:hover { background: var(--surface-2); color: var(--text); transform: translateX(2px); }
.nav-item.active { background: var(--grad); color: #fff; box-shadow: 0 8px 18px rgba(99,102,241,.35); }
.nav-item .nav-icon { font-size: 1.1rem; }
.nav-item .pill-count {
  margin-left: auto; background: var(--danger); color: #fff; font-size: .7rem; font-weight: 800;
  min-width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center; padding: 0 6px;
}
.logout-item.active { background: var(--danger-soft); color: var(--danger); }

.sidebar-foot { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 8px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 12px 8px 2px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--grad); color: #fff;
  display: grid; place-items: center; font-weight: 800; flex-shrink: 0;
}
.avatar-sm { width: 34px; height: 34px; font-size: .9rem; }
.user-name { font-weight: 800; font-size: .9rem; line-height: 1.2; }
.user-mail { font-size: .74rem; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; max-width: 150px; }

.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px;
  padding: 14px 24px; background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-search { flex: 1; max-width: 460px; position: relative; }
.search-input { padding-right: 40px; }
.search-drop {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; z-index: 60;
}
.search-drop .s-item { display: flex; gap: 10px; padding: 11px 14px; cursor: pointer; align-items: center; }
.search-drop .s-item:hover { background: var(--surface-2); }
.search-drop .s-item .s-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); }
.search-drop .s-empty { padding: 16px; text-align: center; color: var(--text-3); font-size: .86rem; }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.content { padding: 24px; max-width: 1400px; width: 100%; margin: 0 auto; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.page-header .date-chip { color: var(--text-2); font-size: .9rem; font-weight: 600; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .eyebrow { color: var(--primary); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; font-size: .72rem; margin-bottom: 4px; }
.page-head h1 { font-size: 1.6rem; letter-spacing: -.02em; margin: 0; }
.page-head .page-subtle { color: var(--text-3); margin: 4px 0 0; font-size: .9rem; }
.calendar-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cal-title { font-size: 1.1rem; font-weight: 800; letter-spacing: -.01em; padding: 0 8px; min-width: 160px; text-align: center; color: var(--text); font-variant-numeric: tabular-nums; }

.menu-btn { display: none; }
.sidebar-overlay { position: fixed; inset: 0; background: rgba(8,12,28,.5); z-index: 35; backdrop-filter: blur(2px); }
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 45; display: none;
  background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(14px);
  border-top: 1px solid var(--border); padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: .64rem; font-weight: 700; color: var(--text-3); padding: 6px 2px; border-radius: 10px;
}
.bottom-nav a .b-ico { font-size: 1.25rem; }
.bottom-nav a.active { color: var(--primary); background: var(--primary-soft); }

/* ------------------------------------------------------------- grids */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.masonry { columns: 2; column-gap: 16px; }
.masonry > * { break-inside: avoid; margin-bottom: 16px; }
.row { display: flex; gap: 12px; }
.row.between { justify-content: space-between; }
.vcenter { align-items: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.flex-1 { flex: 1; }
.mt-1{margin-top:6px}.mt-2{margin-top:12px}.mt-3{margin-top:18px}.mt-4{margin-top:26px}
.mb-1{margin-bottom:6px}.mb-2{margin-bottom:12px}.mb-3{margin-bottom:18px}.mb-4{margin-bottom:26px}
.ta-c { text-align: center; }
.w-100 { width: 100%; }

/* ------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--border); }
table.table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 640px; }
.table th {
  text-align: left; padding: 12px 14px; font-size: .74rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-3); background: var(--surface-2);
  border-bottom: 1px solid var(--border); white-space: nowrap; font-weight: 800;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .16s var(--transition); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .money { font-weight: 700; font-variant-numeric: tabular-nums; }
.table .loan-cell { display: flex; align-items: center; gap: 10px; }
.table .cell-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); font-size: .95rem; }
.table-actions { display: flex; gap: 6px; }
.t-row-actions { display: flex; justify-content: flex-end; gap: 6px; }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.pagination .page-btns { display: flex; gap: 6px; }
.page-btn { min-width: 36px; height: 36px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; font-weight: 700; }
.page-btn:hover:not([disabled]) { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--grad); color: #fff; border-color: transparent; }
.page-btn[disabled] { opacity: .4; cursor: not-allowed; }

/* ------------------------------------------------------------- alerts */
.alert { padding: 12px 16px; border-radius: 13px; font-size: .9rem; font-weight: 600; margin-bottom: 14px; line-height: 1.5; }
.alert-danger { background: var(--danger-soft); color: var(--danger); }
.alert-success { background: var(--accent-soft); color: var(--accent); }
.alert-info { background: var(--info-soft); color: var(--info); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.alert .link { color: inherit; text-decoration: underline; }

/* ------------------------------------------------------------- modals */
.modal-overlay {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px;
  background: rgba(8,12,28,.55); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity .25s var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 24px; transform: translateY(16px) scale(.97);
  transition: transform .3s var(--transition), opacity .3s var(--transition);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal .modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal .modal-head h3 { margin: 0; font-size: 1.12rem; }
.modal-x { border: 0; background: var(--surface-2); width: 34px; height: 34px; border-radius: 10px; cursor: pointer; font-size: 1rem; color: var(--text-2); }
.modal-x:hover { background: var(--danger-soft); color: var(--danger); }

/* ------------------------------------------------------------- toasts */
.toast-root { position: fixed; bottom: 20px; right: 20px; z-index: 120; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-md);
  padding: 13px 16px; display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: .9rem;
  transform: translateX(120%); transition: transform .4s var(--transition), opacity .3s;
}
.toast.show { transform: translateX(0); }
.toast .t-ico { font-size: 1.1rem; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); }
.toast.error .t-ico { background: var(--danger-soft); }
.toast.error { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }

/* ------------------------------------------------------------- empty / loading */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-3); }
.empty-state .e-ico { font-size: 2.6rem; margin-bottom: 10px; }
.empty-state h4 { color: var(--text-2); }
.skeleton { border-radius: 10px; background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-top-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loader-wrap { display: grid; place-items: center; padding: 40px; color: var(--text-3); }

/* ------------------------------------------------------------- calendar */
.calendar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-wrap { }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-week { margin-bottom: 8px; }
.cal-week > div, .cal-weekday { text-align: center; font-size: .74rem; font-weight: 800; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; padding: 6px; }
.cal-grid { margin-bottom: 8px; }
.cal-cell {
  min-height: 92px; border: 1px solid var(--border); border-radius: 13px; padding: 8px;
  background: var(--surface); position: relative; transition: all .2s var(--transition);
}
.cal-cell:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.cal-cell.muted, .cal-cell.empty { background: transparent; border: 1px dashed var(--border); }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--primary); }
.cal-cell .cal-num { font-size: .84rem; font-weight: 800; color: var(--text-2); margin-bottom: 6px; }
.cal-cell.today .cal-num { color: var(--primary); }

.cal-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 14px; font-size: .78rem; font-weight: 700; color: var(--text-2); }
.legend-ico { display: inline-flex; align-items: center; gap: 5px; }
.legend-ico.due { color: var(--info); } .legend-ico.paid { color: var(--accent); } .legend-ico.overdue { color: var(--danger); }
.legend-total { margin-left: auto; color: var(--text-3); }

.day-chip {
  display: block; width: 100%; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: .68rem; font-weight: 700; padding: 4px 7px; border-radius: 8px; margin-bottom: 4px;
  border: none; cursor: pointer; transition: transform .15s var(--transition), box-shadow .15s var(--transition);
}
.day-chip:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.day-chip.pending { background: var(--info-soft); color: var(--info); }
.day-chip.paid { background: var(--accent-soft, #e7f6f1); color: var(--accent); }
.day-chip.overdue { background: var(--danger-soft); color: var(--danger); }
.cal-cell.muted .day-chip { display: none; }
.cal-day-toggle { margin-left: auto; }
.cal-item {
  display: flex; align-items: center; gap: 5px; font-size: .68rem; font-weight: 700; padding: 3px 7px;
  border-radius: 7px; margin-bottom: 4px; cursor: pointer; color: var(--text-2); transition: transform .15s var(--transition);
}
.cal-item:hover { transform: translateX(2px); }
.cal-item.due { background: var(--info-soft); color: var(--info); }
.cal-item.paid { background: var(--accent-soft); color: var(--accent); }
.cal-item.overdue { background: var(--danger-soft); color: var(--danger); }
.cal-item .cal-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.cal-more { font-size: .68rem; color: var(--text-3); font-weight: 700; padding-left: 4px; cursor: pointer; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; font-size: .8rem; color: var(--text-2); font-weight: 600; }
.legend .lg { display: flex; align-items: center; gap: 6px; }
.legend .lg i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ------------------------------------------------------------- reminders / timeline */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--border); border-radius: 2px; }
.tl-item { position: relative; padding: 0 0 18px 12px; }
.tl-item::before {
  content: ""; position: absolute; left: -22px; top: 5px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--info); box-sizing: border-box;
}
.tl-item.done::before { border-color: var(--accent); background: var(--accent); }
.tl-item.danger::before { border-color: var(--danger); background: var(--danger); }
.tl-item .tl-title { font-weight: 800; font-size: .94rem; }
.tl-item .tl-sub { color: var(--text-3); font-size: .82rem; }
.tl-item .tl-time { font-size: .8rem; color: var(--text-2); font-weight: 600; }

/* ------------------------------------------------------------- stats / hero boxes */
.stat-list { display: flex; flex-direction: column; gap: 12px; }
.stat-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-item .s-label { color: var(--text-2); font-size: .88rem; font-weight: 600; }
.stat-item .s-value { font-weight: 800; font-variant-numeric: tabular-nums; }

.milestone-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 2px; border-bottom: 1px dashed var(--border); }
.milestone-item .m-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 1.1rem; background: var(--surface-3); flex-shrink: 0; }
.milestone-item.locked { opacity: .5; }
.milestone-item .m-title { font-weight: 800; font-size: .92rem; }
.milestone-item .m-desc { color: var(--text-3); font-size: .82rem; }

.quote-block { position: relative; padding: 22px; background: var(--grad-soft); border-radius: var(--radius); border: 1px solid var(--border); }
.quote-block .q-mark { font-size: 1.4rem; }
.quote-block p { font-size: 1.05rem; font-weight: 600; color: var(--text); margin: 0; }

/* ------------------------------------------------------------- celebration */
.celebrate-screen { text-align: center; padding: 18px 6px; }
.checkmark-wrap { position: relative; width: 130px; height: 130px; margin: 0 auto 14px; }
.checkmark-wrap .checkmark-circle { stroke-dasharray: 320; stroke-dashoffset: 320; animation: drawCircle .7s var(--transition) forwards; }
.checkmark-wrap .checkmark-check { stroke-dasharray: 80; stroke-dashoffset: 80; animation: drawCheck .4s .6s var(--transition) forwards; }
@keyframes drawCircle { to { stroke-dashoffset: 0; } }
@keyframes drawCheck { to { stroke-dashoffset: 0; } }
.celebrate-screen .ce-tag { font-size: .8rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.celebrate-screen h2 { font-size: 1.7rem; margin: 6px 0 4px; }
.celebrate-screen .ce-sub { color: var(--text-2); font-size: .96rem; }
.celebrate-part { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-radius: 14px; background: var(--surface-2); margin: 8px 0; }
.celebrate-part .c-label { color: var(--text-3); font-size: .8rem; font-weight: 700; }
.celebrate-part .c-value { font-weight: 800; font-variant-numeric: tabular-nums; }

.confetti-piece { position: fixed; top: -20px; width: 10px; height: 14px; z-index: 150; animation: confettiFall linear forwards; pointer-events: none; }
@keyframes confettiFall { to { transform: translateY(110vh) rotate(720deg); opacity: .2; } }

/* ------------------------------------------------------------- auth pages */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1100px 500px at 15% -10%, rgba(99,102,241,.18), transparent 60%),
    radial-gradient(900px 500px at 100% 10%, rgba(16,185,129,.14), transparent 55%),
    var(--bg); }
.auth-wrap { width: 100%; max-width: 460px; }
.auth-card { padding: 30px; }
.brand-lockup { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.brand-lockup .brand-name { font-size: 1.15rem; }
.brand-tag { margin: 0; color: var(--text-3); font-size: .88rem; }
.auth-switch { text-align: center; margin-top: 18px; font-size: .9rem; color: var(--text-2); }
.auth-hint { text-align: center; margin-top: 10px; font-size: .8rem; color: var(--text-3); }
.auth-body .glass { background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(18px); }

/* ------------------------------------------------------------- landing */
.land-body { background: var(--bg); overflow-x: hidden; }
.land-nav {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 20px;
  padding: 14px clamp(18px, 5vw, 64px);
  background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.land-nav .spacer { flex: 1; }
.land-nav a.ln { color: var(--text-2); font-weight: 700; font-size: .92rem; transition: color .2s; }
.land-nav a.ln:hover { color: var(--primary); }
.hero { position: relative; padding: clamp(40px, 8vw, 92px) clamp(18px, 5vw, 64px) 60px; display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; max-width: 1280px; margin: 0 auto; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: .8rem; padding: 7px 14px; border-radius: 999px; margin-bottom: 18px; }
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.1; }
.hero .lead { color: var(--text-2); font-size: clamp(1rem, 2vw, 1.15rem); max-width: 520px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }
.hero-note { color: var(--text-3); font-size: .84rem; margin-top: 14px; }

.hero-visual { position: relative; }
.hero-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 22px; max-width: 420px; margin: 0 auto;
  animation: floaty 7s ease-in-out infinite;
}
.hero-card .hc-top { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.hero-card .hc-top .hc-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--grad); color: #fff; }
.hero-card .hc-top .hc-name { font-weight: 800; }
.hero-card .hc-top .hc-pill { margin-left: auto; }
.mini-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.mini-kpi { background: var(--surface-2); border-radius: 12px; padding: 12px; }
.mini-kpi .mk-label { font-size: .68rem; color: var(--text-3); font-weight: 700; }
.mini-kpi .mk-val { font-weight: 800; font-size: 1.02rem; font-variant-numeric: tabular-nums; }
.hero-float {
  position: absolute; background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-md); padding: 12px 16px; display: flex; align-items: center; gap: 10px;
  animation: floaty 6s ease-in-out .8s infinite;
}
.hero-float.f1 { top: -14px; right: -6px; }
.hero-float.f2 { bottom: -16px; left: -10px; animation-delay: 1.6s; }
.hero-float .f-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); }
.hero-float .f-txt { font-weight: 800; font-size: .9rem; line-height: 1.2; }
.hero-float .f-txt small { display: block; font-weight: 600; color: var(--text-3); font-size: .74rem; }

@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

.section { padding: clamp(44px, 7vw, 84px) clamp(18px, 5vw, 64px); max-width: 1200px; margin: 0 auto; }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 40px; }
.section-head .eyebrow { color: var(--primary); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; font-size: .8rem; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.section-head p { color: var(--text-2); }

.stats-band {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px;
  background: var(--grad); border-radius: var(--radius-lg); color: #fff; padding: 34px 28px;
  box-shadow: 0 24px 60px rgba(99,102,241,.4);
}
.stat-box { text-align: center; }
.stat-box .sb-val { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; }
.stat-box .sb-lbl { font-size: .86rem; opacity: .85; font-weight: 600; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.feature-card { padding: 24px; }
.feature-card .f-ico { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; font-size: 1.4rem; background: var(--primary-soft); margin-bottom: 14px; }
.feature-card:nth-child(2n) .f-ico { background: var(--accent-soft); }
.feature-card:nth-child(3n) .f-ico { background: var(--warn-soft); }
.feature-card h3 { font-size: 1.05rem; }
.feature-card p { color: var(--text-2); font-size: .88rem; }

.loop-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; counter-reset: step; }
.loop-step { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 26px 20px 20px; transition: all .3s var(--transition); }
.loop-step:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.loop-step::before { counter-increment: step; content: counter(step); position: absolute; top: -14px; left: 20px; background: var(--grad); color: #fff; font-weight: 800; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 6px 14px rgba(99,102,241,.4); }
.loop-step .ls-ico { font-size: 1.6rem; margin-bottom: 8px; }
.loop-step h4 { margin: 0 0 4px; }
.loop-step p { color: var(--text-2); font-size: .84rem; margin: 0; }

.faq-wrap { max-width: 760px; margin: 0 auto; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; margin-bottom: 12px; overflow: hidden; transition: box-shadow .25s; }
.faq-item.open { box-shadow: var(--shadow-sm); }
.faq-q { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; background: none; border: 0; cursor: pointer; font-weight: 800; font-size: .96rem; color: var(--text); text-align: left; }
.faq-q .faq-plus { transition: transform .3s var(--transition); color: var(--primary); font-size: 1.2rem; }
.faq-item.open .faq-plus { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .35s var(--transition); }
.faq-a p { padding: 0 20px 16px; color: var(--text-2); font-size: .9rem; margin: 0; }

.step-list { display: grid; gap: 14px; }
.step { display: grid; gap: 2px; }
.step b { font-size: .93rem; }
.step span { color: var(--text-2); font-size: .9rem; line-height: 1.55; }
.step a { color: var(--primary); }

.land-footer { border-top: 1px solid var(--border); padding: 28px clamp(18px,5vw,64px); color: var(--text-3); font-size: .84rem; display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* ------------------------------------------------------------- utility helpers */
.divider { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.fade-up { opacity: 0; transform: translateY(14px); animation: fadeUp .6s var(--transition) forwards; }
.fade-up.d1 { animation-delay: .08s; } .fade-up.d2 { animation-delay: .16s; }
.fade-up.d3 { animation-delay: .24s; } .fade-up.d4 { animation-delay: .32s; }
.fade-up.d5 { animation-delay: .4s; } .fade-up.d6 { animation-delay: .48s; }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

.tag-line { display: flex; align-items: center; gap: 8px; color: var(--primary); font-weight: 800; font-size: .84rem; margin-bottom: 10px; }
.tag-line .tl-ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); }

.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 220px; }

.notif-item { display: flex; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--border); align-items: flex-start; }
.notif-item:last-child { border-bottom: 0; }
.notif-item .n-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); flex-shrink: 0; font-size: 1.1rem; }
.notif-item.unread .n-ico { background: var(--primary-soft); }
.notif-item .n-title { font-weight: 800; font-size: .93rem; }
.notif-item .n-msg { color: var(--text-2); font-size: .86rem; }
.notif-item .n-date { color: var(--text-3); font-size: .76rem; }
.notif-item.unread { background: color-mix(in srgb, var(--primary-soft) 40%, transparent); border-radius: 12px; }

.tabbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 18px 0 14px; }
.tabs .tab { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 11px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 700; font-size: .88rem; cursor: pointer; transition: all .2s var(--transition); white-space: nowrap; }
.tab { padding: 9px 16px; border-radius: 11px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 700; font-size: .88rem; cursor: pointer; transition: all .2s var(--transition); }
.tab.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(99,102,241,.3); }
.tab:hover:not(.active) { border-color: var(--primary); color: var(--primary); }
.tab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); font-size: .72rem; font-weight: 800; }
.tab.active .tab-count { background: rgba(255,255,255,.22); color: #fff; }
.tab-pane { display: block; }
.tab-pane[hidden] { display: none; }
.row-acts { display: inline-flex; gap: 6px; align-items: center; }
.chip-soft { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--text-2); font-size: .68rem; padding: 2px 8px; border-radius: 999px; font-weight: 700; text-transform: capitalize; }

/* ---- payoff priority (highest-interest loan) ---- */
.prio-card { margin-top: 18px; }
.prio-hero { border-radius: 16px; padding: 18px; background: linear-gradient(135deg, #7c3aed 0%, var(--primary) 55%, #6366f1 100%); color: #fff; }
.prio-hero-top { display: flex; align-items: flex-start; gap: 14px; }
.prio-flame { font-size: 2rem; line-height: 1; filter: drop-shadow(0 4px 10px rgba(255, 150, 0, .45)); }
.prio-flag { display: inline-flex; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.2); font-size: .7rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; margin-bottom: 6px; }
.prio-lname { font-size: 1.25rem; font-weight: 800; line-height: 1.2; }
.prio-rate-big { text-align: right; font-size: 2.1rem; font-weight: 900; line-height: 1; white-space: nowrap; }
.prio-rate-big small { display: block; font-size: .7rem; font-weight: 700; opacity: .8; margin-top: 2px; }
.prio-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.prio-stats div { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.18); border-radius: 12px; padding: 10px 12px; }
.prio-stats span { display: block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; opacity: .85; margin-bottom: 2px; }
.prio-stats b { font-size: 1rem; font-weight: 800; }
.prio-progress { margin-top: 14px; }
.prio-hero .progress { background: rgba(255,255,255,.22); }
.prio-hero .progress .progress-bar { background: #4ade80; }
.prio-hero .row.small .muted, .prio-hero .muted { color: rgba(255,255,255,.8); }
.prio-cta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.prio-all-btn { width: 100%; justify-content: center; margin-top: 8px; }
.prio-list { margin-top: 12px; display: grid; gap: 6px; }
.prio-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; background: var(--surface-2); border: 1.5px solid var(--border); text-decoration: none; color: var(--text); transition: border-color .2s var(--transition), transform .2s var(--transition); }
.prio-row:hover { border-color: var(--primary); transform: translateX(3px); }
.prio-row.prio-top { border-color: var(--primary); box-shadow: 0 4px 14px rgba(99,102,241,.18); }
.prio-num { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); font-size: .75rem; font-weight: 800; color: var(--text-2); flex: none; }
.prio-top .prio-num { background: var(--grad); color: #fff; border-color: transparent; }
.prio-name { flex: 1 1 28%; min-width: 0; font-weight: 800; font-size: .87rem; line-height: 1.25; }
.prio-name small { display: block; font-weight: 600; color: var(--text-3); font-size: .72rem; }
.prio-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.prio-emi-prog { height: 5px; max-width: 240px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.prio-emi-prog i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #10b981, #34d399); transition: width 1s var(--transition); }
.prio-overdue .prio-emi-prog i { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.prio-emi-meta { font-size: .72rem; font-weight: 600; color: var(--text-3); }
.prio-out { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: .88rem; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.prio-out small { font-weight: 700; color: var(--text-3); font-size: .68rem; }
.prio-top .prio-out small { color: #b45309; }
.prio-bar-wrap { flex: 1 1 34%; height: 8px; border-radius: 999px; background: var(--surface); overflow: hidden; }
.prio-bar { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), #a78bfa); }
.prio-top .prio-bar { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.prio-rate { font-weight: 800; font-size: .9rem; color: var(--text-2); min-width: 56px; text-align: right; }
.prio-rate.hot { color: #f59e0b; font-size: 1.02rem; }

/* ---- hot loan card (loans page) ---- */
.loan-card.loan-hot { border: 2px solid #f59e0b; box-shadow: 0 10px 28px rgba(245, 158, 11, .28); position: relative; }
.loan-hot-banner { display: flex; align-items: center; gap: 6px; margin: -20px -20px 16px; padding: 8px 16px; border-radius: var(--radius) var(--radius) 0 0; background: linear-gradient(90deg, #f59e0b, #fbbf24); color: #1e1b16; font-size: .74rem; font-weight: 800; letter-spacing: .02em; }
.hot-rate { color: #f59e0b; font-weight: 900; transform: scale(1.08); display: inline-block; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: .8rem; font-weight: 700; color: var(--text-2); }

.filters-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters-bar .input, .filters-bar .select { width: auto; min-width: 150px; }

.upload-drop { border: 2px dashed var(--border-2); border-radius: 16px; padding: 40px 20px; text-align: center; cursor: pointer; transition: all .25s var(--transition); }
.upload-drop:hover, .upload-drop.drag { border-color: var(--primary); background: var(--primary-soft); }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .masonry { columns: 1; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: inline-flex; }
  .bottom-nav { display: flex; }
  .content { padding: 18px 14px 96px; }
  .hero { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .hero-float { display: none; }
  .topbar { padding: 12px 14px; }
  .topbar-search { max-width: 100%; }
}
@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi .kpi-value { font-size: 1.25rem; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .table-wrap { border-radius: 12px; }
  .calendar-grid { gap: 5px; }
  .calendar-nav, .page-head { flex-direction: column; align-items: flex-start; }
  .calendar-nav { width: 100%; }
  .calendar-nav .btn { flex: 1; text-align: center; }
  .cal-title { order: -1; min-width: 0; width: 100%; }
  .cal-cell { min-height: 74px; padding: 6px; }
  .modal { padding: 20px; }
  .filters-bar .input, .filters-bar .select { width: 100%; }
  .stats-band { padding: 26px 18px; }
}