:root {
  /* Wardio Brand Colors */
  --midnight-slate: #1F2A37;
  --soft-teal: #3FA6A0;
  --muted-sky: #7FA9C4;
  --light-bg: #F7F9FB;
  --primary-text: #111827;
  --secondary-text: #6B7280;

  /* Semantic Colors (using Wardio palette) */
  --bg: var(--light-bg);
  --card-bg: #ffffff;
  --primary: var(--soft-teal);
  --text: var(--primary-text);
  --muted: var(--secondary-text);
  --border: #e5e7eb;
  --shadow: 0 10px 25px rgba(15, 23, 42, 0.08);

  /* Feedback Colors (Wardio voice) */
  --success: #10b981;
  --gentle-coral: #fb7185;
  --warm-amber: #f59e0b;
  --info-blue: var(--muted-sky);

  font-size: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Roboto", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(120deg, #ffffff, #f1f5f9);
  /* Clean neutral gradient */
  color: var(--text);
}

/* Wardio Typography - Headings use Manrope */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Manrope", "Inter", sans-serif;
  font-weight: 600;
  /* Semibold for headings */
}

h2,
h3,
h4 {
  font-weight: 500;
  /* Medium for subheadings */
}


@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(63, 166, 160, 0.12);
  }

  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 10px rgba(63, 166, 160, 0.18);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(63, 166, 160, 0.12);
  }
}

.flash-group {
  margin-bottom: 1rem;
}

.flash {
  padding: 0.9rem 1rem;
  border-radius: 0.8rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.flash-success {
  background: #ecfdf5;
  color: #047857;
}

.flash-error {
  background: #fef2f2;
  color: #b91c1c;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.7);
}

.header-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-content .brand {
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.22rem;
  width: 42px;
  height: 42px;
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  background: var(--card-bg);
  box-shadow: var(--shadow);
  cursor: pointer;
  padding: 0.45rem;
}

.menu-toggle-bar {
  display: block;
  width: 20px;
  height: 2.5px;
  background: var(--text);
  border-radius: 999px;
  position: relative;
}

.header-content nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  margin-left: 1rem;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.icon-button {
  border: 1px solid var(--border);
  background: var(--card-bg);
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.notification-shell {
  position: relative;
}

.notification-dot {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  font-size: 0.75rem;
  line-height: 18px;
  text-align: center;
}

.notification-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  width: 320px;
  background: white;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 1rem;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 12;
}

.notification-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.notification-panel__header {
  display: flex;
  justify-content: space-between;
  padding: 0.85rem 1rem 0.35rem;
}

.notification-list {
  list-style: none;
  margin: 0;
  padding: 0 0.75rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 360px;
  overflow-y: auto;
}

.notification-item {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: flex-start;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 0.9rem;
  padding: 0.75rem;
  background: rgba(248, 250, 252, 0.8);
}

.notification-list li.is-unread .notification-item {
  border-color: rgba(63, 166, 160, 0.25);
  box-shadow: inset 0 1px 0 rgba(63, 166, 160, 0.08);
}

.user-pill {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(63, 166, 160, 0.1);
  color: var(--primary);
  font-size: 0.85rem;
}

.app-shell {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  gap: 1.5rem;
}

.app-sidebar {
  width: 230px;
  background: var(--card-bg);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  padding: 1.2rem;
  position: sticky;
  top: 90px;
  align-self: flex-start;
  height: fit-content;
}

.sidebar-overlay {
  display: none;
}

.sidebar-close {
  display: none;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
  margin-left: auto;
  cursor: pointer;
}

.app-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.sidebar-link {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 0.7rem;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-link:hover {
  background: rgba(63, 166, 160, 0.08);
  color: var(--primary);
}

.app-main {
  flex: 1;
  max-width: none;
  margin: 0;
  padding: 0;
}

.page-header-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.dashboard-page {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

.dashboard-hero {
  padding: 2rem;
  border-radius: 1.5rem;
  background: linear-gradient(135deg, #f0fdf4, #eef2ff);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.15);
  position: relative;
  overflow: hidden;
}

.dashboard-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.4), transparent 55%),
    radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.25), transparent 45%);
  pointer-events: none;
}

.dashboard-hero>* {
  position: relative;
  z-index: 1;
}

.dashboard-hero .dashboard-header {
  margin-bottom: 1rem;
}

.dashboard-hero .range-chips {
  background: rgba(255, 255, 255, 0.45);
  padding: 0.4rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.dashboard-hero .chip {
  border: none;
  color: rgba(15, 23, 42, 0.75);
}

.dashboard-hero .chip-active {
  box-shadow: 0 10px 20px rgba(63, 166, 160, 0.35);
  color: #fff;
}

.dashboard-hero .alert-badges {
  margin-bottom: 0;
  margin-top: 1.25rem;
}

.dashboard-hero .kpi-grid {
  margin-bottom: 0;
  margin-top: 1.25rem;
}

.dashboard-hero .kpi-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: none;
  backdrop-filter: blur(6px);
}

