@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── Design Tokens ─────────────────────────────────────── */
:root {
  color-scheme: dark;
  --bg: #060913;
  --bg-grad: radial-gradient(circle at 50% 0%, #0d1527 0%, #060913 70%);
  --surface: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --surface-strong: rgba(255, 255, 255, 0.08);
  --glass: rgba(10, 15, 30, 0.7);
  --glass-border: rgba(255, 255, 255, 0.05);
  --ink: #f1f5f9;
  --ink-secondary: #94a3b8;
  --ink-muted: #64748b;
  --line: rgba(255, 255, 255, 0.04);
  --line-strong: rgba(255, 255, 255, 0.08);

  --accent: #6366f1;
  --accent-soft: rgba(99, 102, 241, 0.12);
  --accent-glow: rgba(99, 102, 241, 0.25);
  --accent-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  
  --teal: #14b8a6;
  --teal-soft: rgba(20, 184, 166, 0.12);
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.12);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.12);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.12);
  --blue: #3b82f6;
  --blue-soft: rgba(59, 130, 246, 0.12);
  --pink: #ec4899;
  --pink-soft: rgba(236, 72, 153, 0.12);

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 50px rgba(99, 102, 241, 0.05);
  
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  
  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background: var(--bg-grad);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
}

/* Ambient glow accents */
body::before {
  content: '';
  position: fixed;
  top: -10%;
  left: 20%;
  width: 60vw;
  height: 60vh;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.07) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -10%;
  right: 10%;
  width: 50vw;
  height: 50vh;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

/* ── Layout & Structure ─────────────────────────────────── */
.app {
  display: flex;
  position: relative;
  z-index: 1;
  min-height: 100vh;
  width: 100%;
  margin: 0;
  padding: 0;
}

.content-wrapper {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 32px 80px;
  width: 100%;
}

/* ── Desktop Navigation Sidebar ────────────────────────── */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 280px;
  background: rgba(8, 12, 24, 0.75);
  border-right: 1px solid var(--glass-border);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  padding: 36px 20px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  flex-shrink: 0;
  z-index: 99;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 6px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.brand-icon i {
  color: #fff;
  width: 22px;
  height: 22px;
}

.sidebar-brand h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #fff;
}

.brand-status {
  font-size: 10px;
  color: var(--teal);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 4px;
}

.brand-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 8px var(--teal);
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  color: var(--ink-secondary);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.menu-item i {
  width: 20px;
  height: 20px;
  transition: transform var(--transition);
}

.menu-item:hover {
  color: #fff;
  background: var(--surface);
  transform: translateX(4px);
}

.menu-item:hover i {
  transform: scale(1.1);
}

.menu-item.active {
  color: #fff;
  background: var(--accent-soft);
  border-color: rgba(99, 102, 241, 0.2);
  box-shadow: inset 0 0 10px rgba(99, 102, 241, 0.1);
}

.menu-item.active i {
  color: var(--accent);
}

/* ── Content Header ───────────────────────────────────── */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 32px;
}

