/* ============================================================
   EMPIIHA — Components Library
   ============================================================ */

/* ── Layout Shell ─────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Scroll architecture fix ──────────────────────────────────
   position:fixed only anchors to the VIEWPORT when body is NOT
   the scroll container. Giving body overflow:hidden and making
   .main-content the scroll container is the reliable cross-browser
   solution. Without this, some browsers treat the body as the
   scroll container (triggered by overflow-x:hidden on body),
   which causes fixed elements to scroll along with the page.
────────────────────────────────────────────────────────────── */
body.has-sidebar {
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  /* Become the scroll container so the sidebar stays fixed */
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content.expanded {
  margin-left: 0;
}

.page-content {
  padding: var(--sp-xl) var(--sp-xl);
  padding-top: calc(var(--topbar-h) + var(--sp-xl));
}

@media (max-width: 991.98px) {
  .main-content { margin-left: 0; }
  .page-content { padding: var(--sp-md); padding-top: calc(var(--topbar-h) + var(--sp-md)); }
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  height: 100dvh;
  background: var(--clr-surface-low);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 20px 0 60px rgba(0, 0, 0, 0.3);
  /* Force GPU compositing layer — prevents scroll-along on some browsers */
  transform: translateZ(0);
  will-change: transform;
  isolation: isolate;
}

.sidebar::-webkit-scrollbar { display: none; }

.sidebar-logo {
  padding: 28px 20px 20px;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.sidebar-logo h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--clr-primary);
  margin: 3px 0 0;
  line-height: 1;
}

.sidebar-logo span {
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  color: var(--clr-on-surface-variant);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  display: block;
  margin-top: 4px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar { display: none; }

.sidebar-section-label {
  font-family: var(--ff-mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clr-outline);
  padding: 8px 12px 4px;
  display: block;
}

.nav-item { margin-bottom: 2px; }

.nav-link-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  color: var(--clr-on-surface-variant);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--tr-base);
  position: relative;
  white-space: nowrap;
}

.nav-link-item:hover {
  color: var(--clr-on-surface);
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
}

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

.nav-link-item.active::after {
  content: '';
  position: absolute;
  right: 0;
  top: 20%;
  height: 60%;
  width: 3px;
  background: var(--clr-primary);
  border-radius: var(--r-pill) 0 0 var(--r-pill);
}

.nav-link-item i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--clr-primary-container);
  color: var(--clr-primary);
  font-family: var(--ff-mono);
  font-size: 0.6rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--r-pill);
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.upgrade-card {
  background: linear-gradient(135deg, rgba(78, 222, 163, 0.12), rgba(68, 226, 205, 0.06));
  border: 1px solid rgba(78, 222, 163, 0.2);
  border-radius: var(--r-lg);
  padding: 14px;
  margin-bottom: 12px;
}

.upgrade-card p { margin: 0; }
.upgrade-card .title { font-size: 0.8rem; font-weight: 600; color: var(--clr-on-surface); }
.upgrade-card .desc { font-size: 0.7rem; color: var(--clr-on-surface-variant); margin-top: 4px; line-height: 1.5; }

/* Mobile sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1035;
}

@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.5);
  }
  .sidebar-overlay.show { display: block; }
}

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: var(--sidebar-w);
  height: var(--topbar-h);
  background: rgba(5, 5, 5, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-xl);
  z-index: 1030;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.85);
}

@media (max-width: 991.98px) {
  .topbar { left: 0; padding: 0 var(--sp-md); }
}

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

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--clr-on-surface-variant);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--r-sm);
  transition: var(--tr-fast);
}

.sidebar-toggle:hover { color: var(--clr-on-surface); background: var(--clr-surface-high); }

@media (max-width: 991.98px) { .sidebar-toggle { display: flex; align-items: center; } }

/* Search */
.topbar-search {
  position: relative;
}

