/* PayFlow MFS — Production Merchant Dashboard Design System */
:root {
  --bg-base: #f8fafc;
  --bg-surface: #ffffff;
  --bg-elevated: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-hover: #f8fafc;
  --border: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-focus: #0284c7;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-subtle: #f0f9ff;
  --primary-border: #bae6fd;
  --primary-text: #ffffff;

  --bkash: #e2136e;
  --nagad: #f97316;
  --rocket: #8b5cf6;
  --upay: #0284c7;

  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;

  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;

  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;

  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 14px -2px rgba(15, 23, 42, 0.06), 0 1px 3px 0 rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 12px 30px -4px rgba(15, 23, 42, 0.09);
  --shadow-drawer: -4px 0 24px rgba(0, 0, 0, 0.15);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --sidebar-w: 260px;
  --sidebar-collapsed-w: 72px;
  --topbar-h: 68px;
}

[data-theme="dark"] {
  --bg-base: #090d16;
  --bg-surface: #0f172a;
  --bg-elevated: #1e293b;
  --bg-subtle: #1e293b;
  --bg-hover: #1e293b;
  --border: #223249;
  --border-subtle: #172436;
  --border-focus: #38bdf8;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-light: #64748b;

  --primary: #38bdf8;
  --primary-hover: #0284c7;
  --primary-subtle: rgba(56, 189, 248, 0.12);
  --primary-border: rgba(56, 189, 248, 0.3);
  --primary-text: #0f172a;

  --success-bg: rgba(16, 185, 129, 0.12);
  --success-border: rgba(16, 185, 129, 0.3);

  --warning-bg: rgba(245, 158, 11, 0.12);
  --warning-border: rgba(245, 158, 11, 0.3);

  --danger-bg: rgba(239, 68, 68, 0.12);
  --danger-border: rgba(239, 68, 68, 0.3);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 14px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 36px -4px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

img, svg {
  max-width: 100%;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  overflow-x: hidden;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

/* ====================================================
   Layout: Sidebar + Main Workspace
   ==================================================== */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 90;
  transition: transform 0.25s ease, width 0.25s ease;
}

.sidebar-brand-wrap {
  height: var(--topbar-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.5px;
}

.sidebar-logo-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

.sandbox-pill {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-border);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

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

.nav-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  padding: 8px 12px 4px;
  margin-top: 10px;
}
.nav-section-title:first-child {
  margin-top: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s ease;
  cursor: pointer;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--primary-subtle);
  color: var(--primary);
  font-weight: 700;
}

/* Plan-locked nav items */
.nav-item.nav-locked {
  opacity: 0.45;
  cursor: not-allowed;
  position: relative;
}
.nav-item.nav-locked:hover {
  background: var(--danger-bg);
  color: var(--danger);
  opacity: 0.7;
}

.nav-item-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-light);
  transition: color 0.15s ease;
}

.nav-item:hover .nav-item-icon,
.nav-item.active .nav-item-icon {
  color: var(--primary);
}

.nav-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: var(--primary-subtle);
  color: var(--primary);
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
}

.user-snippet {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #0284c7, #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}
.user-details {
  line-height: 1.25;
}
.user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-icon-sm {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-icon-sm:hover {
  background: var(--bg-hover);
  color: var(--danger);
  border-color: var(--danger);
}

/* ====================================================
   Main Content Area & Topbar
   ==================================================== */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.25s ease;
  width: calc(100% - var(--sidebar-w));
}

.topbar {
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  max-width: 480px;
}

.btn-mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--text-primary);
  cursor: pointer;
}

.search-container {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 14px;
  display: flex;
  align-items: center;
}

.search-icon svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.search-input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: all 0.15s ease;
}
.search-input:focus {
  background: var(--bg-surface);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--primary-subtle);
}

.search-shortcut {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-light);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-topbar-tool {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-topbar-tool svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
  transition: all 0.15s;
  position: relative;
}
.btn-topbar-tool:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--text-light);
}

.btn-icon-tool {
  width: 38px;
  padding: 0;
  justify-content: center;
}

.notification-badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--danger);
  border: 2px solid var(--bg-surface);
}

/* ====================================================
   Dashboard Views Container
   ==================================================== */
.content-body {
  flex: 1;
  padding: 28px;
  max-width: 1320px;
  margin: 0 auto;
  width: 100%;
}

