:root {
  --cp-primary: #2563eb;
  --cp-primary-hover: #1d4ed8;
  --cp-sidebar: #0f172a;
  --cp-bg: #f8fafc;
  --cp-card: #ffffff;
  --cp-border: #e2e8f0;
  --cp-success: #22c55e;
  --cp-warning: #f59e0b;
  --cp-error: #ef4444;
  --cp-text: #0f172a;
  --cp-muted: #64748b;
  --cp-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
  --cp-shadow-lg: 0 8px 30px rgba(15, 23, 42, 0.08);
  --cp-radius: 0.75rem;
  --cp-radius-lg: 1rem;
}

body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--cp-bg);
  color: var(--cp-text);
}

/* Brand logo */
.cp-logo-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.cp-logo {
  display: block;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 0.65rem;
}
.cp-logo--sm { width: 3rem; height: 3rem; }
.cp-logo--md { width: 4rem; height: 4rem; }
.cp-logo--lg { width: 5rem; height: 5rem; }
.cp-logo--xl { width: 6rem; height: 6rem; }
.cp-logo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 0.65rem;
  background: var(--cp-primary);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.cp-logo-fallback--sm { width: 3rem; height: 3rem; font-size: 1rem; }
.cp-logo-fallback--md { width: 4rem; height: 4rem; font-size: 1.35rem; }
.cp-logo-fallback--lg { width: 5rem; height: 5rem; font-size: 1.65rem; }
.cp-logo-fallback--xl { width: 6rem; height: 6rem; font-size: 2rem; }
.cp-sidebar .cp-logo-wrap { gap: 0.875rem; }
.cp-sidebar .cp-logo--lg { width: 5.5rem; height: 5.5rem; }
.cp-logo-name {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.cp-logo-wrap--on-dark .cp-logo-name { color: #fff; }
.cp-logo-wrap--on-dark .cp-logo { border-radius: 0.75rem; }
.cp-sidebar-logo-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  line-height: 0;
}
.cp-sidebar-logo-link:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.85);
  outline-offset: 4px;
  border-radius: 0.5rem;
}
.cp-sidebar-logo-link:hover .cp-sidebar-logo-img {
  opacity: 0.9;
}

/* First-visit intro splash (login/register) */
html.cp-intro-done #cp-intro-splash {
  display: none !important;
}
html.cp-intro-pending body {
  overflow: hidden;
}
html:not(.cp-intro-done):not(.cp-intro-pending) #cp-intro-splash {
  display: none !important;
}
.cp-intro-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
}
.cp-intro-splash.is-leaving {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.cp-intro-splash__bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 35%, rgba(37, 99, 235, 0.35) 0%, transparent 55%),
    linear-gradient(160deg, #0f172a 0%, #1e3a8a 100%);
  pointer-events: none;
}
.cp-intro-splash__skip {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #94a3b8;
  border-radius: 9999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.6);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.cp-intro-splash__skip:hover {
  color: #f1f5f9;
  border-color: rgba(148, 163, 184, 0.6);
  background: rgba(30, 41, 59, 0.8);
}
.cp-intro-splash__content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 1.5rem;
}
.cp-intro-splash__logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}
.cp-intro-splash__logo {
  width: 9.5rem;
  height: 9.5rem;
  object-fit: contain;
  border-radius: 1rem;
  filter: drop-shadow(0 12px 28px rgba(37, 99, 235, 0.35));
}
.cp-intro-splash__logo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 9.5rem;
  height: 9.5rem;
  border-radius: 1rem;
  background: var(--cp-primary);
  color: #fff;
  font-size: 3rem;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.4);
}
.cp-intro-heartbeat {
  animation: cp-heartbeat 1.4s ease-in-out 2;
}
@keyframes cp-heartbeat {
  0%,
  100% {
    transform: scale(1);
  }
  15% {
    transform: scale(1.1);
  }
  30% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.06);
  }
  60% {
    transform: scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .cp-intro-heartbeat {
    animation: none;
  }
}

