/* ═══════════════════════════════════════════════════════════════════
   GastosDiarios — Design System v2.0
   Mobile-First · Dark Mode · Fintech Style
   ═══════════════════════════════════════════════════════════════════ */

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

/* ─── DESIGN TOKENS ─────────────────────────────────────────────── */
:root {
  /* Brand */
  --primary:          #6C63FF;
  --primary-dark:     #5A52D5;
  --primary-light:    rgba(108, 99, 255, 0.12);
  --primary-glow:     rgba(108, 99, 255, 0.35);
  --accent:           #00D4FF;
  --accent-light:     rgba(0, 212, 255, 0.1);

  /* Semantic */
  --success:          #10B981;
  --success-bg:       rgba(16, 185, 129, 0.12);
  --danger:           #F43F5E;
  --danger-bg:        rgba(244, 63, 94, 0.12);
  --warning:          #F59E0B;
  --warning-bg:       rgba(245, 158, 11, 0.12);
  --info:             #3B82F6;
  --info-bg:          rgba(59, 130, 246, 0.12);

  /* Layout */
  --sidebar-w:        260px;
  --sidebar-collapsed: 68px;
  --topbar-h:         64px;
  --bottom-nav-h:     64px;
  --radius-sm:        8px;
  --radius-md:        14px;
  --radius-lg:        20px;
  --radius-xl:        28px;
  --radius-pill:      999px;

  /* Light theme surfaces */
  --bg:               #F0F2FF;
  --surface:          #FFFFFF;
  --surface-2:        #F5F7FF;
  --surface-3:        #ECEFFE;
  --text:             #1E1B4B;
  --text-2:           #4B5563;
  --text-muted:       #9CA3AF;
  --border:           #E5E7EB;
  --border-light:     #F3F4F6;

  /* Shadows */
  --shadow-sm:        0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:        0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
  --shadow-lg:        0 10px 40px rgba(0,0,0,.12), 0 4px 16px rgba(0,0,0,.06);
  --shadow-primary:   0 4px 20px rgba(108, 99, 255, 0.28);

  /* Transitions */
  --ease:             cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce:      cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast:         150ms;
  --dur-normal:       250ms;
  --dur-slow:         400ms;

  /* Sidebar */
  --sidebar-bg:       #FFFFFF;
  --sidebar-border:   #E5E7EB;
}

/* ─── DARK MODE TOKENS ───────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:               #0D0D1A;
  --surface:          #161628;
  --surface-2:        #1C1C32;
  --surface-3:        #21213A;
  --text:             #F1F5F9;
  --text-2:           #CBD5E1;
  --text-muted:       #64748B;
  --border:           #2A2A4A;
  --border-light:     #1E1E38;

  --shadow-sm:        0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
  --shadow-md:        0 4px 16px rgba(0,0,0,.4), 0 2px 6px rgba(0,0,0,.2);
  --shadow-lg:        0 10px 40px rgba(0,0,0,.5), 0 4px 16px rgba(0,0,0,.3);

  --sidebar-bg:       #161628;
  --sidebar-border:   #2A2A4A;

  --primary-light:    rgba(108, 99, 255, 0.18);
}

/* ─── RESET & BASE ───────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  height: 100dvh;
  overflow: hidden;
  transition: background var(--dur-normal) var(--ease),
              color var(--dur-normal) var(--ease);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── SCROLLBAR ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── SIDEBAR ────────────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform var(--dur-slow) var(--ease),
              background var(--dur-normal) var(--ease),
              border-color var(--dur-normal) var(--ease);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

/* Frosted top accent */
#sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

/* ── Brand ── */
.sidebar-brand {
  padding: 20px 18px 18px;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
}

.sidebar-brand .brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: .95rem;
  box-shadow: var(--shadow-primary);
  flex-shrink: 0;
}

/* ── User mini profile ── */
#sidebar-user {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
  border-radius: 0;
}

#sidebar-user:hover {
  background: var(--primary-light);
}