.topbar-search input {
  background: var(--clr-surface-container);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-pill);
  color: var(--clr-on-surface);
  font-size: 0.8125rem;
  padding: 8px 16px 8px 40px;
  width: 260px;
  transition: var(--tr-base);
}

.topbar-search input::placeholder { color: var(--clr-on-surface-variant); }

.topbar-search input:focus {
  outline: none;
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(78, 222, 163, 0.12);
  width: 300px;
}

.topbar-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--clr-on-surface-variant);
  font-size: 1rem;
  pointer-events: none;
}

.search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--ff-mono);
  font-size: 0.6rem;
  color: var(--clr-outline);
  background: var(--clr-surface-high);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  padding: 1px 5px;
}

@media (max-width: 575.98px) {
  .topbar-search { display: none; }
}

/* Topbar icon buttons */
.topbar-btn {
  position: relative;
  background: none;
  border: none;
  color: var(--clr-on-surface-variant);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--r-md);
  transition: var(--tr-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
}

.topbar-btn:hover {
  color: var(--clr-on-surface);
  background: var(--clr-surface-container);
}

.topbar-btn .badge-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  background: var(--clr-secondary);
  border-radius: 50%;
  border: 1.5px solid var(--clr-bg);
}

.topbar-divider {
  width: 1px;
  height: 24px;
  background: var(--glass-border);
  margin: 0 4px;
}

/* Avatar */
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--clr-on-primary);
  cursor: pointer;
  transition: var(--tr-base);
  flex-shrink: 0;
  text-transform: uppercase;
}

.avatar:hover { box-shadow: 0 0 0 3px rgba(78, 222, 163, 0.25); }

.avatar-lg {
  width: 64px;
  height: 64px;
  font-size: 1.25rem;
}

.avatar-xl {
  width: 96px;
  height: 96px;
  font-size: 2rem;
}

/* ── Topbar avatar sizing ─────────────────────────────────── */
.topbar .avatar {
  width: 34px;
  height: 34px;
  font-size: 0.7rem;
}

/* Page Header */
.page-header {
  margin-bottom: var(--sp-xl);
}

.page-header h1 {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--clr-on-surface);
  margin: 0;
}

.page-header p {
  color: var(--clr-on-surface-variant);
  margin: 4px 0 0;
  font-size: 0.875rem;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--clr-surface-low);
  border: 1px solid var(--glass-border);
  border-top-color: var(--glass-border-top);
  border-radius: var(--r-lg);
  padding: 24px;
  transition: var(--tr-base);
  position: relative;
  overflow: hidden;
}

.card-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-top-color: var(--glass-border-top);
  border-radius: var(--r-lg);
  padding: 24px;
}

.card-hover:hover {
  border-color: rgba(78, 222, 163, 0.2);
  transform: translateY(-2px);
  box-shadow: var(--glow-primary);
}

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

.card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--clr-on-surface);
  margin: 0;
}

.card-subtitle {
  font-size: 0.75rem;
  color: var(--clr-on-surface-variant);
  margin: 2px 0 0;
}

/* Stat Cards */
.stat-card {
  background: var(--clr-surface-low);
  border: 1px solid var(--glass-border);
  border-top-color: var(--glass-border-top);
  border-radius: var(--r-lg);
  padding: 20px;
  transition: var(--tr-base);
}

.stat-card:hover {
  border-color: rgba(78, 222, 163, 0.15);
  box-shadow: var(--glow-primary);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.stat-icon.primary   { background: var(--clr-primary-container); color: var(--clr-primary); }
.stat-icon.secondary { background: var(--clr-secondary-container); color: var(--clr-secondary); }
.stat-icon.error     { background: var(--clr-error-container); color: var(--clr-error); }
.stat-icon.warning   { background: var(--clr-warning-container); color: var(--clr-warning); }
.stat-icon.tertiary  { background: var(--clr-tertiary-container); color: var(--clr-tertiary); }

.stat-value {
  font-family: var(--ff-mono);
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--clr-on-surface);
  line-height: 1.1;
  margin: 8px 0 4px;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--clr-on-surface-variant);
  font-weight: 500;
}