.eyebrow {
  margin: 0 0 8px;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(32px, 4vw, 42px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff 40%, var(--ink-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  margin: 0;
  max-width: 650px;
  color: var(--ink-secondary);
  font-size: 15px;
  line-height: 1.6;
}

/* Month Card component */
.month-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 240px;
  box-shadow: var(--shadow-sm);
}

.month-selector-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.month-selector-title i {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

.month-card label {
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.month-card input[type="month"] {
  border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  color: #fff;
  font-weight: 700;
  outline: none;
}

.month-card input[type="month"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ── Panel Styling (Glass Cards) ───────────────────────── */
.panel {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 24px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.panel:hover {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow), var(--shadow-glow);
  transform: translateY(-2px);
}

.panel-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.panel-head-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  color: var(--accent);
  flex-shrink: 0;
}

.panel-head-icon i {
  width: 20px;
  height: 20px;
}

.panel-head.border-accent .panel-head-icon {
  background: var(--accent-soft);
  border-color: rgba(99, 102, 241, 0.2);
}

.panel h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #fff;
}

.muted {
  color: var(--ink-secondary);
  font-size: 13px;
  margin: 4px 0 0;
}

.tiny {
  color: var(--ink-muted);
  font-size: 12px;
  margin: 0;
}

/* ── Fields & Forms ────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

input, select {
  width: 100%;
  min-height: 46px;
  padding: 11px 16px;
  color: #fff;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: all var(--transition);
}

input:focus, select:focus {
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 20px rgba(99, 102, 241, 0.1);
}

input::placeholder {
  color: var(--ink-muted);
}

/* Input Units wrapper */
.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-wrap input {
  padding-right: 36px;
}

.input-unit {
  position: absolute;
  right: 16px;
  color: var(--ink-muted);
  font-weight: 700;
  font-size: 14px;
  pointer-events: none;
}

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: all var(--transition);
  background: var(--surface);
  color: var(--ink);
}

.btn i {
  width: 16px;
  height: 16px;
}

.btn:hover {
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn.primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn.primary:hover {
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
  filter: brightness(1.1);
}

.btn.success {
  background: linear-gradient(135deg, var(--green) 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.btn.success:hover {
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
  filter: brightness(1.1);
}

.btn.ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink-secondary);
}

.btn.ghost:hover {
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
  background: var(--surface);
}

.btn.ghost.danger:hover {
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--red);
  background: var(--red-soft);
}

.btn.small {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 12px;
  border-radius: var(--radius-xs);
}

.btn.small i {
  width: 14px;
  height: 14px;
}

.btn.primary-glow[aria-pressed="true"] {
  background: var(--green-soft);
  border-color: rgba(16, 185, 129, 0.2);
  color: var(--green);
}

/* ── Split & Spacing Utilities ─────────────────────────── */
.split-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.button-row.compact {
  gap: 8px;
}

.pt-10 { padding-top: 10px; }
.pt-15 { padding-top: 15px; }
.pt-20 { padding-top: 20px; }

/* ── Privacy Note ──────────────────────────────────────── */
.privacy-note {
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: var(--radius);
  padding: 16px 20px;
  color: var(--amber);
  font-size: 13px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.privacy-note i {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ── Summary & Metrics Grid ────────────────────────────── */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.metric {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all var(--transition);
}

.metric:hover {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
}

.metric .label {
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.metric .value {
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.02em;
}

.metric .note {
  font-size: 12px;
  color: var(--ink-muted);
}

.metric.danger {
  border-color: rgba(239, 68, 68, 0.15);
  background: rgba(239, 68, 68, 0.02);
}

.metric.danger .value {
  color: var(--red);
}

.metric.warn {
  border-color: rgba(245, 158, 11, 0.15);
  background: rgba(245, 158, 11, 0.02);
}

.metric.warn .value {
  color: var(--amber);
}

.metric.wide {
  grid-column: span 1;
}

@media (min-width: 992px) {
  .metric.wide {
    grid-column: span 2;
  }
}

/* ── Section Headings ───────────────────────────────────── */
.section {
  margin: 36px 0;
  scroll-margin-top: 20px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.section-head-title {
  display: flex;
  gap: 16px;
  align-items: center;
}

.section-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.section-icon i {
  width: 20px;
  height: 20px;
}

/* ── Expense Row Dynamic Inputs ────────────────────────── */
.expense-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 14px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Due Card & Reminders ──────────────────────────────── */
.due-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: all var(--transition);
}

.due-card:hover {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.due-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
}

.source-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.source-dot.shopee  { background: #f97316; box-shadow: 0 0 10px rgba(249, 115, 22, 0.5); }
.source-dot.kredivo { background: #38bdf8; box-shadow: 0 0 10px rgba(56, 189, 248, 0.5); }
.source-dot.vpbank  { background: var(--green); box-shadow: 0 0 10px rgba(16, 185, 129, 0.5); }
.source-dot.zalopay { background: var(--blue); box-shadow: 0 0 10px rgba(59, 130, 246, 0.5); }
.source-dot.momo    { background: var(--pink); box-shadow: 0 0 10px rgba(236, 72, 153, 0.5); }

.chip {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
}

.chip.green  { background: var(--green-soft); color: var(--green); }
.chip.amber  { background: var(--amber-soft); color: var(--amber); }
.chip.red    { background: var(--red-soft); color: var(--red); }
.chip.blue   { background: var(--blue-soft); color: var(--blue); }
.chip.teal   { background: var(--teal-soft); color: var(--teal); }
.chip.gray   { background: var(--surface-strong); color: var(--ink-secondary); }

.due-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 6px;
  color: var(--ink-secondary);
  font-size: 12px;
}

.due-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.due-icon {
  width: 13px;
  height: 13px;
  color: var(--ink-muted);
}

.note-text {
  color: var(--amber);
}

.due-card .amount {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin-left: auto;
  letter-spacing: -0.01em;
}

/* ── Postpaid Cards ────────────────────────────────────── */
.postpaid-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
}

.postpaid-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: all var(--transition);
}

.postpaid-card:hover {
  border-color: rgba(255, 255, 255, 0.08);
}

.postpaid-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.postpaid-note {
  font-size: 12px;
  color: var(--ink-secondary);
  margin: 6px 0 0;
  line-height: 1.5;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

.checkbox-row span {
  font-size: 12px;
  color: var(--ink-secondary);
  font-weight: 600;
  line-height: 1.4;
}

.postpaid-total {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  row-gap: 8px;
  column-gap: 12px;
  font-size: 12px;
}

.postpaid-total span {
  color: var(--ink-secondary);
}

.postpaid-total strong {
  text-align: right;
  color: #fff;
  font-weight: 700;
}

/* ── Loan Card with Progress bar ────────────────────────── */
.loan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.loan-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: all var(--transition);
}

.loan-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.loan-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
}

.loan-meta {
  color: var(--ink-secondary);
  font-size: 13px;
}

/* Progress bar container */
.loan-progress-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--line);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
}