#sidebar-username {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

#sidebar-user small {
  font-size: .74rem;
  color: var(--text-muted);
}

/* ── Nav Items ── */
.nav-section-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 16px 18px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  margin: 2px 8px;
  color: var(--text-2);
  font-weight: 500;
  font-size: .9rem;
  cursor: pointer;
  border-radius: var(--radius-md);
  border-left: none;
  position: relative;
  transition: background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.nav-item .nav-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  flex-shrink: 0;
  transition: background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
  background: transparent;
}

.nav-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.nav-item:hover .nav-icon {
  background: var(--primary-light);
  color: var(--primary);
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.nav-item.active .nav-icon {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
}

.nav-item:active {
  transform: scale(0.97);
}

/* ── Sidebar footer ── */
.sidebar-footer {
  margin-top: auto;
  padding: 12px 8px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Dark mode toggle in sidebar */
.dark-toggle-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin: 0 2px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
}

.dark-toggle-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.dark-toggle-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  flex-shrink: 0;
}

/* Logout button */
.btn-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin: 0 2px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--danger);
  font-family: inherit;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background var(--dur-fast) var(--ease);
}

.btn-logout:hover {
  background: var(--danger-bg);
}

.btn-logout .nav-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  flex-shrink: 0;
}

/* ─── SIDEBAR OVERLAY (mobile) ───────────────────────────────────── */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 199;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fadeIn var(--dur-normal) var(--ease);
}

#sidebar-overlay.show {
  display: block;
}

/* ─── USER AVATAR ────────────────────────────────────────────────── */
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: .88rem;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: border-color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
  flex-shrink: 0;
  user-select: none;
}

.user-avatar:hover {
  border-color: var(--primary);
  transform: scale(1.06);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* ─── MAIN LAYOUT ────────────────────────────────────────────────── */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ─── TOPBAR ─────────────────────────────────────────────────────── */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: var(--topbar-h);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  transition: background var(--dur-normal) var(--ease),
              border-color var(--dur-normal) var(--ease);
  box-shadow: var(--shadow-sm);
  z-index: 10;
  gap: 12px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

#page-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Hamburger */
#menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-2);
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  transition: background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}

#menu-toggle:hover {
  background: var(--surface-2);
  color: var(--primary);
}

/* Notification button */
.notif-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-2);
  padding: 9px;
  border-radius: var(--radius-sm);
  transition: background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
  font-size: 1rem;
  line-height: 1;
}

.notif-btn:hover {
  background: var(--surface-2);
  color: var(--primary);
}

.notif-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--surface);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

/* Topbar dark mode toggle button */
.topbar-dark-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-2);
  padding: 9px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  line-height: 1;
  transition: background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
  display: none; /* shown only on mobile via JS or always */
}

.topbar-dark-btn:hover {
  background: var(--surface-2);
  color: var(--primary);
}

/* ─── CONTENT AREA ───────────────────────────────────────────────── */
#content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  transition: background var(--dur-normal) var(--ease);
}

/* View animation */
.view-enter {
  animation: viewEnter var(--dur-slow) var(--ease) both;
}

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

/* ─── LOGIN SCREEN ───────────────────────────────────────────────── */
#login-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0D0D1A 0%, #161628 40%, #1a0d35 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

#login-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(108, 99, 255, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(0, 212, 255, 0.1) 0%, transparent 60%);
  pointer-events: none;
}

.login-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  padding: 44px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.08);
  animation: loginCardIn .5s var(--ease-bounce) both;
}

@keyframes loginCardIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #fff;
  box-shadow: var(--shadow-primary);
}

.login-card h3 {
  font-weight: 800;
  font-size: 1.6rem;
  color: #F1F5F9;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.login-card .login-subtitle {
  color: rgba(241, 245, 249, 0.5);
  font-size: .88rem;
  margin-bottom: 32px;
}

/* Login inputs */
.login-field {
  position: relative;
  margin-bottom: 16px;
}