/* Layout */
.cp-app { min-height: 100vh; }
.cp-sidebar {
  background: var(--cp-sidebar);
  color: #e2e8f0;
}
.cp-main { flex: 1; min-width: 0; background: var(--cp-bg); }
.cp-topbar {
  background: var(--cp-card);
  border-bottom: 1px solid var(--cp-border);
  position: sticky;
  top: 0;
  z-index: 30;
}

/* Nav */
.cp-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--cp-radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: #94a3b8;
  transition: background 0.15s, color 0.15s;
}
.cp-nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
}
.cp-nav-item.active {
  background: rgba(37, 99, 235, 0.2);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--cp-primary);
}

/* Buttons */
.cp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--cp-radius);
  transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
  min-height: 2.75rem;
  touch-action: manipulation;
}
.cp-btn:active { transform: scale(0.98); }
.cp-btn-primary {
  background: var(--cp-primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.3);
}
.cp-btn-primary:hover { background: var(--cp-primary-hover); }
.cp-btn-secondary {
  background: var(--cp-sidebar);
  color: #fff;
}
.cp-btn-secondary:hover { background: #1e293b; }
.cp-btn-success { background: var(--cp-success); color: #fff; }
.cp-btn-success:hover { background: #16a34a; }
.cp-btn-danger { background: var(--cp-error); color: #fff; }
.cp-btn-danger:hover { background: #dc2626; }
.cp-btn-outline {
  background: var(--cp-card);
  color: var(--cp-text);
  border: 1px solid var(--cp-border);
}
.cp-btn-outline:hover { background: #f1f5f9; }
.cp-btn-ghost {
  background: transparent;
  color: var(--cp-muted);
  border: 1px solid transparent;
}
.cp-btn-ghost:hover { background: #f1f5f9; color: var(--cp-text); }
.cp-btn-sm { padding: 0.5rem 0.875rem; font-size: 0.8125rem; min-height: 2.25rem; }

/* Reports quick range — beats Tailwind CDN button reset */
#reports-form .reports-range-btn.cp-btn-range-today,
#reports-form .reports-range-btn.cp-btn-range-today.cp-btn-outline {
  background-color: #166534 !important;
  color: #ffffff !important;
  border: 1px solid #14532d !important;
  box-shadow: 0 1px 2px rgba(22, 101, 52, 0.25);
}
#reports-form .reports-range-btn.cp-btn-range-today:hover,
#reports-form .reports-range-btn.cp-btn-range-today.cp-btn-outline:hover {
  background-color: #15803d !important;
  color: #ffffff !important;
  border-color: #166534 !important;
}
#reports-form .reports-range-btn.cp-btn-range-today.cp-btn-outline-primary {
  background-color: #14532d !important;
  color: #ffffff !important;
  border: 2px solid #052e16 !important;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35), 0 2px 8px rgba(22, 101, 52, 0.4);
}

#reports-form .reports-range-btn.cp-btn-range-yesterday,
#reports-form .reports-range-btn.cp-btn-range-yesterday.cp-btn-outline {
  background-color: #ea580c !important;
  color: #ffffff !important;
  border: 1px solid #c2410c !important;
  box-shadow: 0 1px 2px rgba(234, 88, 12, 0.25);
}
#reports-form .reports-range-btn.cp-btn-range-yesterday:hover,
#reports-form .reports-range-btn.cp-btn-range-yesterday.cp-btn-outline:hover {
  background-color: #f97316 !important;
  color: #ffffff !important;
  border-color: #ea580c !important;
}
#reports-form .reports-range-btn.cp-btn-range-yesterday.cp-btn-outline-primary {
  background-color: #c2410c !important;
  color: #ffffff !important;
  border: 2px solid #9a3412 !important;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35), 0 2px 8px rgba(234, 88, 12, 0.4);
}

/* Cards */
.cp-card {
  background: var(--cp-card);
  border: 1px solid var(--cp-border);
  border-radius: var(--cp-radius-lg);
  box-shadow: var(--cp-shadow);
}
.cp-stat-card {
  background: var(--cp-card);
  border: 1px solid var(--cp-border);
  border-radius: var(--cp-radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--cp-shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}
.cp-stat-card:hover {
  box-shadow: var(--cp-shadow-lg);
  transform: translateY(-1px);
}
.cp-stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cp-muted);
}
.cp-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: 0.375rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

