/* ==========================================================================
   DISHA 8.2 SOVEREIGN CONSOLE DESIGN SYSTEM
   PhonePe-Inspired Light, Human-Centered, Professional Fintech Experience
   Covers: /login, /setup, /dashboard
   ========================================================================== */

:root {
  --font-display: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'DM Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, Menlo, monospace;

  /* Color Tokens */
  --primary: #382477;
  --primary-deep: #251654;
  --primary-light: #533ba8;
  --primary-soft: #ede8fa;
  --accent-emerald: #19c99e;
  --accent-emerald-soft: #d8f7ed;
  --accent-cyan: #29cee9;
  --accent-gold: #f59e0b;
  --accent-gold-soft: #fef3d6;
  --accent-danger: #ef4444;
  --accent-danger-soft: #fef2f2;

  /* Surfaces & Borders */
  --bg-canvas: #f8f7fc;
  --bg-surface: #ffffff;
  --bg-surface-subtle: #faf9fd;
  --border-subtle: #eeeaf6;
  --border-card: #ece7f5;
  --border-focus: #5b3ea8;

  /* Typography Colors */
  --text-main: #1f183d;
  --text-muted: #676179;
  --text-soft: #918b9f;

  /* Elevation */
  --shadow-sm: 0 2px 8px rgba(40, 25, 85, 0.04);
  --shadow-card: 0 8px 24px rgba(40, 25, 85, 0.05);
  --shadow-hover: 0 16px 36px rgba(40, 25, 85, 0.09);
  --shadow-drawer: -10px 0 35px rgba(25, 15, 60, 0.12);
}

/* Base Resets for Console */
body.auth-body,
body.setup-body,
body.dashboard-body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  background-color: var(--bg-canvas);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.auth-title, .setup-title, .brand-title, .metric-value, .workspace-heading {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-main);
}

.font-mono {
  font-family: var(--font-mono) !important;
}

/* ==========================================================================
   1. AUTHENTICATION (/login)
   ========================================================================== */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: 
    radial-gradient(circle at 12% 18%, rgba(120, 95, 205, 0.07) 0%, transparent 45%),
    radial-gradient(circle at 88% 82%, rgba(25, 201, 158, 0.08) 0%, transparent 45%),
    #faf9fd;
  padding: 30px 16px;
  box-sizing: border-box;
}

.auth-wrapper {
  width: 100%;
  max-width: 480px;
}

.auth-top-nav {
  margin-bottom: 20px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #5c479e;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  background: #f1edfb;
  transition: all 0.2s;
}

.back-link:hover {
  background: #e5def8;
  color: #382477;
}

.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: 24px;
  box-shadow: var(--shadow-card);
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #382477, #19c99e, #29cee9);
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: #f3effc;
  margin-bottom: 16px;
}

.auth-brand-logo img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.auth-title {
  font-size: 28px;
  margin: 0 0 8px;
  color: var(--primary);
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

/* Auth Segment Control (Sign In vs Request Access) */
.auth-mode-switch {
  display: flex;
  background: #f2edf9;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 24px;
  gap: 4px;
}

.auth-mode-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #645c7b;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-mode-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Alert Banners */
.auth-alert-danger, .auth-alert-info, .auth-alert-success {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  margin-bottom: 20px;
}

.auth-alert-danger {
  background: var(--accent-danger-soft);
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.auth-alert-info {
  background: #edf5fe;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.auth-alert-success {
  background: var(--accent-emerald-soft);
  border: 1px solid #a7f3d0;
  color: #065f46;
}

/* Form Styles */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #372e56;
  margin-bottom: 7px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  box-sizing: border-box;
  background: #ffffff;
  border: 1.5px solid #dfd8ec;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text-main);
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(91, 62, 168, 0.12);
}

.form-input::placeholder {
  color: #a49fb1;
}

.btn-toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: #79718d;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 6px;
}

.btn-toggle-password:hover {
  color: var(--primary);
  background: #f3effc;
}

.btn-auth-submit {
  width: 100%;
  background: linear-gradient(135deg, #382477, #53399b);
  border: none;
  border-radius: 12px;
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  padding: 14px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 18px rgba(56, 36, 119, 0.25);
  transition: transform 0.2s, box-shadow 0.2s;
  margin-top: 6px;
}

.btn-auth-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(56, 36, 119, 0.35);
}

.btn-auth-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.quick-creds-container {
  margin-top: 22px;
  padding: 14px 16px;
  background: #f7f4fc;
  border: 1px dashed #cfc2eb;
  border-radius: 12px;
}