.login-field label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: rgba(241, 245, 249, 0.7);
  margin-bottom: 6px;
  letter-spacing: .02em;
}

.login-field input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: #F1F5F9;
  font-family: inherit;
  font-size: .95rem;
  transition: border-color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
  outline: none;
}

.login-field input::placeholder {
  color: rgba(241, 245, 249, 0.3);
}

.login-field input:focus {
  border-color: var(--primary);
  background: rgba(108, 99, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.2);
}

#login-error {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-radius: var(--radius-sm);
  color: #FDA4AF;
  padding: 10px 14px;
  font-size: .87rem;
  margin-bottom: 16px;
}

/* Hidden state — Bootstrap utility .d-none works, but this is the display state */
#login-error:not(.d-none) {
  display: block !important;
}

.btn-login {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--primary) 0%, #8B5CF6 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: .97rem;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              opacity var(--dur-fast) var(--ease);
  box-shadow: var(--shadow-primary);
  margin-top: 8px;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(108, 99, 255, 0.45);
}

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

/* ─── APP CARDS ──────────────────────────────────────────────────── */
.app-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  transition: background var(--dur-normal) var(--ease),
              border-color var(--dur-normal) var(--ease),
              box-shadow var(--dur-normal) var(--ease),
              transform var(--dur-fast) var(--ease);
}

/* Legacy aliases (keep bootstrap compatibility) */
.stat-card  { background: var(--surface); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-md); border: 1px solid var(--border); transition: background var(--dur-normal) var(--ease), border-color var(--dur-normal) var(--ease), transform var(--dur-fast) var(--ease); }
.card-box   { background: var(--surface); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-md); border: 1px solid var(--border); transition: background var(--dur-normal) var(--ease), border-color var(--dur-normal) var(--ease); }

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ── KPI Cards ── */
.kpi-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              background var(--dur-normal) var(--ease);
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.kpi-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  transform: translate(30%, -30%);
  opacity: .08;
}

.kpi-card.income::after  { background: var(--success); }
.kpi-card.expense::after { background: var(--danger); }
.kpi-card.net::after     { background: var(--primary); }
.kpi-card.balance::after { background: var(--warning); }

.kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  margin-bottom: 12px;
}

.kpi-icon.income  { background: var(--success-bg); color: var(--success); }
.kpi-icon.expense { background: var(--danger-bg);  color: var(--danger); }
.kpi-icon.net     { background: var(--primary-light); color: var(--primary); }
.kpi-icon.balance { background: var(--warning-bg); color: var(--warning); }

.kpi-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.kpi-sub {
  font-size: .74rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
}

.kpi-value {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.kpi-value.income  { color: var(--success); }
.kpi-value.expense { color: var(--danger); }
.kpi-value.balance { color: var(--warning); }
.kpi-value.net-pos { color: var(--success); }
.kpi-value.net-neg { color: var(--danger); }

/* ─── BALANCE BLOCK (bb-*) — Selector de billetera ─────────────── */
.bb-block {
  background: linear-gradient(135deg, var(--surface-3) 0%, var(--surface-2) 100%);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  color: var(--text);
  transition: background var(--dur-normal) var(--ease),
              border-color var(--dur-normal) var(--ease);
}

[data-theme="dark"] .bb-block {
  background: linear-gradient(135deg, var(--surface-3) 0%, var(--surface) 100%);
}

.bb-selector {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: inherit;
  font-size: .88rem;
  font-weight: 600;
  padding: 7px 12px;
  max-width: 300px;
  width: 100%;
  cursor: pointer;
  outline: none;
  transition: border-color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
  appearance: auto;
}

.bb-selector:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.bb-selector option {
  background: var(--surface);
  color: var(--text);
}

.bb-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.bb-amount {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1.1;
}

.bb-sub {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.bb-divider {
  border-top: 1px solid var(--border);
}

.bb-detail-label {
  font-size: .82rem;
  color: var(--text-2);
}

.bb-primary-value {
  color: var(--primary);
}

/* ─── WALLET BANNER ──────────────────────────────────────────────── */
.wallet-banner {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e1b4b 100%);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  color: #fff;
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.2);
  position: relative;
  overflow: hidden;
}