.stat-change {
  font-size: 0.7rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 4px;
}

.stat-change.up   { color: var(--clr-primary); }
.stat-change.down { color: var(--clr-error); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  font-family: var(--ff-sans);
  font-weight: 600;
  font-size: 0.8125rem;
  border-radius: var(--r-sm);
  padding: 9px 18px;
  border: none;
  cursor: pointer;
  transition: var(--tr-base);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

.btn:focus-visible {
  outline: 2px solid var(--clr-primary);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--clr-primary) 0%, var(--clr-secondary) 100%);
  color: var(--clr-on-primary);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--clr-secondary) 0%, var(--clr-primary) 100%);
  box-shadow: 0 0 20px rgba(78, 222, 163, 0.3);
  color: var(--clr-on-primary);
  text-decoration: none;
  transform: translateY(-1px);
}

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

.btn-secondary {
  background: var(--clr-secondary-container);
  color: var(--clr-secondary);
  border: 1px solid rgba(68, 226, 205, 0.2);
}

.btn-secondary:hover {
  background: rgba(68, 226, 205, 0.18);
  color: var(--clr-secondary);
  text-decoration: none;
  box-shadow: 0 0 20px rgba(68, 226, 205, 0.2);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--clr-on-surface-variant);
}

.btn-ghost:hover {
  background: var(--clr-surface-container);
  color: var(--clr-on-surface);
  border-color: rgba(255, 255, 255, 0.12);
  text-decoration: none;
}

.btn-danger {
  background: var(--clr-error-container);
  color: var(--clr-error);
  border: 1px solid rgba(255, 107, 107, 0.2);
}

.btn-danger:hover {
  background: rgba(255, 107, 107, 0.18);
  color: var(--clr-error);
  text-decoration: none;
}

.btn-sm {
  font-size: 0.75rem;
  padding: 6px 12px;
  gap: 5px;
}

.btn-lg {
  font-size: 0.9375rem;
  padding: 13px 28px;
  border-radius: var(--r-md);
  gap: 9px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
  border-radius: var(--r-sm);
}

.btn-icon-lg {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Forms & Inputs ───────────────────────────────────────── */
.form-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--clr-on-surface-variant);
  margin-bottom: 6px;
  display: block;
  letter-spacing: 0.02em;
}

.form-control, .form-select {
  background: var(--clr-surface-container);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-sm);
  color: var(--clr-on-surface) !important;
  -webkit-text-fill-color: var(--clr-on-surface) !important;
  font-size: 0.875rem;
  font-family: var(--ff-sans);
  padding: 10px 14px;
  width: 100%;
  transition: var(--tr-base);
  -webkit-appearance: none;
}

.form-control::placeholder { color: var(--clr-outline); }
.form-select option { background: var(--clr-surface-container); color: var(--clr-on-surface); }

/* ── Fix: dark-mode autofill & browser-override ──────────── */
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus,
.form-select:-webkit-autofill {
  -webkit-text-fill-color: var(--clr-on-surface) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--clr-surface-container) inset !important;
  caret-color: var(--clr-on-surface);
  transition: background-color 5000s ease-in-out 0s;
}
textarea.form-control {
  -webkit-text-fill-color: var(--clr-on-surface) !important;
  color: var(--clr-on-surface) !important;
  resize: vertical;
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(78, 222, 163, 0.12);
  background: var(--clr-surface-low);
}

.form-control.is-invalid { border-color: var(--clr-error); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.12); }

.invalid-feedback {
  color: var(--clr-error);
  font-size: 0.75rem;
  margin-top: 4px;
}

.input-group {
  position: relative;
}

.input-group .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--clr-outline);
  font-size: 1rem;
  pointer-events: none;
}

