:root {
  --color-background: #f4f6fb;
  --color-surface: #ffffff;
  --color-surface-alt: #f9fbff;
  --color-border: rgba(15, 23, 42, 0.08);
  --color-border-strong: rgba(15, 23, 42, 0.16);
  --color-text: #0f172a;
  --color-text-muted: #64748b;
  --color-text-subtle: #8a94a6;
  --color-primary: #2563eb;
  --color-primary-soft: rgba(37, 99, 235, 0.12);
  --color-primary-strong: #1d4ed8;
  --color-success: #0f9d58;
  --color-warning: #f4a261;
  --color-danger: #dc2626;
  --color-sidebar-bg: #0f172a;
  --color-sidebar-surface: rgba(15, 23, 42, 0.48);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow-soft: 0 18px 35px -22px rgba(15, 23, 42, 0.35);
  --shadow-lift: 0 35px 65px -35px rgba(15, 23, 42, 0.45);
  --shadow-flat: 0 10px 30px rgba(15, 23, 42, 0.08);
  --font-heading: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.theme-dark {
  color-scheme: dark;
  --color-background: #050b17;
  --color-surface: rgba(15, 23, 42, 0.72);
  --color-surface-alt: rgba(15, 23, 42, 0.85);
  --color-border: rgba(148, 163, 184, 0.2);
  --color-border-strong: rgba(148, 163, 184, 0.32);
  --color-text: #e2e8f0;
  --color-text-muted: #98a4bb;
  --color-text-subtle: #74829b;
  --color-primary: #60a5fa;
  --color-primary-soft: rgba(96, 165, 250, 0.18);
  --color-primary-strong: #3b82f6;
  --color-sidebar-bg: rgba(9, 15, 26, 0.85);
  --color-sidebar-surface: rgba(148, 163, 184, 0.12);
  --shadow-soft: 0 28px 55px -28px rgba(2, 6, 23, 0.85);
  --shadow-lift: 0 38px 60px -30px rgba(2, 6, 23, 0.85);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  background: linear-gradient(180deg, #f8faff 0%, var(--color-background) 32%);
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.theme-dark body {
  background: radial-gradient(circle at top, rgba(37, 99, 235, 0.12), transparent 55%), var(--color-background);
}

a {
  color: var(--color-primary-strong);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover,
a:focus {
  color: var(--color-primary);
}

.wrapper {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
  gap: 2.5rem;
  padding: 2.5rem 2rem;
}

@media (max-width: 1200px) {
  .wrapper {
    padding: 1.5rem 1rem 2rem;
  }
}

.main-panel {
  flex: 1;
  max-width: 100%;
  background: transparent;
}

.main-header {
  display: none;
}

.container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
}

.page-inner {
  padding: 0;
}

.page-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.page-hero {
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.09), rgba(16, 185, 129, 0.08)), var(--color-surface);
  border: 1px solid rgba(37, 99, 235, 0.18);
  box-shadow: var(--shadow-flat);
  position: relative;
  overflow: hidden;
}

.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.16), transparent 55%);
  opacity: 0.6;
}

.page-hero > .card-body,
.page-hero > .panel-body {
  position: relative;
  z-index: 1;
}

.hero-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.65rem, 1.4rem + 1vw, 2.15rem);
  letter-spacing: -0.025em;
}

.hero-subtitle,
.hero-note {
  color: var(--color-text-muted);
  max-width: 720px;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  background: rgba(15, 23, 42, 0.04);
  color: var(--color-text);
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.hero-chip i {
  color: var(--color-primary-strong);
}

.hero-chip--muted {
  color: var(--color-text-muted);
  background: rgba(100, 116, 139, 0.1);
  border-color: rgba(148, 163, 184, 0.25);
}

.theme-dark .hero-chip {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.24);
  color: var(--color-text);
}

.theme-dark .hero-chip--muted {
  background: rgba(96, 165, 250, 0.16);
  border-color: rgba(96, 165, 250, 0.32);
  color: var(--color-text-muted);
}

.hero-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(37, 99, 235, 0.32));
  color: #fff;
  font-size: 1.75rem;
  box-shadow: var(--shadow-soft);
}

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  background: rgba(15, 23, 42, 0.05);
  color: var(--color-text-muted);
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-weight: 600;
}

.hero-status__icon {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.18);
  color: var(--color-primary-strong);
  font-size: 1rem;
}

.hero-status[data-state="success"] {
  background: rgba(16, 185, 129, 0.12);
  color: #0f766e;
  border-color: rgba(16, 185, 129, 0.32);
}

.hero-status[data-state="success"] .hero-status__icon {
  background: rgba(16, 185, 129, 0.18);
  color: #0d7a68;
}

