:root {
  --bg-app: #090d16;
  --bg-surface: #0f172a;
  --bg-surface-hover: #17233d;
  --bg-card: #111a2e;
  --bg-card-border: #1e293b;
  --bg-card-border-hover: #334155;
  --bg-input: #070b14;
  --bg-input-border: #22314a;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #38bdf8;

  --accent-emerald: #10b981;
  --accent-emerald-bg: rgba(16, 185, 129, 0.12);
  --accent-amber: #f59e0b;
  --accent-amber-bg: rgba(245, 158, 11, 0.12);
  --accent-rose: #f43f5e;
  --accent-rose-bg: rgba(244, 63, 94, 0.12);
  --accent-cyan: #06b6d4;
  --accent-cyan-bg: rgba(6, 182, 212, 0.12);
  --accent-indigo: #6366f1;
  --accent-indigo-bg: rgba(99, 102, 241, 0.12);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

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

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px -2px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.8);
}

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

body {
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Utilities */
.hidden {
  display: none !important;
}

/* App Container */
.app-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 20px;
  background-color: var(--bg-surface);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  color: #fff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.35);
}

.brand-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}

.brand-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(56, 189, 248, 0.16);
  color: var(--text-accent);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 2px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

.status-dot.syncing {
  background-color: var(--accent-amber);
  box-shadow: 0 0 8px var(--accent-amber);
  animation: pulse 1s infinite;
}

.status-time {
  opacity: 0.7;
}

.status-time::before {
  content: "•";
  margin-right: 6px;
  opacity: 0.5;
}

/* Nav Mode Switcher */
.nav-mode-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  padding: 4px;
  border-radius: var(--radius-md);
}

.nav-mode-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-mode-btn:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.04);
}

.nav-mode-btn.active {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #fff;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

/* Header Actions & Stat Pills */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-pill {
  display: flex;
  flex-direction: column;
  padding: 5px 12px;
  background-color: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  min-width: 90px;
}

.stat-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.stat-val {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Filter Bar */
.filter-bar {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-surface);
  border: 1px solid var(--bg-card-border);
  padding: 4px;
  border-radius: var(--radius-md);
}

.filter-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-tab:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.04);
}

.filter-tab.active {
  background-color: #0284c7;
  color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 16px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  user-select: none;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #fff;
  border-color: #38bdf8;
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4);
}

.btn-secondary {
  background-color: var(--bg-card);
  color: var(--text-secondary);
  border-color: var(--bg-card-border);
}

.btn-secondary:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--bg-card-border-hover);
}

.btn-icon {
  padding: 8px;
  background-color: var(--bg-card);
  color: var(--text-muted);
  border-color: var(--bg-card-border);
}

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

.btn-lg {
  padding: 12px 24px;
  font-size: 15px;
  border-radius: var(--radius-lg);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  background-color: var(--bg-surface);
  border: 1px dashed var(--bg-card-border-hover);
  border-radius: var(--radius-lg);
  max-width: 580px;
  margin: 40px auto;
}

.empty-icon {
  font-size: 40px;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
  line-height: 1.6;
}

/* Accounts Grid */
.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 20px;
}

