:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #eef2ff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --primary: #1d4ed8;
  --primary-2: #2563eb;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #0ea5e9;
  --purple: #8b5cf6;
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.05);
  --shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 22px 48px rgba(15, 23, 42, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 25%),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.08), transparent 18%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ========== 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(180deg, #0f172a, #172554);
  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: 900; 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: linear-gradient(135deg, var(--primary), var(--info));
  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: 900;
}
.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: 18px 16px 110px; min-width: 0; }
@media (min-width: 1024px) { .main { padding: 28px 32px 40px; } }

.topbar {
  display: flex; flex-wrap: wrap;
  justify-content: space-between; align-items: end;
  gap: 12px; margin-bottom: 18px;
}
.topbar h1 { margin: 0 0 6px; font-size: 26px; line-height: 1.15; }
@media (min-width: 768px) { .topbar h1 { font-size: 30px; } }
.topbar p { margin: 0; color: var(--muted); 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: linear-gradient(135deg, var(--primary), var(--info));
  color: #fff;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.3);
}

.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(135deg, var(--primary), var(--info));
  color: #fff;
  margin: -18px -16px 18px;
  padding: 56px 18px 22px;
  border-radius: 0 0 26px 26px;
  position: relative;
}
@media (min-width: 1024px) {
  .m-topbar { display: none; }
}
.m-topbar .subtle {
  font-size: 12px; letter-spacing: .04em;
  text-transform: uppercase; opacity: .85;
}
.m-topbar .title { font-size: 24px; font-weight: 800; margin-top: 8px; }
.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 { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.m-topbar .month-pill {
  background: rgba(255,255,255,.2);
  padding: 8px 12px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 800;
}

/* ========== 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: 16px; font-weight: 900; }
.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: 10px;
  margin-bottom: 14px;
}
@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: var(--radius-lg);
  padding: 14px;
  color: #fff;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  position: relative; overflow: hidden;
}
.metric.green  { background: linear-gradient(135deg, #059669, #10b981); }
.metric.red    { background: linear-gradient(135deg, #e11d48, #f43f5e); }
.metric.blue   { background: linear-gradient(135deg, #0284c7, #38bdf8); }
.metric.purple { background: linear-gradient(135deg, #6d28d9, #a78bfa); }
.metric.gold   { background: linear-gradient(135deg, #d97706, #fbbf24); }
.metric.dark   { background: linear-gradient(135deg, #0f172a, #1e293b); }
.metric.teal   { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.metric.violet { background: linear-gradient(135deg, #6d28d9, #a78bfa); }
.metric-value-single {
  display: block;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
  margin: 4px 0 6px;
  word-break: break-all;
  color: #fff;
  letter-spacing: -0.02em;
}
.metric strong {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: .85;
  margin-bottom: 6px;
}
.metric span {
  display: block;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.metric small {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  opacity: .75;
  line-height: 1.4;
}

@media (min-width: 768px) {
  .metric-value-single,
  .metric span {
    font-size: 22px;
  }
  .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: 16px;
  padding: 12px;
}
.list-item.clickable { cursor: pointer; transition: .15s; }
.list-item.clickable:hover { background: #f0f9ff; border-color: #93c5fd; }
.list-item.selected {
  background: linear-gradient(135deg, #eff6ff, #e0f2fe);
  border-color: #60a5fa;
  box-shadow: 0 10px 22px rgba(59, 130, 246, 0.10);
}
.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: 14px;
  display: grid; place-items: center;
  color: #fff; font-weight: 800; 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: linear-gradient(135deg, #38bdf8, #2563eb);
}

/* ========== 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: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  color: var(--text);
  width: 100%;
  outline: none;
  transition: .15s;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.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: linear-gradient(135deg, #10b981, #059669); color: #fff;
}
.segmented button.active-expense {
  background: linear-gradient(135deg, #fb7185, #ef4444); color: #fff;
}
.segmented button.active-transfer {
  background: linear-gradient(135deg, #0ea5e9, #1d4ed8); 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: 16px;
  padding: 14px 16px;
  text-align: center; color: #fff;
  font-size: 14px; font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 14px 24px rgba(37, 99, 235, 0.18);
  cursor: pointer; transition: .15s;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.button.sky    { background: linear-gradient(135deg, #0ea5e9, #0284c7); box-shadow: 0 14px 24px rgba(14, 165, 233, 0.2); }
.button.purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); box-shadow: 0 14px 24px rgba(139, 92, 246, 0.2); }
.button.dark   { background: linear-gradient(135deg, #0f172a, #334155); box-shadow: 0 14px 24px rgba(15, 23, 42, 0.2); }
.button.danger { background: linear-gradient(135deg, #ef4444, #b91c1c); box-shadow: 0 14px 24px rgba(239, 68, 68, 0.2); }
.button.ghost  { background: transparent; color: var(--primary); box-shadow: none; border: 1px solid var(--line); }
.button.small  { padding: 8px 12px; font-size: 12px; border-radius: 10px; }

.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:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.15), transparent 24%),
    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-lg);
}
.brand-hero {
  background: linear-gradient(135deg, #0f172a, #1d4ed8);
  border-radius: var(--radius-xl);
  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: 12px; right: 12px; bottom: 12px;
  background: rgba(255,255,255,.95);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 8px;
  display: grid;
  gap: 6px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  z-index: 50;
  max-width: 520px;
  margin: 0 auto;
}
.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 {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--info));
}
@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(135deg, #0f172a, #1e3a8a);
  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: 900; }
.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: #fff; padding: 16px; border-radius: 18px; }
.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: 900; 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: 900; 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: linear-gradient(135deg, #eff6ff, #e0f2fe);
  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: linear-gradient(135deg, #eef2ff, #f0f9ff);
  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: 900; }
.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: linear-gradient(135deg, var(--primary), var(--info));
  color: #fff; border-color: transparent;
}

/* ========== MISC ========== */
.empty {
  text-align: center; padding: 28px 12px;
  color: var(--muted); font-size: 13px;
}
.empty .ic { font-size: 36px; margin-bottom: 8px; opacity: .4; }

.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: linear-gradient(135deg, var(--primary), var(--info));
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 12px rgba(29, 78, 216, .25);
}