/* Page header */
.cp-page-header { margin-bottom: 1.5rem; }

/* Customer ledger — account holder premium card */
.cp-customer-ledger-header {
  margin-bottom: 1.5rem;
}
.cp-account-holder-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.25rem 1.375rem;
  border-radius: 1.125rem;
  border: 1px solid rgba(37, 99, 235, 0.12);
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 48%, #eff6ff 100%);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 8px 28px rgba(37, 99, 235, 0.1);
  position: relative;
  overflow: hidden;
}
.cp-account-holder-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 1.125rem 0 0 1.125rem;
  background: linear-gradient(180deg, #2563eb 0%, #22c55e 100%);
}
.cp-account-holder-card__main {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding-left: 0.25rem;
}
.cp-account-holder-card__avatar {
  flex-shrink: 0;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.cp-account-holder-card__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 9999px;
}
.cp-account-holder-card__name {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #9a6700;
  line-height: 1.2;
}
.cp-account-holder-card__meta {
  margin-top: 0.35rem;
  font-size: 0.875rem;
  color: var(--cp-muted);
  line-height: 1.45;
}
.cp-account-holder-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-left: 0.25rem;
}
@media (max-width: 639px) {
  .cp-account-holder-card__avatar {
    width: 2.625rem;
    height: 2.625rem;
    border-radius: 0.75rem;
    font-size: 1rem;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.3);
  }
}
@media (min-width: 768px) {
  .cp-account-holder-card__name {
    font-size: 1.75rem;
  }
}
@media (min-width: 1024px) {
  .cp-account-holder-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 1.375rem 1.5rem;
  }
  .cp-account-holder-card__actions {
    flex-shrink: 0;
    padding-left: 0;
  }
}
.cp-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--cp-text);
}
@media (min-width: 768px) {
  .cp-page-title { font-size: 1.75rem; }
}
.cp-page-subtitle {
  font-size: 0.875rem;
  color: var(--cp-muted);
  margin-top: 0.25rem;
}