.view-panel {
  display: none;
  animation: fadeIn 0.15s ease-in-out;
}
.view-panel.active {
  display: block;
}

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

/* View Header */
.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}
.view-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.6px;
  color: var(--text-primary);
}
.view-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

.date-filters-group {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}

.btn-date-filter {
  background: transparent;
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-date-filter:hover {
  color: var(--text-primary);
}
.btn-date-filter.active {
  background: var(--primary);
  color: var(--primary-text);
  box-shadow: var(--shadow-sm);
}

/* ====================================================
   StatCards (KPI Grid)
   ==================================================== */
.kpi-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.stat-card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--text-secondary);
}

.stat-card-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.stat-card-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.6px;
  line-height: 1.15;
}

.stat-card-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  margin-top: 8px;
}
.trend-up {
  color: var(--success);
}
.trend-down {
  color: var(--danger);
}
.trend-neutral {
  color: var(--text-light);
}

/* ====================================================
   Charts Layout: Split Grid
   ==================================================== */
.charts-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 1080px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

.card-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.card-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}

.card-panel-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}

.chart-filters {
  display: flex;
  gap: 4px;
}
.chart-pill-btn {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.chart-pill-btn.active {
  background: var(--primary-subtle);
  border-color: var(--primary-border);
  color: var(--primary);
}

/* SVG Line Chart Container */
.svg-chart-container {
  width: 100%;
  height: 220px;
  position: relative;
}
.svg-chart-container svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 11px;
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  display: none;
  z-index: 50;
  line-height: 1.4;
}

/* Donut & Payment Methods */
.donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 8px 0;
}

.donut-legend-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.legend-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* ====================================================
   Tables & DataGrids
   ==================================================== */
.table-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table-toolbar {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 12px;
}

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

.tbl-filter-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}
.tbl-filter-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.tbl-filter-btn.active {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text-primary);
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.data-table th {
  padding: 12px 18px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tr:hover {
  background: var(--bg-hover);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge-completed {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}
.badge-pending {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}
.badge-failed, .badge-expired {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}
.badge-online {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}
.badge-offline {
  background: var(--bg-subtle);
  color: var(--text-light);
  border: 1px solid var(--border);
}

/* Provider Pill & Badge */
.provider-badge,
.provider-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-subtle);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  width: fit-content;
  white-space: nowrap;
}

.provider-logo,
.provider-tag img {
  width: 18px;
  height: 18px;
  max-width: 18px;
  max-height: 18px;
  object-fit: contain;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  text-decoration: none;
}
.btn-primary-action {
  background: var(--primary);
  color: var(--primary-text);
  box-shadow: var(--shadow-sm);
}
.btn-primary-action:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}
.btn-secondary-action {
  background: var(--bg-surface);
  border-color: var(--border);
  color: var(--text-primary);
}
.btn-secondary-action:hover {
  background: var(--bg-hover);
  border-color: var(--text-light);
}
.btn-danger-action {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-border);
}
.btn-danger-action:hover {
  background: var(--danger);
  color: #ffffff;
}

/* Form Inputs */
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}

/* ====================================================
   Modals & Drawers
   ==================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active {
  display: flex;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}
.modal-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}
.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}

.modal-body {
  padding: 24px;
  max-height: 75vh;
  overflow-y: auto;
}

/* Modal Tabs */
.modal-tabs {
  display: flex;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
  margin-bottom: 20px;
}
.modal-tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.modal-tab-btn:hover {
  color: var(--text-primary);
}
.modal-tab-btn.active {
  background: var(--bg-surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.modal-footer {
  padding: 16px 24px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* QR Code & Pairing Box */
.qr-code-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 16px 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}
.qr-code-box img {
  width: 220px;
  height: 220px;
  max-width: 220px;
  max-height: 220px;
  border-radius: 8px;
}
.pairing-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  gap: 10px;
}
.pairing-info-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}
.pairing-info-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 600;
  word-break: break-all;
}

/* Quota & Subscription Progress Bars */
.quota-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.quota-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.quota-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}
.quota-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.quota-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}
.quota-counts {
  font-size: 12px;
  font-weight: 800;
  color: var(--primary);
}
.progress-track {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 6px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, #10b981 100%);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* Side Drawer (for Transaction details & Notifications) */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 190;
  display: none;
}
.drawer-overlay.active {
  display: block;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 440px;
  max-width: 90vw;
  height: 100vh;
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-drawer);
  z-index: 195;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}