.quick-creds-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #61469e;
  display: block;
  margin-bottom: 8px;
}

.quick-creds-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-cred-chip {
  background: #ffffff;
  border: 1px solid #dcd4f0;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #43307a;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-cred-chip:hover {
  background: #ede7fa;
  border-color: #8c73c8;
}

.auth-card-footer {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #f0ecf6;
  text-align: center;
}

.auth-card-footer p {
  font-size: 12px;
  color: #7b748d;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   2. FIRST-TIME ONBOARDING SETUP (/setup)
   ========================================================================== */
.setup-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #faf9fd;
  padding: 40px 16px;
}

.setup-wrapper {
  width: 100%;
  max-width: 680px;
}

.setup-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: 24px;
  box-shadow: var(--shadow-card);
  padding: 42px 40px;
}

.setup-header {
  text-align: center;
  margin-bottom: 30px;
}

.setup-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  padding: 4px 10px;
  background: #ede8fa;
  color: #513ba8;
  border-radius: 6px;
  margin-bottom: 12px;
}

.setup-title {
  font-size: 26px;
  margin: 0 0 8px;
  color: var(--primary);
}

.setup-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

.setup-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 28px 0 32px;
  gap: 12px;
}

.step-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ede8fa;
  color: #634da4;
  font-weight: 800;
  font-size: 13px;
  display: grid;
  place-items: center;
}

.step-indicator.active .step-number {
  background: var(--primary);
  color: #ffffff;
}

.step-indicator.completed .step-number {
  background: var(--accent-emerald);
  color: #ffffff;
}

.step-label {
  font-size: 13px;
  font-weight: 700;
  color: #79718d;
}

.step-indicator.active .step-label {
  color: var(--primary);
}

.step-line {
  width: 40px;
  height: 2px;
  background: #e3ddef;
}

.step-line.active {
  background: var(--primary);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.step-nav-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #f0ecf6;
}

.btn-step-next {
  background: var(--primary);
  border: none;
  border-radius: 12px;
  padding: 12px 22px;
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s, transform 0.2s;
}

.btn-step-next:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
}

.btn-step-back {
  background: #f1edfb;
  border: 1px solid #dcd3f0;
  border-radius: 12px;
  padding: 12px 18px;
  color: #483482;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

/* ==========================================================================
   3. MERCHANT DASHBOARD (/dashboard)
   ========================================================================== */
.dash-shell {
  display: flex;
  min-height: 100vh;
  background: var(--bg-canvas);
}

/* Sidebar */
.dash-sidebar {
  width: 260px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-card);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  box-sizing: border-box;
  z-index: 40;
}

.sidebar-brand {
  padding: 24px 20px 18px;
  border-bottom: 1px solid #f1ecf7;
}

.sidebar-logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-hexagon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #ede8fa;
  display: grid;
  place-items: center;
  color: var(--primary);
}

.sidebar-title-group {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 18px;
  line-height: 1.1;
  color: var(--primary);
}

.brand-sub {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #8c859d;
  margin-top: 2px;
}

.sidebar-merchant-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  margin: 12px 14px;
  background: #f7f4fc;
  border: 1px solid #ebe5f5;
  border-radius: 14px;
}

.merchant-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #ffffff;
  display: grid;
  place-items: center;
  color: var(--primary);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.merchant-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.merchant-meta strong {
  font-size: 13px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.merchant-meta span {
  font-size: 11px;
  color: #7b738e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
  overflow-y: auto;
}

.side-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  color: #554d6e;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
}

.side-nav-item:hover {
  background: #f1edfb;
  color: var(--primary);
}

.side-nav-item.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(56, 36, 119, 0.2);
}

.side-nav-item.active svg {
  stroke: #ffffff;
}

.nav-badge {
  margin-left: auto;
  background: var(--accent-emerald);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
}

.sidebar-footer {
  padding: 16px 18px;
  border-top: 1px solid #f1ecf7;
  background: #ffffff;
}

.user-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.user-email-text {
  font-size: 11px;
  font-weight: 700;
  color: #7c7490;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout {
  background: #f4f0fb;
  border: none;
  color: #5b4890;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-logout:hover {
  background: #fae4e4;
  color: #c52222;
}

/* Dashboard Main Content */
.dash-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Header */
.dash-header {
  height: 68px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-card);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-sidebar-toggle {
  display: none;
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--primary);
  border-radius: 8px;
}

.header-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.bc-root {
  color: #8c839f;
  font-weight: 600;
}

.bc-sep {
  color: #c5bcd6;
}