/* Account Card */
.account-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.account-card:hover {
  border-color: var(--bg-card-border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.provider-badge-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.account-titles {
  display: flex;
  flex-direction: column;
}

.account-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-type-pill {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

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

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

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

.card-action-btn.delete-btn:hover {
  color: var(--accent-rose);
  background-color: var(--accent-rose-bg);
  border-color: rgba(244, 63, 94, 0.3);
}

/* Balance Hero Card View */
.balance-card-hero {
  background-color: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.balance-amount-display {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.currency-symbol {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-emerald);
}

.balance-number {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
}

.balance-tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-left: 8px;
}

.balance-sub-stat {
  font-size: 12px;
  color: var(--text-secondary);
}

/* API Key Hero Card View */
.api-key-card-hero {
  background-color: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.api-status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-emerald);
  font-weight: 700;
  font-size: 14px;
}

.api-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
}

.api-key-detail {
  font-size: 12px;
  color: var(--text-muted);
}

/* Primary Rate Meter */
.rate-meter-box {
  background-color: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rate-meter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.meter-label {
  font-weight: 600;
  color: var(--text-secondary);
}

.meter-value-group {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-mono);
}

.meter-pct {
  font-size: 15px;
  font-weight: 700;
}

.meter-fraction {
  font-size: 12px;
  color: var(--text-muted);
}

/* Progress Bar */
.progress-track {
  width: 100%;
  height: 8px;
  background-color: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dynamic State Colors */
.state-healthy {
  color: var(--accent-emerald);
}
.progress-fill.state-healthy {
  background: linear-gradient(90deg, #10b981, #059669);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.state-warning {
  color: var(--accent-amber);
}
.progress-fill.state-warning {
  background: linear-gradient(90deg, #f59e0b, #d97706);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.state-danger {
  color: var(--accent-rose);
}
.progress-fill.state-danger {
  background: linear-gradient(90deg, #f43f5e, #e11d48);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.4);
}

/* Countdown & Reset Chip */
.meter-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.reset-countdown {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}

/* Secondary & Tertiary Windows */
.sub-meters-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sub-meter-card {
  background-color: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sub-meter-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}

.sub-meter-label {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sub-meter-val {
  font-family: var(--font-mono);
  font-weight: 700;
}

/* Card Footer */
.card-footer-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.balance-ticker {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-secondary);
}

.error-banner {
  background-color: var(--accent-rose-bg);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--accent-rose);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ========================================================== */
/* TOKENUSE TIME PRESETS & CALENDAR CONTROLS                  */
/* ========================================================== */

.tu-time-bar {
  background-color: var(--bg-surface);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.tu-time-presets {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tu-time-btn {
  background: transparent;
  border: 1px solid var(--bg-card-border);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tu-time-btn:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.04);
  border-color: var(--bg-card-border-hover);
}

.tu-time-btn.active {
  background-color: #0284c7;
  color: #fff;
  border-color: #38bdf8;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.tu-date-pickers {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tu-picker-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tu-picker-group label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tu-picker-select,
.tu-date-input {
  background-color: var(--bg-input);
  border: 1px solid var(--bg-input-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 5px 8px;
  outline: none;
  cursor: pointer;
}

.tu-picker-select:focus,
.tu-date-input:focus {
  border-color: var(--text-accent);
}

/* Token Controls Bar */
.tu-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background-color: var(--bg-surface);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tu-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--bg-input);
  border: 1px solid var(--bg-input-border);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  flex: 1;
  min-width: 260px;
  color: var(--text-muted);
}

.tu-search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  width: 100%;
}

.tu-select-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tu-select-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tu-select-group label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tu-select {
  background-color: var(--bg-input);
  border: 1px solid var(--bg-input-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  padding: 7px 12px;
  outline: none;
  cursor: pointer;
}

.tu-select:focus {
  border-color: var(--text-accent);
}

.sort-dir-btn {
  font-family: var(--font-mono);
  font-weight: 700;
  min-width: 76px;
}

.token-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.metric-card:hover {
  border-color: var(--bg-card-border-hover);
  transform: translateY(-2px);
}

.metric-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.metric-icon {
  font-size: 16px;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 2px;
}

.metric-sub {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.tokenuse-section-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

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

.table-card-header .section-card-title {
  margin-bottom: 0;
}

.table-results-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background-color: var(--bg-card);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--bg-card-border);
}

.section-card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.provider-share-bar {
  display: flex;
  height: 12px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background-color: var(--bg-input);
  margin-bottom: 14px;
}

.provider-segment {
  height: 100%;
  transition: width 0.3s ease;
}

.provider-share-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

/* Model Breakdown Table with Clickable Headers */
.table-container {
  overflow-x: auto;
}

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

.model-table th {
  padding: 10px 14px;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--bg-card-border);
}

.sortable-th {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.sortable-th:hover {
  color: var(--text-accent);
  background-color: rgba(255, 255, 255, 0.02);
}

.th-sort-arrow {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  opacity: 0.6;
}

.sortable-th.active-sort .th-sort-arrow {
  opacity: 1;
  color: var(--text-accent);
}

.model-table td {
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.model-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

.model-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
}

.token-bar-cell {
  min-width: 180px;
}

.token-bar-mini {
  height: 4px;
  background-color: var(--bg-input);
  border-radius: var(--radius-full);
  margin-top: 4px;
  overflow: hidden;
}

.token-bar-mini-fill {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
  border-radius: var(--radius-full);
}

/* Modals & Overlays */
.lock-overlay,
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.lock-card,
.modal-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--bg-card-border-hover);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 460px;
  overflow: hidden;
  animation: modalEnter 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalEnter {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.lock-card {
  text-align: center;
  padding: 36px 32px;
}

.lock-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.12);
  color: var(--text-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.lock-card h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
}

.lock-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

.lock-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lock-error,
.modal-alert {
  background-color: var(--accent-rose-bg);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--accent-rose);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-top: 14px;
}

/* Modal Form Styles */
.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--bg-card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-control {
  background-color: var(--bg-input);
  border: 1px solid var(--bg-input-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.15s ease;
  width: 100%;
}

.form-control:focus {
  border-color: var(--text-accent);
  box-shadow: 0 0 0 1px var(--text-accent);
}

.field-helper {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

/* Spinner */
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .tu-time-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .tu-control-bar {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    align-items: stretch;
  }
  .nav-mode-switch {
    width: 100%;
    justify-content: center;
  }
  .header-actions {
    flex-wrap: wrap;
    justify-content: space-between;
  }
  .stat-pill {
    flex: 1;
  }
  .accounts-grid {
    grid-template-columns: 1fr;
  }
}