/* ========== BUTTON VARIANTS ========== */
.button.danger {
  background: linear-gradient(135deg, #be123c, #f43f5e);
  color: #fff; border: none;
  font-weight: 700;
}
.button.danger:hover { background: linear-gradient(135deg, #9f1239, #e11d48); }
.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: linear-gradient(135deg, #eff6ff, #f0f9ff);
  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: linear-gradient(135deg, var(--primary), var(--info));
  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: linear-gradient(135deg, #8b5cf6, #d946ef);
  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: 900;
  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: 900; }
.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: 44px; height: 44px; flex: 0 0 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1d4ed8; font-size: 22px; font-weight: 900;
  line-height: 1;
}
.modal-icon.danger { background: linear-gradient(135deg, #fee2e2, #fecaca); 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: linear-gradient(135deg, var(--primary), var(--info)); color: #fff; border-color: transparent; }
.btn-confirm:hover { box-shadow: 0 6px 16px rgba(29, 78, 216, .32); }
.btn-danger { background: linear-gradient(135deg, #dc2626, #b91c1c); color: #fff; border-color: transparent; }
.btn-danger:hover { box-shadow: 0 6px 16px rgba(220, 38, 38, .32); }

/* ========== 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: linear-gradient(135deg, var(--primary), var(--info));
  color: #fff; box-shadow: 0 2px 6px rgba(29, 78, 216, .25);
}
.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: linear-gradient(135deg, #f0f9ff 0%, #e0e7ff 50%, #f5f3ff 100%); }
.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: 0 20px 50px rgba(15, 23, 42, .12), 0 4px 12px rgba(15, 23, 42, .06);
  padding: 32px 28px; display: flex; flex-direction: column; gap: 16px;
}
.brand-hero {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 0;
  margin: -32px -28px 8px;
  padding: 32px 24px 28px;
  border-radius: 0 0 14px 14px;
  background: linear-gradient(135deg, #1d4ed8 0%, #4f46e5 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.brand-hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.12), transparent 45%),
    radial-gradient(circle at 80% 90%, rgba(255, 255, 255, 0.08), 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: linear-gradient(90deg, transparent, #e5e7eb, transparent); 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: 900; 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: linear-gradient(135deg, var(--primary), #6366f1);
  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: #f0f9ff; 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: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
}
.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: linear-gradient(135deg, #16a34a, #15803d); 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;
}