.filter-card,
.summary-cards,
.transactions-card {
  background: var(--card-bg);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.filter-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.quick-months {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.quick-months--floating {
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.5rem;
}

.quick-months--inline {
  margin-bottom: 0.5rem;
}

.filter-shell.is-open .quick-months--floating {
  display: none;
}

.btn-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

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

.btn-chip.is-active {
  background: rgba(63, 166, 160, 0.08);
  color: var(--primary);
  border-color: var(--primary);
}

.filter-shell {
  gap: 0.75rem;
}

.filter-shell__bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-shell__title {
  margin: 0 0 0.25rem 0;
}

.filter-shell__status {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.filter-shell__preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.6rem;
  background: rgba(63, 166, 160, 0.05);
  border: 1px solid rgba(63, 166, 160, 0.15);
  border-radius: 0.65rem;
  font-size: 0.85rem;
  color: var(--text);
}

.filter-chip--muted {
  background: rgba(248, 250, 252, 0.9);
  border-style: dashed;
  color: var(--muted);
}

.filter-shell__bar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.filter-toggle {
  border: 1px solid var(--border);
  background: linear-gradient(135deg, #ffffff, rgba(63, 166, 160, 0.04));
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
}

.filter-toggle__icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(63, 166, 160, 0.15), rgba(63, 166, 160, 0.05));
  border: 1px solid rgba(63, 166, 160, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.filter-toggle__icon::after {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.filter-shell.is-open .filter-toggle__icon::after {
  transform: rotate(-135deg);
}

.filter-shell__body {
  border: 1px dashed var(--border);
  border-radius: 0.9rem;
  padding: 1rem;
  background: linear-gradient(135deg, #ffffff, rgba(63, 166, 160, 0.02));
  max-height: 1400px;
  overflow: hidden;
  opacity: 1;
  transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.25s ease;
}

.filter-shell:not(.is-open) .filter-shell__body {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
}

.filter-form label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.filter-form input,
.filter-form select {
  width: 100%;
  padding: 0.65rem;
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  font-size: 0.95rem;
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: flex-end;
  margin-top: 0.25rem;
}

@media (max-width: 720px) {
  .filter-shell__bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-shell__bar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .filter-toggle {
    width: 100%;
    justify-content: center;
  }
}

.actions-card {
  background: var(--card-bg);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.reprocess-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.reprocess-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.reprocess-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.reprocess-progress[hidden] {
  display: none;
}

.spinner {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  animation: spinner 0.8s linear infinite;
}

.muted.small {
  font-size: 0.85rem;
}

.muted.tiny {
  font-size: 0.78rem;
}

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

.btn {
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.4rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-compact {
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
}

.btn.small {
  padding: 0.4rem 0.9rem;
  font-size: 0.92rem;
}

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

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.summary-card {
  padding: 1rem;
  border-radius: 0.75rem;
  background: var(--bg);
}

.summary-card h4 {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.summary-card p {
  margin: 0.35rem 0 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
}

.transaction-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}











.transaction-card__value {
  font-weight: 700;
  font-size: 1.1rem;
}



.transaction-card__meta,
.transaction-card__details,
.transaction-card__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.transaction-card__details {
  color: var(--muted);
}

.pill,
.meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  font-size: 0.8rem;
  color: var(--muted);
  background: rgba(248, 250, 252, 0.9);
}

.pill--accent {
  color: var(--chip-accent, var(--primary));
  border-color: rgba(99, 102, 241, 0.2);
}

.pill--light {
  background: rgba(15, 23, 42, 0.02);
}

.pill--soft {
  background: rgba(63, 166, 160, 0.08);
  border-color: rgba(63, 166, 160, 0.18);
  color: var(--primary);
}



.transaction-card__button {
  margin-left: auto;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(59, 130, 246, 0.08);
  transition: background 0.15s ease, color 0.15s ease;
}

.transaction-card__button:hover {
  background: rgba(59, 130, 246, 0.2);
  color: var(--primary-dark, #1d4ed8);
}

.transaction-card--cta {
  flex-direction: row;
  align-items: center;
  gap: 1rem;
}

.transaction-card--cta .transaction-card__merchant {
  font-size: 1.3rem;
}

.transaction-card__cta-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(63, 166, 160, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.transaction-card__cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 15px 30px rgba(63, 166, 160, 0.35);
}

.manual-form-card {
  padding: 2rem;
}

.manual-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem 1.25rem;
}

.preferences-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.form-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.manual-input {
  width: 100%;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 0.75rem;
  padding: 0.6rem 0.9rem;
  font-size: 0.95rem;
  background: rgba(248, 250, 252, 0.9);
}

.manual-textarea {
  min-height: 110px;
  resize: vertical;
}

.manual-checkbox {
  width: auto;
  margin-right: 0.4rem;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.manual-form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.feedback-card {
  padding: 2.75rem;
}

.feedback-card .section-header h1 {
  margin-bottom: 0.4rem;
}

.feedback-card p {
  line-height: 1.6;
  color: var(--muted);
}

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding: 1.25rem;
  border: 1px solid rgba(226, 232, 240, 0.7);
  border-radius: 1.25rem;
  background: linear-gradient(135deg, #ffffff, rgba(255, 255, 255, 0.7));
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.08);
}

.feedback-form .form-field {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.feedback-form .form-field label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.feedback-form .form-field select,
.feedback-form .form-field textarea,
.feedback-form .form-field input[type="file"] {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.5);
  border-radius: 1rem;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  background: rgba(248, 250, 252, 0.95);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

.feedback-form .form-field select:focus,
.feedback-form .form-field textarea:focus,
.feedback-form .form-field input[type="file"]:focus-visible {
  outline: none;
  border-color: rgba(63, 166, 160, 0.75);
  box-shadow: 0 0 0 3px rgba(63, 166, 160, 0.15);
}

.feedback-form textarea {
  min-height: 170px;
  resize: vertical;
  line-height: 1.55;
}

.feedback-form .form-field .muted {
  margin-top: 0.2rem;
}

.feedback-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 0.25rem;
}

.feedback-actions .btn-primary {
  padding: 0.9rem 1.75rem;
  border-radius: 999px;
  font-size: 1rem;
  box-shadow: 0 15px 30px rgba(63, 166, 160, 0.25);
}

.feedback-table .feedback-description p {
  margin: 0;
  white-space: pre-line;
}

.attachment-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.attachment-list a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.attachment-list a:hover {
  text-decoration: underline;
}

/* Fallback styling for legacy transaction list markup */
.transactions-list,
.transaction-item {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.transaction-item {
  border: 1px solid rgba(226, 232, 240, 0.7);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  background: #fff;
}

.pagination {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
}

.pagination a,
.pagination span {
  padding: 0.4rem 0.8rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
}

.pagination .active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

body.sidebar-open {
  overflow: hidden;
}

@media (max-width: 1024px) {
  .header-content {
    padding: 0.9rem 1.2rem;
    gap: 1rem;
  }

  .header-content nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .app-shell {
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
  }

  .app-sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 85%);
    max-width: 100%;
    height: 100vh;
    transform: translateX(-105%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.22s ease, box-shadow 0.22s ease, opacity 0.18s ease, visibility 0.18s ease;
    border-radius: 0 1rem 1rem 0;
    z-index: 25;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.35);
    padding-top: 1.2rem;
    box-sizing: border-box;
  }

  .app-sidebar.is-open {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    display: block;
  }

  .app-sidebar nav {
    gap: 0.4rem;
  }

  .sidebar-close {
    display: inline-block;
  }

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.32);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 15;
  }

  .sidebar-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .app-main {
    padding-top: 0.5rem;
  }

  .card-management__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .transaction-card__top {
    flex-direction: column;
    gap: 0.4rem;
  }

  .transaction-card__amount {
    text-align: left;
    width: 100%;
  }
}

.transaction-detail-card {
  background: var(--card-bg);
  box-shadow: var(--shadow);
  border-radius: 1rem;
  padding: 1.5rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
}

.detail-grid div {
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  padding: 1rem;
}

.detail-grid h4 {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.detail-grid p {
  margin: 0.4rem 0 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.detail-actions {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.inline-form {
  display: inline-flex;
}

.card-management {
  background: var(--card-bg);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.card-management__grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.dashboard-controls {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.expense-filter-form {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.expense-filter-form label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--muted);
}

.expense-filter-form select {
  border: none;
  background: transparent;
  font-weight: 600;
  color: var(--text);
  font-size: 0.9rem;
  min-width: 160px;
  outline: none;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
  font-weight: 700;
  display: inline-block;
}

.muted {
  color: var(--muted);
  margin: 0;
}

.muted.small {
  font-size: 0.85rem;
}

.range-chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid var(--border);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
}

.chip-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: var(--card-bg);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.kpi-label {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 0.3rem;
}

.kpi-value {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  word-break: break-word;
}

.kpi-delta {
  font-weight: 600;
  font-size: 0.9rem;
}

.delta-up {
  color: #b91c1c;
}

.delta-down {
  color: #047857;
}

.kpi-muted {
  font-size: 0.85rem;
  color: var(--muted);
}

.currency-breakdown {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.currency-breakdown li {
  margin-bottom: 0.2rem;
}

.alert-badges {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.alert-badge {
  border-radius: 0.9rem;
  padding: 0.35rem 0.9rem;
  font-weight: 600;
  font-size: 0.85rem;
}

.alert-warn {
  background: #fef3c7;
  color: #92400e;
}

.alert-error {
  background: #ffe4e6;
  color: #e11d48;
}

.alert-info {
  background: #e0f2fe;
  color: #075985;
}

.section-card {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 1.2rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(226, 232, 240, 0.7);
  overflow: hidden;
}

.danger-card {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(254, 226, 226, 0.5);
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.info-callout {
  margin: 0.75rem 0 0;
  padding: 0.75rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(241, 245, 249, 0.8);
  font-size: 0.9rem;
  color: var(--text);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.info-callout strong {
  color: var(--primary);
}

.category-section-body {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
  gap: 1.25rem;
  margin-top: 1rem;
}

.category-section-body.single-card {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 1024px) {
  .category-section-body {
    grid-template-columns: 1fr;
  }
}

.groups-page {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.invite-banner {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1rem 1.25rem;
  border: 1px dashed rgba(63, 166, 160, 0.35);
  border-radius: 1rem;
  background: rgba(255, 247, 250, 0.9);
}

.invite-banner__list {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.invite-chip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 0.9rem;
  padding: 0.7rem 0.85rem;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.invite-chip__actions {
  display: flex;
  gap: 0.35rem;
}

.groups-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.groups-header h2 {
  margin: 0.15rem 0;
}

.groups-header-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.groups-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 1.5rem;
}

.groups-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.groups-panel {
  background: rgba(248, 250, 252, 0.85);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.groups-panel.muted {
  background: rgba(249, 247, 255, 0.8);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.panel-badge {
  align-self: flex-start;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: rgba(63, 166, 160, 0.1);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.8rem;
}

.group-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.group-nav-link {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(226, 232, 240, 0.8);
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.8);
  transition: border 0.15s ease, transform 0.15s ease;
}

.group-nav-link.is-active {
  border-color: rgba(63, 166, 160, 0.4);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.15);
  transform: translateY(-1px);
}

.group-nav-link:hover {
  border-color: rgba(63, 166, 160, 0.3);
}

.group-nav-link strong {
  display: block;
}

.group-nav-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.role-chip {
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(148, 163, 184, 0.2);
  color: var(--muted);
}

.role-chip.is-admin {
  background: rgba(63, 166, 160, 0.1);
  color: var(--primary);
}

.btn-full {
  width: 100%;
}

.groups-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.group-hero-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(238, 242, 255, 0.95));
  border-radius: 1.2rem;
  padding: 1.5rem;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 25px 45px rgba(15, 23, 42, 0.12);
}

.invite-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: 0.5rem 0 0.25rem;
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  border: 1px solid rgba(226, 232, 240, 0.8);
  background: rgba(250, 250, 250, 0.95);
}

.invite-card__actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.group-hero-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.group-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.group-type,
.group-role,
.group-status {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  background: rgba(148, 163, 184, 0.2);
  color: #0f172a;
  font-weight: 600;
}

.group-role.is-admin {
  background: rgba(63, 166, 160, 0.12);
  color: var(--primary);
}

.group-hero-card h3 {
  margin: 0.2rem 0;
  font-size: 1.8rem;
}

.group-stats {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
}

.group-stats li {
  padding: 0.95rem;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.8);
  text-align: center;
}

.group-stats strong {
  font-size: 1.4rem;
  display: block;
  color: var(--primary);
}

.group-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.group-card {
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.1);
  display: flex;
  flex-direction: column;
}

.group-card--full {
  width: 100%;
}

.group-card__header {
  padding: 1.2rem 1.2rem 0.6rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.group-card__body {
  padding: 1.2rem;
}

.group-card__header h4 {
  margin: 0.15rem 0;
}

.group-card__header p {
  margin: 0;
}

.table-card.compact table {
  font-size: 0.92rem;
}

.group-accordion {
  margin-top: 1rem;
  border: 1px dashed rgba(148, 163, 184, 0.5);
  border-radius: 0.9rem;
  padding: 0.6rem 0.95rem;
  background: rgba(247, 250, 252, 0.7);
}

.group-accordion summary {
  cursor: pointer;
  font-weight: 600;
  outline: none;
}

.group-accordion[open] summary {
  margin-bottom: 0.6rem;
}

.category-chip-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.category-chip-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 0.9rem;
  padding: 0.8rem;
  background: rgba(248, 250, 252, 0.8);
}

.subcategory-list {
  list-style: none;
  padding: 0;
  margin: 0;
  columns: 2;
  column-gap: 1.5rem;
}

@media (max-width: 640px) {
  .subcategory-list {
    columns: 1;
  }
}

.chip-soft {
  background: rgba(63, 166, 160, 0.1);
  color: var(--primary);
}

.group-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 100;
}

.modal.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-overlay {
  position: absolute;
  inset: 0;
}

.modal-panel {
  position: relative;
  background: #fff;
  border-radius: 1.2rem;
  padding: 1.5rem;
  width: min(500px, 100%);
  box-shadow: 0 25px 80px rgba(15, 23, 42, 0.25);
  border: 1px solid rgba(226, 232, 240, 0.9);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.modal-form label {
  display: block;
}

body.modal-open {
  overflow: hidden;
}

.empty-state {
  border: 1px dashed rgba(148, 163, 184, 0.5);
  border-radius: 1rem;
  padding: 1.5rem;
  text-align: center;
  background: rgba(248, 250, 252, 0.8);
}

.empty-state.hero {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.empty-state h3,
.empty-state h4 {
  margin: 0 0 0.5rem;
}

@media (max-width: 960px) {
  .groups-layout {
    grid-template-columns: 1fr;
  }

  .groups-header {
    flex-direction: column;
  }

  .groups-header-actions {
    justify-content: flex-start;
  }
}

.group-hero-actions {
  max-width: 300px;
}

.category-budget-chart .chart-card {
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 1rem;
  padding: 1rem;
  background: rgba(248, 250, 252, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.category-budget-chart h3 {
  margin: 0;
}

.category-budget-chart .muted {
  margin: 0.2rem 0 1rem;
}

.budget-chart-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.category-budget-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.category-budget-row:hover {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 6px 18px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

.category-budget-row:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.category-budget-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.category-budget-meta span:last-child {
  text-align: right;
}

.budget-chart-fill.no-budget {
  background: rgba(148, 163, 184, 0.5);
}

.budget-chart-head {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
}

.budget-chart-head small {
  font-weight: 500;
  color: var(--muted);
}

.budget-chart-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.3);
  overflow: hidden;
}

.budget-chart-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #fb923c);
  border-radius: inherit;
}

.budget-chart-fill.over {
  background: linear-gradient(90deg, #b91c1c, #f97316);
}

.budget-chart-meta {
  font-size: 0.85rem;
  font-weight: 600;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.budget-control {
  margin-top: 2rem;
}

.budget-control-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: stretch;
}

@media (max-width: 1024px) {
  .budget-control-layout {
    grid-template-columns: 1fr;
  }
}

.budget-control-summary {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.budget-control-meta {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
}

.budget-control-meta strong {
  font-size: 1.5rem;
}

.budget-status {
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.budget-status strong {
  display: block;
  margin-bottom: 0.2rem;
}

.budget-status p {
  margin: 0;
  font-size: 0.85rem;
}

.budget-status span {
  font-size: 1.35rem;
  font-weight: 600;
}

.budget-status.status-risk {
  background: #fee2e2;
  color: #991b1b;
}

.budget-status.status-ok {
  background: #dcfce7;
  color: #166534;
}

.budget-control-stat-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat-card {
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 1rem;
  background: white;
}

.stat-card .stat-value {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0.2rem 0;
}

.stat-card small {
  font-size: 0.8rem;
  color: var(--muted);
}

.empty-state {
  border: 1px dashed var(--border);
  border-radius: 0.9rem;
  padding: 1.25rem;
  background: #f8fafc;
  text-align: center;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
}

.data-table th,
.data-table td {
  padding: 0.6rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.data-table th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.budget-progress {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.budget-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.3);
  overflow: hidden;
}

.budget-progress-fill {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: inherit;
}

.budget-progress-fill.over {
  background: #b91c1c;
}

.budget-progress-meta {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.budget-progress-meta strong {
  font-size: 1rem;
}

.budget-progress-meta small {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  color: var(--muted);
}

.stacked-block {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.merchant-signal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.merchant-toggle {
  display: inline-flex;
  gap: 0.4rem;
}

.simple-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.simple-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.simple-list-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.simple-list-link:hover {
  border-color: rgba(148, 163, 184, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 6px 18px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

.simple-list-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.sync-health-list li {
  flex-direction: column;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
}

.sync-health-row-stale {
  border-color: #f97316;
  background: rgba(249, 115, 22, 0.08);
}

.sync-health-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.sync-health-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.8rem;
}

.sync-health-stat {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  font-size: 0.95rem;
}

.sync-health-stat small {
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.7rem;
}

.status-pill {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 999px;
  padding: 0.1rem 0.7rem;
  font-weight: 600;
}

.status-pill-ok {
  background: #dcfce7;
  color: #166534;
}

.status-pill-warn {
  background: #fee2e2;
  color: #b91c1c;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.category-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.category-tile {
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem;
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.category-tile header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
}

.section-table .table-card {
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.data-table thead th {
  text-align: left;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.9rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.data-table tbody td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

.data-table tbody tr:hover {
  background: rgba(15, 23, 42, 0.02);
}

.cell-title {
  display: block;
  font-weight: 600;
}

.cell-caption {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.cell-number {
  font-weight: 600;
  text-align: right;
}

.text-right {
  text-align: right;
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
}

.inline-action-form {
  margin: 0;
  display: inline-flex;
}

.empty-row td {
  text-align: center;
  color: var(--muted);
  padding: 1.5rem 1rem;
  font-weight: 600;
}

@media (max-width: 820px) {
  .accounts-table {
    min-width: 520px;
  }

  .cards-table {
    min-width: 0;
  }

  .cards-table thead {
    display: none;
  }

  .cards-table tbody {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .cards-table tbody tr {
    display: block;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    background: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  }

  .cards-table tbody td {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.25rem;
    padding: 0.35rem 0;
    border: none;
  }

  .cards-table tbody td::before {
    content: attr(data-label);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
  }

  .cards-table tbody td:last-child {
    padding-bottom: 0.15rem;
  }

  .cards-table tbody tr:hover {
    background: #fff;
  }

  .cards-table .table-actions {
    justify-content: flex-start;
    gap: 0.5rem;
  }

  .cards-table .table-actions .btn {
    width: 100%;
    max-width: 200px;
    justify-content: center;
  }
}

.inline-row {
  display: none;
  background: #f8fafc;
}

.inline-row.is-visible {
  display: table-row;
}

.inline-row td {
  padding: 1.2rem;
  border-top: 1px solid var(--border);
  background: linear-gradient(135deg, #f8fafc, #fefce8);
}

.inline-edit-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.inline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.inline-field label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
  display: block;
  margin-bottom: 0.35rem;
}

.inline-field input,
.inline-field textarea,
.inline-field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
  font-family: inherit;
}

.inline-field textarea {
  min-height: 90px;
  resize: vertical;
}

.inline-description,
.inline-span-2 {
  grid-column: span 2;
}

.inline-checkbox {
  padding: 0.75rem;
  border: 1px dashed var(--border);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.inline-checkbox input {
  width: auto;
}

.inline-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.btn-ghost {
  background: rgba(15, 23, 42, 0.04);
}

.btn-danger {
  color: #b91c1c;
  border: 1px solid #fecaca;
  background: rgba(251, 113, 133, 0.08);
}

.btn-danger:hover {
  color: #991b1b;
  border-color: #fca5a5;
}

.empty-table {
  margin: 0;
  padding-top: 1rem;
}

@media (max-width: 640px) {
  .table-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

.suggestion-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.suggestion-list li {
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  padding: 0.8rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.suggestion-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-small {
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
}

.rule-form p {
  margin-bottom: 0.6rem;
}

.headline {
  font-size: 2.5rem;
  margin: 0.2rem 0 0;
  font-weight: 700;
}

.idle-cards ul {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.attention-list li {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
}

.attention-amount {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: flex-end;
}

.mini-link {
  font-size: 0.8rem;
  text-decoration: none;
  color: var(--primary);
  font-weight: 600;
}

.llm-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.line-chart {
  width: 100%;
  height: 260px;
  margin-top: 1rem;
  padding: 0.75rem 1rem 1rem;
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 1.25rem;
  background: radial-gradient(circle at 20% 0%, rgba(244, 114, 182, 0.18), transparent 40%),
    linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(255, 255, 255, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 15px 45px rgba(15, 23, 42, 0.08);
  box-sizing: border-box;
}

.line-chart svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-line {
  fill: none;
  stroke: #f43f5e;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-point {
  fill: #fff;
  stroke: #f43f5e;
  stroke-width: 1.75;
}

.chart-axis {
  stroke: rgba(100, 116, 139, 0.35);
  stroke-width: 0.6;
}

.chart-labels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.75rem;
  margin-top: 0.9rem;
  font-size: 0.85rem;
}

.chart-labels span {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.4rem 0.6rem;
  border-radius: 0.75rem;
  background: rgba(248, 250, 252, 0.85);
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.chart-labels strong {
  font-size: 0.95rem;
}

.chart-labels small {
  color: var(--muted);
}

.chart-insights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 0.5rem 0 1rem;
}

.insight-value {
  margin: 0.2rem 0 0;
  font-size: 1.4rem;
  font-weight: 700;
}

.chart-area {
  stroke: none;
}

.chart-grid {
  stroke: rgba(148, 163, 184, 0.25);
  stroke-width: 0.5;
}

/* Chart.js Enhancements */
.chart-container {
  position: relative;
  height: 400px;
  margin: 2rem 0;
  padding: 1rem;
  border-radius: 1.25rem;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(255, 255, 255, 0.9));
  box-shadow: 0 15px 45px rgba(15, 23, 42, 0.08);
}

.chart-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  justify-content: flex-end;
}

.chart-controls .btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.chart-controls .btn:hover {
  background: var(--soft-teal);
  color: white;
  border-color: var(--soft-teal);
}

@media (max-width: 768px) {
  .chart-container {
    height: 300px;
    margin: 1rem 0;
    padding: 0.75rem;
  }

  .chart-controls {
    justify-content: center;
  }
}

.expense-account-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 1.5rem;
}

@media (max-width: 960px) {
  .expense-account-grid {
    grid-template-columns: 1fr;
  }
}

.expense-bars {
  list-style: none;
  padding: 0;
  margin: 0;
}

.expense-bar-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.expense-bar-list li {
  list-style: none;
}

.expense-bar-row {
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem 1.2rem;
  background: rgba(255, 255, 255, 0.7);
  display: block;
  text-decoration: none;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

.expense-bars a.expense-bar-row,
.expense-bars a.expense-bar-row:link,
.expense-bars a.expense-bar-row:visited,
.expense-bars a.expense-bar-row:hover,
.expense-bars a.expense-bar-row:active {
  color: var(--text) !important;
  text-decoration: none !important;
}

.expense-bar-row:hover {
  border-color: rgba(226, 232, 240, 0.8);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5), 0 10px 26px rgba(15, 23, 42, 0.14);
  transform: translateY(-2px);
}

.expense-bar-row:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.expense-bar-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.8rem;
}

.expense-bar-value {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: flex-end;
  font-weight: 600;
}

.expense-bar-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  overflow: hidden;
}

.expense-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: rgba(63, 166, 160, 0.2);
  display: flex;
}

.expense-bar-segment {
  display: block;
  height: 100%;
}

.expense-bar-meta {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.7rem;
}

.expense-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.expense-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 0.2rem 0.75rem;
  font-size: 0.8rem;
  background: #fff;
}

.expense-tag small {
  color: var(--muted);
  font-size: 0.75rem;
}

.expense-pie-panel {
  border: 1px dashed var(--border);
  border-radius: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.6);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.expense-pie {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 45%, transparent 46%), conic-gradient(var(--primary) 0deg, var(--primary) 360deg);
  box-shadow: inset 0 0 30px rgba(15, 23, 42, 0.08);
}

.expense-pie-meta {
  text-align: center;
}

.expense-legend {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.expense-legend li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.legend-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.card-management__form {
  background: var(--bg);
  border-radius: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
}

.card-management__list {
  display: grid;
  gap: 1rem;
}

.card-management__list--full {
  grid-template-columns: 1fr;
}

.card-tile {
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem;
  background: #fff;
}

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

.card-inline-form {
  margin-top: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card-inline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.card-inline-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.card-inline-form input,
.card-inline-form select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 0.7rem;
  border: 1px solid var(--border);
  font-size: 0.95rem;
}

.expense-trigger {
  margin-top: 0.4rem;
  padding: 0;
}

.expense-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.expense-modal.is-open {
  display: flex;
}

.expense-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.expense-modal__card {
  position: relative;
  background: var(--card-bg);
  border-radius: 1.25rem;
  padding: 1.5rem;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.25);
  width: min(520px, 100%);
}

.expense-modal__card input {
  margin-top: 0.6rem;
}

.expense-modal__card .actions-inline {
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1rem;
}

.expense-picker {
  display: flex;
  flex-direction: column;
}

body.expense-modal-open {
  overflow: hidden;
}

.status.active {
  color: #047857;
}

.status.inactive {
  color: #b91c1c;
}

.auth-card {
  max-width: 420px;
  margin: 2rem auto;
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: var(--shadow);
}

.auth-form label {
  display: block;
  margin-bottom: 1rem;
  color: var(--muted);
}

.auth-form input {
  width: 100%;
  padding: 0.6rem;
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  margin-top: 0.3rem;
}

.auth-form .btn-primary {
  width: 100%;
  justify-content: center;
}

.divider {
  margin: 1rem 0;
  text-align: center;
  color: var(--muted);
}

.auth-card .muted,
.auth-card .muted a {
  text-align: center;
  display: block;
  color: var(--muted);
}

.social-auth-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.25rem;
}

.auth-card .google-btn,
.auth-card .outlook-btn {
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
}

.email-section {
  margin-top: 1.5rem;
}


.edit-grid input,
.edit-grid textarea,
.edit-grid select {
  width: 100%;
  padding: 0.4rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  font-size: 0.95rem;
}

.error {
  color: #b91c1c;
  font-size: 0.8rem;
}

@media (max-width: 640px) {
  .transaction-card {
    padding: 0.9rem 1rem;
  }

  .transaction-card__amount {
    text-align: left;
  }

  .filter-actions {
    flex-direction: column;
  }
}

.app-footer {
  text-align: center;
  padding: 2rem 1rem 3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  padding: 0.85rem 1.5rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
  background: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  transition: all 0.2s ease;
}

.google-btn img {
  width: 20px;
  height: 20px;
}

.google-btn:hover {
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
  border-color: rgba(66, 133, 244, 0.4);
}

.outlook-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  border-radius: 999px;
  padding: 0.85rem 1.5rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  background: linear-gradient(135deg, #0f6cbd, #1b87e0);
  color: #fff;
  box-shadow: 0 10px 25px rgba(34, 118, 206, 0.35);
  border: none;
  transition: all 0.2s ease;
}

.outlook-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(34, 118, 206, 0.45);
}

.outlook-btn .icon {
  font-size: 1.15rem;
}

.mailbox-connect {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1.5rem 0 2rem;
}

.import-card {
  background: var(--card-bg);
  padding: 2.5rem;
  border-radius: 1.25rem;
  box-shadow: var(--shadow);
}

.import-header h2 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  color: var(--text);
}

.import-header p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.import-progress {
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  margin: 1rem 0 1.5rem;
  background: #fff7f8;
}

.import-progress.is-completed {
  background: #ecfdf3;
  border-color: rgba(22, 101, 52, 0.22);
}

.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.status-pill {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(63, 166, 160, 0.1);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
}

.status-pill.is-completed {
  background: rgba(22, 101, 52, 0.15);
  color: #166534;
}

.live-progress-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  align-items: center;
  background: linear-gradient(120deg, rgba(63, 166, 160, 0.08), #ffffff);
  border: 1px solid rgba(63, 166, 160, 0.18);
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  margin-bottom: 0.85rem;
}

.import-progress.is-completed .live-progress-card {
  background: linear-gradient(120deg, rgba(22, 101, 52, 0.08), #ffffff);
  border-color: rgba(22, 101, 52, 0.2);
}

.live-progress-indicator {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 40%, var(--primary) 60%);
  box-shadow: 0 0 0 8px rgba(63, 166, 160, 0.12);
  position: relative;
  animation: pulse 1.5s ease-in-out infinite;
}

.import-progress.is-completed .live-progress-indicator {
  background: radial-gradient(circle, #fff 40%, #16a34a 60%);
  box-shadow: 0 0 0 8px rgba(22, 101, 52, 0.12);
  animation: none;
}

.live-progress-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.live-progress-eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.01em;
}

.live-progress-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0;
}

.live-progress-hint {
  margin: 0;
  color: #475569;
  font-size: 0.95rem;
}

.live-progress-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.65rem;
  border-radius: 0.75rem;
  background: var(--card-bg);
  border: 1px solid rgba(15, 23, 42, 0.07);
  color: #0f172a;
  font-weight: 600;
  font-size: 0.85rem;
}

.meta-pill.soft {
  background: rgba(63, 166, 160, 0.08);
  color: var(--primary);
  border-color: rgba(63, 166, 160, 0.15);
}

.import-stepper {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 0;
  margin: 0 0 1rem;
}

.import-stepper li {
  position: relative;
  padding: 0.65rem 0.8rem 0.6rem 2.2rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: #fff;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}

.import-stepper li::before {
  content: "";
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: #fff;
}

.import-stepper li.is-active {
  border-color: rgba(63, 166, 160, 0.25);
  background: rgba(63, 166, 160, 0.08);
  color: var(--primary);
}

.import-stepper li.is-active::before {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 0 0 5px rgba(63, 166, 160, 0.18);
}

.import-stepper li.is-complete {
  color: #166534;
  border-color: rgba(22, 101, 52, 0.25);
  background: #ecfdf3;
}

.import-stepper li.is-complete::before {
  background: #166534;
  border-color: #166534;
  box-shadow: 0 0 0 5px rgba(22, 101, 52, 0.15);
}

.import-stepper li.is-failed {
  border-color: rgba(185, 28, 28, 0.3);
  background: #fef2f2;
  color: #b91c1c;
}

.import-stepper li.is-failed::before {
  background: #b91c1c;
  border-color: #b91c1c;
  box-shadow: 0 0 0 5px rgba(185, 28, 28, 0.15);
}

.progress-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  overflow: hidden;
  margin: 0.25rem 0 0.6rem;
  position: relative;
}

.progress-value {
  height: 100%;
  background: linear-gradient(120deg, var(--soft-teal), var(--muted-sky));
  border-radius: inherit;
  transition: width 0.6s ease;
}

.progress-value.is-completed {
  background: linear-gradient(120deg, #16a34a, #22c55e);
}

.progress-metrics {
  margin: 0.2rem 0 0.2rem;
  font-weight: 600;
  color: #0f172a;
}

.text-danger {
  color: #b91c1c;
  margin: 0.2rem 0 0;
  font-weight: 600;
}

@media (max-width: 768px) {
  .live-progress-card {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .live-progress-indicator {
    margin: 0.1rem 0 0.35rem;
  }

  .import-stepper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.mailbox-list {
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 1.5rem;
  margin-bottom: 1.75rem;
  background: linear-gradient(135deg, #fafbfc, #ffffff);
}

.mailbox-list h3 {
  margin: 0 0 1.25rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.mailbox-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
}

.mailbox-list li {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
  background: white;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  transition: all 0.2s ease;
}

.mailbox-list li:hover {
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
  border-color: rgba(63, 166, 160, 0.2);
}

.mailbox-label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mailbox-label strong {
  display: block;
  font-size: 1.05rem;
  color: var(--text);
}

.mailbox-label small {
  color: var(--muted);
  font-size: 0.9rem;
}

.mailbox-meta {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.provider {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.07);
  color: var(--text);
}

.provider.gmail {
  background: rgba(234, 67, 53, 0.12);
  color: #d93025;
}

.provider.outlook {
  background: rgba(15, 108, 189, 0.15);
  color: #0f6cbd;
}

/* Form styling */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.75rem;
}

.auth-form>label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--text);
}

.auth-form select {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  font-size: 1rem;
  background: white;
  color: var(--text);
  transition: all 0.2s ease;
}

.auth-form select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(63, 166, 160, 0.1);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-group>label {
  font-weight: 600;
  color: var(--text);
  font-size: 1rem;
}

.bank-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.bank-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.bank-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.bank-chip-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 600;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bank-chip-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.bank-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  display: inline-flex;
}

.bank-chip input:focus+.bank-chip-label {
  box-shadow: 0 0 0 2px rgba(63, 166, 160, 0.15);
}

.bank-chip input:checked+.bank-chip-label {
  background: rgba(63, 166, 160, 0.12);
  border-color: rgba(63, 166, 160, 0.4);
  color: var(--primary);
}

.bank-chip input:checked+.bank-chip-label .bank-chip-dot {
  background: var(--primary);
}

.form-hint {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

.auth-form button[type="submit"] {
  padding: 0.9rem 2rem;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 999px;
  border: none;
  background: var(--soft-teal);
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 10px 25px rgba(63, 166, 160, 0.25);
  align-self: flex-start;
}

.auth-form button[type="submit"]:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(63, 166, 160, 0.35);
}

.auth-form button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.import-history {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.import-history h3 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.import-history table {
  width: 100%;
  border-collapse: collapse;
}

.import-history th {
  text-align: left;
  padding: 0.75rem;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
}

.import-history td {
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.5);
  color: var(--text);
}

.import-history tr:hover {
  background: rgba(63, 166, 160, 0.02);
}

.alert {
  padding: 1.25rem 1.5rem;
  border-radius: 1rem;
  margin: 1.5rem 0;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.alert-warning {
  background: linear-gradient(135deg, #fef3c7, #fef9e7);
  border: 1px solid #fbbf24;
  color: #92400e;
  font-weight: 600;
}

.page-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.page-hero {
  background: var(--card-bg);
  border-radius: 1.25rem;
  padding: 1.75rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(229, 231, 235, 0.8);
}

.page-hero h1 {
  margin: 0.2rem 0 0.6rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
  display: inline-block;
}

.hero-lede {
  color: var(--muted);
  max-width: 520px;
  line-height: 1.6;
}

.chatbot-card {
  background: var(--card-bg);
  border-radius: 1.5rem;
  padding: 1.5rem;
  border: 1px dashed rgba(107, 114, 128, 0.4);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.chatbot-preview {
  background: #f3f4f6;
  border-radius: 1.25rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 260px;
}

.chatbot-message {
  display: flex;
  gap: 0.8rem;
  background: white;
  border-radius: 1rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(229, 231, 235, 0.9);
  color: var(--muted);
}

.chatbot-message.assistant {
  background: rgba(229, 231, 235, 0.6);
}

.chatbot-message.user {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

.chatbot-message.waiting p:last-child {
  font-style: italic;
  color: rgba(107, 114, 128, 0.9);
}

.chatbot-message .avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(31, 41, 55, 0.08);
}

.chatbot-message .sender {
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.chatbot-input {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.chatbot-input label {
  font-weight: 600;
  color: var(--muted);
}

.chatbot-input textarea {
  width: 100%;
  background: #f9fafb;
  border: 1px dashed rgba(107, 114, 128, 0.6);
  padding: 0.75rem;
  border-radius: 0.8rem;
  resize: none;
  font-family: inherit;
  color: var(--muted);
}

.chatbot-input textarea:disabled {
  cursor: not-allowed;
  background: #f3f4f6;
}

.chatbot-input button {
  padding: 0.75rem;
  border-radius: 999px;
  border: none;
  background: rgba(107, 114, 128, 0.7);
  color: white;
  font-weight: 600;
  cursor: not-allowed;
}

.chatbot-input small {
  color: var(--muted);
}

/* Bulk Actions Bar */
.bulk-actions-bar {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(150%);
  background: white;
  border: 1px solid var(--border);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  border-radius: 1rem;
  padding: 1rem 1.5rem;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  width: 90%;
  max-width: 800px;
}

.bulk-actions-bar.is-visible {
  transform: translateX(-50%) translateY(0);
}

.bulk-actions-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 1rem;
  flex-wrap: wrap;
}

.bulk-actions-info {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.bulk-actions-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.bulk-actions-controls select {
  padding: 0.45rem 2rem 0.45rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  background-color: #fff;
  max-width: 200px;
}

.checkbox-field--small {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
}

.checkbox-field--small input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

@media (max-width: 768px) {
  .bulk-actions-bar {
    bottom: 1rem;
    width: 95%;
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .bulk-actions-form {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .bulk-actions-controls {
    width: 100%;
    justify-content: space-between;
  }

  .bulk-actions-controls select {
    flex: 1;
    max-width: none;
  }
}

/* Redesigned Transaction Card */
.transaction-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  border: 1px solid rgba(226, 232, 240, 0.6);
  border-radius: 1.25rem;
  background: white;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.transaction-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
  border-color: rgba(63, 166, 160, 0.15);
}

.transaction-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--chip-accent, var(--muted));
  opacity: 0.7;
}

/* Custom Checkbox */
.transaction-card__select {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 0.5rem;
  margin: -0.5rem;
}

.transaction-card__select input {
  display: none;
}

.checkbox-visual {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s ease;
  position: relative;
  background: #fff;
}

.transaction-card__select input:checked+.checkbox-visual {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(63, 166, 160, 0.25);
}

.transaction-card__select input:checked+.checkbox-visual::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Card Content Layout */
.transaction-card__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  /* Prevent flex overflow */
}

.transaction-card__header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.transaction-card__merchant {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.transaction-card__date {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}

.transaction-card__meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.transaction-card__end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  text-align: right;
}

.transaction-card__amount {
  display: flex;
  flex-direction: column;
}

.transaction-card__value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.transaction-card__value small {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-left: 0.1rem;
}

.transaction-card__action-btn {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(63, 166, 160, 0.06);
  transition: background 0.15s ease;
}

.transaction-card__action-btn:hover {
  background: rgba(63, 166, 160, 0.12);
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .transaction-card {
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
  }

  .transaction-card__end {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed var(--border);
    padding-top: 0.75rem;
    margin-top: 0.25rem;
  }

  .transaction-card__select {
    align-self: flex-start;
    margin-top: 0.2rem;
  }
}

/* Date Grouping */
.transaction-group {
  margin-bottom: 2rem;
}

.transaction-group__header {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  top: 70px;
  background: rgba(248, 250, 252, 0.9);
  backdrop-filter: blur(4px);
  padding: 0.5rem 0;
  z-index: 5;
}

.text-success {
  color: #059669;
}

/* Hover Actions */
.transaction-card__actions {
  opacity: 0;
  transform: translateX(10px);
  transition: all 0.2s ease;
}

.transaction-card:hover .transaction-card__actions {
  opacity: 1;
  transform: translateX(0);
}

@media (max-width: 640px) {
  .transaction-card__actions {
    opacity: 1;
    transform: none;
  }
}

/* Redesigned Transaction Card Base Styles */
.transaction-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  border: 1px solid rgba(226, 232, 240, 0.6);
  border-radius: 1.25rem;
  background: white;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
  height: 100%;
}

.transaction-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
  border-color: rgba(63, 166, 160, 0.15);
}

.transaction-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--chip-accent, var(--muted));
  opacity: 0.7;
}

/* Visual Redesign - Transaction Card */

.category-badge {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  font-size: 1.1rem;
  flex-shrink: 0;
  text-transform: uppercase;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.meta-text {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
}

.meta-dot {
  color: var(--border);
  font-size: 0.8rem;
}

.action-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--muted);
  transition: all 0.2s ease;
  background: transparent;
}

.action-icon-btn:hover {
  background: rgba(63, 166, 160, 0.08);
  color: var(--primary);
  transform: scale(1.1);
}

.transaction-card__header {
  margin-bottom: 0.15rem;
}

.transaction-card__date {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 400;
}

/* Responsive Grid Layout */
.transaction-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.transaction-group__header {
  grid-column: 1 / -1;
  margin-bottom: 0.5rem;
}



@media (max-width: 768px) {
  .transaction-group {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Authentication Pages */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  background-color: var(--light-bg);
  padding: 2rem 1rem;
}

.auth-card {
  background: var(--card-bg);
  width: 100%;
  max-width: 450px;
  padding: 1.75rem;
  border-radius: 1rem;
  box-shadow: var(--shadow);
  text-align: center;
}

.auth-header {
  margin-bottom: 1.5rem;
}

.auth-logo {
  height: 48px;
  width: 48px;
  border-radius: 0.6rem;
  margin: 0 auto 0.75rem;
}

.auth-title {
  font-family: 'Manrope', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--midnight-slate);
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  font-size: 0.95rem;
  color: var(--secondary-text);
  line-height: 1.5;
}

.auth-form {
  text-align: left;
}

.auth-footer {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--secondary-text);
}

.auth-footer a {
  color: var(--soft-teal);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}

.auth-footer a:hover {
  color: #2d8a84;
  text-decoration: underline;
}

.auth-alert {
  background-color: rgba(255, 128, 128, 0.1);
  border: 1px solid var(--gentle-coral);
  color: #c0392b;
  font-size: 0.875rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* Auth Button & Divider Styles */
.auth-form .form-group {
  margin-bottom: 0.85rem;
}

.auth-form .form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--midnight-slate);
  margin-bottom: 0.5rem;
}

.auth-form .form-input {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  color: var(--primary-text);
  background-color: var(--input-bg, #fff);
  transition: all 0.2s ease-in-out;
}

.auth-form .form-input:focus {
  outline: none;
  border-color: var(--soft-teal);
  box-shadow: 0 0 0 3px rgba(63, 166, 160, 0.1);
}

.auth-form .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.auth-form .btn-primary {
  background-color: var(--soft-teal);
  color: white;
}

.auth-form .btn-primary:hover {
  background-color: #358d88;
  box-shadow: 0 4px 12px rgba(63, 166, 160, 0.25);
  transform: translateY(-1px);
}

.btn-icon svg {
  width: 20px;
  height: 20px;
  margin-right: 8px;
}

.btn-outlook {
  background-color: #0078d4;
  color: white;
}

.btn-outlook:hover {
  background-color: #106ebe;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 120, 212, 0.2);
}

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

.btn-google:hover {
  background-color: var(--light-bg);
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.btn-google svg {
  color: var(--secondary-text);
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1rem 0;
  color: var(--secondary-text);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}

.divider span {
  padding: 0 10px;
}

.social-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}