.input-group .form-control {
  padding-left: 38px;
  /* Bootstrap's own .input-group CSS (loaded on the same pages) flattens
     the right-side border-radius of any child that is not :last-child --
     meant for classic grouped input+addon-button UI. We reuse the
     .input-group class name for an unrelated pattern (an icon or a
     button visually overlaid via position:absolute), so the underlying
     <input> is never really *last* in the DOM once a suffix button
     follows it, and Bootstrap silently squares off its right corners.
     Force our own radius back so it matches every other field. */
  border-radius: var(--r-sm) !important;
}

.input-group.has-suffix .form-control { padding-right: 38px; }

/* No leading icon (e.g. auth password fields that only have a right-side
   eye-toggle button) -- cancel the icon's left padding so the typed text
   lines up with plain fields like First/Last Name. */
.input-group.no-left-icon .form-control { padding-left: 14px; }

.input-group .input-suffix {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--clr-outline);
}

/* Custom Select Arrow */
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%239aada0' d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px;
  padding-right: 36px;
  cursor: pointer;
}

/* Checkbox & Radio */
.form-check-input {
  background-color: var(--clr-surface-container);
  border: 1px solid var(--clr-outline);
  width: 16px;
  height: 16px;
  border-radius: 3px;
  cursor: pointer;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  transition: var(--tr-fast);
  position: relative;
  top: 1px;
}

.form-check-input:checked {
  background-color: var(--clr-primary);
  border-color: var(--clr-primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%23003824' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z'/%3E%3C/svg%3E");
  background-size: 10px;
  background-position: center;
  background-repeat: no-repeat;
}

.form-check-input[type="radio"] { border-radius: 50%; }

.form-check-input[type="radio"]:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='5' fill='%23003824'/%3E%3C/svg%3E");
}

.form-check-label {
  font-size: 0.875rem;
  color: var(--clr-on-surface);
  cursor: pointer;
  margin-left: 8px;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input { display: none; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--clr-surface-high);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: var(--tr-base);
  border: 1px solid var(--glass-border);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  background: var(--clr-on-surface-variant);
  border-radius: 50%;
  transition: var(--tr-base);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--clr-primary-container);
  border-color: rgba(78, 222, 163, 0.3);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: var(--clr-primary);
}

/* Amount Input */
.amount-input-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
  background: var(--clr-surface-container);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-sm);
  transition: var(--tr-base);
}

.amount-input-wrap:focus-within {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(78, 222, 163, 0.12);
  background: var(--clr-surface-low);
}

.amount-currency {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 10px 0 10px 14px;
  font-family: var(--ff-mono);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--clr-on-surface-variant);
  pointer-events: none;
  white-space: nowrap;
}

.amount-input-wrap .form-control {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding-left: 6px;
  font-family: var(--ff-mono);
  font-size: 1rem;
  font-weight: 600;
}

.amount-input-wrap .form-control:focus {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

/* ── Badges / Chips ───────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 0.675rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.4;
  white-space: nowrap;
}

.badge-primary   { background: var(--clr-primary-container); color: var(--clr-primary); }
.badge-secondary { background: var(--clr-secondary-container); color: var(--clr-secondary); }
.badge-error     { background: var(--clr-error-container); color: var(--clr-error); }
.badge-warning   { background: var(--clr-warning-container); color: var(--clr-warning); }
.badge-tertiary  { background: var(--clr-tertiary-container); color: var(--clr-tertiary); }
.badge-neutral   { background: var(--clr-surface-container); color: var(--clr-on-surface-variant); }

.badge-income  { background: rgba(78, 222, 163, 0.12); color: var(--clr-primary); }
.badge-expense { background: rgba(255, 107, 107, 0.12); color: var(--clr-error); }
.badge-transfer { background: rgba(173, 198, 255, 0.12); color: var(--clr-tertiary); }

/* AI chip */
.ai-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, rgba(78, 222, 163, 0.1), rgba(68, 226, 205, 0.06));
  border: 1px solid rgba(78, 222, 163, 0.2);
  border-radius: var(--r-pill);
  padding: 3px 10px;
  font-size: 0.675rem;
  font-weight: 600;
  color: var(--clr-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── Transaction Items ────────────────────────────────────── */
.transaction-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--glass-border);
  transition: var(--tr-fast);
}