.wallet-banner::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 180px; height: 180px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.06);
}

.wallet-banner::after {
  content: '';
  position: absolute;
  bottom: -50px; right: 40px;
  width: 120px; height: 120px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.04);
}

.wallet-banner-label {
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .6;
  margin-bottom: 4px;
}

.wallet-banner-name {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.wallet-banner-meta {
  font-size: .8rem;
  opacity: .5;
}

.wallet-banner-amount {
  font-size: 2rem;
  font-weight: 900;
  color: #FCD34D;
  letter-spacing: -0.04em;
  line-height: 1;
}

.wallet-banner-currency {
  font-size: .8rem;
  opacity: .5;
  margin-top: 2px;
}

/* ─── SECTION HEADERS ────────────────────────────────────────────── */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 12px;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title i {
  color: var(--primary);
}

/* ─── PERIOD TABS ────────────────────────────────────────────────── */
.period-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.period-btn {
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-family: inherit;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}

.period-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.period-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
}

/* Override Bootstrap btn classes used in period tabs */
.btn.btn-primary.btn-sm.fw-bold,
.btn.btn-outline-secondary.btn-sm.fw-bold {
  font-family: inherit;
}

/* ─── TABLES ─────────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: var(--surface-2);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  font-weight: 700;
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  transition: background var(--dur-normal) var(--ease);
}

th:first-child { border-radius: var(--radius-sm) 0 0 0; }
th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }

td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: .9rem;
  vertical-align: middle;
  color: var(--text);
  transition: background var(--dur-fast) var(--ease);
}

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

tr:hover td {
  background: var(--surface-2);
}

/* ─── BADGES ─────────────────────────────────────────────────────── */
.badge-income {
  background: var(--success-bg);
  color: var(--success);
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-size: .76rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.badge-expense {
  background: var(--danger-bg);
  color: var(--danger);
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-size: .76rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.badge-transfer {
  background: var(--info-bg);
  color: var(--info);
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-size: .76rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* ─── BUTTONS ────────────────────────────────────────────────────── */

/* Primary full width */
.btn-primary-full {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--primary) 0%, #8B5CF6 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
  margin-top: 16px;
  font-family: inherit;
  box-shadow: var(--shadow-primary);
  position: relative;
  overflow: hidden;
}

.btn-primary-full:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(108, 99, 255, 0.4);
}

.btn-primary-full:active {
  transform: translateY(0);
  box-shadow: var(--shadow-primary);
}

/* Ripple effect */
.btn-primary-full::after,
.btn-login::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--dur-fast) var(--ease);
  border-radius: inherit;
}

.btn-primary-full:active::after,
.btn-login:active::after {
  background: rgba(255,255,255,0.12);
}

/* Action buttons (edit/delete in tables) */
.btn-action {
  border: none;
  background: none;
  cursor: pointer;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  transition: background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
  line-height: 1;
}

.btn-action.edit  { color: var(--info); }
.btn-action.edit:hover  { background: var(--info-bg); transform: scale(1.1); }
.btn-action.del   { color: var(--danger); }
.btn-action.del:hover   { background: var(--danger-bg); transform: scale(1.1); }

/* Add new button */
.btn-add {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
  box-shadow: var(--shadow-primary);
  white-space: nowrap;
}

.btn-add:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(108, 99, 255, 0.4);
}

/* ─── FORMS ──────────────────────────────────────────────────────── */
.form-label {
  font-weight: 600;
  font-size: .84rem;
  margin-bottom: 5px;
  display: block;
  color: var(--text-2);
}

.form-control,
.form-select {
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  padding: 10px 14px;
  width: 100%;
  font-family: inherit;
  font-size: .92rem;
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  background: var(--surface);
}

.form-control::placeholder {
  color: var(--text-muted);
}