.hero-status[data-state="loading"] {
  background: rgba(37, 99, 235, 0.12);
  color: var(--color-primary-strong);
  border-color: rgba(37, 99, 235, 0.25);
}

.hero-status[data-state="error"] {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.25);
}

.theme-dark .hero-status {
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.3);
  color: var(--color-text-muted);
}

.theme-dark .hero-status__icon {
  background: rgba(96, 165, 250, 0.18);
  color: var(--color-primary);
}

.theme-dark .hero-status[data-state="success"] {
  background: rgba(34, 197, 94, 0.22);
  border-color: rgba(34, 197, 94, 0.38);
  color: #86efac;
}

.theme-dark .hero-status[data-state="success"] .hero-status__icon {
  background: rgba(34, 197, 94, 0.28);
  color: #4ade80;
}

.theme-dark .hero-status[data-state="loading"] {
  background: rgba(96, 165, 250, 0.2);
  border-color: rgba(96, 165, 250, 0.42);
  color: var(--color-primary);
}

.theme-dark .hero-status[data-state="error"] {
  background: rgba(248, 113, 113, 0.22);
  border-color: rgba(248, 113, 113, 0.36);
  color: #fecaca;
}

.card,
.panel,
.table-card,
.stat-card,
.filter-step-card,
.log-entry,
.log-detail,
.modal-content,
.payment-tile,
.choices__inner,
.list-group-item,
.alert-light {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-flat);
}

.card-header,
.panel-header {
  border-bottom: 1px solid var(--color-border);
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.1), transparent 55%);
  padding: 1.15rem 1.5rem;
}

.card-body,
.panel-body {
  padding: 1.5rem;
}

.chart-card-body {
  position: relative;
  min-height: 260px;
  height: clamp(260px, 38vh, 360px);
  display: flex;
  align-items: stretch;
}

.chart-card-body canvas {
  width: 100% !important;
  height: 100% !important;
  max-height: 100%;
}

.card.rounded,
.card.card-round {
  border-radius: var(--radius-md);
}

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

.section-heading h5,
.section-heading h4 {
  margin: 0;
  font-weight: 600;
}

.section-heading .section-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.stat-card {
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.stat-card__accent {
  width: 48px;
  height: 4px;
  border-radius: 999px;
  background: var(--color-primary);
}

.stat-card__label {
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  letter-spacing: 0.08em;
}

.stat-card__value {
  font-size: 1.45rem;
  font-weight: 600;
}

.badge,
.tag,
.sidebar-updated-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(37, 99, 235, 0.12);
  color: var(--color-primary-strong);
}

.table-responsive {
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: none;
}

.table thead th {
  background: rgba(15, 23, 42, 0.04);
  border-bottom: none;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.theme-dark .table thead th {
  background: rgba(148, 163, 184, 0.12);
  color: var(--color-text-muted);
}

.table > :not(caption) > * > * {
  padding: 0.6rem 0.9rem;
  vertical-align: middle;
}

.table tbody tr:hover {
  background: rgba(37, 99, 235, 0.04);
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(15, 23, 42, 0.02);
}

.table-hover tbody tr:hover {
  background-color: rgba(37, 99, 235, 0.06);
}

.theme-dark .table-responsive {
  background: var(--color-surface);
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-soft);
}

.theme-dark .table {
  color: var(--color-text);
  --bs-table-bg: transparent;
  --bs-table-striped-color: var(--color-text);
  --bs-table-striped-bg: rgba(148, 163, 184, 0.08);
  --bs-table-hover-color: var(--color-text);
  --bs-table-hover-bg: rgba(96, 165, 250, 0.16);
  --bs-table-border-color: rgba(148, 163, 184, 0.24);
}

.theme-dark .table tbody tr:hover,
.theme-dark .table-hover tbody tr:hover {
  background-color: rgba(96, 165, 250, 0.16);
}

.theme-dark .table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(148, 163, 184, 0.08);
}

.theme-dark .table > :not(caption) > * {
  border-color: rgba(148, 163, 184, 0.22);
}

.theme-dark .table > :not(caption) > * > * {
  background-color: transparent;
  color: var(--color-text);
}

.theme-dark .table tbody tr {
  background-color: transparent;
}

.table-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.table-controls .form-control,
.table-controls .form-select {
  max-width: 220px;
}

.table-pagination {
  display: flex;
  gap: 0.4rem;
}