.transaction-item:last-child { border-bottom: none; }
.transaction-item:hover { opacity: 0.85; }

.tx-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.tx-info { flex: 1; min-width: 0; }

.tx-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--clr-on-surface);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-meta {
  font-size: 0.7rem;
  color: var(--clr-on-surface-variant);
  margin: 2px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
}
.tx-meta > * { white-space: nowrap; }

.tx-amount {
  font-family: var(--ff-mono);
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}

.tx-amount.income   { color: var(--clr-primary); }
.tx-amount.expense  { color: var(--clr-error); }
.tx-amount.transfer { color: var(--clr-tertiary); }

/* ── Day-grouped transaction lists (date moved to a group header instead of
   competing for space on every row -- see .tx-meta above) ─────────────── */
.day-group-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--clr-on-surface-variant);
  background: var(--clr-surface-low);
}
.day-group-header .day-group-total {
  font-family: var(--ff-mono);
  font-weight: 700;
  font-size: 0.75rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.day-group-header .day-group-total.positive { color: var(--clr-primary); }
.day-group-header .day-group-total.negative { color: var(--clr-error); }
.day-group-header .day-group-total.zero { color: var(--clr-on-surface-variant); }

/* ── Progress Bars ────────────────────────────────────────── */
.progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: var(--clr-surface-high);
  border-radius: var(--r-pill);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--clr-primary), var(--clr-secondary));
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar-fill.danger { background: linear-gradient(90deg, var(--clr-error), #ff8080); }
.progress-bar-fill.warning { background: linear-gradient(90deg, var(--clr-warning), #fcd34d); }

/* ── Tables ───────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.data-table th {
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--clr-outline);
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--glass-border);
  color: var(--clr-on-surface);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: var(--tr-fast);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.data-table tbody tr:last-child td { border-bottom: none; }

/* Responsive table wrapper */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--r-lg);
}

/* ── Modals ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: var(--clr-surface-low);
  border: 1px solid var(--glass-border);
  border-top-color: var(--glass-border-top);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(20px);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.modal-overlay.open .modal-box {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 0;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--clr-on-surface);
  margin: 0;
  letter-spacing: -0.01em;
}

.modal-close {
  background: none;
  border: none;
  color: var(--clr-on-surface-variant);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--r-sm);
  transition: var(--tr-fast);
  display: flex;
  align-items: center;
}

.modal-close:hover { color: var(--clr-on-surface); background: var(--clr-surface-container); }

.modal-body {
  padding: 20px 24px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 0 24px 24px;
}

/* ── Notifications ────────────────────────────────────────── */
.notification-item {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--glass-border);
  position: relative;
  transition: var(--tr-fast);
}

.notification-item.unread::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: var(--clr-primary);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(78, 222, 163, 0.5);
}

.notif-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.notif-content { flex: 1; min-width: 0; }
.notif-title { font-size: 0.875rem; font-weight: 500; color: var(--clr-on-surface); margin: 0; }
.notif-desc { font-size: 0.75rem; color: var(--clr-on-surface-variant); margin: 3px 0 0; }
.notif-time { font-size: 0.675rem; color: var(--clr-outline); margin-top: 4px; font-family: var(--ff-mono); }

/* ── Wallet Cards ─────────────────────────────────────────── */
.wallet-card {
  background: linear-gradient(135deg, var(--clr-surface-low) 0%, var(--clr-surface-container) 100%);
  border: 1px solid var(--glass-border);
  border-top-color: var(--glass-border-top);
  border-radius: var(--r-xl);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: var(--tr-base);
}