/* ─── MODALS ─────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.show {
  display: flex;
  animation: fadeIn var(--dur-normal) var(--ease);
}

.modal-box {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  animation: modalSlideUp var(--dur-slow) var(--ease-bounce) both;
  max-height: 90dvh;
  overflow-y: auto;
  transition: background var(--dur-normal) var(--ease),
              border-color var(--dur-normal) var(--ease);
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-box h5 {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 22px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close {
  float: right;
  background: var(--surface-2);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
  margin: -4px -4px 0 0;
  line-height: 1;
}

.modal-close:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

/* ─── LOADING SPINNER ────────────────────────────────────────────── */
.spinner-sm {
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-state {
  text-align: center;
  padding: 60px 20px;
}

.loading-state .spinner-lg {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

.loading-state p {
  color: var(--text-muted);
  font-size: .9rem;
}

/* ─── EMPTY STATES ───────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state-icon {
  width: 70px;
  height: 70px;
  background: var(--surface-2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 16px;
  color: var(--text-muted);
}

.empty-state h6 {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: .88rem;
}

/* ─── FREQUENT EXPENSE CARDS ─────────────────────────────────────── */
.freq-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: transform var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              background var(--dur-normal) var(--ease);
  cursor: default;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.freq-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.freq-card-title {
  font-weight: 700;
  font-size: .95rem;
  color: var(--text);
}

.freq-card-amount {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.freq-card-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-execute {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: .83rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}

.btn-execute:hover {
  background: var(--primary);
  color: #fff;
  transform: scale(1.03);
}

/* ─── WALLET ITEMS ───────────────────────────────────────────────── */
.wallet-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--border-light);
}

.wallet-item:last-child { border-bottom: none; }

.wallet-item-name {
  font-weight: 600;
  font-size: .92rem;
  color: var(--text);
}

.wallet-item-currency {
  font-size: .76rem;
  color: var(--text-muted);
}

.wallet-item-balance {
  font-weight: 800;
  font-size: 1rem;
}

.wallet-item-balance.positive { color: var(--success); }
.wallet-item-balance.negative { color: var(--danger); }

/* ─── PROFILE AVATAR (large) ─────────────────────────────────────── */
.avatar-large {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 2.2rem;
  color: #fff;
  font-weight: 700;
  box-shadow: var(--shadow-primary);
}

/* ─── SEARCH INPUT ───────────────────────────────────────────────── */
.search-input-wrap {
  position: relative;
  margin-bottom: 20px;
}

.search-input-wrap i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: .9rem;
  pointer-events: none;
}

.search-input-wrap input {
  padding-left: 40px;
}

/* ─── CHART CONTAINERS ───────────────────────────────────────────── */
.chart-wrap {
  position: relative;
  width: 100%;
}

/* ─── ANIMATIONS ─────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

/* ─── UTILS ──────────────────────────────────────────────────────── */
.text-income   { color: var(--success) !important; }
.text-expense  { color: var(--danger)  !important; }
.text-transfer { color: var(--info)    !important; }

.fw-black { font-weight: 900; }
.fw-extra { font-weight: 800; }

/* Consolidated wallet total */
.wallet-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 0;
  margin-top: 8px;
  border-top: 2px dashed var(--border);
}

/* ─── BOTTOM NAVIGATION (mobile) ────────────────────────────────── */
#bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding: 0 4px;
  box-shadow: 0 -4px 20px rgba(0,0,0,.08);
  transition: background var(--dur-normal) var(--ease),
              border-color var(--dur-normal) var(--ease);
}

.bottom-nav-inner {
  display: flex;
  height: 100%;
  align-items: stretch;
}

.bnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .02em;
  padding: 0 4px;
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.bnav-item i {
  font-size: 1.1rem;
  transition: transform var(--dur-fast) var(--ease-bounce);
}

.bnav-item.active {
  color: var(--primary);
}

.bnav-item.active i {
  transform: translateY(-2px);
}

.bnav-indicator {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--primary);
  border-radius: var(--radius-pill);
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease);
}