.table-pagination button {
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.table-pagination button:hover,
.table-pagination button.active {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
}

.btn,
button.btn,
.btn-range {
  border-radius: 999px;
  font-weight: 600;
  padding: 0.55rem 1.2rem;
  border-width: 1px;
}

.btn-primary,
.btn-range.active,
button.btn-primary {
  background: linear-gradient(135deg, var(--color-primary-strong), var(--color-primary));
  border: none;
  color: #fff;
  box-shadow: 0 18px 28px -18px rgba(37, 99, 235, 0.65);
}

.btn-outline-secondary,
.btn-outline-light,
.btn-light,
.btn-range {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
  box-shadow: 0 12px 18px -16px rgba(15, 23, 42, 0.35);
}

.btn-range:hover,
.btn-outline-secondary:hover,
.btn-outline-light:hover,
.btn-light:hover {
  transform: translateY(-2px);
  border-color: var(--color-primary);
  color: var(--color-primary-strong);
}

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

.form-control,
.form-select,
input,
select,
textarea {
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  padding: 0.6rem 0.75rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-control:focus,
.form-select:focus,
input:focus,
select:focus,
textarea:focus,
.choices__inner.is-focused {
  border-color: rgba(37, 99, 235, 0.6);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.form-label,
label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.empty-state {
  border: 1px dashed rgba(15, 23, 42, 0.12);
  background: var(--color-surface-alt);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.8rem;
  text-align: center;
  color: var(--color-text-muted);
  box-shadow: none;
}

.empty-state .icon,
.empty-state__icon {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  background: rgba(37, 99, 235, 0.12);
  color: var(--color-primary-strong);
  font-size: 1.6rem;
}

.theme-dark .empty-state {
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.72);
  color: var(--color-text-muted);
}

.theme-dark .empty-state .icon,
.theme-dark .empty-state__icon {
  background: rgba(96, 165, 250, 0.2);
  color: var(--color-primary);
}

.log-entry {
  display: flex;
  gap: 1.1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.log-entry:hover {
  transform: translateY(-4px);
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: var(--shadow-soft);
}

.log-detail {
  padding: 1.4rem;
  border-radius: var(--radius-md);
}

.payment-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.payment-tile {
  flex: 1 1 160px;
  min-width: 150px;
  text-align: center;
  padding: 0.9rem 1rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.payment-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-soft);
}

.payment-tile img {
  width: 32px;
  height: 32px;
}

.app-sidebar {
  width: 265px;
  flex: 0 0 265px;
  background: var(--color-sidebar-bg);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.1rem;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-soft);
  position: sticky;
  top: 1.5rem;
  height: calc(100vh - 3rem);
}

.theme-dark .app-sidebar {
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
}

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

.app-sidebar__logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1rem;
  color: #f8fafc;
}

.app-sidebar__logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.3), rgba(37, 99, 235, 0.65));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.app-sidebar__collapse {
  border: none;
  background: rgba(148, 163, 184, 0.12);
  color: #f8fafc;
  border-radius: 10px;
  padding: 0.3rem 0.55rem;
  display: none;
}

.app-sidebar__version {
  font-size: 0.8rem;
  line-height: 1.5;
  background: var(--color-sidebar-surface);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  color: rgba(226, 232, 240, 0.85);
  margin-bottom: 1rem;
}

.app-sidebar__section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(203, 213, 225, 0.65);
  margin: 0;
  padding: 0;
}

.app-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.app-sidebar__group {
  display: grid;
  gap: 0.35rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.app-sidebar__group--fixed {
  gap: 0.45rem;
}

.app-sidebar__group:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.app-sidebar__section-label {
  display: flex;
  align-items: center;
  padding: 0 0.35rem;
  color: rgba(203, 213, 225, 0.75);
}

.app-sidebar__section-toggle {
  border: none;
  background: rgba(148, 163, 184, 0.08);
  color: rgba(203, 213, 225, 0.75);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.6rem;
  text-align: left;
  font-weight: 600;
  letter-spacing: 0.08em;
  border-radius: 10px;
  transition: color 0.2s ease;
}

.app-sidebar__section-toggle i {
  font-size: 0.7rem;
  transition: transform 0.2s ease;
}

.app-sidebar__section-toggle[aria-expanded="true"] i {
  transform: rotate(180deg);
}

.app-sidebar__section-toggle:hover {
  color: rgba(248, 250, 252, 0.95);
}

.app-sidebar__group-items {
  display: grid;
  gap: 0.3rem;
  margin-top: 0.45rem;
}

.app-sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  color: rgba(226, 232, 240, 0.92);
  font-weight: 500;
  font-size: 0.92rem;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.app-sidebar__link i {
  width: 1.25rem;
  text-align: center;
  color: rgba(148, 163, 184, 0.85);
}

.app-sidebar__link:hover {
  background: rgba(148, 163, 184, 0.15);
  color: #fff;
  transform: translateX(2px);
}

.app-sidebar__link.active {
  background: rgba(37, 99, 235, 0.3);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.35);
}

