/* Stripe Design System Tokens & Base Styles */
:root {
  --bg-canvas: #f8fafc;
  --bg-surface: #ffffff;
  --bg-elevated: #ffffff;
  --bg-hover: #f1f5f9;
  --bg-sidebar: #f8fafc;
  
  --stripe-indigo: #635bff;
  --stripe-indigo-hover: #5851ea;
  --stripe-indigo-subtle: #f0efff;
  --stripe-indigo-border: #d4d1ff;
  
  --text-primary: #0f172a;
  --text-muted: #475569;
  --text-subtle: #94a3b8;
  --text-inverse: #ffffff;

  --border-default: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-strong: #cbd5e1;

  --warning-bg: #fffbeb;
  --warning-border: #fef08a;
  --warning-text: #92400e;
  --warning-accent: #d97706;

  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #991b1b;
  --danger-accent: #dc2626;

  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;
  --success-text: #166534;
  --success-accent: #16a34a;

  --info-bg: #eff6ff;
  --info-border: #bfdbfe;
  --info-text: #1e40af;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --ring-focus: 0 0 0 3px rgba(99, 91, 255, 0.25);
  --sidebar-w: 240px;
  --topbar-h: 48px;
}

.dark {
  --bg-canvas: #0a0d14;
  --bg-surface: #111726;
  --bg-elevated: #182032;
  --bg-hover: #1e283d;
  --bg-sidebar: #0d121c;

  --stripe-indigo: #7a73ff;
  --stripe-indigo-hover: #8f88ff;
  --stripe-indigo-subtle: rgba(99, 91, 255, 0.15);
  --stripe-indigo-border: #3b358a;

  --text-primary: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  --border-default: #1e293b;
  --border-subtle: #161f30;
  --border-strong: #334155;

  --warning-bg: rgba(217, 119, 6, 0.15);
  --warning-border: rgba(217, 119, 6, 0.35);
  --warning-text: #fde047;
  --warning-accent: #f59e0b;

  --danger-bg: rgba(220, 38, 38, 0.15);
  --danger-border: rgba(220, 38, 38, 0.35);
  --danger-text: #fca5a5;
  --danger-accent: #ef4444;

  --success-bg: rgba(22, 163, 74, 0.15);
  --success-border: rgba(22, 163, 74, 0.35);
  --success-text: #86efac;
  --success-accent: #22c55e;

  --info-bg: rgba(37, 99, 235, 0.15);
  --info-border: rgba(37, 99, 235, 0.35);
  --info-text: #93c5fd;

  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.55);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.65);
}

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

html, body, #root {
  height: 100%;
  width: 100%;
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono), var(--font-sans);
}

/* App Shell Layout */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 20;
  transition: transform 0.2s ease;
}

.sidebar-header {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-bottom: 1px solid var(--border-default);
  gap: 10px;
}

.account-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.account-selector:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.account-badge {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: var(--stripe-indigo);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.account-name {
  font-weight: 600;
  font-size: 12.5px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

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

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  padding: 6px 8px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 9px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
  position: relative;
}

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

.nav-item.active {
  background: var(--stripe-indigo-subtle);
  color: var(--stripe-indigo);
  font-weight: 600;
}

.nav-badge-alert {
  margin-left: auto;
  background: #dc2626;
  color: white;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.nav-badge-warn {
  margin-left: auto;
  background: #f59e0b;
  color: white;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-sidebar);
}

.test-mode-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border-strong);
  transition: 0.2s;
  border-radius: 18px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--stripe-indigo);
}

input:checked + .slider:before {
  transform: translateX(14px);
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-canvas);
  height: 100vh;
  overflow: hidden;
}

/* Topbar */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
  z-index: 10;
  gap: 12px;
}

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

.mobile-menu-btn {
  display: none;
  padding: 6px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  width: 100%;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.search-bar:hover {
  border-color: var(--border-strong);
}

.kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 4px;
  padding: 1px 4px;
  margin-left: auto;
  color: var(--text-subtle);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease;
  position: relative;
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background: #dc2626;
  border-radius: 50%;
  border: 1.5px solid var(--bg-surface);
}

.user-avatar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

.user-avatar-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-default);
}

.avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #635bff;
  color: white;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Scrollable Main Area */
.content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 60px;
}

.content-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Stripe Critical Alert / Frozen Balance Banner */
.stripe-freeze-banner {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-left: 4px solid var(--danger-accent);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.freeze-banner-icon {
  color: var(--danger-accent);
  margin-top: 1px;
  flex-shrink: 0;
}

.freeze-banner-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.freeze-banner-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--danger-text);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.freeze-status-tag {
  font-size: 11px;
  font-weight: 700;
  background: var(--danger-accent);
  color: #ffffff;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.freeze-banner-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.freeze-banner-desc strong {
  color: var(--text-primary);
  font-weight: 600;
}