.wallet-card::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--wallet-color, rgba(78,222,163,0.08)) 0%, transparent 70%);
  pointer-events: none;
}

.wallet-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.wallet-card.active {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 1px var(--clr-primary), var(--glow-primary);
}

.wallet-type {
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clr-on-surface-variant);
}

.wallet-balance {
  font-family: var(--ff-mono);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--clr-on-surface);
  margin: 12px 0 4px;
}

.wallet-name {
  font-size: 0.875rem;
  color: var(--clr-on-surface-variant);
}

/* ── Budget Cards ─────────────────────────────────────────── */
.budget-card {
  background: var(--clr-surface-low);
  border: 1px solid var(--glass-border);
  border-top-color: var(--glass-border-top);
  border-radius: var(--r-lg);
  padding: 20px;
  transition: var(--tr-base);
}

.budget-card:hover { border-color: rgba(78, 222, 163, 0.15); }

.budget-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ── Tags / Labels ────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 0.7rem;
  font-weight: 500;
  background: var(--clr-surface-container);
  color: var(--clr-on-surface-variant);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: var(--tr-fast);
  white-space: nowrap;
  user-select: none;
}

.tag:hover {
  background: var(--clr-surface-high);
  color: var(--clr-on-surface);
  border-color: rgba(255, 255, 255, 0.1);
}

.tag.selected {
  background: var(--clr-primary-container);
  color: var(--clr-primary);
  border-color: rgba(78, 222, 163, 0.25);
}

.tag i { font-size: 0.7rem; }

/* Tag dot */
.tag-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* ── AI Insight Cards ─────────────────────────────────────── */
.ai-insight-card {
  background: linear-gradient(135deg,
    rgba(78, 222, 163, 0.06) 0%,
    rgba(68, 226, 205, 0.03) 50%,
    rgba(18, 18, 18, 0) 100%);
  border: 1px solid rgba(78, 222, 163, 0.15);
  border-radius: var(--r-xl);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: var(--tr-base);
}

.ai-insight-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(78, 222, 163, 0.4), transparent);
}

.ai-insight-card:hover {
  border-color: rgba(78, 222, 163, 0.25);
  box-shadow: 0 0 60px -20px rgba(78, 222, 163, 0.12);
}

.ai-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--clr-secondary);
  position: relative;
  flex-shrink: 0;
}

.ai-pulse::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--clr-secondary);
  opacity: 0.3;
  animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
  0%   { transform: scale(1); opacity: 0.4; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* ── Tabs ─────────────────────────────────────────────────── */
.tabs-bar {
  display: flex;
  gap: 2px;
  background: var(--clr-surface-container);
  border-radius: var(--r-sm);
  padding: 4px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tabs-bar::-webkit-scrollbar { display: none; }

.tab-btn {
  background: none;
  border: none;
  color: var(--clr-on-surface-variant);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--tr-fast);
  white-space: nowrap;
}

.tab-btn:hover { color: var(--clr-on-surface); }

.tab-btn.active {
  background: var(--clr-surface-bright);
  color: var(--clr-on-surface);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* ── Filter Chips ─────────────────────────────────────────── */
.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  background: var(--clr-surface-container);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-pill);
  color: var(--clr-on-surface-variant);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 6px 14px;
  cursor: pointer;
  transition: var(--tr-fast);
  white-space: nowrap;
}

.filter-chip:hover { color: var(--clr-on-surface); border-color: rgba(255, 255, 255, 0.1); }
.filter-chip.active {
  background: var(--clr-primary-container);
  color: var(--clr-primary);
  border-color: rgba(78, 222, 163, 0.3);
  font-weight: 600;
}

/* ── Chip Strip (horizontally scrollable period chips) ──────── */
.chip-strip-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chip-strip {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  padding-bottom: 2px;
  min-width: 0;
}
.chip-strip::-webkit-scrollbar { display: none; }