.drawer.active {
  transform: translateX(0);
}

.drawer-header {
  height: var(--topbar-h);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* Key-Value Details List */
.details-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}
.detail-key {
  color: var(--text-muted);
  font-weight: 600;
}
.detail-val {
  color: var(--text-primary);
  font-weight: 700;
}

/* ====================================================
   Empty States, Loading Skeletons & Error
   ==================================================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-state-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.6;
}
.empty-state-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.empty-state-desc {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 380px;
  margin: 0 auto 18px;
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--border-subtle) 50%, var(--bg-subtle) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

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

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}
.skeleton-box {
  height: 60px;
}

/* ====================================================
   Toast System (Floating top-right)
   ==================================================== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 380px;
  animation: toastSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes toastSlide {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast-success {
  border-left: 4px solid var(--success);
}
.toast-error {
  border-left: 4px solid var(--danger);
}
.toast-info {
  border-left: 4px solid var(--primary);
}

/* ====================================================
   Responsive Drawer Behavior for Mobile
   ==================================================== */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-drawer);
  }
  .main-wrapper {
    margin-left: 0;
    width: 100%;
  }
  .btn-mobile-toggle {
    display: block;
  }
  .topbar {
    padding: 0 16px;
  }
  .content-body {
    padding: 16px;
  }
}

/* ====================================================
   Developer API Reference Documentation Styling
   ==================================================== */
.api-doc-wrap {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.api-doc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

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

.api-endpoint-badge-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.api-method-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.api-method-badge.post {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

.api-method-badge.get {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.api-endpoint-path {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  background: var(--bg-subtle);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.api-doc-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

/* Mac-Style Dark Code Terminal */
.code-terminal {
  background: #090d16;
  border: 1px solid #1e293b;
  border-radius: 12px;
  overflow: hidden;
  margin: 14px 0 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
}

.terminal-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.terminal-dot.red { background: #ef4444; }
.terminal-dot.yellow { background: #f59e0b; }
.terminal-dot.green { background: #10b981; }

.terminal-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
}

.btn-terminal-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-terminal-copy:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.terminal-content {
  padding: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.7;
  color: #f1f5f9;
  overflow-x: auto;
  white-space: pre;
}

.terminal-content .cmd { color: #38bdf8; font-weight: bold; }
.terminal-content .flag { color: #f472b6; }
.terminal-content .url { color: #34d399; }
.terminal-content .header-key { color: #fbbf24; }
.terminal-content .str { color: #a5b4fc; }
.terminal-content .comment { color: #64748b; font-style: italic; }

/* Parameter Breakdown Table */
.param-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin-top: 14px;
}

.param-table th {
  text-align: left;
  padding: 8px 12px;
  background: var(--bg-subtle);
  color: var(--text-light);
  font-weight: 700;
  border-bottom: 1px solid var(--border-subtle);
}

.param-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: top;
}

.param-name {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--primary);
}

.param-type {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #8b5cf6;
  background: #f5f3ff;
  padding: 2px 6px;
  border-radius: 4px;
}

.param-req {
  font-size: 10px;
  font-weight: 800;
  color: #ef4444;
  background: #fef2f2;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.param-opt {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

/* Callout Info Box */
.api-callout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  font-size: 13px;
  color: #0369a1;
  margin-bottom: 18px;
}

.api-callout-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

/* Preset Chips for Quick Verify */
.btn-preset-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-subtle, #f1f5f9);
  color: var(--text-primary, #0f172a);
  border: 1px solid var(--border, #cbd5e1);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  font-family: monospace;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-preset-chip:hover {
  background: var(--primary-subtle, #e0f2fe);
  border-color: var(--primary, #0284c7);
  color: var(--primary, #0284c7);
  transform: translateY(-1px);
}

/* Verification Result Box Animation */
#quick-verify-result-box {
  animation: fadeIn 0.25s ease-out;
}

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

/* Highlighted Raw SMS Box */
.raw-sms-box {
  background: var(--bg-subtle, #0f172a);
  border: 1px solid var(--border, #334155);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: monospace;
  font-size: 12px;
  color: var(--text-secondary, #94a3b8);
  line-height: 1.6;
  word-break: break-word;
}