.freeze-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.btn-danger-primary {
  background: var(--danger-accent);
  color: #ffffff;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.15s ease, filter 0.15s ease;
  box-shadow: var(--shadow-xs);
}

.btn-danger-primary:hover {
  filter: brightness(0.92);
}

.btn-danger-secondary {
  background: var(--bg-surface);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease;
}

.btn-danger-secondary:hover {
  background: var(--bg-hover);
}

/* Page Header */
.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title-group h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.page-title-group p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.header-action-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Top Balance Cards Grid */
.balance-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 14px;
}

@media (max-width: 1100px) {
  .balance-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .balance-grid {
    grid-template-columns: 1fr;
  }
}

.balance-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
}

.balance-card.frozen-hero {
  border: 1.5px solid rgba(220, 38, 38, 0.4);
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--danger-bg) 100%);
}

.balance-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.balance-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.balance-tag-frozen {
  background: #fee2e2;
  color: #dc2626;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid #fca5a5;
}

.balance-amount {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.2;
}

.balance-amount.frozen-text {
  color: var(--danger-accent);
}

.balance-subtext {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.badge-risk {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #b45309;
  background: #fef3c7;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Tabs */
.tab-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--border-default);
  margin-top: 6px;
  overflow-x: auto;
}

.tab-btn {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: color 0.12s ease, border-color 0.12s ease;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--stripe-indigo);
  border-bottom-color: var(--stripe-indigo);
  font-weight: 600;
}

.tab-count {
  background: var(--bg-hover);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

/* Section Cards */
.content-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.card-header-bar {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Table */
.table-container {
  overflow-x: auto;
  width: 100%;
}

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

.stripe-table th {
  background: var(--bg-canvas);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
}

.stripe-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-default);
  color: var(--text-primary);
  vertical-align: middle;
}

.stripe-table tr:hover td {
  background: var(--bg-hover);
  cursor: pointer;
}

.table-amount {
  font-weight: 600;
  text-align: right;
}

.table-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 500;
}

.status-held {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.status-succeeded {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.status-disputed {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.status-refunded {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.card-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.card-brand-icon {
  width: 22px;
  height: 14px;
  border-radius: 2px;
  background: var(--border-default);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Reserve Breakdown Details List */
.reserve-breakdown-list {
  display: flex;
  flex-direction: column;
}

.reserve-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-default);
}

.reserve-item:last-child {
  border-bottom: none;
}

.reserve-item-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}

.reserve-item-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.reserve-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border-default);
  border-radius: 4px;
  overflow: hidden;
  margin: 12px 0 6px;
  display: flex;
}

.progress-fill-frozen {
  background: #dc2626;
  height: 100%;
}

.progress-fill-dispute {
  background: #f59e0b;
  height: 100%;
}

.progress-fill-available {
  background: #10b981;
  height: 100%;
}

/* Buttons */
.btn-primary {
  background: var(--stripe-indigo);
  color: white;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease;
}

.btn-primary:hover {
  background: var(--stripe-indigo-hover);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.btn-ghost {
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Modal and Drawer Overlays */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-enter 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-enter {
  from { opacity: 0; transform: scale(0.97) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-default);
  background: var(--bg-canvas);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* Slide-over Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 60;
  display: flex;
  justify-content: flex-end;
}

.drawer-panel {
  width: 100%;
  max-width: 520px;
  height: 100%;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border-default);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  animation: drawer-slide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes drawer-slide {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-section-title {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-subtle);
}

.detail-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px;
  font-size: 13px;
}

.detail-key {
  color: var(--text-muted);
}

.detail-val {
  color: var(--text-primary);
  font-weight: 500;
  word-break: break-all;
}

/* Command Palette */
.command-palette-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}

.command-palette {
  width: 100%;
  max-width: 560px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.command-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-default);
}

.command-search-input {
  border: none;
  background: transparent;
  width: 100%;
  font-size: 14px;
  color: var(--text-primary);
}

.command-search-input:focus {
  outline: none;
}

.command-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
}

.command-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  color: var(--text-primary);
  transition: background 0.1s ease;
}

.command-item:hover, .command-item.selected {
  background: var(--stripe-indigo-subtle);
  color: var(--stripe-indigo);
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 300px;
  max-width: 420px;
  animation: toast-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive adjustments */
@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
  }

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

  .mobile-menu-btn {
    display: inline-flex;
  }
}