.bc-active {
  font-weight: 800;
  color: var(--primary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.date-select {
  background: #faf8fc;
  border: 1px solid #ded6eb;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #4b397b;
  cursor: pointer;
  outline: none;
}

.header-badge-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  color: #0b8869;
  background: var(--accent-emerald-soft);
  border: 1px solid #bcefdc;
  padding: 4px 10px;
  border-radius: 20px;
}

.header-badge-live .pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-emerald);
  animation: dotPulse 1.4s infinite;
}

/* Workspace Sections */
.workspace-section {
  display: none;
  padding: 32px;
  box-sizing: border-box;
}

.workspace-section.active {
  display: block;
}

.workspace-heading-wrap {
  margin-bottom: 24px;
}

.workspace-heading {
  font-size: 26px;
  margin: 0 0 6px;
  color: var(--primary);
}

.workspace-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* Metric Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

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

.metric-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #7b738e;
}

.metric-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 16px;
}

.metric-icon.purple { background: #ede8fa; color: #513ba8; }
.metric-icon.mint { background: #dff7ee; color: #0a8f6d; }
.metric-icon.cyan { background: #e0f6fc; color: #11819e; }
.metric-icon.gold { background: #fef4dc; color: #a16b09; }

.metric-value {
  font-size: 28px;
  line-height: 1.1;
  color: #24174d;
  margin-bottom: 6px;
}

.metric-sub {
  font-size: 11px;
  color: #8c849e;
  font-weight: 600;
}

/* Chart & Recent Tx Grids */
.overview-charts-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.dash-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  padding: 26px 28px;
  box-shadow: var(--shadow-sm);
}

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

.card-title-row h3 {
  font-size: 16px;
  margin: 0;
  color: #2a1d56;
}

/* Transaction Tables */
.card-table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

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

.dash-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.dash-table th {
  background: #faf8fc;
  padding: 13px 20px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #695e80;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.dash-table td {
  padding: 14px 20px;
  font-size: 13px;
  color: #382e56;
  border-bottom: 1px solid #f2edf8;
  vertical-align: middle;
}

.dash-table tbody tr:hover {
  background: #fbf9fe;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.status-badge.completed,
.status-badge.verified,
.status-badge.active {
  background: var(--accent-emerald-soft);
  color: #088365;
}

.status-badge.pending {
  background: var(--accent-gold-soft);
  color: #926006;
}

.status-badge.failed {
  background: var(--accent-danger-soft);
  color: #b91c1c;
}

/* Create Payment Section */
.create-payment-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
}

.qr-preview-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 20px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.qr-canvas-wrap {
  width: 200px;
  height: 200px;
  margin: 16px auto;
  border: 1px solid #ece7f5;
  border-radius: 14px;
  padding: 12px;
  background: #ffffff;
  display: grid;
  place-items: center;
}

.qr-countdown-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  color: #946206;
  background: #fef5dc;
  padding: 4px 12px;
  border-radius: 20px;
  margin-top: 10px;
}

/* Soundbox Simulator Panel */
.soundbox-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.soundbox-speaker-box {
  background: linear-gradient(135deg, #322171, #47328e);
  border-radius: 22px;
  padding: 36px 30px;
  color: #ffffff;
  text-align: center;
  box-shadow: 0 16px 36px rgba(45, 25, 95, 0.2);
}

.speaker-mesh-disc {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, #5b46a8 20%, #291a5e 80%);
  border: 3px solid #735fc3;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  font-size: 34px;
  box-shadow: 0 0 25px rgba(25, 201, 158, 0.25);
}

/* Toast Notifications */
.dash-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #2b1c67;
  color: #ffffff;
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   4. RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 1024px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .overview-charts-grid,
  .create-payment-grid,
  .soundbox-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .dash-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    height: 100vh;
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .dash-sidebar.open {
    left: 0;
  }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(18, 11, 40, 0.5);
    backdrop-filter: blur(4px);
    z-index: 35;
  }
  .sidebar-backdrop.active {
    display: block;
  }
  .btn-sidebar-toggle {
    display: block;
  }
  .dash-header {
    padding: 0 18px;
  }
  .workspace-section {
    padding: 20px 16px;
  }
  .auth-card,
  .setup-card {
    padding: 28px 20px;
  }
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  .metric-value {
    font-size: 24px;
  }
  .auth-title {
    font-size: 24px;
  }
}


/* ==========================================================================
   5. DASHBOARD COMPLETE COMPONENT OVERRIDES (Light Theme)
   ========================================================================== */
.dash-panel {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-card) !important;
  border-radius: 20px !important;
  padding: 26px 28px !important;
  box-shadow: var(--shadow-sm) !important;
  margin-bottom: 24px !important;
}

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