.bnav-item.active .bnav-indicator {
  opacity: 1;
}

/* ─── ERROR / ALERT BOXES ────────────────────────────────────────── */
.err-box {
  background: var(--danger-bg);
  border: 1px solid rgba(244, 63, 94, 0.25);
  border-radius: var(--radius-md);
  color: var(--danger);
  padding: 14px 18px;
  font-size: .9rem;
  margin-top: 12px;
}

/* ─── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
  /* Hide sidebar, show hamburger */
  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

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

  #menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Show bottom nav */
  #bottom-nav {
    display: flex;
  }

  /* Adjust content padding for bottom nav */
  #content {
    padding: 16px 14px calc(var(--bottom-nav-h) + 16px);
  }

  /* Topbar */
  .topbar {
    padding: 0 14px;
  }

  #page-title {
    font-size: .95rem;
  }

  /* KPI cards 2 per row on mobile */
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Modal full width on mobile */
  .modal-box {
    padding: 24px 20px;
    border-radius: var(--radius-lg);
    max-height: 95dvh;
  }

  /* Wallet banner */
  .wallet-banner-amount {
    font-size: 1.5rem;
  }

  /* Tables scroll */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Period tabs */
  .period-tabs .btn,
  .period-tabs .period-btn {
    font-size: .78rem;
    padding: 6px 12px;
  }
}

@media (min-width: 768px) {
  /* Always show sidebar, hide overlay and bottom nav */
  #sidebar {
    transform: translateX(0) !important;
    position: relative;
  }

  #sidebar-overlay { display: none !important; }
  #bottom-nav      { display: none !important; }
  #menu-toggle     { display: none !important; }
}

@media (min-width: 768px) and (max-width: 1023.98px) {
  /* Tablet: slightly narrower sidebar */
  :root { --sidebar-w: 220px; }
  #content { padding: 20px; }
}

@media (min-width: 1024px) {
  #content { padding: 28px 32px; }
}

/* ─── DARK MODE: Override Bootstrap components ───────────────────── */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
  background: var(--surface-3);
  border-color: var(--primary);
}

[data-theme="dark"] .form-control::placeholder {
  color: var(--text-muted);
}

/* Alert overrides for dark mode */
[data-theme="dark"] .alert-danger {
  background: var(--danger-bg);
  border-color: rgba(244, 63, 94, 0.25);
  color: #FDA4AF;
}

[data-theme="dark"] .alert-info {
  background: var(--info-bg);
  border-color: rgba(59, 130, 246, 0.25);
  color: #93C5FD;
}

/* Bootstrap btn overrides */
.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline-primary:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}

/* Badge bg-primary */
.badge.bg-primary {
  background-color: var(--primary) !important;
}

/* ─── SWAL DARK MODE ADJUSTMENTS ─────────────────────────────────── */
[data-theme="dark"] .swal2-popup {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--border);
}

[data-theme="dark"] .swal2-title {
  color: var(--text) !important;
}

[data-theme="dark"] .swal2-content,
[data-theme="dark"] .swal2-html-container {
  color: var(--text-2) !important;
}

/* ─── TRANSITION: theme switch ───────────────────────────────────── */
*, *::before, *::after {
  transition-property: background-color, border-color, color, box-shadow;
  transition-duration: var(--dur-normal);
  transition-timing-function: var(--ease);
}

/* But keep animation-only elements fast */
.spinner-sm, .bnav-item i, .user-avatar, .nav-item, .btn-action,
.btn-login, .btn-primary-full, .btn-add, .btn-execute, .freq-card {
  transition-duration: var(--dur-fast);
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE TABLES — Scroll wrapper + Card layout on mobile
   ═══════════════════════════════════════════════════════════════════ */

/* Scroll wrapper injected by app.js for tables without .table-responsive */
.gd-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* subtle scrollbar track */
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.gd-table-wrap table {
  min-width: 480px; /* force horizontal scroll when needed */
}

/* ─── WALLET-SOURCE BADGE (both themes, desktop + mobile) ─────────── */
.wallet-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-pill);
  font-size: .76rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid rgba(108, 99, 255, 0.15);
  transition: background var(--dur-fast) var(--ease);
}