.chip-strip .filter-chip { flex-shrink: 0; }

.chip-strip-year {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--clr-on-surface);
  min-width: 38px;
  text-align: center;
  flex-shrink: 0;
}

.chip-nav-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--clr-surface-container);
  border: 1px solid var(--glass-border);
  color: var(--clr-on-surface-variant);
  transition: var(--tr-fast);
}
.chip-nav-arrow:hover { color: var(--clr-on-surface); border-color: rgba(255, 255, 255, 0.1); }
.chip-nav-arrow.disabled { opacity: 0.35; pointer-events: none; }

/* ── Transactions list: pagination / "show all" footer ────────
   Stacks (info+toggle row, then nav row) instead of one crowded
   flex row so it doesn't overflow on small screens; the numbered
   page buttons scroll horizontally (like .chip-strip) rather than
   wrapping into a ragged multi-line block of tiny buttons. */
.pagination-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.pagination-footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}

.pagination-info {
  font-size: 0.8rem;
  color: var(--clr-on-surface-variant);
}

.pagination-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.pagination-nums {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  padding-bottom: 2px;
  min-width: 0;
}
.pagination-nums::-webkit-scrollbar { display: none; }
.pagination-nums .btn { flex-shrink: 0; }

@media (max-width: 575.98px) {
  .pagination-footer { padding: 0.85rem 1rem; }
  .pagination-info { font-size: 0.75rem; }
}

/* ── Dashboard: top-level Month & Year picker ─────────────────
   Sits beside the Week/Month/Year/All period-tabs; picking a
   month drives the WHOLE dashboard (stats, donut, sparkline,
   cash flow), not just one card. */
.month-year-picker {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--clr-surface-container);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-sm);
  padding: 4px 8px;
  transition: var(--tr-fast);
}
.month-year-picker.active {
  border-color: var(--clr-primary);
  background: var(--clr-primary-container);
}
.month-year-picker .my-icon {
  font-size: 0.75rem;
  color: var(--clr-on-surface-variant);
  margin-right: 3px;
  flex-shrink: 0;
}
.month-year-picker.active .my-icon { color: var(--clr-primary); }
.month-year-picker select {
  background: transparent;
  border: none;
  outline: none;
  padding: 3px 2px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--ff-sans);
  color: var(--clr-on-surface);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  max-width: 84px;
}
.month-year-picker option { background: var(--clr-surface-container); color: var(--clr-on-surface); }
.month-year-picker .my-clear {
  display: inline-flex;
  align-items: center;
  color: var(--clr-on-surface-variant);
  font-size: 0.9rem;
  margin-left: 2px;
  line-height: 1;
  flex-shrink: 0;
}
.month-year-picker .my-clear:hover { color: var(--clr-error); }