.panel-header h3 {
  font-size: 17px !important;
  font-weight: 800 !important;
  color: #24174d !important;
  margin: 0;
}

.panel-subtitle {
  font-size: 13px !important;
  color: var(--text-muted) !important;
  margin-top: 4px;
}

.panel-badge {
  font-size: 11px !important;
  font-weight: 800 !important;
  color: #0b8869 !important;
  background: var(--accent-emerald-soft) !important;
  border: 1px solid #bcefdc !important;
  padding: 3px 9px !important;
  border-radius: 6px !important;
}

/* Toolbar & Filters */
.payments-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff !important;
  border: 1.5px solid #ded6eb !important;
  border-radius: 12px !important;
  padding: 8px 14px !important;
  flex-grow: 1;
  max-width: 380px;
  transition: border-color 0.2s;
}

.search-box:focus-within {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(91, 62, 168, 0.12);
}

.search-box input {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  font-family: inherit;
  font-size: 13px;
  color: #24174d !important;
  width: 100%;
}

.search-box input::placeholder {
  color: #9d96ad !important;
}

.filter-pills {
  display: flex;
  gap: 6px;
}

.filter-pills .pill {
  border: none;
  background: #f1edfb !important;
  color: #554877 !important;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-pills .pill.active {
  background: var(--primary) !important;
  color: #ffffff !important;
  box-shadow: 0 3px 10px rgba(56, 36, 119, 0.2);
}

.btn-dash-export {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff !important;
  border: 1.5px solid #ded6eb !important;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary) !important;
  cursor: pointer;
  margin-left: auto;
  transition: background 0.2s;
}

.btn-dash-export:hover {
  background: #f7f4fc !important;
}

/* Inputs & Currency in Dashboard */
.currency-input-wrap {
  display: flex;
  align-items: center;
  background: #ffffff !important;
  border: 1.5px solid #ded6eb !important;
  border-radius: 12px;
  padding: 0 14px;
  height: 46px;
}

.currency-input-wrap:focus-within {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(91, 62, 168, 0.12);
}

.currency-symbol {
  font-size: 16px;
  font-weight: 800;
  color: #8c84a2 !important;
  margin-right: 8px;
}

.currency-input {
  border: none !important;
  outline: none !important;
  font-size: 16px;
  font-weight: 800;
  color: #24174d !important;
  width: 100%;
  background: transparent !important;
}

/* Slide-out Drawer */
.tx-drawer {
  background: #ffffff !important;
  border-left: 1px solid var(--border-card) !important;
  color: #24174d !important;
  box-shadow: var(--shadow-drawer) !important;
}

.drawer-header {
  background: #faf8fc !important;
  border-bottom: 1px solid #eeeaf6 !important;
  padding: 20px 24px;
}

.drawer-title {
  color: #24174d !important;
  font-size: 18px;
  font-weight: 800;
  margin: 0;
}

.drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #7b738e;
}

.drawer-body {
  padding: 24px;
  background: #ffffff !important;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f4f0fa;
  font-size: 13px;
}

.detail-label {
  color: #7d7690;
}

.detail-value {
  font-weight: 700;
  color: #281b5c;
}

/* Modals */
.modal {
  background: rgba(18, 11, 40, 0.45);
  backdrop-filter: blur(4px);
}

.modal-content {
  background: #ffffff !important;
  border: 1px solid var(--border-card) !important;
  border-radius: 20px !important;
  padding: 28px !important;
  box-shadow: 0 20px 50px rgba(45, 25, 95, 0.15) !important;
  color: #24174d !important;
}

.modal-header h3 {
  color: #24174d !important;
  font-size: 18px;
  font-weight: 800;
  margin: 0;
}

/* Hourly Volume Chart */
.chart-bar-container {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 160px;
  padding-top: 20px;
}

.chart-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
}

.chart-bar-track {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  background: #f2edf8;
  border-radius: 8px;
  overflow: hidden;
}

.chart-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, #533ba8, #382477) !important;
  border-radius: 8px;
  transition: height 0.4s ease;
}

.chart-time-label {
  font-size: 11px;
  color: #7f7794;
  font-weight: 700;
}

/* VPA Cards */
.vpa-card {
  background: #ffffff !important;
  border: 1px solid var(--border-card) !important;
  border-radius: 16px !important;
  padding: 20px !important;
  box-shadow: var(--shadow-sm) !important;
}

.vpa-card.default-vpa {
  border-color: #cfc2eb !important;
  background: #faf8fd !important;
}