/* Forms */
.form-card input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.form-card select,
.form-card textarea,
.cp-input {
  width: 100%;
  border: 1px solid var(--cp-border);
  border-radius: var(--cp-radius);
  padding: 0.625rem 0.875rem;
  margin-top: 0.375rem;
  background: #fff;
  font-size: 0.9375rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-card input:focus,
.form-card select:focus,
.form-card textarea:focus,
.cp-input:focus {
  outline: none;
  border-color: var(--cp-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.form-card label,
.cp-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
}
.form-card p { margin-bottom: 1rem; }
.form-card ul.errorlist,
.cp-errorlist {
  list-style: none;
  margin: 0.25rem 0 0.5rem;
  padding: 0;
  color: var(--cp-error);
  font-size: 0.8125rem;
}

/* Tables */
.cp-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.cp-table {
  width: 100%;
  font-size: 0.875rem;
  border-collapse: separate;
  border-spacing: 0;
}
.cp-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}
.cp-table thead th {
  background: #f1f5f9;
  color: #475569;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--cp-border);
  white-space: nowrap;
}
.cp-table thead.cp-table-head-primary th {
  background: var(--cp-primary);
  color: #fff;
}
.cp-table tbody td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.cp-table tbody tr {
  transition: background 0.12s;
}
.cp-table tbody tr:hover {
  background: #f8fafc;
}
.cp-table .tabular { font-variant-numeric: tabular-nums; }

/* Badges */
.cp-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.cp-badge-success { background: #dcfce7; color: #15803d; }
.cp-badge-warning { background: #fef3c7; color: #b45309; }
.cp-badge-danger { background: #fee2e2; color: #b91c1c; }
.cp-badge-primary { background: #dbeafe; color: #1d4ed8; }

/* Alerts */
.cp-alert {
  border-radius: var(--cp-radius);
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  border: 1px solid var(--cp-border);
  background: var(--cp-card);
  margin-bottom: 1rem;
}
.cp-alert-success { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }

/* Empty state */
.cp-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--cp-muted);
}
.cp-empty-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  opacity: 0.4;
}

/* Search */
.cp-search {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.cp-search .cp-input { margin-top: 0; }

/* Transactions — colored filter chips */
.cp-txn-filters .cp-btn-filter {
  font-weight: 600;
  box-shadow: none;
  border-width: 1px;
  border-style: solid;
}
.cp-txn-filters .cp-btn-filter-all {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
.cp-txn-filters .cp-btn-filter-all:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}
.cp-txn-filters .cp-btn-filter-all.cp-btn-filter-active {
  background: #2563eb;
  color: #fff;
  border-color: #1d4ed8;
}
/* Debit / Credit / Today / Yesterday — visible colors (beats Tailwind reset) */
.cp-txn-filters .cp-btn-filter-debit {
  background: #ffedd5 !important;
  color: #9a3412 !important;
  border: 1px solid #fdba74 !important;
}
.cp-txn-filters .cp-btn-filter-debit:hover {
  background: #fed7aa !important;
  border-color: #fb923c !important;
  color: #7c2d12 !important;
}
.cp-txn-filters .cp-btn-filter-debit.cp-btn-filter-active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #fff !important;
  border-color: #b45309 !important;
  box-shadow: 0 2px 10px rgba(217, 119, 6, 0.4) !important;
}
.cp-txn-filters .cp-btn-filter-credit {
  background: #dcfce7 !important;
  color: #166534 !important;
  border: 1px solid #86efac !important;
}
.cp-txn-filters .cp-btn-filter-credit:hover {
  background: #bbf7d0 !important;
  border-color: #4ade80 !important;
  color: #14532d !important;
}
.cp-txn-filters .cp-btn-filter-credit.cp-btn-filter-active {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
  color: #fff !important;
  border-color: #15803d !important;
  box-shadow: 0 2px 10px rgba(22, 163, 74, 0.4) !important;
}
.cp-txn-filters .cp-btn-filter-date-all {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}
.cp-txn-filters .cp-btn-filter-date-all:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}
.cp-txn-filters .cp-btn-filter-date-all.cp-btn-filter-active {
  background: #334155;
  color: #fff;
  border-color: #1e293b;
}
.cp-txn-filters .cp-btn-filter-today {
  background: #d1fae5 !important;
  color: #065f46 !important;
  border: 1px solid #6ee7b7 !important;
}
.cp-txn-filters .cp-btn-filter-today:hover {
  background: #a7f3d0 !important;
  border-color: #34d399 !important;
  color: #064e3b !important;
}
.cp-txn-filters .cp-btn-filter-today.cp-btn-filter-active {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #fff !important;
  border-color: #047857 !important;
  box-shadow: 0 2px 10px rgba(5, 150, 105, 0.4) !important;
}
.cp-txn-filters .cp-btn-filter-yesterday {
  background: #ffedd5 !important;
  color: #c2410c !important;
  border: 1px solid #fdba74 !important;
}
.cp-txn-filters .cp-btn-filter-yesterday:hover {
  background: #fed7aa !important;
  border-color: #fb923c !important;
  color: #9a3412 !important;
}
.cp-txn-filters .cp-btn-filter-yesterday.cp-btn-filter-active {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
  color: #fff !important;
  border-color: #c2410c !important;
  box-shadow: 0 2px 10px rgba(234, 88, 12, 0.4) !important;
}
.cp-txn-filters .cp-btn-filter-clear {
  background: #f8fafc;
  color: #64748b;
  border-color: #e2e8f0;
}
.cp-txn-filters .cp-btn-filter-clear:hover {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}
.cp-txn-filters .cp-btn-filter-submit {
  background: #e0e7ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
  font-weight: 600;
  box-shadow: none;
}
.cp-txn-filters .cp-btn-filter-submit:hover {
  background: #c7d2fe;
  color: #3730a3;
  border-color: #a5b4fc;
}

/* Mobile sidebar overlay */
.cp-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 40;
}
.cp-sidebar-overlay.open { display: block; }
@media (max-width: 1023px) {
  .cp-sidebar-panel {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(18rem, 85vw);
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .cp-sidebar-panel.open { transform: translateX(0); }
  .cp-sidebar-brand {
    align-items: flex-start;
    overflow: visible;
  }
  .cp-sidebar-logo-slot {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0.2rem 0.125rem 0;
    overflow: visible;
    line-height: 0;
  }
  .cp-sidebar .cp-logo-wrap {
    gap: 0.625rem;
    margin-bottom: 1.25rem !important;
  }
  .cp-sidebar .cp-sidebar-logo-img,
  .cp-sidebar .cp-logo--lg.cp-sidebar-logo-img {
    width: auto !important;
    height: auto !important;
    max-width: 3.5rem;
    max-height: none !important;
    object-fit: contain;
    object-position: top left;
  }
  .cp-sidebar .cp-logo-fallback--lg {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.15rem;
  }
  .cp-sidebar-brand--logo-only {
    justify-content: center;
  }
  .cp-sidebar-brand--logo-only .cp-sidebar-logo-slot {
    padding-top: 0.25rem;
  }
}
@media (min-width: 1024px) {
  .cp-sidebar-brand--logo-only {
    justify-content: flex-start;
  }
  .cp-sidebar-panel {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 16.5rem;
    flex-shrink: 0;
  }
}

/* Auth (login / register) */
.cp-auth-panel {
  background: #eff6ff;
}
.cp-auth-card {
  border: 1px solid rgba(37, 99, 235, 0.1);
  box-shadow:
    0 4px 6px rgba(15, 23, 42, 0.04),
    0 12px 36px rgba(15, 23, 42, 0.1);
}
.cp-auth-panel .cp-btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border: none;
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.cp-auth-panel .cp-btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 6px 22px rgba(37, 99, 235, 0.45);
}
.cp-btn-outline-success {
  background: #fff;
  color: #15803d;
  border: 2px solid #22c55e;
  font-weight: 600;
}
.cp-btn-outline-success:hover {
  background: rgba(34, 197, 94, 0.08);
  color: #166534;
  border-color: #16a34a;
  box-shadow: 0 2px 10px rgba(34, 197, 94, 0.2);
}
.cp-btn-outline-primary {
  background: #fff;
  color: #1d4ed8;
  border: 1px solid #2563eb;
  font-weight: 600;
}
.cp-btn-outline-primary:hover {
  background: #eff6ff;
  color: #1e40af;
  border-color: #1d4ed8;
}
.cp-auth-input {
  width: 100%;
  border: 1px solid var(--cp-border);
  border-radius: var(--cp-radius);
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.cp-auth-input:focus {
  outline: none;
  border-color: var(--cp-primary);
  background: #fafcff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.cp-auth-card {
  padding: 1.75rem 2rem;
}
.cp-auth-card__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cp-text);
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.cp-auth-card__subtitle {
  font-size: 0.875rem;
  color: var(--cp-muted);
  margin-top: 0.25rem;
  margin-bottom: 1.25rem;
  line-height: 1.45;
}
.cp-auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.cp-auth-card__footer {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  text-align: center;
}
.cp-auth-card__footer-label {
  font-size: 0.8125rem;
  color: var(--cp-muted);
  margin-bottom: 0.625rem;
}
.cp-auth-card__footer--inline {
  border-top: none;
  padding-top: 0;
  margin-top: 1.25rem;
  font-size: 0.8125rem;
  color: var(--cp-muted);
}