/* ── Empty States ─────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-state-icon {
  width: 72px;
  height: 72px;
  border-radius: var(--r-xl);
  background: var(--clr-surface-container);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--clr-outline);
  margin-bottom: 20px;
}

.empty-state h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--clr-on-surface);
  margin: 0 0 8px;
}

.empty-state p {
  font-size: 0.875rem;
  color: var(--clr-on-surface-variant);
  margin: 0 0 20px;
  max-width: 300px;
}

/* ── Toast / Snackbar ─────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--clr-surface-bright);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--clr-on-surface);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  pointer-events: all;
  animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 340px;
  min-width: 260px;
}

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

.toast.out { animation: slideOutRight 0.25s ease forwards; }
@keyframes slideOutRight {
  to { transform: translateX(120%); opacity: 0; }
}

.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast.success .toast-icon { color: var(--clr-primary); }
.toast.error   .toast-icon { color: var(--clr-error); }
.toast.info    .toast-icon { color: var(--clr-tertiary); }

/* ── Mobile Bottom Nav (floating capsule) ─────────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0));
  height: 64px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-pill);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  z-index: 1020;
  padding: 0 8px;
}

@media (max-width: 991.98px) { .bottom-nav { display: flex; } }

.bottom-nav-list {
  display: flex;
  align-items: center;
  justify-content: space-around;
  width: 100%;
  height: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
}

.bottom-nav-item {
  flex: 1;
}

.bottom-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--clr-on-surface-variant);
  text-decoration: none;
  padding: 6px 0;
  transition: var(--tr-fast);
  border-radius: var(--r-sm);
  min-height: 52px;
}

.bottom-nav-link i { font-size: 1.2rem; }
.bottom-nav-link span { font-size: 0.575rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.bottom-nav-link.active { color: var(--clr-primary); }

/* ── Bottom nav FAB (centre add button) ───────────────────── */
.bottom-nav-fab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-secondary));
  color: var(--clr-on-primary);
  box-shadow: 0 0 20px rgba(78, 222, 163, 0.4);
  position: relative;
  bottom: 10px;          /* lift above bar */
  text-decoration: none;
  flex-shrink: 0;
  transition: var(--tr-base);
}
.bottom-nav-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 0 30px rgba(78, 222, 163, 0.55);
  color: var(--clr-on-primary);
  text-decoration: none;
}
.bottom-nav-fab i { font-size: 1.4rem; line-height: 1; }

/* Adjust page content for the floating bottom nav on mobile */
@media (max-width: 991.98px) {
  .page-content {
    padding-bottom: calc(64px + 12px + var(--sp-md) + env(safe-area-inset-bottom, 0));
  }
}

/* ── Loading Skeleton ─────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg,
    var(--clr-surface-container) 25%,
    var(--clr-surface-high) 50%,
    var(--clr-surface-container) 75%);
  background-size: 400% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--r-sm);
}

@keyframes shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ── Dropdown ─────────────────────────────────────────────── */
.dropdown-menu-dark {
  background: var(--clr-surface-high);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  padding: 6px;
  min-width: 180px;
}

.dropdown-item-dark {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 0.8125rem;
  color: var(--clr-on-surface-variant);
  cursor: pointer;
  transition: var(--tr-fast);
  text-decoration: none;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}

.dropdown-item-dark:hover {
  background: var(--clr-surface-bright);
  color: var(--clr-on-surface);
  text-decoration: none;
}

.dropdown-item-dark.danger:hover { color: var(--clr-error); }

.dropdown-divider-dark {
  border: none;
  border-top: 1px solid var(--glass-border);
  margin: 6px 0;
}

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

/* ── Dividers ─────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--glass-border);
  margin: 0;
}

/* ── Sparkline SVG ────────────────────────────────────────── */
.sparkline {
  display: block;
  overflow: visible;
}

/* ── Category Icon ────────────────────────────────────────── */
.cat-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

/* ── Utility ──────────────────────────────────────────────── */
.gap-2   { gap: 8px; }
.gap-3   { gap: 12px; }
.gap-4   { gap: 16px; }

.rounded-full { border-radius: var(--r-pill) !important; }
.rounded-lg   { border-radius: var(--r-lg) !important; }
.rounded-xl   { border-radius: var(--r-xl) !important; }

.text-sm   { font-size: 0.75rem !important; }
.text-xs   { font-size: 0.675rem !important; }
.fw-semibold { font-weight: 600 !important; }

.d-flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards; }

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

.stagger > * {
  opacity: 0;
  animation: fadeInStagger 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.1s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.2s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.3s; }

/* ── Responsive helpers ───────────────────────────────────── */
@media (max-width: 575.98px) {
  .btn-lg { padding: 11px 20px; font-size: 0.875rem; }
  .card, .card-glass { padding: 18px; }
  .stat-value { font-size: 1.375rem; }
  .page-header h1 { font-size: 1.375rem; }
}