.loan-progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 99px;
  overflow: hidden;
}

.loan-progress-bar {
  height: 100%;
  background: var(--accent-grad);
  border-radius: 99px;
  box-shadow: 0 0 10px var(--accent-glow);
  transition: width 0.5s ease-out;
}

.loan-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}

.loan-progress-label span {
  color: var(--ink-muted);
  font-weight: 700;
  text-transform: uppercase;
}

.loan-progress-label strong {
  color: var(--accent);
}

.loan-stats {
  display: flex;
  gap: 20px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.loan-stats .stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.loan-stats small {
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.loan-stats strong {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

.next-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.next-box .due-meta {
  margin-top: 4px;
  gap: 12px;
}

.next-box .due-meta span {
  font-size: 11px;
}

.statement-link-tag {
  color: var(--ink-muted);
}

.empty-installment {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: rgba(16, 185, 129, 0.04);
  border: 1px dashed rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-sm);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.empty-installment i {
  width: 16px;
  height: 16px;
}

/* ── Calendar / Installments Table ─────────────────────── */
.table-wrap {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

th, td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--ink-secondary);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
  background: rgba(0, 0, 0, 0.15);
}

tr:last-child td {
  border-bottom: none;
}

tr {
  transition: background var(--transition);
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.amount-cell {
  font-weight: 800;
  color: #fff;
}

/* ── Cloud Sync Status box ──────────────────────────────── */
.sync-info-box {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--line);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.sync-icon-spin {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.sync-icon-spin i {
  width: 20px;
  height: 20px;
}

.sync-status {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--ink-secondary);
  font-size: 14px;
  font-weight: 600;
}

/* Empty data notices */
.empty {
  padding: 24px;
  text-align: center;
  color: var(--ink-muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
}

.empty strong {
  color: var(--ink-secondary);
}

/* ── Toast notifications ────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  z-index: 1000;
  font-weight: 700;
  font-size: 13px;
  opacity: 0;
  transform: translateY(12px) scale(0.95);
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
  backdrop-filter: blur(10px);
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ── Responsive breakpoints ─────────────────────────────── */

@media (max-width: 991px) {
  .app {
    flex-direction: column;
  }
  
  .sidebar {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    width: 100vw;
    padding: 0 12px;
    border-right: none;
    border-top: 1px solid var(--glass-border);
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    gap: 0;
    background: rgba(8, 12, 24, 0.9);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3);
  }
  
  .sidebar-brand {
    display: none;
  }
  
  .sidebar-menu {
    flex-direction: row;
    justify-content: space-around;
    width: 100%;
    height: 100%;
    align-items: center;
  }
  
  .menu-item {
    flex-direction: column;
    gap: 4px;
    padding: 6px 12px;
    font-size: 10px;
    border-radius: var(--radius-xs);
    flex: 1;
    justify-content: center;
    align-items: center;
  }
  
  .menu-item i {
    width: 20px;
    height: 20px;
  }

  .menu-item span {
    font-size: 9px;
  }
  
  .content-wrapper {
    padding: 24px 20px 100px;
  }

  .topbar {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }

  .month-card {
    min-width: auto;
  }
}

@media (max-width: 576px) {
  .content-wrapper {
    padding: 20px 16px 90px;
  }
  
  h1 {
    font-size: 28px;
  }
  
  .panel {
    padding: 16px;
  }
  
  .due-card {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .due-card .amount {
    margin-left: 0;
    font-size: 20px;
  }
  
  .due-card button {
    align-self: flex-start;
  }
  
  .expense-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .postpaid-grid {
    grid-template-columns: 1fr;
  }
  
  .postpaid-card {
    padding: 16px;
  }
  
  .loan-card {
    padding: 16px;
  }
  
  .next-box {
    flex-direction: column;
    align-items: stretch;
  }
  
  .next-box button {
    align-self: flex-start;
  }
}
