/* ========================================================
   REKAPZ DASHBOARD - ULTRA-PREMIUM CLAYMORPHISM DESIGN SYSTEM
   Tactile, 3D pillowy depth, extruded rubber keys, debossed wells
   ======================================================== */

:root {
  /* Clay Canvas & Surface Palettes */
  --clay-bg: #0d121c;
  --clay-bg-gradient: radial-gradient(120% 120% at 50% 0%, #1a2336 0%, #0f1523 50%, #080c14 100%);

  --clay-surface: #182030;
  --clay-surface-gradient: linear-gradient(145deg, #1f283d 0%, #131926 100%);
  --clay-surface-hover: linear-gradient(145deg, #242f47 0%, #171f30 100%);
  --clay-surface-active: linear-gradient(145deg, #131926 0%, #1c2437 100%);
  --clay-inset-bg: #090e17;

  /* Accent Clay Colors (Vibrant, Friendly, High-Contrast) */
  --clay-emerald: #10b981;
  --clay-emerald-edge: #047857;
  --clay-emerald-gradient: linear-gradient(180deg, #10b981 0%, #059669 100%);

  --clay-rose: #f43f5e;
  --clay-rose-edge: #be123c;
  --clay-rose-gradient: linear-gradient(180deg, #f43f5e 0%, #e11d48 100%);

  --clay-iris: #6366f1;
  --clay-iris-edge: #4338ca;
  --clay-iris-gradient: linear-gradient(180deg, #6366f1 0%, #4f46e5 100%);

  --clay-amber: #f59e0b;
  --clay-amber-edge: #b45309;
  --clay-amber-gradient: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);

  --clay-blue: #38bdf8;
  --clay-blue-edge: #0284c7;
  --clay-blue-gradient: linear-gradient(180deg, #38bdf8 0%, #0ea5e9 100%);

  --clay-dark-btn: #1e2638;
  --clay-dark-btn-edge: #0d131f;

  /* Clay Shadows (The Core of Claymorphism) */
  --clay-card-shadow: 
    14px 18px 36px rgba(0, 0, 0, 0.48),
    -6px -6px 18px rgba(255, 255, 255, 0.04),
    inset 2px 2px 4px rgba(255, 255, 255, 0.14),
    inset -3px -3px 6px rgba(0, 0, 0, 0.45);

  --clay-card-shadow-hover: 
    18px 24px 44px rgba(0, 0, 0, 0.58),
    -6px -6px 20px rgba(255, 255, 255, 0.05),
    inset 2px 2px 5px rgba(255, 255, 255, 0.18),
    inset -4px -4px 8px rgba(0, 0, 0, 0.5);

  --clay-btn-shadow:
    0 5px 0 var(--clay-dark-btn-edge),
    0 10px 18px rgba(0, 0, 0, 0.35),
    inset 0 1px 2px rgba(255, 255, 255, 0.25),
    inset 0 -2px 3px rgba(0, 0, 0, 0.3);

  --clay-btn-shadow-active:
    0 2px 0 var(--clay-dark-btn-edge),
    0 4px 8px rgba(0, 0, 0, 0.25),
    inset 0 2px 4px rgba(0, 0, 0, 0.5);

  --clay-input-shadow:
    inset 4px 4px 8px rgba(0, 0, 0, 0.7),
    inset -2px -2px 5px rgba(255, 255, 255, 0.04);

  --clay-pill-shadow:
    3px 4px 10px rgba(0, 0, 0, 0.35),
    -2px -2px 5px rgba(255, 255, 255, 0.05),
    inset 1px 1px 2px rgba(255, 255, 255, 0.3),
    inset -1px -1px 2px rgba(0, 0, 0, 0.3);

  /* Typography & Layout Metrics */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --border-clay: rgba(255, 255, 255, 0.07);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --sidebar-width: 275px;
  --topbar-height: 76px;

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-xl: 34px;
  --radius-full: 9999px;

  /* Legacy color aliases */
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-violet: #6366f1;
  --accent-blue: #38bdf8;
  --accent-amber: #f59e0b;
}

/* ========================================================
   GLOBAL RESETS & CLAY CANVAS
   ======================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body.dashboard-body {
  font-family: var(--font-sans);
  background: var(--clay-bg-gradient);
  background-color: var(--clay-bg);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* Custom Soft Scrollbars */
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: #090e17;
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(145deg, #253147 0%, #161e2c 100%);
  border-radius: var(--radius-full);
  box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.15);
}

::-webkit-scrollbar-thumb:hover {
  background: #3b4d6e;
}

/* Ambient Studio Light Glows */
.dash-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.18;
}

.glow-top {
  top: -140px;
  right: 12%;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
}

.glow-bottom {
  bottom: -160px;
  left: 8%;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, #10b981 0%, transparent 70%);
}

/* Base Clay Pillowy Card */
.glass-card, .clay-card {
  background: var(--clay-surface-gradient);
  border: 1px solid var(--border-clay);
  border-radius: var(--radius-lg);
  box-shadow: var(--clay-card-shadow);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.glass-card:hover, .clay-card:hover {
  box-shadow: var(--clay-card-shadow-hover);
  border-color: rgba(255, 255, 255, 0.12);
}

/* Utility Colors & Alignment */
.text-emerald { color: #34d399 !important; }
.text-rose { color: #fb7185 !important; }
.text-amber { color: #fbbf24 !important; }
.text-blue { color: #60a5fa !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-dim { color: var(--text-dim); }

/* ========================================================
   APPLICATION LAYOUT
   ======================================================== */
.app-layout {
  display: flex;
  height: 100vh;
  position: relative;
  z-index: 10;
  overflow: hidden;
}

/* ========================================================
   SIDEBAR NAVIGATION (SCULPTED CLAY RAIL)
   ======================================================== */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #131926 0%, #0b0f17 100%);
  border-right: 1px solid var(--border-clay);
  box-shadow: 10px 0 28px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 50;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sidebar-header {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  border-bottom: 1px solid var(--border-clay);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: var(--clay-emerald-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 
    0 4px 0 var(--clay-emerald-edge),
    0 8px 16px rgba(16, 185, 129, 0.4),
    inset 0 1px 2px rgba(255, 255, 255, 0.4),
    inset 0 -2px 3px rgba(0, 0, 0, 0.25);
}

.brand-title {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-subtitle {
  display: block;
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.btn-sidebar-close {
  display: none;
  background: var(--clay-surface-gradient);
  border: 1px solid var(--border-clay);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.sidebar-nav {
  flex: 1;
  padding: 24px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-section-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  padding: 14px 14px 6px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 18px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.sidebar-item:hover {
  background: var(--clay-surface-hover);
  color: var(--text-main);
  transform: translateX(4px);
  box-shadow: 6px 8px 16px rgba(0, 0, 0, 0.35);
}

.sidebar-item.active {
  background: linear-gradient(145deg, #222d42 0%, #151c2a 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-left: 4px solid #10b981;
  color: #ffffff;
  box-shadow: 
    8px 10px 22px rgba(0, 0, 0, 0.5),
    -2px -2px 6px rgba(255, 255, 255, 0.06),
    inset 2px 2px 4px rgba(255, 255, 255, 0.16),
    inset -2px -2px 5px rgba(0, 0, 0, 0.45);
}

.sidebar-item.active .item-icon {
  transform: scale(1.18);
}

.item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.item-icon svg {
  width: 19px;
  height: 19px;
  display: block;
}

.badge-pending-count {
  margin-left: auto;
  background: var(--clay-amber-gradient);
  color: #1a1001;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  box-shadow: var(--clay-pill-shadow);
}

.sidebar-footer {
  padding: 18px;
  border-top: 1px solid var(--border-clay);
  background: rgba(10, 14, 22, 0.5);
}

.user-profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  background: var(--clay-surface-gradient);
  border: 1px solid var(--border-clay);
  box-shadow: var(--clay-card-shadow);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--clay-iris-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  box-shadow: 
    0 3px 0 var(--clay-iris-edge),
    3px 4px 10px rgba(0, 0, 0, 0.35),
    inset 1px 1px 2px rgba(255, 255, 255, 0.35);
}

.user-info {
  flex: 1;
  overflow: hidden;
}

.user-name {
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-badge {
  font-size: 0.72rem;
  color: #34d399;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-logout {
  background: var(--clay-surface-gradient);
  border: 1px solid var(--border-clay);
  color: var(--text-dim);
  cursor: pointer;
  padding: 9px;
  border-radius: var(--radius-sm);
  box-shadow: var(--clay-btn-shadow);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-logout:hover {
  background: var(--clay-rose-gradient);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 
    0 4px 0 var(--clay-rose-edge),
    0 6px 14px rgba(244, 63, 94, 0.4);
}

.btn-logout:active {
  transform: translateY(2px);
}

/* ========================================================
   MAIN CONTENT AREA & TOPBAR
   ======================================================== */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
}

.topbar {
  height: var(--topbar-height);
  padding: 0 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-clay);
  background: rgba(13, 18, 28, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-sidebar-toggle {
  display: none;
  background: var(--clay-surface-gradient);
  border: 1px solid var(--border-clay);
  color: var(--text-main);
  padding: 9px;
  border-radius: var(--radius-md);
  box-shadow: var(--clay-btn-shadow);
  cursor: pointer;
}

.page-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.db-status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--clay-surface-gradient);
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: var(--clay-pill-shadow);
  font-size: 0.8rem;
  font-weight: 700;
  color: #6ee7b7;
}

.status-indicator-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 12px #10b981;
}

/* ========================================================
   CONTENT CONTAINER & TAB PANELS
   ======================================================== */
.content-container {
  padding: 34px;
  flex: 1;
  max-width: 1560px;
  margin: 0 auto;
  width: 100%;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeInTab 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes fadeInTab {
  from { opacity: 0; transform: translateY(12px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ========================================================
   SMART CHAT BANNER (CLAY CONTROL CONSOLE)
   ======================================================== */
.smart-chat-banner {
  padding: 24px 28px;
  margin-bottom: 30px;
  background: linear-gradient(145deg, #1b2436 0%, #111724 100%);
  border: 1px solid rgba(16, 185, 129, 0.22);
  border-radius: var(--radius-xl);
  box-shadow: 
    16px 20px 42px rgba(0, 0, 0, 0.52),
    -6px -6px 18px rgba(255, 255, 255, 0.04),
    inset 2px 2px 4px rgba(255, 255, 255, 0.14),
    inset -3px -3px 6px rgba(0, 0, 0, 0.45);
}

.smart-chat-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.smart-chat-icon {
  font-size: 1.7rem;
  filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.4));
}

.smart-chat-input-row input {
  flex: 1;
  background: var(--clay-inset-bg);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 15px 22px;
  color: var(--text-main);
  font-size: 0.98rem;
  outline: none;
  box-shadow: var(--clay-input-shadow);
  transition: all 0.2s ease;
}

.smart-chat-input-row input:focus {
  border-color: #10b981;
  box-shadow: 
    inset 3px 3px 6px rgba(0, 0, 0, 0.7),
    0 0 0 3px rgba(16, 185, 129, 0.22);
}

.btn-chat-tool {
  background: var(--clay-surface-gradient);
  border: 1px solid var(--border-clay);
  border-radius: var(--radius-md);
  font-size: 1.3rem;
  color: var(--text-main);
  cursor: pointer;
  box-shadow: var(--clay-btn-shadow);
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 48px;
}

.btn-chat-tool:hover {
  transform: translateY(-2px);
  background: var(--clay-surface-hover);
  box-shadow: 
    0 7px 0 var(--clay-dark-btn-edge),
    0 12px 20px rgba(0, 0, 0, 0.4),
    inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.btn-chat-tool:active {
  transform: translateY(3px);
  box-shadow: var(--clay-btn-shadow-active);
}

.btn-chat-tool.listening {
  background: var(--clay-rose-gradient) !important;
  color: #fff;
  border-color: #f43f5e !important;
  box-shadow: 0 4px 0 var(--clay-rose-edge), 0 0 20px rgba(244, 63, 94, 0.7) !important;
  animation: pulse-mic 1.2s infinite;
}

@keyframes pulse-mic {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.smart-chat-chips {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.chip-label {
  font-size: 0.76rem;
  color: var(--text-dim);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chat-chip {
  background: var(--clay-surface-gradient);
  border: 1px solid var(--border-clay);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 16px;
  cursor: pointer;
  box-shadow: var(--clay-pill-shadow);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-chip:hover {
  background: var(--clay-surface-hover);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
  transform: translateY(-2px);
  box-shadow: 
    4px 6px 14px rgba(0, 0, 0, 0.45),
    inset 1px 1px 2px rgba(255, 255, 255, 0.25);
}

.chat-chip:active {
  transform: translateY(1px) scale(0.97);
}

/* ========================================================
   KPI CARDS (PILLOWY 3D CLAY CUSHIONS)
   ======================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 24px;
  margin-bottom: 30px;
}

.kpi-card {
  padding: 26px 28px;
  border-radius: var(--radius-lg);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.kpi-title {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 0.07em;
}

.kpi-icon-badge {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    4px 6px 14px rgba(0, 0, 0, 0.35),
    -2px -2px 6px rgba(255, 255, 255, 0.08),
    inset 2px 2px 3px rgba(255, 255, 255, 0.35),
    inset -2px -2px 4px rgba(0, 0, 0, 0.3);
}

.kpi-icon-badge svg {
  width: 22px;
  height: 22px;
  display: block;
}

.icon-emerald { background: var(--clay-emerald-gradient); color: #fff; }
.icon-rose { background: var(--clay-rose-gradient); color: #fff; }
.icon-blue { background: var(--clay-blue-gradient); color: #fff; }
.icon-violet { background: var(--clay-iris-gradient); color: #fff; }
.icon-amber { background: var(--clay-amber-gradient); color: #fff; }

.kpi-value {
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.kpi-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ========================================================
   CHARTS GRID & VISUAL ANALYTICS
   ======================================================== */
.charts-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 26px;
  margin-bottom: 30px;
}

.chart-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
}

.chart-header {
  margin-bottom: 22px;
}

.chart-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.chart-subtitle {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.chart-canvas-wrapper {
  position: relative;
  height: 300px;
  width: 100%;
}

.donut-wrapper {
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========================================================
   BOTTOM OVERVIEW GRID: TRANSACTIONS & WALLETS
   ======================================================== */
.bottom-overview-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 26px;
}

.card-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.recent-tx-card, .quick-wallets-card {
  padding: 28px;
}

/* Wallets Mini List in Overview */
.wallets-mini-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.wallet-mini-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  background: var(--clay-surface-gradient);
  border: 1px solid var(--border-clay);
  border-radius: var(--radius-md);
  box-shadow: var(--clay-btn-shadow);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wallet-mini-item:hover {
  transform: translateY(-2px);
  background: var(--clay-surface-hover);
  box-shadow: 
    0 7px 0 var(--clay-dark-btn-edge),
    0 12px 22px rgba(0, 0, 0, 0.45);
}

.wallet-mini-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.wallet-mini-icon {
  font-size: 1.45rem;
  filter: drop-shadow(2px 3px 5px rgba(0,0,0,0.3));
}

.wallet-mini-name {
  font-weight: 700;
  font-size: 0.96rem;
}

.wallet-mini-bal {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1rem;
  color: #34d399;
}

/* ========================================================
   DATA TABLES WITH CLAY LOZENGES
   ======================================================== */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
  font-size: 0.92rem;
}

.data-table th {
  text-align: left;
  padding: 10px 18px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  border: none;
}

.data-table tbody tr {
  background: linear-gradient(145deg, #182030 0%, #111722 100%);
  box-shadow: 
    6px 7px 16px rgba(0, 0, 0, 0.28),
    inset 1px 1px 2px rgba(255, 255, 255, 0.06),
    inset -1px -1px 2px rgba(0, 0, 0, 0.35);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.data-table tbody tr:hover {
  background: var(--clay-surface-hover);
  transform: translateY(-2px);
  box-shadow: 
    8px 10px 20px rgba(0, 0, 0, 0.38),
    inset 1px 1px 2px rgba(255, 255, 255, 0.12);
}

.data-table td {
  padding: 15px 18px;
  border: none;
  color: var(--text-main);
}

.data-table tbody tr td:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.data-table tbody tr td:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.tx-amount-mono {
  font-family: var(--font-mono);
  font-weight: 800;
}

/* Claymorphic Badges & Pills */
.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  box-shadow: var(--clay-pill-shadow);
}

.pill-expense {
  background: var(--clay-rose-gradient);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.pill-income {
  background: var(--clay-emerald-gradient);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.pill-wallet {
  background: var(--clay-surface-gradient);
  color: var(--text-muted);
  border: 1px solid var(--border-clay);
}

/* ========================================================
   LEDGER TAB TOOLBAR
   ======================================================== */
.ledger-card {
  padding: 30px;
}

.toolbar-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.search-box input {
  width: 330px;
  background: var(--clay-inset-bg);
  border: 1px solid var(--border-clay);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.92rem;
  outline: none;
  box-shadow: var(--clay-input-shadow);
  transition: all 0.2s ease;
}

.search-box input:focus {
  border-color: #6366f1;
  box-shadow: 
    inset 3px 3px 6px rgba(0, 0, 0, 0.7),
    0 0 0 3px rgba(99, 102, 241, 0.22);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.filter-group select {
  background: var(--clay-surface-gradient);
  border: 1px solid var(--border-clay);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.92rem;
  font-weight: 600;
  outline: none;
  box-shadow: var(--clay-btn-shadow);
  cursor: pointer;
}

/* ========================================================
   WALLETS GRID & TACTILE 3D PAYMENT CARDS
   ======================================================== */
.wallets-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 18px;
}

.section-heading {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-subheading {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.action-btn-row {
  display: flex;
  gap: 14px;
}

.wallets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

.payment-card {
  height: 205px;
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 
    16px 22px 42px rgba(0, 0, 0, 0.6),
    -4px -4px 14px rgba(255, 255, 255, 0.12),
    inset 2px 2px 4px rgba(255, 255, 255, 0.28),
    inset -3px -3px 6px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}

.payment-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 
    20px 28px 50px rgba(0, 0, 0, 0.7),
    -4px -4px 16px rgba(255, 255, 255, 0.18);
}

.card-theme-bca { background: linear-gradient(135deg, #035bb3 0%, #002254 100%); }
.card-theme-mandiri { background: linear-gradient(135deg, #024182 0%, #b8860b 100%); }
.card-theme-cash { background: linear-gradient(135deg, #057a5b 0%, #044333 100%); }
.card-theme-gopay { background: linear-gradient(135deg, #0096c7 0%, #005f73 100%); }
.card-theme-ovo { background: linear-gradient(135deg, #5b21b6 0%, #2e0854 100%); }
.card-theme-default { background: linear-gradient(135deg, #273549 0%, #151d29 100%); }

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

.card-chip {
  width: 44px;
  height: 30px;
  background: linear-gradient(135deg, #ffe066 0%, #d4af37 100%);
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 
    2px 3px 6px rgba(0, 0, 0, 0.4),
    inset 1px 1px 2px rgba(255, 255, 255, 0.7);
}

.card-brand-label {
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff;
  letter-spacing: 0.06em;
  text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.45);
}

.card-balance-box {
  margin: 10px 0;
}

.card-bal-label {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.card-balance-amount {
  font-family: var(--font-mono);
  font-size: 1.7rem;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 1px 2px 5px rgba(0, 0, 0, 0.5);
}

.card-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
}

/* ========================================================
   ANALYTICS & INSIGHTS PANEL
   ======================================================== */
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.category-bars-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cat-bar-item {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.cat-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.92rem;
  font-weight: 600;
}

.cat-bar-bg {
  height: 12px;
  background: var(--clay-inset-bg);
  border-radius: var(--radius-full);
  box-shadow: var(--clay-input-shadow);
  overflow: hidden;
}

.cat-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #6366f1 100%);
  border-radius: var(--radius-full);
  box-shadow: 2px 0 8px rgba(16, 185, 129, 0.5);
  transition: width 0.6s ease;
}

.insights-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.insight-item {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: var(--clay-surface-gradient);
  border: 1px solid var(--border-clay);
  border-radius: var(--radius-md);
  box-shadow: var(--clay-btn-shadow);
}

.insight-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--clay-inset-bg);
  border: 1px solid var(--border-clay);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #38bdf8;
}

.insight-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.insight-text strong {
  display: block;
  font-size: 0.98rem;
  margin-bottom: 4px;
}

.insight-text p {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ========================================================
   SUPER ADMIN CONTROL DECK
   ======================================================== */
.admin-table-card, .broadcast-card {
  padding: 28px;
  margin-bottom: 28px;
}

.broadcast-card textarea {
  width: 100%;
  background: var(--clay-inset-bg);
  border: 1px solid var(--border-clay);
  border-radius: var(--radius-md);
  padding: 18px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  resize: vertical;
  margin-bottom: 18px;
  box-shadow: var(--clay-input-shadow);
}

.broadcast-card textarea:focus {
  border-color: #6366f1;
}

.broadcast-actions {
  display: flex;
  justify-content: flex-end;
}

/* ========================================================
   BUTTONS: 3D EXTRUDED RUBBER / CLAY KEYS
   Physical tactile keys with satisfying click depth
   ======================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  text-decoration: none;
  position: relative;
  transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

/* Primary Emerald Clay Key */
.btn-primary {
  background: var(--clay-emerald-gradient);
  color: #ffffff;
  box-shadow: 
    0 6px 0 var(--clay-emerald-edge),
    0 12px 22px rgba(5, 150, 105, 0.4),
    inset 0 2px 2px rgba(255, 255, 255, 0.45),
    inset 0 -2px 3px rgba(0, 0, 0, 0.2);
  transform: translateY(0);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 8px 0 var(--clay-emerald-edge),
    0 16px 28px rgba(5, 150, 105, 0.5),
    inset 0 2px 2px rgba(255, 255, 255, 0.55);
}

.btn-primary:active {
  transform: translateY(4px);
  box-shadow: 
    0 2px 0 var(--clay-emerald-edge),
    0 4px 8px rgba(5, 150, 105, 0.25),
    inset 0 2px 4px rgba(0, 0, 0, 0.35);
}

/* Secondary Dark Slate Clay Key */
.btn-secondary {
  background: linear-gradient(180deg, #222c3f 0%, #151c2a 100%);
  color: var(--text-main);
  box-shadow: 
    0 5px 0 var(--clay-dark-btn-edge),
    0 10px 18px rgba(0, 0, 0, 0.35),
    inset 0 1px 2px rgba(255, 255, 255, 0.22),
    inset 0 -2px 3px rgba(0, 0, 0, 0.3);
  transform: translateY(0);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  background: linear-gradient(180deg, #28354c 0%, #192233 100%);
  box-shadow: 
    0 7px 0 var(--clay-dark-btn-edge),
    0 14px 24px rgba(0, 0, 0, 0.45),
    inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.btn-secondary:active {
  transform: translateY(3px);
  box-shadow: 
    0 2px 0 var(--clay-dark-btn-edge),
    0 4px 8px rgba(0, 0, 0, 0.25),
    inset 0 2px 4px rgba(0, 0, 0, 0.45);
}

/* Ghost Button */
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text-main);
  background: var(--clay-surface-gradient);
  box-shadow: var(--clay-pill-shadow);
}

/* Delete / Action Button */
.btn-action-del {
  background: var(--clay-surface-gradient);
  border: 1px solid var(--border-clay);
  color: var(--text-dim);
  cursor: pointer;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  box-shadow: var(--clay-pill-shadow);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-action-del:hover {
  background: var(--clay-rose-gradient);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 
    0 4px 0 var(--clay-rose-edge),
    0 6px 14px rgba(244, 63, 94, 0.4);
}

.btn-action-del:active {
  transform: translateY(2px);
}

/* ========================================================
   MODALS (3D CHUNKY CLAY POPUPS)
   ======================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 11, 18, 0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 520px;
  padding: 36px;
  position: relative;
  background: linear-gradient(145deg, #1f273b 0%, #131926 100%);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 
    22px 30px 60px rgba(0, 0, 0, 0.7),
    -8px -8px 24px rgba(255, 255, 255, 0.04),
    inset 2px 2px 5px rgba(255, 255, 255, 0.14),
    inset -4px -4px 8px rgba(0, 0, 0, 0.5);
  animation: scaleInModal 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes scaleInModal {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}

.modal-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.modal-close {
  background: var(--clay-surface-gradient);
  border: 1px solid var(--border-clay);
  color: var(--text-dim);
  font-size: 1.15rem;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: var(--clay-pill-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  color: #fff;
  transform: translateY(-2px);
  background: var(--clay-rose-gradient);
}

.modal-mode-tabs {
  display: flex;
  gap: 10px;
  background: var(--clay-inset-bg);
  padding: 7px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  box-shadow: var(--clay-input-shadow);
}

.mode-tab-btn {
  flex: 1;
  padding: 10px 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mode-tab-btn.active {
  background: var(--clay-surface-gradient);
  color: #fff;
  box-shadow: var(--clay-pill-shadow);
}

.modal-chat-input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-chat-input-wrapper .form-input {
  flex: 1;
}

.chat-hint-box {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.45;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 26px;
}

/* Form Controls */
.form-group {
  margin-bottom: 22px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.col-half {
  flex: 1;
}

.input-label {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-input, .form-select {
  width: 100%;
  background: var(--clay-inset-bg);
  border: 1px solid var(--border-clay);
  border-radius: var(--radius-md);
  padding: 13px 18px;
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  box-shadow: var(--clay-input-shadow);
  transition: all 0.2s ease;
}

.form-input:focus, .form-select:focus {
  border-color: #6366f1;
  box-shadow: 
    inset 3px 3px 6px rgba(0, 0, 0, 0.7),
    0 0 0 3px rgba(99, 102, 241, 0.22);
}

.type-toggle-row {
  display: flex;
  gap: 12px;
}

.toggle-label {
  flex: 1;
  padding: 13px;
  background: var(--clay-surface-gradient);
  border: 1px solid var(--border-clay);
  border-radius: var(--radius-md);
  box-shadow: var(--clay-btn-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.94rem;
  color: var(--text-muted);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toggle-label:has(input:checked) {
  background: var(--clay-emerald-gradient);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 
    0 4px 0 var(--clay-emerald-edge),
    0 8px 16px rgba(16, 185, 129, 0.4),
    inset 0 1px 2px rgba(255, 255, 255, 0.4);
}

.toggle-label:has(input[value="expense"]:checked) {
  background: var(--clay-rose-gradient);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 
    0 4px 0 var(--clay-rose-edge),
    0 8px 16px rgba(244, 63, 94, 0.4),
    inset 0 1px 2px rgba(255, 255, 255, 0.4);
}

.toggle-label input {
  display: none;
}

/* ========================================================
   AUTHENTICATION MODAL STYLES (THE TACTILE CLAY VAULT)
   ======================================================== */
.auth-modal-card {
  text-align: center;
  max-width: 460px;
}

.auth-icon-badge {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: var(--radius-lg);
  background: var(--clay-iris-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 6px 0 var(--clay-iris-edge),
    0 14px 28px rgba(99, 102, 241, 0.45),
    inset 0 2px 3px rgba(255, 255, 255, 0.45),
    inset 0 -2px 4px rgba(0, 0, 0, 0.3);
}

.auth-icon-badge svg {
  width: 32px;
  height: 32px;
  color: #ffffff;
  display: block;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.auth-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 22px;
}

.auth-guide-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--clay-inset-bg);
  border: 1px solid var(--border-clay);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-bottom: 22px;
  font-size: 0.86rem;
  box-shadow: var(--clay-input-shadow);
  text-align: left;
}

.guide-step {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--clay-emerald-gradient);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  flex-shrink: 0;
}

.auth-guide-box code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 6px;
  color: #34d399;
}

.pin-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pin-input {
  width: 100%;
  background: var(--clay-inset-bg);
  border: 1px solid var(--border-clay);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-align: center;
  color: #fff;
  outline: none;
  box-shadow: var(--clay-input-shadow);
  transition: all 0.2s ease;
}

.pin-input:focus {
  border-color: #10b981;
  box-shadow: 
    inset 3px 3px 6px rgba(0, 0, 0, 0.7),
    0 0 0 3px rgba(16, 185, 129, 0.25);
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
  color: var(--text-dim);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-clay);
}

.auth-divider span {
  padding: 0 14px;
}

.auth-footer-links {
  margin-top: 20px;
}

.auth-back-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.auth-back-link:hover {
  color: #fff;
}

/* ========================================================
   TOAST NOTIFICATION (PUFFY CLAY CAPSULE)
   ======================================================== */
.toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  background: linear-gradient(145deg, #1f273b 0%, #131926 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  padding: 15px 22px;
  color: #fff;
  box-shadow: 
    12px 16px 32px rgba(0, 0, 0, 0.55),
    inset 1px 1px 2px rgba(255, 255, 255, 0.25);
  font-size: 0.94rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInToast 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes slideInToast {
  from { opacity: 0; transform: translateY(20px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ========================================================
   5-TIER RESPONSIVE MEDIA QUERIES (ZERO-DEFECT CROSS-DEVICE)
   ======================================================== */

/* 1. TIER XL: Ultra-Wide & 4K Displays (>= 1441px) */
@media (min-width: 1441px) {
  .content-container {
    padding: 38px 48px;
  }
}

/* 2. TIER MD: Tablets Portrait & Small Laptops (769px - 1024px) */
@media (max-width: 1024px) {
  .charts-grid, .bottom-overview-grid, .analytics-grid {
    grid-template-columns: 1fr;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .wallets-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .card-header-flex {
    flex-wrap: wrap;
    gap: 12px;
  }
}

/* 3. TIER SM: Standard Mobile Phones & Phablets (<= 768px) */
@media (max-width: 768px) {
  /* Prevent iOS Safari forced auto-zoom on input focus */
  input, select, textarea, .form-input, .chat-input {
    font-size: 16px !important;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    padding-left: max(16px, env(safe-area-inset-left));
    z-index: 1050;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .btn-sidebar-toggle {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }

  .btn-sidebar-close {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }

  .topbar {
    padding: max(10px, env(safe-area-inset-top)) 16px 10px;
    height: auto;
    min-height: 64px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .topbar-left {
    gap: 12px;
  }

  .page-title {
    font-size: 1.15rem;
  }

  .content-container {
    padding: 16px 14px;
    padding-bottom: max(32px, env(safe-area-inset-bottom));
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .kpi-card {
    padding: 16px;
  }

  .kpi-val {
    font-size: 1.3rem;
  }

  .wallets-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .search-box input {
    width: 100%;
  }

  .toolbar-flex {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .smart-chat-input-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .smart-chat-input-row input {
    min-width: 100%;
    order: 1;
  }

  .smart-chat-icon {
    display: none;
  }

  .btn-chat-tool {
    order: 2;
    flex: 1;
    min-height: 44px;
  }

  #btn-smart-chat-send {
    order: 3;
    flex: 2;
    min-height: 44px;
  }

  .btn-action-del, .btn-action-icon {
    min-width: 40px;
    min-height: 40px;
  }
}

/* 4. TIER XS-M: Modern Smart Bottom Sheet Modals & Responsive Tables (<= 640px) */
@media (max-width: 640px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  /* Modal Bottom-Sheet Pattern on Mobile */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-card, .auth-modal-card {
    max-width: 100% !important;
    width: 100%;
    border-radius: 26px 26px 0 0;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px 18px max(24px, env(safe-area-inset-bottom));
    animation: slideUpModal 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  @keyframes slideUpModal {
    from { opacity: 0; transform: translateY(100%); }
    to { opacity: 1; transform: translateY(0); }
  }

  .modal-header {
    margin-bottom: 18px;
  }

  .modal-title {
    font-size: 1.18rem;
  }

  /* Responsive Clay Card View for Ledger Table */
  #table-ledger thead {
    display: none;
  }

  #table-ledger, 
  #table-ledger tbody, 
  #table-ledger tr, 
  #table-ledger td {
    display: block;
    width: 100%;
  }

  #table-ledger tbody tr {
    background: var(--clay-surface-gradient);
    border: 1px solid var(--border-clay);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 12px;
    box-shadow: var(--clay-card-shadow);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  #table-ledger tbody tr:hover {
    transform: none;
  }

  #table-ledger td {
    padding: 0 !important;
    border: none !important;
  }

  #table-ledger td:nth-child(1) { /* ID */
    width: auto;
    font-size: 0.75rem;
    color: var(--text-dim);
    order: 1;
  }

  #table-ledger td:nth-child(2) { /* Tipe */
    width: auto;
    order: 2;
  }

  #table-ledger td:nth-child(6) { /* Tanggal */
    width: auto;
    font-size: 0.78rem;
    color: var(--text-muted);
    order: 3;
    margin-left: auto;
  }

  #table-ledger td:nth-child(3) { /* Keterangan */
    width: 100%;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    order: 4;
    padding: 4px 0 !important;
  }

  #table-ledger td:nth-child(4) { /* Kategori */
    width: auto;
    order: 5;
  }

  #table-ledger td:nth-child(5) { /* Dompet */
    width: auto;
    font-size: 0.82rem;
    color: var(--text-muted);
    order: 6;
  }

  #table-ledger td:nth-child(7) { /* Nominal */
    width: auto;
    font-size: 1.05rem;
    font-weight: 800;
    order: 7;
    margin-left: auto;
    text-align: right;
  }

  #table-ledger td:nth-child(8) { /* Aksi */
    width: 100%;
    order: 8;
    display: flex;
    justify-content: flex-end;
    padding-top: 8px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
    margin-top: 4px;
  }

  .btn-action-del {
    width: 38px;
    height: 38px;
  }
}

/* 5. TIER XS-MIN: Smallest Phones (iPhone SE, Galaxy Fold Cover 320px - 414px) */
@media (max-width: 480px) {
  .topbar {
    padding: max(8px, env(safe-area-inset-top)) 12px 8px;
  }

  .topbar-right {
    gap: 6px;
  }

  .admin-status-badge {
    display: none; /* Hemat ruang layar compact */
  }

  .content-container {
    padding: 12px 10px;
    padding-bottom: max(28px, env(safe-area-inset-bottom));
  }

  .modal-card, .auth-modal-card {
    padding: 20px 14px max(20px, env(safe-area-inset-bottom));
  }

  .auth-icon-badge {
    width: 52px;
    height: 52px;
    margin-bottom: 12px;
  }

  .auth-title {
    font-size: 1.25rem;
  }

  .auth-desc {
    font-size: 0.8rem;
    margin-bottom: 16px;
  }

  .mobile-install-banner {
    left: 8px;
    right: 8px;
    bottom: max(10px, env(safe-area-inset-bottom));
    padding: 10px 12px;
  }

  .banner-app-icon {
    width: 32px;
    height: 32px;
  }

  .banner-text strong {
    font-size: 0.82rem;
  }

  .banner-text p {
    font-size: 0.68rem;
  }

  .btn-pwa-install {
    padding: 6px 10px;
    font-size: 0.75rem;
  }
}

/* ========================================================
   AI FINANCIAL ADVISOR, DATE RANGE PICKER & PWA STYLES
   ======================================================== */
.ai-advisor-card {
  margin-bottom: 24px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(99, 102, 241, 0.08) 100%), #131926;
  border: 1px solid rgba(16, 185, 129, 0.25);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  position: relative;
  overflow: hidden;
}

.ai-advisor-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #10b981, #6366f1, #3b82f6);
}

.ai-advisor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.ai-badge-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-avatar-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  flex-shrink: 0;
}

.ai-advisor-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.ai-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ai-advisor-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 2px 0 0;
}

.ai-advisor-body {
  font-size: 0.94rem;
  line-height: 1.68;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.45);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.ai-loading-shimmer {
  color: var(--text-muted);
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Date Range Picker Controls */
.date-range-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-bottom: 16px;
  padding: 14px 18px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border-clay);
  border-radius: var(--radius-md);
}

.date-range-inputs {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.date-range-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.date-input {
  background: var(--clay-inset-bg);
  border: 1px solid var(--border-clay);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.86rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.date-input:focus {
  border-color: #10b981;
}

.date-sep {
  color: var(--text-dim);
  font-size: 0.82rem;
  font-weight: 600;
}

.date-presets {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.date-preset-pill {
  background: var(--clay-surface-gradient);
  border: 1px solid var(--border-clay);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.date-preset-pill:hover {
  color: #fff;
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.12);
}

.date-preset-pill.active {
  background: #10b981;
  color: #064e3b;
  border-color: #10b981;
  font-weight: 700;
}

/* Export Buttons Group */
.export-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-export-excel {
  background: linear-gradient(135deg, #107c41, #185a37) !important;
  color: #fff !important;
  border: 1px solid #1f8a4e !important;
  font-weight: 600;
}

.btn-export-excel:hover {
  background: linear-gradient(135deg, #148f4b, #1d6b41) !important;
  box-shadow: 0 4px 12px rgba(16, 124, 65, 0.4) !important;
}

.btn-export-pdf {
  background: linear-gradient(135deg, #b30b00, #850800) !important;
  color: #fff !important;
  border: 1px solid #cc0e00 !important;
  font-weight: 600;
}

.btn-export-pdf:hover {
  background: linear-gradient(135deg, #cc0e00, #990a00) !important;
  box-shadow: 0 4px 12px rgba(179, 11, 0, 0.4) !important;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  color: #fff !important;
  border: 1px solid #f87171 !important;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  padding: 8px 16px;
  transition: all 0.2s ease;
}

.btn-danger:hover:not(:disabled) {
  background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4) !important;
}

.btn-danger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.btn-danger-subtle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.12) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
  font-weight: 600;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger-subtle:hover {
  background: rgba(239, 68, 68, 0.22) !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
}

.link-wa {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #34d399;
  text-decoration: none;
  font-weight: 500;
  padding: 3px 8px;
  background: rgba(52, 211, 153, 0.1);
  border-radius: 6px;
  font-size: 0.85rem;
}

.link-wa:hover {
  background: rgba(52, 211, 153, 0.2);
  text-decoration: underline;
}

/* PWA Install Button */
.btn-pwa-install {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-pwa-install:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.45);
}

/* Sidebar PWA Install Box */
.sidebar-pwa-box {
  margin: 10px 16px 16px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(99, 102, 241, 0.1) 100%), #151c2c;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.pwa-box-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.pwa-icon-glow {
  font-size: 1.3rem;
  line-height: 1;
}

.pwa-box-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
}

.pwa-box-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* Floating Mobile Install Banner */
.mobile-install-banner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  max-width: 460px;
  margin: 0 auto;
  background: linear-gradient(135deg, #131926 0%, #0d121c 100%);
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65), 0 0 20px rgba(16, 185, 129, 0.2);
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  z-index: 999;
  animation: slideUpBanner 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.banner-app-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  flex-shrink: 0;
}

.banner-text strong {
  display: block;
  font-size: 0.88rem;
  color: #fff;
}

.banner-text p {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-banner-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.btn-banner-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* PWA Guide Modal Steps */
.pwa-guide-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
  background: rgba(15, 23, 42, 0.4);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-clay);
}

.pwa-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #10b981;
  color: #064e3b;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pwa-step-body h4 {
  margin: 0 0 4px;
  font-size: 0.92rem;
  color: #fff;
}

.pwa-step-body p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}