/* Auth — mobile (phone): dark brand header + light form */
@media (max-width: 1023px) {
  .cp-auth-panel {
    justify-content: flex-start;
    padding-top: 0;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
  }
  .cp-auth-mobile-hero {
    position: relative;
    width: 100%;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 0 0 1rem 1rem;
    background: #0f172a;
    padding: max(0.875rem, env(safe-area-inset-top, 0px)) 0.75rem 1.25rem;
  }
  .cp-auth-mobile-hero__bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 20%, rgba(37, 99, 235, 0.35) 0%, transparent 50%),
      linear-gradient(160deg, #0f172a 0%, #1e3a8a 100%);
    pointer-events: none;
  }
  .cp-auth-mobile-hero__logo {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.25rem 0;
  }
  .cp-auth-logo-mobile {
    display: block;
    width: auto;
    height: auto;
    max-width: min(11.5rem, 68vw);
    max-height: 4.5rem;
    object-fit: contain;
    margin: 0 auto;
    filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.25));
  }
  .cp-auth-logo-mobile-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 5rem;
    height: 5rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, #22c55e 0%, #2563eb 100%);
    color: #fff;
    font-size: 1.75rem;
    font-weight: 800;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
  }
  .cp-auth-mobile-inner {
    flex: 0 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: 100%;
    max-width: 18.5rem;
    margin: 0 auto;
    padding: 0.75rem 1rem 0;
  }
  .cp-auth-card {
    width: 100%;
    margin: 0 auto;
    padding: 1rem 1.125rem;
    border-radius: 0.875rem;
    box-shadow:
      0 1px 3px rgba(15, 23, 42, 0.05),
      0 6px 20px rgba(15, 23, 42, 0.07);
  }
  .cp-auth-card__title {
    font-size: 1.125rem;
  }
  .cp-auth-card__subtitle {
    font-size: 0.75rem;
    margin-bottom: 0.875rem;
  }
  .cp-auth-form {
    gap: 0.75rem;
  }
  .cp-auth-card .cp-label {
    font-size: 0.75rem;
    margin-bottom: 0.125rem;
  }
  .cp-auth-input {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    min-height: 2.625rem;
    border-radius: 0.625rem;
  }
  .cp-auth-panel .cp-btn {
    min-height: 2.625rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    border-radius: 0.625rem;
  }
  .cp-auth-card__footer {
    margin-top: 0.875rem;
    padding-top: 0.875rem;
  }
  .cp-auth-card__footer-label {
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
  }
  .cp-auth-card__footer--inline {
    margin-top: 0.875rem;
    font-size: 0.75rem;
  }
}

/* Phone-only: mobile logo sizing (tablet/desktop unchanged) */
@media (max-width: 639px) {
  .cp-sidebar .cp-sidebar-logo-img,
  .cp-sidebar .cp-logo--lg.cp-sidebar-logo-img {
    max-width: 4.25840625rem;
  }
  .cp-sidebar .cp-logo-fallback--lg {
    width: 3.345890625rem;
    height: 3.345890625rem;
    font-size: 1.399190625rem;
  }
  .cp-auth-logo-mobile {
    max-width: min(13.99190625rem, 82.73475vw);
    max-height: 5.47509375rem;
  }
  .cp-auth-logo-mobile-fallback {
    width: 6.0834375rem;
    height: 6.0834375rem;
    font-size: 2.129203125rem;
  }
}

/* Pagination */
.cp-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.25rem;
  font-size: 0.875rem;
}

/* Link */
.cp-link { color: var(--cp-primary); font-weight: 600; }
.cp-link:hover { color: var(--cp-primary-hover); text-decoration: underline; }

/* Ledger highlight */
.cp-ledger-hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #fff;
  border-radius: var(--cp-radius-lg);
  padding: 1rem 1.25rem;
}