.wallet-source-badge i {
  font-size: .7rem;
  opacity: .8;
}

tr:hover .wallet-source-badge {
  background: rgba(108, 99, 255, 0.18);
}

[data-theme="dark"] .wallet-source-badge {
  background: rgba(108, 99, 255, 0.2);
  border-color: rgba(108, 99, 255, 0.25);
}

/* ─── CARD LAYOUT (< 768px) ──────────────────────────────────────── */
@media (max-width: 767.98px) {

  /* ── Reset table display ── */
  .rsp-table,
  .rsp-table tbody {
    display: block !important;
    width: 100% !important;
  }

  /* Hide desktop header row */
  .rsp-table thead {
    display: none !important;
  }

  /* Each row becomes a card */
  .rsp-table tbody tr {
    display: block !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    margin-bottom: 12px !important;
    overflow: hidden !important;
    box-shadow: var(--shadow-sm) !important;
    min-width: 0 !important;
  }

  /* Each cell becomes a row inside the card */
  .rsp-table tbody td {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 14px !important;
    border-bottom: 1px solid var(--border-light) !important;
    font-size: .88rem !important;
    min-width: 0 !important;
    gap: 8px !important;
    white-space: normal !important;
  }

  .rsp-table tbody td:last-child {
    border-bottom: none !important;
  }

  /* Label column (left side of each row) */
  .rsp-table tbody td[data-label]::before {
    content: attr(data-label);
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
    flex-shrink: 0;
    min-width: 72px;
  }

  /* Colspan empty state rows */
  .rsp-table tbody td[colspan] {
    justify-content: center !important;
  }

  .rsp-table tbody td[colspan]::before {
    display: none !important;
  }

  /* Action buttons cell — just show buttons right-aligned */
  .rsp-table tbody td:not([data-label]) {
    justify-content: flex-end !important;
    padding: 8px 14px !important;
    background: var(--surface-2) !important;
  }

  /* Prevent scroll wrapper from constraining on mobile
     (card layout doesn't need horizontal scroll) */
  .gd-table-wrap {
    overflow-x: visible;
  }

  .gd-table-wrap .rsp-table {
    min-width: 0 !important;
  }

  /* Wallet badge — slightly smaller on mobile */
  .wallet-source-badge {
    font-size: .73rem;
    padding: 3px 8px;
  }
} /* end @media 767.98px */

/* ═══════════════════════════════════════════════════════════════════
   NOTIFICATION INTERVAL BUTTONS
   ═══════════════════════════════════════════════════════════════════ */

/* Grid container — set by JS as display:grid */
#notif-grid,
#profile-notif-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 10px;
}

.notif-interval-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 10px 12px;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: inherit;
  font-size: .82rem;
  color: var(--text-2);
  width: 100%;
  min-height: 72px;
  text-align: center;
  transition: background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.notif-interval-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ── Estado ACTIVO ── */
.notif-interval-btn.active {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
  box-shadow: var(--shadow-primary) !important;
  transform: translateY(-1px);
}

.notif-interval-btn.active .notif-btn-icon,
.notif-interval-btn.active .notif-btn-label {
  color: #fff !important;
}

/* Icon */
.notif-btn-icon {
  font-size: 1.2rem;
  color: var(--primary);
  line-height: 1;
}

/* Label */
.notif-btn-label {
  font-weight: 600;
  font-size: .79rem;
  text-align: center;
  line-height: 1.2;
}

/* Active badge */
.notif-active-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .66rem;
  font-weight: 700;
  background: rgba(255,255,255,0.25);
  padding: 2px 7px;
  border-radius: 12px;
  color: #fff !important;
  letter-spacing: .03em;
}

@media (max-width: 767.98px) {
  #notif-grid,
  #profile-notif-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}