.app-sidebar__link.active i {
  color: #fff;
}

.app-sidebar__badge {
  margin-left: auto;
}

.app-sidebar__footer {
  margin-top: 1.4rem;
  font-size: 0.78rem;
  line-height: 1.5;
  color: rgba(203, 213, 225, 0.75);
  background: var(--color-sidebar-surface);
  border-radius: var(--radius-sm);
  padding: 0.85rem 0.9rem;
}

.app-sidebar__danger {
  margin-top: 1.5rem;
}

.app-sidebar__danger .app-sidebar__link {
  background: rgba(220, 38, 38, 0.12);
  color: #fee2e2;
}

.app-sidebar__danger .app-sidebar__link:hover {
  background: rgba(220, 38, 38, 0.18);
}

@media (max-width: 1200px) {
  .app-sidebar {
    position: fixed;
    inset: 1rem;
    inset-right: auto;
    transform: translateX(-110%);
    width: 280px;
    height: calc(100vh - 2rem);
    z-index: 1030;
    transition: transform 0.3s ease;
  }

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

  .app-sidebar__collapse {
    display: inline-flex;
  }

  .wrapper {
    padding-top: 0;
  }
}

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

.footer {
  border-top: 1px solid var(--color-border);
  margin-top: 3rem;
  padding: 1.5rem 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.03), transparent);
  color: var(--color-text-subtle);
  font-size: 0.85rem;
  position: static;
  width: 100%;
}

.footer a {
  color: var(--color-primary-strong);
  font-weight: 600;
}

.footer a:hover,
.footer a:focus {
  color: var(--color-primary);
}

.footer .nav,
.footer .copyright {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer .nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer #footerInfo {
  color: var(--color-text);
  font-weight: 600;
}

.theme-dark .footer #footerInfo {
  color: rgba(226, 232, 240, 0.92);
}

.theme-dark .footer {
  background: rgba(15, 23, 42, 0.65);
  color: rgba(226, 232, 240, 0.72);
  border-color: rgba(148, 163, 184, 0.24);
  box-shadow: 0 -25px 60px -40px rgba(2, 6, 23, 0.85);
}

.theme-dark .footer a {
  color: rgba(96, 165, 250, 0.9);
}

.theme-dark .footer a:hover,
.theme-dark .footer a:focus {
  color: rgba(96, 165, 250, 1);
}

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

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0 1rem;
}

.app-header__title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.22em;
}

.app-header__actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.badge-success {
  background: rgba(16, 185, 129, 0.18);
  color: #0f766e;
}

.badge-warning {
  background: rgba(234, 179, 8, 0.18);
  color: #b45309;
}

.badge-info {
  background: rgba(6, 182, 212, 0.18);
  color: #0e7490;
}

.badge-danger {
  background: rgba(220, 38, 38, 0.18);
  color: #b91c1c;
}

.form-text,
small.text-muted,
.text-muted {
  color: var(--color-text-muted) !important;
}

.table-card .card-body {
  padding-top: 1rem;
}

.table-card__toggle {
  appearance: none;
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.table-card__toggle:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-1px);
}

.table-card__toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.table-card__toggle .table-card__chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 0.85rem;
  transition: transform 0.2s ease;
}

.table-card__toggle:not(.collapsed) {
  background: linear-gradient(135deg, var(--color-primary-strong), var(--color-primary));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 16px 22px -18px rgba(37, 99, 235, 0.65);
}

.table-card__toggle:not(.collapsed) .table-card__chevron {
  transform: rotate(180deg);
}

.theme-dark .table-card__toggle {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(148, 163, 184, 0.4);
}

.theme-dark .table-card__toggle:hover {
  background: rgba(96, 165, 250, 0.16);
  border-color: rgba(96, 165, 250, 0.55);
  color: var(--color-primary);
}

.theme-dark .table-card__toggle:not(.collapsed) {
  box-shadow: 0 18px 26px -18px rgba(96, 165, 250, 0.65);
}

.filter-step-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem;
  border-radius: var(--radius-md);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.filter-step-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-soft);
}

.filter-step-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.12);
  color: var(--color-primary-strong);
}

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

.choices__list--dropdown {
  z-index: 2000;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.timeline-connector {
  width: 2px;
  flex: 1;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.15), transparent);
}

.alert {
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
}

.toast-container .toast {
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.modal-content {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-strong);
  box-shadow: var(--shadow-lift);
}

