:root {
  /* Keuangan DS — light professional (ui-ux-pro-max adapted) */
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-soft: #eef2f7;
  --text: #0f172a;
  --muted: #475569; /* ≥4.5:1 on white */
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --primary: #1e40af;
  --primary-2: #1e3a8a;
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --info: #0284c7;
  --purple: #6d28d9;
  --ring: #1e40af;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 4px 6px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 15px rgba(15, 23, 42, 0.10);
  --radius-xl: 12px;
  --radius-lg: 10px;
  --radius-md: 8px;
  --radius-sm: 6px;
  --radius-pill: 999px;
  --space-xs: 2px;
  --space-sm: 4px;
  --space-md: 8px;
  --space-lg: 12px;
  --space-xl: 16px;
  --space-2xl: 24px;
  --touch: 44px;
  --font: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --transition: 180ms ease;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}

button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 16px; } /* avoid iOS zoom */
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Keyboard focus — never remove without replacement */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
button:focus-visible,
a:focus-visible,
.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible,
.nav-item:focus-visible,
.cur-chip:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ========== APP SHELL ========== */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
  .app-shell.has-sidebar {
    grid-template-columns: 280px 1fr;
  }
}

.sidebar {
  display: none;
  background: linear-gradient(160deg, #1e40af 0%, #2563eb 100%);
  color: #fff;
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}
@media (min-width: 1024px) {
  .app-shell.has-sidebar .sidebar { display: flex; }
}

@media (max-width: 1023px) {
  .app-shell.has-sidebar { grid-template-columns: 1fr !important; }
  .app-shell.has-sidebar .sidebar { display: none !important; }
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 6px 12px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-badge {
  width: 54px; height: 54px;
  border-radius: 18px;
  display: block;
  object-fit: cover;
  background: rgba(255,255,255,.12);
  flex-shrink: 0;
}
.brand small {
  display: block; font-size: 12px;
  text-transform: uppercase; letter-spacing: .06em;
  color: #bfdbfe; margin-bottom: 6px;
}
.brand h2 { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.2; }
.brand p { margin: 6px 0 0; font-size: 12px; color: #bfdbfe; line-height: 1.5; }

.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side-nav .nav-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px; font-weight: 700;
  color: #cbd5e1;
  cursor: pointer;
  transition: .15s;
}
.side-nav .nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-nav .nav-item.active {
  background: var(--primary);
  color: #fff;
}
.side-nav .nav-item .badge {
  font-size: 11px; background: rgba(255,255,255,.18);
  padding: 2px 8px; border-radius: 999px;
}

.side-card {
  padding: 14px; border-radius: 16px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  font-size: 12px; color: #bfdbfe; line-height: 1.5;
}
.side-card strong { display: block; color: #fff; margin-bottom: 6px; font-size: 13px; }

.sidebar .user-card {
  padding: 12px; border-radius: 16px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; gap: 10px;
}
.sidebar .user-card .avatar {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; color: #fff; font-weight: 700;
}
.sidebar .user-card .info { flex: 1; min-width: 0; }
.sidebar .user-card .info strong { display: block; color: #fff; font-size: 13px; }
.sidebar .user-card .info small { color: #93c5fd; font-size: 11px; }
.sidebar .user-card button {
  background: rgba(239,68,68,.2); color: #fecaca; border: 1px solid rgba(239,68,68,.3);
  padding: 6px 10px; border-radius: 10px; font-size: 11px; font-weight: 800;
}
.sidebar .user-card button:hover { background: rgba(239,68,68,.3); }

.main { padding: 12px 12px calc(72px + env(safe-area-inset-bottom, 0px)); min-width: 0; }
@media (min-width: 1024px) { .main { padding: 20px 24px 32px; } }

.topbar {
  display: flex; flex-wrap: wrap;
  justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 14px;
  padding: 18px 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 55%, #3b82f6 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.20);
}
.topbar h1, .topbar p { color: inherit; }
.topbar p { opacity: .9; }
.topbar .toolbar .button.ghost,
.topbar .currency-switch {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.22);
  color: #fff;
}
.topbar .currency-switch button { color: rgba(255,255,255,.85); }
.topbar .currency-switch button.active {
  background: #fff;
  color: #1e40af;
}
.topbar h1 { margin: 0 0 6px; font-size: 24px; line-height: 1.15; font-weight: 700; color: #fff; }
@media (min-width: 768px) { .topbar h1 { font-size: 28px; } }
.topbar p { margin: 0; color: rgba(255,255,255,.92); font-size: 14px; line-height: 1.55; max-width: 760px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.currency-switch {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--surface-soft); border-radius: var(--radius-pill);
  border: 1px solid var(--line);
}
.currency-switch button {
  border: none; background: transparent;
  padding: 8px 14px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 800;
  color: var(--muted);
}
.currency-switch button.active {
  background: var(--primary);
  color: #fff;
  box-shadow: none;
}

.pill {
  padding: 9px 14px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--line);
  font-size: 12px; font-weight: 800; color: var(--muted);
}

/* ========== MOBILE TOPBAR (gradient) ========== */
.m-topbar {
  background: linear-gradient(160deg, #1e40af 0%, #2563eb 55%, #3b82f6 100%);
  color: #fff;
  margin: -12px -12px 0;
  padding: 14px 14px 16px;
  padding-top: max(14px, env(safe-area-inset-top, 0px));
  border-radius: 0 0 20px 20px;
  position: relative;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}
@media (min-width: 1024px) {
  .m-topbar { display: none; }
}
.m-topbar .subtle {
  font-size: 11px; letter-spacing: .04em;
  text-transform: uppercase; opacity: .85;
  margin: 0;
  line-height: 1.2;
}
.m-topbar .title {
  font-size: 22px; font-weight: 800;
  margin-top: 2px;
  line-height: 1.15;
}
.m-topbar .m-topbar-logo {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: rgba(255,255,255,.18);
  object-fit: cover;
  flex-shrink: 0;
}
.m-topbar-text { flex: 1; min-width: 0; }
.m-topbar .row,
.m-topbar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}
.m-topbar-text { flex: 1; min-width: 0; padding-right: 4px; }
.m-topbar-profile {
  flex: 0 0 auto;
  align-self: center;
}
/* Floating profile (legacy) — hide; desktop never shows header profile */
.app-header-profile { display: none !important; }

.m-topbar .month-pill {
  background: rgba(255,255,255,.22);
  padding: 8px 12px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 700;
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
}

/* ========== CARDS ========== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 14px; }
.card-title { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.card-header {
  display: flex; justify-content: space-between; align-items: start;
  gap: 12px; margin-bottom: 12px;
}
.card-header .muted { color: var(--muted); font-size: 13px; line-height: 1.55; margin-top: 4px; }

.section-title { margin: 0; font-size: 14px; font-weight: 800; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.55; }

/* ========== METRIC GRID ========== */
.metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
@media (min-width: 768px) {
  .metrics { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1280px) {
  .metrics { grid-template-columns: repeat(6, 1fr); }
}
.metric {
  border-radius: 14px;
  padding: 14px;
  color: #fff;
  background: linear-gradient(145deg, #1e3a8a 0%, #1d4ed8 100%);
  border: none;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(29, 78, 216, 0.18);
}
.metric::after {
  content: '';
  position: absolute;
  right: -18px; top: -18px;
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  pointer-events: none;
}
.metric.green  { background: linear-gradient(145deg, #047857 0%, #10b981 100%); box-shadow: 0 8px 18px rgba(16, 185, 129, 0.22); }
.metric.red    { background: linear-gradient(145deg, #b91c1c 0%, #f43f5e 100%); box-shadow: 0 8px 18px rgba(244, 63, 94, 0.20); }
.metric.blue   { background: linear-gradient(145deg, #0369a1 0%, #38bdf8 100%); box-shadow: 0 8px 18px rgba(14, 165, 233, 0.22); }
.metric.purple { background: linear-gradient(145deg, #5b21b6 0%, #8b5cf6 100%); box-shadow: 0 8px 18px rgba(139, 92, 246, 0.22); }
.metric.gold   { background: linear-gradient(145deg, #b45309 0%, #f59e0b 100%); box-shadow: 0 8px 18px rgba(245, 158, 11, 0.22); }
.metric.dark   { background: linear-gradient(145deg, #0f172a 0%, #1e3a8a 100%); box-shadow: 0 8px 18px rgba(15, 23, 42, 0.20); }
.metric.teal   { background: linear-gradient(145deg, #0f766e 0%, #14b8a6 100%); box-shadow: 0 8px 18px rgba(20, 184, 166, 0.20); }
.metric.violet { background: linear-gradient(145deg, #6d28d9 0%, #a78bfa 100%); box-shadow: 0 8px 18px rgba(167, 139, 250, 0.20); }
.metric-value-single {
  display: block;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  margin: 4px 0 6px;
  word-break: break-all;
  color: #fff;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}
.metric strong {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: rgba(255,255,255,.88);
  font-weight: 600;
  margin-bottom: 6px;
  opacity: 1;
  position: relative;
  z-index: 1;
}
.metric span {
  display: block;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  position: relative;
  z-index: 1;
}
.metric small {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: rgba(255,255,255,.78);
  opacity: 1;
  line-height: 1.4;
  position: relative;
  z-index: 1;
}

@media (min-width: 768px) {
  .metric-value-single,
  .metric span {
    font-size: 20px;
  }
  .metric strong,
  .metric small {
    font-size: 11px;
  }
}

/* ========== LIST ========== */
.list { display: grid; gap: 10px; }
.list-item {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: var(--radius-md);
  padding: 12px;
}
.list-item.clickable { cursor: pointer; transition: .15s; }
.list-item.clickable:hover { background: var(--bg); border-color: #93c5fd; }
.list-item.selected {
  background: #eff6ff;
  border-color: #93c5fd;
  box-shadow: none;
}
.list-item.danger { border-color: #fecaca; background: #fef2f2; }

.left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  color: #fff; font-weight: 700; flex: 0 0 auto;
}
.icon.green  { background: var(--success); }
.icon.red    { background: var(--danger); }
.icon.blue   { background: var(--info); }
.icon.purple { background: var(--purple); }
.icon.gold   { background: var(--warning); }
.icon.dark   { background: #0f172a; }

.item-title { font-size: 14px; font-weight: 800; margin-bottom: 2px; }
.item-subtitle { font-size: 12px; color: var(--muted); }
.stack { display: grid; gap: 6px; min-width: 0; }
.meta-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }

.amount { font-size: 14px; font-weight: 800; white-space: nowrap; }
.amount.income { color: #047857; }
.amount.expense { color: #b91c1c; }

.tiny-tag {
  display: inline-flex; align-items: center;
  padding: 4px 8px; border-radius: var(--radius-pill);
  font-size: 10px; font-weight: 800;
  border: 1px solid; white-space: nowrap;
}
.tiny-tag.soft { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.tiny-tag.optional { color: #6b21a8; background: #f3e8ff; border-color: #d8b4fe; }
.tiny-tag.success { color: #166534; background: #dcfce7; border-color: #86efac; }
.tiny-tag.danger  { color: #991b1b; background: #fee2e2; border-color: #fca5a5; }
.tiny-tag.neutral { color: #475569; background: #f1f5f9; border-color: #cbd5e1; }

.mini-tag {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 800;
  background: var(--surface-soft); color: var(--primary);
  border: 1px solid #bfdbfe;
}

/* ========== PROGRESS ========== */
.progress-wrap { margin-top: 8px; }
.progress-head {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 11px; font-weight: 800; color: var(--muted);
  margin-bottom: 5px;
}
.progress-bar {
  width: 100%; height: 8px; border-radius: var(--radius-pill);
  background: #e2e8f0; overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: var(--radius-pill);
  background: var(--primary);
}

/* ========== FORMS ========== */
.form { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; }
.label {
  font-size: 11px; font-weight: 800;
  color: var(--muted); letter-spacing: .03em; text-transform: uppercase;
}
.input, .textarea, .select, .pill-input {
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px 12px;
  min-height: 40px;
  border-radius: var(--radius-md);
  font-size: 16px;
  color: var(--text);
  width: 100%;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.18);
}
.textarea { min-height: 88px; resize: vertical; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) center, calc(100% - 13px) center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 36px; }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .row-2 { grid-template-columns: 1fr; } }
.split { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.today-btn {
  border: 1px solid var(--line); background: #0f172a; color: #fff;
  border-radius: 14px; padding: 0 14px; font-size: 12px; font-weight: 800;
  white-space: nowrap;
}

.segmented {
  display: flex;
  gap: 6px; background: #eff6ff;
  padding: 5px; border-radius: 16px;
}
.segmented button {
  flex: 1;
  border: none; background: transparent;
  padding: 10px; border-radius: 12px;
  font-size: 13px; font-weight: 800; color: var(--primary);
  white-space: nowrap;
}
.segmented button.active-income {
  background: var(--success); color: #fff;
}
.segmented button.active-expense {
  background: var(--danger); color: #fff;
}
.segmented button.active-transfer {
  background: var(--primary); color: #fff;
}
.segmented button.active-payable,
.segmented button.active-receivable,
.segmented button.active-credit {
  background: var(--primary); color: #fff;
}


.dropzone {
  border: 1.6px dashed #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 16px;
  padding: 18px 14px;
  text-align: center;
  font-size: 13px; line-height: 1.5; font-weight: 700;
  cursor: pointer;
  transition: .15s;
}
.dropzone:hover, .dropzone.drag-over {
  background: #dbeafe; border-color: #2563eb;
}
.dropzone input[type=file] { display: none; }
.dropzone .filename { display: block; margin-top: 6px; color: #047857; font-weight: 800; }

.button {
  border: none; border-radius: var(--radius-md);
  padding: 12px 16px;
  min-height: var(--touch);
  text-align: center; color: #fff;
  font-size: 14px; font-weight: 600;
  background: var(--primary);
  box-shadow: none;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
}
.button:hover { background: var(--primary-2); }
.button:disabled { opacity: .5; cursor: not-allowed; }
.button.sky    { background: var(--info); }
.button.sky:hover { background: #0369a1; }
.button.purple { background: var(--purple); }
.button.purple:hover { background: #6d28d9; }
.button.dark   { background: #0f172a; }
.button.dark:hover { background: #1e293b; }
.button.danger { background: var(--danger); }
.button.danger:hover { background: #b91c1c; }
.button.success { background: var(--success); }
.button.success:hover { background: #047857; }
.button.ghost  { background: transparent; color: var(--text); box-shadow: none; border: 1px solid var(--line); }
.button.ghost:hover { background: var(--surface-soft); }
.button.small  { padding: 8px 12px; font-size: 12px; border-radius: var(--radius-sm); }

.hint {
  display: flex; gap: 8px; align-items: start;
  font-size: 12px; color: var(--muted);
  margin-top: 8px; line-height: 1.5;
}
.bullet {
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--primary); margin-top: 5px; flex: 0 0 auto;
}

/* ========== AUTH ========== */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: var(--bg);
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 26px;
  box-shadow: var(--shadow);
}
.brand-hero {
  background: linear-gradient(160deg, #1e40af 0%, #2563eb 100%);
  border-radius: var(--radius-lg);
  padding: 20px;
  color: #fff;
  margin-bottom: 18px;
}
.brand-hero .logo {
  width: 48px; height: 48px; border-radius: 14px;
  background: rgba(255,255,255,.16);
  display: block;
  object-fit: cover;
  margin-bottom: 12px;
}
.brand-hero .subtle { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; opacity: .85; }
.brand-hero h2 { margin: 6px 0 0; font-size: 22px; }
.brand-hero p { margin: 8px 0 0; font-size: 13px; opacity: .85; line-height: 1.6; }

.auth-tabs { display: flex; gap: 6px; background: var(--surface-soft); padding: 5px; border-radius: var(--radius-pill); margin-bottom: 16px; }
.auth-tabs button {
  flex: 1; border: none; background: transparent;
  padding: 10px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 800; color: var(--muted);
}
.auth-tabs button.active { background: var(--primary); color: #fff; box-shadow: 0 6px 14px rgba(37, 99, 235, .3); }

.auth-hint {
  margin-top: 14px; padding: 12px;
  background: var(--surface-soft); border-radius: 14px;
  font-size: 12px; color: var(--muted); line-height: 1.6;
}
.auth-hint strong { color: var(--text); }
.auth-hint code { background: #fff; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); }

.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px;
  border: none; background: var(--surface-soft);
  border-radius: 10px; cursor: pointer;
  font-size: 16px; line-height: 1;
  display: grid; place-items: center;
  color: var(--muted);
  transition: background .15s, color .15s;
}
.pw-toggle:hover { background: var(--line); color: var(--text); }
.pw-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.remember-row {
  display: flex; align-items: center; gap: 8px;
  margin: 4px 0 14px;
  font-size: 13px; color: var(--muted);
  cursor: pointer; user-select: none;
  font-weight: 600;
}
.remember-row .checkbox-input {
  width: 18px; height: 18px; margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.error-msg {
  background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
  padding: 10px 14px; border-radius: 12px; font-size: 13px;
  margin-bottom: 12px;
}
.success-msg {
  background: #dcfce7; border: 1px solid #86efac; color: #166534;
  padding: 10px 14px; border-radius: 12px; font-size: 13px;
  margin-bottom: 12px;
}

/* ========== BOTTOM NAV ========== */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0;
  /* base; full styles in polish block */
}
.bottom-nav .nav-item {
  border-radius: 14px;
  padding: 8px 4px;
  text-align: center;
  font-size: 10.5px; font-weight: 800;
  color: var(--muted);
  background: transparent;
  border: none;
  display: flex; flex-direction: column; gap: 2px;
  align-items: center;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bottom-nav .nav-item .ic { font-size: 18px; line-height: 1; }
.bottom-nav .nav-item.active {
  /* polish block owns active state */
}
@media (min-width: 1024px) {
  .bottom-nav { display: none; }
}
/* Mobile-only: padding bottom for main so content not hidden by nav */
@media (max-width: 1023px) {
  .main { padding-bottom: 96px; }
  .main-wrap { padding-bottom: 90px; }
  body { padding-bottom: env(safe-area-inset-bottom, 0); }
}

/* ========== TABLES (desktop) ========== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid #edf2f7; vertical-align: middle; }
th { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 800; }
tbody tr:hover { background: #f8fbff; }

.badge {
  display: inline-flex; align-items: center;
  padding: 5px 10px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 800;
  border: 1px solid;
  white-space: nowrap;
}
.badge.income { color: #166534; background: #dcfce7; border-color: #86efac; }
.badge.expense { color: #991b1b; background: #fee2e2; border-color: #fca5a5; }
.badge.info { color: #1d4ed8; background: #dbeafe; border-color: #93c5fd; }
.badge.neutral { color: #475569; background: #f1f5f9; border-color: #cbd5e1; }
.badge.warning { color: #92400e; background: #fef3c7; border-color: #fcd34d; }

/* ========== GRIDS ========== */
.grid-2 {
  display: grid; gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 1024px) {
  .grid-2 { grid-template-columns: 1fr 1.1fr; }
}

/* ========== ADMIN DETAIL PANEL ========== */
.detail-panel {
  background: linear-gradient(160deg, #1e40af 0%, #2563eb 100%);
  color: #fff;
  border-radius: 22px;
  padding: 18px;
  margin-top: 14px;
}
.detail-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; margin-top: 14px;
}
@media (min-width: 768px) { .detail-grid { grid-template-columns: repeat(4, 1fr); } }
.detail-box {
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  border-radius: 16px; padding: 12px;
}
.detail-box.clickable { cursor: pointer; transition: .15s; }
.detail-box.clickable:hover { background: rgba(255,255,255,.14); }
.detail-box strong {
  display: block; font-size: 10px;
  text-transform: uppercase; opacity: .85;
  letter-spacing: .04em; margin-bottom: 6px;
}
.detail-box span { display: block; font-size: 18px; font-weight: 700; }
.detail-link {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px; color: #bfdbfe; font-size: 11px; font-weight: 800;
}
.detail-empty { font-size: 12px; color: #dbeafe; margin-top: 14px; line-height: 1.6; }

/* ========== TOAST ========== */
#toast-root {
  position: fixed; top: 16px; right: 16px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 100; pointer-events: none;
}
.toast {
  background: var(--surface);
  border-left: 4px solid var(--primary);
  padding: 12px 16px; border-radius: 12px;
  box-shadow: var(--shadow-lg);
  font-size: 13px; font-weight: 600;
  min-width: 220px; max-width: 340px;
  pointer-events: auto;
  animation: slideIn .25s ease;
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ========== ADMIN FILTER BAR ========== */
.filter-bar {
  display: grid; gap: 14px;
  grid-template-columns: 1fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
@media (min-width: 900px) {
  .filter-bar { grid-template-columns: 1.4fr 1fr 1fr; align-items: end; }
}
.filter-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.filter-cell .input { width: 100%; }
.filter-label {
  font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted);
}

/* ========== ADMIN LAYOUT ========== */
.admin-layout { display: grid; gap: 18px; margin-top: 4px; }
.admin-metrics {
  display: grid; gap: 14px;
  grid-template-columns: repeat(1, 1fr);
  margin: 14px 0 4px;
}
@media (min-width: 640px) { .admin-metrics { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .admin-metrics { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .admin-metrics { grid-template-columns: repeat(5, 1fr); } }
.admin-metrics .metric { color: var(--text); padding: 16px; border-radius: var(--radius-md); }
.admin-metrics .metric strong {
  display: block; font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .06em; opacity: .9;
  margin-bottom: 6px;
}
.admin-metrics .metric span {
  display: block; font-size: 22px; font-weight: 700; line-height: 1.1;
  word-break: break-word;
}
.admin-metrics .metric small {
  display: block; margin-top: 6px; font-size: 11px; opacity: .85; line-height: 1.4;
}
/* ========== ADMIN USER ROW ========== */
.admin-user-card { display: flex; flex-direction: column; gap: 8px; }
.user-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: .15s;
}
.admin-user-card .user-row { cursor: pointer; }
.admin-user-card .user-row:hover { background: #eff6ff; border-color: #93c5fd; }
.user-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .15);
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 14px; font-weight: 800; color: var(--text); }
.user-sub { font-size: 12px; color: var(--muted); margin-top: 2px; word-break: break-word; }
.user-row .arrow { color: var(--muted); font-size: 18px; flex-shrink: 0; }
.user-row.selected {
  background: #eff6ff;
  border-color: var(--primary);
  box-shadow: 0 6px 16px rgba(29, 78, 216, .12);
}
.user-row.selected .arrow { color: var(--primary); }
.admin-pick-hint {
  background: #f8fafc;
  border: 1px dashed #93c5fd;
  border-radius: 18px; padding: 26px 20px; text-align: center;
  color: var(--muted);
}
.admin-pick-hint .ic {
  font-size: 42px; margin-bottom: 6px;
  display: inline-block;
  animation: wave 1.4s ease-in-out infinite;
}
@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(14deg); }
  40% { transform: rotate(-8deg); }
  60% { transform: rotate(10deg); }
  80% { transform: rotate(-4deg); }
}
.admin-pick-hint strong { color: var(--text); font-size: 15px; display: block; margin-bottom: 4px; }

/* ========== MODAL ========== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .55);
  display: grid; place-items: center;
  padding: 16px;
  z-index: 80;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  max-width: 520px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.modal-header h3 { margin: 0; font-size: 18px; font-weight: 700; }
.modal-close {
  background: transparent; border: none; font-size: 22px;
  color: var(--muted); cursor: pointer;
}

/* ========== FILTERS / TABS ========== */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  border-radius: 12px; padding: 8px 12px;
  background: var(--surface-soft); color: var(--primary);
  font-size: 12px; font-weight: 800;
  border: 1px solid #bfdbfe;
  cursor: pointer;
}
.tab.active {
  background: var(--primary);
  color: #fff; border-color: transparent;
}

/* ========== MISC ========== */
.empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
  font-size: 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  background: #fafbfc;
}
.empty .ic { display: none; }

.kv {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.kv:last-child { border-bottom: none; }
.kv strong { color: var(--muted); font-weight: 600; font-size: 12px; }
.kv span { font-weight: 800; }

.row-flex { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid rgba(37, 99, 235, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-page {
  min-height: 100vh; display: grid; place-items: center;
}

@media (max-width: 480px) {
  .auth-card { padding: 20px; }
  .m-topbar .title { font-size: 22px; }
}

/* ========== ADMIN SUBTABS ========== */
.admin-tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 6px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.admin-tabs .tab {
  flex: 1; min-width: 140px; text-align: center;
  padding: 10px 14px;
  font-size: 13px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  cursor: pointer;
  transition: .15s;
  font-weight: 800;
}
.admin-tabs .tab:hover { background: var(--surface-soft); color: var(--text); }
.admin-tabs .tab.active {
  background: var(--primary);
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 12px rgba(29, 78, 216, .25);
}

/* ========== BUTTON VARIANTS ========== */
.button.danger {
  background: #be123c;
  color: #fff; border: none;
  font-weight: 700;
}
.button.danger:hover { background: #9f1239; }
.button.danger:disabled { opacity: .5; cursor: not-allowed; }
.button.ghost {
  background: transparent; color: var(--muted);
  border: 1px solid var(--line);
  font-weight: 700;
}
.button.ghost:hover { background: var(--surface-soft); color: var(--text); }

/* ========== USER MANAGEMENT PAGE ========== */
.um-grid {
  display: grid; gap: 18px;
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 1024px) {
  .um-grid {
    grid-template-columns: minmax(420px, 1fr) minmax(520px, 1.25fr);
  }
  .um-grid .pending-card { grid-column: 1 / -1; }
}
.um-form-card, .um-list-card, .pending-card { min-width: 0; height: 100%; display: flex; flex-direction: column; }
.um-form-card { position: sticky; top: 16px; }
.um-list-card { max-height: calc(100vh - 32px); overflow-y: auto; }
@media (max-width: 1023px) {
  .um-form-card { position: static; }
  .um-list-card { max-height: none; overflow-y: visible; }
  .um-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767px) {
  .um-grid { grid-template-columns: 1fr; }
}
.um-form-card .form { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.um-form-card .field { display: flex; flex-direction: column; gap: 6px; }
.um-form-card .label {
  font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted);
}
.um-form-card .input {
  padding: 12px 14px; font-size: 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: #fff;
  transition: border-color .15s;
}
.um-form-card .input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(29, 78, 216, .12); }
.um-form-card .button.dark { padding: 12px 16px; font-size: 14px; border-radius: 12px; }
.um-search-wrap { flex: 1; min-width: 220px; max-width: 320px; }
.um-search-wrap .input { width: 100%; padding: 9px 12px; font-size: 13px; }

/* ========== USER MANAGEMENT ========== */
.mgt-header {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.mgt-header .input { flex: 1; min-width: 220px; }
.mgt-meta {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.user-row.mgt-row { gap: 16px; }
.mgt-row .user-warn {
  margin-top: 6px; font-size: 11px; font-weight: 700;
  color: #92400e; background: #fef3c7;
  border: 1px solid #fcd34d;
  padding: 4px 8px; border-radius: 8px;
  display: inline-block;
}
.mgt-row .button.danger {
  padding: 8px 14px; border-radius: 10px;
  font-size: 12px; white-space: nowrap;
}
.mgt-row .button.danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(244, 63, 94, .35);
}

/* ========== ADMIN OVERVIEW PICKER ========== */
.admin-picker-bar {
  display: grid; gap: 14px;
  grid-template-columns: 1fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}
@media (min-width: 768px) {
  .admin-picker-bar { grid-template-columns: 1.6fr 1fr; align-items: end; }
}
.admin-picker-cell { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.admin-picker-label {
  font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted);
}
.admin-picker {
  display: flex; align-items: center; gap: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px 12px 4px 14px;
  transition: border-color .15s;
}
.admin-picker:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29, 78, 216, .12); }
.admin-picker .ic { font-size: 16px; }
.admin-picker .select {
  border: none; background: transparent; padding: 10px 4px; font-size: 14px;
  flex: 1; min-width: 0;
}
.admin-picker .select:focus { outline: none; }
.admin-currency {
  display: flex; gap: 8px; flex-wrap: wrap;
  background: #f1f5f9; border: 1px solid var(--line);
  border-radius: 12px; padding: 6px;
}
.admin-currency .cur-chip {
  flex: 1 1 0; min-width: 86px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 800; font-size: 12px;
  padding: 9px 16px;
  border-radius: 9px;
  cursor: pointer;
  transition: .15s;
  white-space: nowrap;
  text-align: center;
  margin: 2px 0;
}
.admin-currency .cur-chip:hover { background: var(--surface); color: var(--text); }
.admin-currency .cur-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(29, 78, 216, .25);
}

/* ========== PERIOD PICKER ========== */
.period-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 10px;
}
.period-chips {
  display: flex; gap: 8px; flex-wrap: wrap;
  background: #f1f5f9; border: 1px solid var(--line);
  border-radius: 12px; padding: 5px;
}
.period-chip {
  flex: 1 1 0; min-width: 80px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 800; font-size: 12px;
  padding: 9px 14px;
  border-radius: 9px;
  cursor: pointer;
  transition: .15s;
  white-space: nowrap;
  text-align: center;
  margin: 2px 0;
}
.period-chip:hover { background: var(--surface); color: var(--text); }
.period-chip.active {
  background: #7c3aed;
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(139, 92, 246, .25);
}
.period-input-wrap { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.period-input {
  max-width: 220px;
  padding: 10px 14px; font-size: 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: #fff;
}
.period-input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(29, 78, 216, .12); }

/* Category list panel (toggle) */
.cat-list-panel { margin-top: 10px; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; background: #f8fafc; }
.cat-list-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cat-list-panel-body { display: grid; gap: 8px; }
.cat-list-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.cat-list-info { display: grid; gap: 2px; }
.cat-list-name { font-weight: 600; color: var(--text); }
.cat-list-meta { font-size: 12px; color: var(--muted); }
.cat-list-x { background: transparent; border: 1px solid var(--line); color: #dc2626; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 14px; line-height: 1; }
.cat-list-x:hover { background: #fee2e2; border-color: #fecaca; }
.cat-list-x:disabled { opacity: .5; cursor: not-allowed; }

/* ========== ENHANCED TOAST ========== */
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  padding: 12px 14px 12px 12px; border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .14), 0 2px 6px rgba(15, 23, 42, .08);
  font-size: 13px; font-weight: 600; color: var(--text);
  min-width: 260px; max-width: 380px;
  pointer-events: auto;
  animation: toastIn .32s cubic-bezier(.21,1.02,.73,1);
}
.toast.toast-leaving { animation: toastOut .28s ease forwards; }
@keyframes toastIn  { from { transform: translateX(20px) scale(.96); opacity: 0; } to { transform: translateX(0) scale(1); opacity: 1; } }
@keyframes toastOut { to   { transform: translateX(20px) scale(.96); opacity: 0; } }
.toast-icon {
  width: 26px; height: 26px; flex: 0 0 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 14px; font-weight: 700;
  line-height: 1;
}
.toast-msg { flex: 1; line-height: 1.4; word-break: break-word; }
.toast-close {
  background: transparent; border: none;
  color: var(--muted); font-size: 18px; line-height: 1;
  width: 22px; height: 22px; padding: 0; cursor: pointer;
  border-radius: 6px; transition: .15s;
}
.toast-close:hover { background: #f1f5f9; color: var(--text); }
.toast-success { border-left-color: var(--success); }
.toast-success .toast-icon { background: var(--success); }
.toast-error   { border-left-color: var(--danger); }
.toast-error   .toast-icon { background: var(--danger); }
.toast-warning { border-left-color: #f59e0b; }
.toast-warning .toast-icon { background: #f59e0b; }
.toast-info    { border-left-color: var(--info); }
.toast-info    .toast-icon { background: var(--info); }

/* ========== ENHANCED MODAL CONFIRM ========== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: grid; place-items: center;
  padding: 16px;
  z-index: 200;
  animation: fadeIn .18s ease;
}
.modal {
  background: var(--surface);
  border-radius: 18px;
  padding: 22px;
  max-width: 460px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .35), 0 4px 12px rgba(15, 23, 42, .12);
  animation: modalIn .22s cubic-bezier(.21, 1.02, .73, 1);
}
@keyframes modalIn { from { transform: translateY(8px) scale(.97); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.modal-header h3 { margin: 0; font-size: 18px; font-weight: 700; }
.modal-close {
  background: transparent; border: none; font-size: 22px;
  color: var(--muted); cursor: pointer;
  width: 30px; height: 30px; border-radius: 8px;
  transition: .15s;
}
.modal-close:hover { background: #f1f5f9; color: var(--text); }

.modal-confirm .modal { padding: 0; overflow: hidden; }
.modal-confirm .modal-header { display: none; }
.modal-body { display: flex; flex-direction: column; }
.modal-head-row { display: flex; align-items: flex-start; gap: 14px; padding: 22px 22px 8px; }
.modal-icon {
  width: 40px; height: 40px; flex: 0 0 40px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8; font-size: 16px; font-weight: 700;
  line-height: 1;
}
.modal-icon.danger { background: #fef2f2; color: #b91c1c; }
.modal-text { flex: 1; min-width: 0; }
.modal-title { margin: 0 0 4px; font-size: 16px; font-weight: 800; color: var(--text); }
.modal-message { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.5; word-break: break-word; }
.modal-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 16px 22px 22px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
  margin-top: 14px;
}
.btn-modal {
  appearance: none; border: 1px solid var(--line);
  background: #fff; color: var(--text);
  padding: 9px 18px; border-radius: 10px;
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: .15s;
  min-width: 90px;
}
.btn-modal:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(15, 23, 42, .08); }
.btn-cancel:hover { background: #f1f5f9; }
.btn-confirm { background: var(--primary); color: #fff; border-color: transparent; }
.btn-confirm:hover { background: var(--primary-2); box-shadow: none; }
.btn-danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn-danger:hover { background: #b91c1c; box-shadow: none; }

/* ========== TRANSACTION CURRENCY CHIPS ========== */
.cur-chips { display: flex; gap: 4px; padding: 3px; background: #f1f5f9; border-radius: 10px; }
.cur-chip {
  padding: 5px 10px; border-radius: 7px;
  background: transparent; border: none;
  font-size: 11px; font-weight: 800;
  color: var(--muted); cursor: pointer;
  transition: .15s;
  min-width: 38px;
}
.cur-chip:hover { background: #e2e8f0; color: var(--text); }
.cur-chip.active {
  background: var(--primary);
  color: #fff; box-shadow: none;
}
.header-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

/* ========== LOGIN REDESIGN ========== */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--bg); }
.auth-stack { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 420px; gap: 28px; }
.auth-card {
  width: 100%; max-width: 420px;
  background: #fff; border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 28px 24px; display: flex; flex-direction: column; gap: 14px;
  border: 1px solid var(--line);
}
.brand-hero {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 0;
  margin: -28px -24px 4px;
  padding: 28px 24px 24px;
  border-radius: 0 0 12px 12px;
  background: linear-gradient(160deg, #1e40af 0%, #2563eb 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.brand-hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    transparent 50%);
  pointer-events: none;
}
.brand-hero > * { position: relative; z-index: 1; }
.brand-icon {
  width: 60px; height: 60px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(6px);
  margin-bottom: 12px;
}
.brand-icon svg { display: block; }
.brand-hero h1 { font-size: 24px; font-weight: 800; margin: 0; color: #fff; letter-spacing: .3px; line-height: 1.2; max-width: 320px; }
.brand-sub { color: rgba(255, 255, 255, 0.92); font-size: 13px; line-height: 1.55; margin: 6px 0 0; max-width: 280px; }
.auth-title { font-size: 18px; font-weight: 700; margin: 0; color: var(--text); }
.auth-sub { color: var(--muted); font-size: 13px; margin: -8px 0 0; }
.auth-link { color: var(--primary); text-decoration: none; font-size: 13px; }
.auth-link strong { font-weight: 700; }
.auth-link:hover { text-decoration: underline; }
.auth-divider { height: 1px; background: #e5e7eb; margin: 4px 0; }
.auth-footer { text-align: center; padding-top: 4px; }
.auth-footnote {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .02em;
  width: 100%;
}
.auth-footnote strong { color: var(--text); font-weight: 800; }
.auth-footnote-link { color: var(--primary); text-decoration: none; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.auth-footnote-link:hover { text-decoration: underline; }
.auth-footnote-link svg { flex: 0 0 auto; display: block; }
.tg-logo-wrap { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; }
.tg-badge {
  position: absolute; right: -3px; bottom: -3px;
  width: 12px; height: 12px;
  background: #fff;
  color: #229ED9;
  border: 1.5px solid #fff;
  border-radius: 3px;
  font-size: 8px; font-weight: 700; line-height: 1;
  display: grid; place-items: center;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  box-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.form-login, .form-register { display: flex; flex-direction: column; gap: 12px; }
.form-login .field, .form-register .field { display: flex; flex-direction: column; gap: 6px; }
.form-login .label, .form-register .label { font-size: 12px; font-weight: 700; color: var(--text); }
.form-login .button-primary, .form-register .button-primary {
  margin-top: 4px; padding: 12px;
  background: var(--primary);
  color: #fff; border: none; border-radius: 10px;
  font-weight: 700; font-size: 14px; cursor: pointer;
  transition: .2s; box-shadow: 0 4px 12px rgba(99, 102, 241, .25);
}
.form-login .button-primary:hover:not(:disabled),
.form-register .button-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(99, 102, 241, .35);
}
.form-login .button-primary:disabled,
.form-register .button-primary:disabled { opacity: .65; cursor: not-allowed; }
.info-msg {
  background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a;
  padding: 10px 12px; border-radius: 10px; font-size: 12px; line-height: 1.5;
}
.rate-info {
  background: #fef3c7; border: 1px solid #fde68a; color: #92400e;
  padding: 8px 12px; border-radius: 8px; font-size: 12px;
}
.demo-toggle {
  display: flex; align-items: center; gap: 6px;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 8px 12px; color: var(--text); font-size: 12px; font-weight: 600;
  cursor: pointer; width: 100%; justify-content: center;
  transition: .15s;
}
.demo-toggle:hover { background: #f1f5f9; }
.demo-toggle-icon { font-size: 9px; color: var(--muted); }
.demo-list { display: flex; flex-direction: column; gap: 4px; padding: 4px 0; }
.demo-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 8px 12px; cursor: pointer; text-align: left;
  font-size: 12px; transition: .15s;
}
.demo-row:hover { background: var(--bg); border-color: #bae6fd; }
.demo-label { font-weight: 700; color: var(--text); }
.demo-email { color: var(--muted); font-family: ui-monospace, monospace; font-size: 11px; }

/* ========== PENDING USERS PANEL (ADMIN) ========== */
.pending-card {
  border: 1px solid #fde68a;
  background: #fffbeb;
}
.pending-card .card-title { color: #92400e; }
.pending-list { display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.pending-row {
  background: #fff; border: 1px solid #fde68a; border-radius: 10px;
  padding: 12px; align-items: center; gap: 12px;
  flex-wrap: wrap;
}
.pending-row .user-avatar { flex-shrink: 0; }
.pending-row .user-info { flex: 1 1 200px; min-width: 0; }
.pending-row .user-name { overflow-wrap: anywhere; }
.pending-row .user-sub { overflow-wrap: anywhere; word-break: break-all; }
.pending-row .pending-actions { flex-shrink: 0; }
.pending-badge {
  display: inline-block; margin-left: 8px; padding: 2px 8px;
  background: #fbbf24; color: #78350f; font-size: 10px; font-weight: 800;
  border-radius: 999px; text-transform: uppercase; letter-spacing: .5px;
  vertical-align: middle;
}
.pending-actions { display: flex; gap: 6px; }
.button.success {
  background: #16a34a; color: #fff;
  border: none; padding: 8px 14px; border-radius: 8px;
  font-weight: 700; font-size: 12px; cursor: pointer; transition: .15s;
}
.button.success:hover { box-shadow: 0 4px 12px rgba(22, 163, 74, .3); }

/* ========== HYBRID CUSTOM SELECT STYLES ========== */
.custom-select-container {
  position: relative;
  width: 100%;
}
.custom-select-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  user-select: none;
}
.custom-select-trigger:hover {
  border-color: #cbd5e1;
}
.custom-select-trigger-content {
  display: flex;
  align-items: center;
  gap: 8px;
}
.custom-select-arrow {
  font-size: 10px;
  color: #64748b;
}
.custom-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-top: 4px;
  max-height: 250px;
  overflow-y: auto;
  z-index: 500;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}
.custom-select-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}
.custom-select-option:hover {
  background-color: #f1f5f9;
}
.custom-select-option.selected {
  background-color: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
}
.custom-select-balance {
  font-weight: 700;
  color: #475569;
}
.custom-select-option.selected .custom-select-balance {
  color: #1d4ed8;
}





/* Confirm modal: text-first, no emoji badge needed */
.modal-confirm .modal-head-row { padding: 22px 22px 8px; }
.modal-confirm .modal-icon { display: none; }


/* ========== Keuangan polish (ui-ux-pro-max) ========== */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: grid;
  gap: 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -1px 0 rgba(15, 23, 42, 0.04);
}
@media (min-width: 1024px) {
  .bottom-nav { display: none; }
}
.bottom-nav .nav-item {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  min-height: var(--touch);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}
.bottom-nav .nav-item:hover { color: var(--text); background: var(--surface-soft); }
.bottom-nav .nav-item.active {
  color: var(--primary);
  background: transparent;
}
.bottom-nav .nav-item .ic {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  opacity: 0.9;
  background: none !important;
  border-radius: 0 !important;
  clip-path: none !important;
  margin: 0 !important;
}
.bottom-nav .nav-item .ic svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bottom-nav .nav-item.active .ic svg { stroke-width: 2.1; }

.side-nav .nav-item {
  min-height: 40px;
  transition: background var(--transition), color var(--transition);
}

/* Card density */
.card { padding: 14px; border-radius: var(--radius-lg); }
.card + .card { margin-top: 10px; }
.topbar h1 { margin: 0 0 4px; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: #fff; }
.topbar p { margin: 0; font-size: 13px; color: rgba(255,255,255,.9); max-width: 52ch; }
@media (min-width: 768px) { .topbar h1 { font-size: 26px; } }

.list-item { border-radius: var(--radius-md); padding: 10px 12px; transition: background var(--transition), border-color var(--transition); }
.list-item.clickable:hover { background: #f8fafc; }

.label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--muted);
}

/* Currency switch tighter */
.currency-switch button {
  min-height: 36px;
  font-weight: 600;
  transition: background var(--transition), color var(--transition);
}

/* Modal density */
.modal { border-radius: var(--radius-lg); }

/* Skip-link for a11y */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: 8px 12px;
  z-index: 1000;
  border-radius: var(--radius-sm);
}
.skip-link:focus {
  left: 12px;
  top: 12px;
}


/* topbar mobile hide */
@media (max-width: 1023px) {
  .main > .topbar { display: none; }
}
@media (min-width: 1024px) {
  .m-topbar { display: none !important; }
}

/* Sidebar brand accent blue */
.sidebar {
  background: linear-gradient(180deg, #0b1f4d 0%, #1e3a8a 45%, #1d4ed8 100%) !important;
}
.side-nav .nav-item.active {
  background: rgba(255,255,255,.18) !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}

/* Admin metrics inherit colored metric look */
.admin-metrics .metric { color: #fff; }


/* Profile chip in header */
.main-wrap { position: relative; }
.app-header-profile {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 30;
}
@media (min-width: 1024px) {
  .app-header-profile { top: 18px; right: 24px; }
}
.header-profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255,255,255,.30);
  background: rgba(255,255,255,.20);
  color: #fff;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: none;
  transition: background .15s;
  max-width: 42vw;
}
.header-profile-chip:hover { background: rgba(255,255,255,.28); }
.header-profile-name {
  font-size: 13px;
  font-weight: 600;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 4px;
}
/* When page has no blue header, make chip solid blue */
.view-host .main > .topbar { padding-right: 140px; }
.view-host .main > .m-topbar { padding-right: 120px; }
.user-card-clickable { cursor: pointer; }
.user-card-clickable:hover { background: rgba(255,255,255,.12); }

/* Debt UI */
.debt-tabs {
  display: flex; gap: 6px; padding: 4px;
  background: var(--surface-soft); border-radius: 12px; margin-bottom: 12px;
}
.debt-tabs button {
  flex: 1; border: none; background: transparent;
  padding: 10px; border-radius: 10px;
  font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer;
}
.debt-tabs button.active {
  background: var(--primary); color: #fff;
}
.debt-badge {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.debt-badge.open { background: #fef3c7; color: #92400e; }
.debt-badge.partial { background: #dbeafe; color: #1e40af; }
.debt-badge.paid { background: #d1fae5; color: #065f46; }
.debt-badge.overdue { background: #fee2e2; color: #991b1b; }


/* Hide legacy role pills */
.m-topbar .month-pill { display: none !important; }

.page-header-block { margin-bottom: 12px; }

/* Currency bar under header — full width attractive 3-choice */
.currency-bar {
  margin: 12px 0 14px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}
.currency-bar-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  padding: 0 2px;
}
.currency-bar-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .02em;
}
.currency-bar-hint {
  font-size: 11px;
  color: var(--muted);
}
.currency-switch-bar {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
}
.currency-switch-bar .cur-btn {
  border: 1.5px solid var(--line);
  background: #f8fafc;
  border-radius: 14px;
  padding: 12px 8px;
  min-height: 56px;
  cursor: pointer;
  color: var(--muted);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .15s;
}
.currency-switch-bar .cur-btn:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  color: var(--primary);
}
.currency-switch-bar .cur-btn.active {
  background: linear-gradient(145deg, #1e40af 0%, #2563eb 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28);
  transform: translateY(-1px);
}
.currency-switch-bar .cur-btn-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.currency-switch-bar .cur-sym {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
}
.currency-switch-bar .cur-code {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
}
.currency-switch-bar .cur-btn.active .cur-sym,
.currency-switch-bar .cur-btn.active .cur-code { color: #fff; }

/* Desktop topbar cleaner padding for profile chip */
@media (min-width: 1024px) {
  .page-header-block .topbar {
    margin-bottom: 0;
    border-radius: 16px 16px 0 0;
  }
  .page-header-block .currency-bar {
    margin-top: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-top: none;
  }
}
@media (max-width: 1023px) {
  .page-header-block .topbar { display: none; }
  .page-header-block .currency-bar {
    margin-top: -8px;
    position: relative;
    z-index: 2;
  }
}

/* default currency switch (pill) — jangan override .currency-switch-bar */
.currency-switch:not(.currency-switch-bar) .cur-btn {
  border: none;
  background: transparent;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s, transform .12s;
}
.currency-switch:not(.currency-switch-bar) .cur-btn:hover {
  background: #e2e8f0;
  color: var(--text);
}
.currency-switch:not(.currency-switch-bar) .cur-btn:active {
  transform: scale(0.97);
}
.currency-switch:not(.currency-switch-bar) .cur-btn.active {
  background: var(--primary);
  color: #fff;
}
.currency-switch:not(.currency-switch-bar) .cur-btn.active:hover {
  background: var(--primary-2);
  color: #fff;
}


/* ===== Single header (mobile vs desktop) ===== */
@media (max-width: 1023px) {
  .page-header-block > .topbar,
  .main > .topbar,
  .view-host .topbar {
    display: none !important;
  }
  .page-header-block > .m-topbar {
    display: block !important;
  }
  .m-topbar .subtle { display: none !important; }
}
@media (min-width: 1024px) {
  .page-header-block > .m-topbar {
    display: none !important;
  }
  .page-header-block > .topbar {
    display: flex !important;
  }
}

/* Metric sub-date under value */
.metric .metric-sub {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,.88);
  position: relative;
  z-index: 1;
  letter-spacing: 0.01em;
}

/* Auth pages — clean professional */
.auth-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: #f1f5f9 !important;
}
.auth-stack {
  width: 100%;
  max-width: 400px;
  gap: 16px !important;
}
.auth-card {
  width: 100%;
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 16px !important;
  padding: 28px 24px !important;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06) !important;
  gap: 14px !important;
}
.auth-card .brand-hero {
  margin: 0 0 8px !important;
  padding: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--text) !important;
  text-align: left !important;
  align-items: flex-start !important;
  display: flex !important;
  flex-direction: row !important;
  gap: 12px !important;
  box-shadow: none !important;
}
.auth-card .brand-hero::before { display: none !important; }
.auth-card .brand-icon {
  width: 44px !important;
  height: 44px !important;
  border-radius: 12px !important;
  background: linear-gradient(145deg, #1e40af, #2563eb) !important;
  display: grid !important;
  place-items: center !important;
  flex-shrink: 0;
  margin: 0 !important;
}
.auth-card .brand-hero h1 {
  font-size: 20px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin: 0 !important;
  letter-spacing: -0.02em !important;
}
.auth-card .brand-sub {
  color: #64748b !important;
  font-size: 13px !important;
  margin: 2px 0 0 !important;
  opacity: 1 !important;
}
.auth-card .brand-hero-text { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.auth-title {
  font-size: 17px !important;
  font-weight: 700 !important;
  margin: 8px 0 0 !important;
  color: #0f172a !important;
}
.auth-sub {
  display: none !important; /* kurangi copy berulang */
}
.auth-footnote {
  color: #94a3b8;
  font-size: 12px;
  text-align: center;
}
.auth-card .button,
.auth-card .button-primary {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  font-weight: 600;
}
.auth-card .form { gap: 14px; }
.info-msg {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: #475569;
  line-height: 1.45;
}

.metrics.metrics-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) {
  .metrics.metrics-4 { grid-template-columns: repeat(4, 1fr); }
}


/* ===== Auth page with blue header ===== */
.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #f1f5f9;
}
.auth-header {
  background: linear-gradient(160deg, #1e40af 0%, #2563eb 55%, #3b82f6 100%);
  color: #fff;
  padding: 14px 18px;
  padding-top: max(14px, env(safe-area-inset-top, 0px));
  border-radius: 0 0 20px 20px;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
  flex-shrink: 0;
}
.auth-header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 420px;
  margin: 0 auto;
  min-height: 48px;
}
.auth-header-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  background: rgba(255,255,255,.18);
  flex-shrink: 0;
}
.auth-header-title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.auth-header-sub {
  font-size: 12px;
  opacity: .9;
  margin-top: 2px;
  font-weight: 600;
  letter-spacing: .02em;
}
.auth-page .auth-wrap {
  flex: 1;
  display: flex !important;
  align-items: flex-start;
  justify-content: center;
  padding: 20px 16px 32px !important;
  background: transparent !important;
  min-height: 0 !important;
}
.auth-page .auth-card {
  margin-top: 4px;
}
.auth-page .auth-title {
  display: block !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  margin: 0 0 4px !important;
  color: #0f172a !important;
}
/* override old flat brand-hero rules on auth card */
.auth-page .auth-card .brand-hero { display: none !important; }

/* Password eye toggle */
.pw-toggle {
  min-width: 40px !important;
  width: 40px !important;
  height: 40px !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center !important;
  font-size: 18px !important;
  line-height: 1 !important;
  border-radius: 10px !important;
  background: #f1f5f9 !important;
  border: 1px solid var(--line) !important;
  color: var(--text) !important;
}

/* ===== Currency bar — compact on mobile ===== */
@media (max-width: 1023px) {
  .currency-bar {
    margin: 8px 0 10px !important;
    padding: 8px !important;
    border-radius: 12px !important;
  }
  .currency-bar-head {
    margin-bottom: 6px !important;
  }
  .currency-bar-label {
    font-size: 11px !important;
  }
  .currency-bar-hint { display: none !important; }
  .currency-switch-bar {
    gap: 6px !important;
  }
  .currency-switch-bar .cur-btn {
    min-height: 40px !important;
    padding: 6px 4px !important;
    border-radius: 10px !important;
  }
  .currency-switch-bar .cur-sym {
    font-size: 14px !important;
  }
  .currency-switch-bar .cur-code {
    font-size: 11px !important;
  }
  .page-header-block .currency-bar {
    margin-top: -4px !important;
  }
}


/* Delete icon button — global */
.btn-icon-delete {
  appearance: none;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #dc2626;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background .15s, border-color .15s, transform .15s;
}
.btn-icon-delete:hover {
  background: #fee2e2;
  border-color: #f87171;
  transform: translateY(-1px);
}
.btn-icon-delete:active { transform: none; }
.list-item .btn-icon-delete { margin-left: 8px; }
.list-item {
  gap: 8px;
}
.list-item .amount {
  margin-left: auto;
}


/* Profile photo */
.profile-photo-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.profile-avatar-wrap .avatar {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
  border: 3px solid #fff;
}
.profile-photo-actions { flex: 1; min-width: 160px; }
.avatar-photo img { border-radius: inherit; }


.profile-avatar-clickable {
  appearance: none;
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  position: relative;
}
.profile-avatar-clickable:hover .avatar {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35), 0 4px 14px rgba(15, 23, 42, 0.12);
}
.profile-avatar-clickable.is-uploading {
  opacity: 0.65;
  pointer-events: none;
}
.profile-avatar-clickable::after {
  content: '📷';
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #1e40af;
  color: #fff;
  font-size: 13px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
  line-height: 1;
}


/* ===== Interactive controls (currency, tabs, nav) ===== */
.currency-bar {
  position: relative;
  z-index: 5;
  isolation: isolate;
}
.currency-switch-bar .cur-btn {
  appearance: none;
  -webkit-appearance: none;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  cursor: pointer !important;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: rgba(37, 99, 235, 0.15);
  position: relative;
  z-index: 1;
}
.currency-switch-bar .cur-btn:hover:not(.active) {
  border-color: #60a5fa !important;
  background: #dbeafe !important;
  color: #1d4ed8 !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}
.currency-switch-bar .cur-btn:active {
  transform: scale(0.97) !important;
}
.currency-switch-bar .cur-btn.active:hover {
  filter: brightness(1.05);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.34);
}
.currency-switch-bar .cur-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Segmented / debt tabs / generic tabs */
.segmented button,
.debt-tabs button,
.tabs .tab,
.admin-tabs .tab,
.auth-tabs button {
  cursor: pointer !important;
  touch-action: manipulation;
  transition: background .15s, color .15s, box-shadow .15s, transform .12s;
}
.segmented button:hover:not([class*="active-"]) {
  background: #e2e8f0;
  color: var(--text);
}
.segmented button:active { transform: scale(0.97); }
.debt-tabs button:hover:not(.active) {
  background: #e2e8f0;
  color: var(--text);
}
.debt-tabs button:active { transform: scale(0.97); }
.tabs .tab:hover:not(.active),
.admin-tabs .tab:hover:not(.active) {
  background: var(--surface-soft);
  color: var(--text);
}

/* Nav interactive */
.side-nav .nav-item,
.bottom-nav .nav-item {
  cursor: pointer !important;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(37, 99, 235, 0.12);
  transition: background .15s, color .15s, transform .12s;
}
.side-nav .nav-item:active,
.bottom-nav .nav-item:active {
  transform: scale(0.98);
}
.bottom-nav .nav-item:hover:not(.active) {
  color: var(--text);
  background: var(--surface-soft);
}
.header-profile-chip,
.user-card-clickable,
.btn-icon-delete,
.button,
.cur-chip,
.period-chip {
  cursor: pointer !important;
  touch-action: manipulation;
}

/* Ensure nothing invisible blocks currency bar */
.page-header-block {
  position: relative;
  z-index: 6;
}
.page-header-block .currency-bar {
  pointer-events: auto;
}
.page-header-block .currency-bar * {
  pointer-events: auto;
}


/* ===== Avatar crop editor ===== */
.avatar-crop-backdrop { z-index: 220; }
.avatar-crop-card {
  width: min(420px, calc(100vw - 24px));
  max-height: min(92vh, 720px);
  overflow: auto;
}
.avatar-crop-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 4px 8px;
}
.avatar-crop-stage {
  position: relative;
  width: min(280px, 100%);
  margin: 0 auto;
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  background: #0f172a;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
  touch-action: none;
}
.avatar-crop-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}
.avatar-crop-canvas.is-dragging { cursor: grabbing; }
.avatar-crop-mask {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* darken outside circle */
  background: radial-gradient(circle at center,
    transparent 0,
    transparent 46%,
    rgba(15, 23, 42, 0.55) 47%,
    rgba(15, 23, 42, 0.72) 100%);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.35);
  border-radius: 16px;
}
.avatar-crop-hint {
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.avatar-crop-controls { display: grid; gap: 8px; }
.avatar-crop-zoom-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}
.avatar-crop-range {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
}
.avatar-crop-zoom-label {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.avatar-crop-actions-mid {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.avatar-crop-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}
.avatar-crop-footer .button { min-width: 110px; }



/* Dashboard period filter — compact */
.dash-period-block {
  margin: 0 0 12px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  display: grid;
  gap: 8px;
}
.dash-period-chips {
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}
.dash-period-chips .period-chip {
  flex: 1 1 0;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 9px;
  box-shadow: none;
}
.dash-period-chips .period-chip.active {
  background: #1e40af;
  color: #fff;
  box-shadow: none;
}
.dash-period-input-wrap {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.dash-period-input-wrap .period-input {
  max-width: 220px;
  width: 100%;
  margin: 0;
}
.dash-period-hint { display: none !important; }
.metric .metric-sub {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.9;
  margin-top: 2px;
}


/* Filter di dalam kartu Transaksi saya terbaru */
.dash-tx-filters {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}
.card .dash-period-block {
  margin: 0;
}
.dash-tx-search {
  margin: 0;
  padding: 0;
}


/* Notifikasi jatuh tempo hutang/cicilan */
.debt-due-notice {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #fcd34d;
  background: #fffbeb;
  border-radius: 14px;
  display: grid;
  gap: 10px;
}
.debt-due-title {
  font-weight: 700;
  font-size: 14px;
  color: #92400e;
}
.debt-due-sub {
  font-size: 12px;
  color: #a16207;
  margin-top: -4px;
}
.debt-due-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #fde68a;
  border-radius: 12px;
}
.debt-due-name {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}
.debt-due-q {
  font-weight: 600;
  color: #78350f;
  font-size: 14px;
  line-height: 1.35;
  margin-bottom: 4px;
}
.debt-due-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.debt-due-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* === HERMES MONEY CHANGER MOBILE FIX START === */
.mc-from-to {
 display: grid;
 grid-template-columns: 1fr 1fr;
 gap: 14px;
 border: 1px solid #e2e8f0;
 padding: 12px;
 border-radius: 8px;
 background-color: #f8fafc;
}
.mc-panel { min-width: 0; }
.mc-panel-title {
 font-size: 11px;
 display: block;
 margin-bottom: 8px;
 color: #64748b;
 letter-spacing: 0.05em;
}
.mc-panel .field { margin-top: 8px; }
.mc-panel .field:first-of-type { margin-top: 0; }

.custom-select-trigger {
 align-items: center;
 gap: 8px;
 min-height: 52px;
}
.custom-select-trigger-content {
 flex: 1 1 auto;
 min-width: 0;
 width: 100%;
 display: block !important;
}
.custom-select-arrow {
 flex: 0 0 auto;
 margin-left: 4px;
}
.custom-select-account-row {
 display: flex;
 align-items: flex-start;
 gap: 10px;
 width: 100%;
 min-width: 0;
}
.custom-select-logo {
 flex: 0 0 auto;
 width: 28px;
 height: 28px;
 display: flex;
 align-items: center;
 justify-content: center;
 margin-top: 1px;
}
.custom-select-logo--empty {
 width: 0;
 height: 0;
 margin: 0;
 overflow: hidden;
}
.custom-select-account-body {
 flex: 1 1 auto;
 min-width: 0;
 display: flex;
 flex-direction: column;
 gap: 2px;
}
.custom-select-name {
 font-weight: 600;
 font-size: 0.92rem;
 line-height: 1.25;
 white-space: nowrap;
 overflow: hidden;
 text-overflow: ellipsis;
 max-width: 100%;
}
.custom-select-meta {
 display: flex;
 flex-wrap: wrap;
 align-items: center;
 justify-content: space-between;
 gap: 4px 10px;
 font-size: 0.78rem;
 line-height: 1.3;
 color: #64748b;
}
.custom-select-account {
 font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
 font-size: 0.78rem;
 color: #64748b;
 min-width: 0;
 overflow: hidden;
 text-overflow: ellipsis;
 white-space: nowrap;
}
.custom-select-option {
 display: block !important;
 padding: 10px 12px !important;
 min-height: 52px;
}
.custom-select-dropdown {
 max-height: min(50vh, 320px);
 z-index: 600;
}
.custom-select-balance {
 font-weight: 700;
 white-space: nowrap;
 margin-left: auto;
 color: #475569;
}

@media (max-width: 640px) {
 .mc-from-to {
 grid-template-columns: 1fr;
 gap: 12px;
 }
 .mc-panel + .mc-panel {
 border-top: 1px dashed #cbd5e1;
 padding-top: 12px;
 }
 .custom-select-trigger { padding: 10px 12px; }
 .row-2 { grid-template-columns: 1fr !important; }
}
/* === HERMES MONEY CHANGER MOBILE FIX END === */