.vpa-title {
  font-size: 15px;
  font-weight: 800;
  color: #281b5c;
  margin: 0 0 6px;
}

.vpa-bank-tag {
  font-size: 11px;
  font-weight: 700;
  color: #554488;
  background: #ede8fa;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
}

/* Notifications List */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid #f1ecf7;
  background: #ffffff;
}

.notif-item.unread {
  background: #faf8fd;
}

.notif-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #ede8fa;
  color: #513ba8;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.notif-content strong {
  font-size: 13px;
  color: #271a54;
  display: block;
}

.notif-content p {
  font-size: 12px;
  color: #6b637e;
  margin: 4px 0 0;
}

.notif-time {
  font-size: 10px;
  color: #9d95ad;
  margin-left: auto;
  white-space: nowrap;
}

/* ==========================================================================
   SMART VPA ROUTING STYLES
   ========================================================================== */
.routing-rails-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 16px 0;
}

.rail-card {
  background: #ffffff;
  border: 1px solid #ebe5f5;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 4px 14px rgba(45, 25, 95, 0.03);
  transition: transform 0.2s, box-shadow 0.2s;
}

.rail-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(45, 25, 95, 0.06);
}

.rail-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.rail-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #513ba8;
}

.rail-vpa {
  font-size: 14px;
  font-weight: 700;
  color: #241b47;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.rail-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  border-top: 1px solid #f1edf7;
  padding-top: 12px;
}

.stat-col {
  display: flex;
  flex-direction: column;
}

.stat-col small {
  font-size: 10px;
  color: #8c859d;
  margin-bottom: 2px;
}

.stat-col strong {
  font-size: 12px;
  color: #2b1f52;
}

.sim-output-card {
  background: #fcfbff;
  border: 1px solid #e7e0f2;
  border-left: 4px solid #19c99e;
  border-radius: 10px;
  padding: 16px;
  animation: fadeIn 0.2s ease-in;
}

.sim-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.sim-details {
  font-size: 12px;
  line-height: 1.7;
  color: #4b4461;
}

/* ==========================================================================
   7-LAYER FRAUD DEFENSE STYLES
   ========================================================================== */
.fraud-layers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  padding: 16px 0;
}

.fraud-layer-card {
  background: #ffffff;
  border: 1px solid #ebe5f5;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 4px 14px rgba(45, 25, 95, 0.03);
}

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

.layer-pill {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  background: #ede8fa;
  color: #513ba8;
  padding: 3px 8px;
  border-radius: 6px;
}

.layer-title {
  font-size: 14px;
  font-weight: 800;
  color: #241b47;
  margin: 0 0 8px;
}

.layer-desc {
  font-size: 12px;
  line-height: 1.6;
  color: #69627d;
  margin: 0 0 12px;
  min-height: 40px;
}

.layer-footer {
  border-top: 1px solid #f1edf7;
  padding-top: 10px;
}

.fraud-audit-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.interception-item {
  background: #faf8fd;
  border: 1px solid #ede8f5;
  border-radius: 10px;
  padding: 14px;
}

.interception-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  margin-bottom: 6px;
}

.interception-text strong {
  font-size: 12px;
  color: #281c54;
  display: block;
}

.interception-text p {
  font-size: 11px;
  color: #6b637e;
  margin: 2px 0 0;
  line-height: 1.5;
}

/* ==========================================================================
   DEVELOPER API CONSOLE STYLES
   ========================================================================== */
.api-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.api-keys-box {
  background: #fbf9fe;
  border: 1px solid #ede8f5;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.api-key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #ffffff;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #ebe5f5;
}

.api-key-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.api-key-label {
  font-size: 11px;
  font-weight: 700;
  color: #8c859d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.api-key-info code {
  font-size: 12px;
  color: #513ba8;
  word-break: break-all;
}

.btn-copy-sm {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: #ede8fa;
  color: #513ba8;
  border: 1px solid #ded6f0;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-copy-sm:hover {
  background: #e2daf5;
}

.api-runner-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 18px;
}

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

.api-response-side {
  background: #1b1433;
  color: #f1ecfc;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

.api-response-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid #33275c;
  font-size: 12px;
}

.response-status-badge .label, .response-time-badge .label {
  color: #a49aba;
  margin-right: 6px;
}

.api-response-viewer {
  font-size: 12px;
  line-height: 1.6;
  color: #62f4cb;
  overflow: auto;
  max-height: 380px;
  margin: 12px 0 0;
  padding-right: 8px;
  white-space: pre-wrap;
  word-break: break-all;
}