.modal-header,
.modal-footer {
  border-color: var(--color-border);
}

.animate-scale {
  transform: scale(0.96);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.modal.show .animate-scale {
  transform: scale(1);
  opacity: 1;
}

.fade-in-up {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.floating-icon {
  animation: floatIcon 8s ease-in-out infinite;
}

@keyframes floatIcon {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

.card,
.card-body,
.card-header {
  overflow: visible;
}

.card:has(.choices.is-open) {
  z-index: 40;
}

.choices__inner {
  border-radius: var(--radius-sm) !important;
  border-color: var(--color-border) !important;
  padding: 0.45rem 0.7rem !important;
  min-height: 48px;
  display: flex;
  align-items: center;
}

.choices__list--multiple .choices__item {
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.24);
  color: var(--color-primary-strong);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.85rem;
}

.choices__list--dropdown,
.choices__list[role='listbox'] {
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
}

.choices__list--dropdown .choices__item,
.choices__list[role='listbox'] .choices__item {
  font-size: 0.9rem;
  padding: 0.45rem 0.75rem;
}

.theme-dark .choices__inner {
  background: var(--color-surface);
  border-color: var(--color-border-strong) !important;
  color: var(--color-text);
}

.theme-dark .choices__list--multiple .choices__item {
  background: rgba(96, 165, 250, 0.16);
  border-color: rgba(96, 165, 250, 0.32);
  color: #dbeafe;
}

.theme-dark .choices__list--dropdown,
.theme-dark .choices__list[role='listbox'] {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.24);
  color: var(--color-text);
  box-shadow: var(--shadow-soft);
}

.theme-dark .choices__list--dropdown .choices__item,
.theme-dark .choices__list[role='listbox'] .choices__item {
  color: var(--color-text);
}

.theme-dark .choices__list--dropdown .choices__item--selectable.is-highlighted,
.theme-dark .choices__list[role='listbox'] .choices__item--selectable.is-highlighted {
  background: rgba(96, 165, 250, 0.22);
  color: var(--color-text);
}

.results-container > * + * {
  margin-top: 1.75rem;
}

#loadingBarContainer {
  display: none;
  width: 100%;
  background: rgba(148, 163, 184, 0.25);
  height: 6px;
  border-radius: 999px;
  position: relative;
  margin-bottom: 20px;
  overflow: hidden;
}

#loadingBar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary-strong), var(--color-success));
  transition: width 0.3s ease;
}

#loadingBarText {
  position: absolute;
  top: -28px;
  left: 0;
  width: 100%;
  text-align: center;
  font-weight: 600;
  color: var(--color-text);
}

#loadingOverlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  backdrop-filter: blur(3px);
}

.spinner {
  border: 6px solid rgba(148, 163, 184, 0.35);
  border-top: 6px solid var(--color-primary-strong);
  border-radius: 50%;
  width: 54px;
  height: 54px;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.log-entry.active {
  border-color: var(--color-primary);
  background: rgba(37, 99, 235, 0.12);
  box-shadow: 0 18px 28px -18px rgba(37, 99, 235, 0.4);
}

.log-entry-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.log-entry-index {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  background: rgba(37, 99, 235, 0.16);
  color: var(--color-primary-strong);
}

.log-entry-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.log-entry-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text);
}

.log-entry-meta-line,
.log-entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.log-detail-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.log-detail-header strong {
  font-size: 1.1rem;
}

.timeline-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.timeline-item {
  display: flex;
  gap: 1rem;
}

.timeline-item__icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.timeline-item__content {
  flex: 1;
  background: var(--color-surface-alt);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  border: 1px solid var(--color-border);
}

.timeline-item__content strong {
  display: block;
  color: var(--color-text);
}

.timeline-item__content span {
  color: var(--color-text-muted);
  font-size: 0.82rem;
}

.payment-section-title {
  font-weight: 600;
  margin-top: 0.75rem;
  margin-bottom: 0.35rem;
  color: var(--color-text-muted);
}

.app-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.app-table-toolbar .form-control {
  max-width: 220px;
}

@media (max-width: 991px) {
  .app-sidebar {
    border-radius: 20px;
  }

  .app-header__title {
    font-size: 0.85rem;
  }

  .page-container {
    gap: 1.5rem;
  }

  .card-body,
  .panel-body {
    padding: 1.2rem;
  }
}

@media (max-width: 767px) {
  .wrapper {
    flex-direction: column;
  }

  .main-panel {
    width: 100%;
  }

  .page-hero {
    border-radius: 18px;
  }

  .hero-icon {
    width: 52px;
    height: 52px;
    font-size: 1.4rem;
  }
}
