/* ==========================================================================
   XcalpAI Admin Subdomain — Responsive & Non-Clipping Layout CSS
   ========================================================================== */

:root {
  /* Color Palette — HSL Tailored Dark Theme */
  --bg-dark: #070a12;
  --bg-surface: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.85);
  --bg-card-hover: rgba(30, 41, 59, 0.9);
  
  --border-color: rgba(255, 255, 255, 0.1);
  --border-glow: rgba(56, 189, 248, 0.4);
  --border-danger: rgba(239, 68, 68, 0.4);
  
  --primary: #38bdf8;
  --primary-hover: #0284c7;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --purple: #a855f7;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --glass-backdrop: blur(12px);
  --shadow-lg: 0 15px 35px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.12);
}

/* Light Theme Overrides */
[data-theme="light"] {
  --bg-dark: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  
  --border-color: #cbd5e1;
  --border-glow: #0284c7;
  --border-danger: #ef4444;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 4px 18px rgba(2, 132, 199, 0.12);
}

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

html, body {
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-family);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Responsive Shell Layout */
.dash-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Sidebar Styling */
.dash-sidebar {
  width: 250px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.2rem 0.85rem;
  z-index: 50;
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  box-sizing: border-box;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.4rem 0.65rem;
  margin-bottom: 0.8rem;
}

.brand-text-title {
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
  overflow-y: auto;
  padding: 0 0.15rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav-item i {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.nav-item:hover {
  background: rgba(56, 189, 248, 0.08);
  color: var(--text-main);
}

.nav-item.active {
  background: rgba(56, 189, 248, 0.15);
  color: var(--primary);
  border: 1px solid var(--border-glow);
  font-weight: 700;
}

.sidebar-footer {
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-color);
}

.btn-start-session {
  width: 100%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  color: #ffffff;
  padding: 0.7rem;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
  transition: all 0.25s ease;
}

.btn-start-session.paused {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.25);
}

/* Main Content Area */
.dash-content-area {
  flex: 1;
  min-width: 0; /* Prevents overflow clipping */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--bg-dark);
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Top Telemetry Header Layout */
.top-telemetry-header {
  min-height: 65px;
  height: auto;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.2rem;
  z-index: 100;
  gap: 0.75rem;
  position: sticky;
  top: 0;
  flex-wrap: wrap;
  box-sizing: border-box;
}

.header-left-title {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-shrink: 0;
}

.header-center-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-wrap: wrap;
}


.header-right-profile {
  display: flex;
  align-items: center;
  margin-left: 0.5rem;
}

.status-pill-badge {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
  padding: 0.35rem 0.85rem;
  border-radius: 50px;
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-glow 1.5s infinite;
}

@keyframes pulse-glow {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0.7rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  cursor: pointer;
  white-space: nowrap;
}

[data-theme="light"] .user-profile-badge {
  background: #f1f5f9;
}

.avatar-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.profile-info-text {
  display: flex;
  flex-direction: column;
}

.profile-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
}

.profile-role-badge {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
}

/* Dashboard Scrollable Grid Container */
.dashboard-grid-container {
  flex: 1;
  padding: 1.2rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Tab Content Visibility */
.admin-tab-content {
  display: none;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.admin-tab-content.active {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.dash-panel-card, .admin-kpi-card, .admin-sub-card {
  min-width: 0;
  box-sizing: border-box;
}


/* Clean Cards & Panels */
.section-group-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.admin-kpi-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.admin-kpi-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.dash-panel-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.3rem;
  box-shadow: var(--shadow-lg);
  width: 100%;
}

.admin-sub-card {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  box-sizing: border-box;
}

.admin-sub-card.danger-tint {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

[data-theme="light"] .admin-sub-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .admin-sub-card.danger-tint {
  background: #fef2f2;
  border-color: #fca5a5;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.panel-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-badge.active {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-badge.danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-badge.info {
  background: rgba(56, 189, 248, 0.15);
  color: #0284c7;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

[data-theme="light"] .status-badge.info {
  color: #0284c7;
  background: #e0f2fe;
}

/* Tables System — Compact Financial Table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  line-height: 1.35;
  white-space: nowrap;
}

.admin-table th {
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1.5px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
}

[data-theme="light"] .admin-table th {
  background: #f1f5f9;
  color: #334155;
  border-bottom: 1.5px solid #cbd5e1;
}

.admin-table td {
  padding: 0.65rem 0.75rem;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

[data-theme="light"] .admin-table td {
  border-bottom: 1px solid #e2e8f0;
}

.admin-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.04);
}

[data-theme="light"] .admin-table tbody tr:hover {
  background: #f8fafc;
}

/* Compact Color-Coded Action Buttons */
.btn-action-sm {
  padding: 4px 9px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  line-height: 1.2;
  border: 1px solid transparent;
}

/* Edit / Primary Default */
.btn-action-sm.edit, .btn-action-sm.primary {
  background: rgba(56, 189, 248, 0.14);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
}

[data-theme="light"] .btn-action-sm.edit, [data-theme="light"] .btn-action-sm.primary {
  background: #e0f2fe;
  color: #0284c7;
  border-color: #7dd3fc;
}

/* Warning / Pause Action */
.btn-action-sm.warning {
  background: rgba(245, 158, 11, 0.14);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.35);
}

[data-theme="light"] .btn-action-sm.warning {
  background: #fef3c7;
  color: #d97706;
  border-color: #fde68a;
}

/* Danger / Suspend Action */
.btn-action-sm.danger {
  background: rgba(239, 68, 68, 0.14);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.35);
}

[data-theme="light"] .btn-action-sm.danger {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

/* Success / Resume / Activate Action */
.btn-action-sm.success {
  background: rgba(16, 185, 129, 0.14);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.35);
}

[data-theme="light"] .btn-action-sm.success {
  background: #d1fae5;
  color: #059669;
  border-color: #a7f3d0;
}

/* Info / Map Action */
.btn-action-sm.info {
  background: rgba(56, 189, 248, 0.14);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
}

[data-theme="light"] .btn-action-sm.info {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #7dd3fc;
}

/* Hover effects */
.btn-action-sm:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}



/* Health Metric Rows */
.health-metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.9rem;
  background: rgba(11, 15, 25, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

[data-theme="light"] .health-metric-row {
  background: #f8fafc;
}

.health-metric-status {
  font-weight: 800;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 6px;
}

.health-metric-status.ok {
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.health-metric-status.blue {
  color: #0284c7;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* Radial Probability Cards */
.probability-radial-card {
  background: rgba(11, 15, 25, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

[data-theme="light"] .probability-radial-card {
  background: #ffffff;
}

.prob-meter-group {
  display: flex;
  gap: 1rem;
  width: 100%;
  justify-content: space-around;
}

.prob-meter-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.prob-meter-bar {
  width: 12px;
  height: 80px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  display: flex;
  flex-direction: column-reverse;
  overflow: hidden;
}

[data-theme="light"] .prob-meter-bar {
  background: #e2e8f0;
}

.prob-fill-buy { background: #10b981; }
.prob-fill-sell { background: #ef4444; }
.prob-fill-hold { background: #f59e0b; }

/* Sliders */
.range-slider-input {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
}

[data-theme="light"] .range-slider-input {
  background: #cbd5e1;
}

.range-slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #0284c7;
  cursor: pointer;
}

/* Terminal Log Viewers */
.terminal-log-viewer {
  background: #070a12;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  max-height: 320px;
  overflow-y: auto;
  color: #cbd5e1;
}

.log-line {
  padding: 2px 0;
  white-space: pre-wrap;
  word-break: break-all;
}

.log-info { color: #38bdf8; }
.log-warn { color: #f59e0b; }
.log-error { color: #ef4444; }
.log-critical { color: #c084fc; font-weight: 700; }

/* Resource Progress Meter */
.resource-progress-bar {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.35rem;
}

[data-theme="light"] .resource-progress-bar {
  background: #e2e8f0;
}

.resource-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0284c7 0%, #10b981 100%);
  border-radius: 4px;
}

/* Form Inputs */
input[type="text"], input[type="number"], select {
  background: #0b0f19;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  outline: none;
  font-family: inherit;
}

[data-theme="light"] input[type="text"], [data-theme="light"] input[type="number"], [data-theme="light"] select {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

/* Buttons */
.btn-primary, .btn-danger, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  line-height: 1;
}

.btn-primary svg, .btn-danger svg, .btn-secondary svg,
.btn-primary i, .btn-danger i, .btn-secondary i {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  border: none;
  color: #ffffff;
  font-weight: 800;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border: none;
  color: #ffffff;
  font-weight: 800;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  color: #ffffff;
  font-weight: 800;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  line-height: 1;
}

.btn-success:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}


.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
}

[data-theme="light"] .btn-secondary {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

/* Header Action Bar & Mini Theme Switcher */
.header-action-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.mini-theme-switch {
  width: 40px;
  height: 22px;
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid var(--border-color);
  border-radius: 50px;
  padding: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

[data-theme="light"] .mini-theme-switch {
  background: #cbd5e1;
  border-color: #94a3b8;
  justify-content: flex-end;
}

.mini-switch-knob {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #ffffff;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

[data-theme="light"] .mini-switch-knob {
  background: #0f172a;
  color: #ffffff;
}

/* Scrollbars */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ==========================================================================
   Clean Sidebar Emergency Caution Box (Bottom of Left Panel)
   ========================================================================== */
.sidebar-caution-box {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.85rem 0.95rem;
  margin: 0.5rem 0 1rem 0;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.18);
  cursor: pointer;
  transition: all 0.2s ease;
}

[data-theme="light"] .sidebar-caution-box {
  background: #fef2f2;
  border-color: #fca5a5;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.12);
}

.sidebar-caution-box:hover {
  border-color: #ef4444;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
}

.sidebar-caution-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.sidebar-caution-title {
  font-size: 0.84rem;
  font-weight: 800;
  color: #ef4444;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

[data-theme="light"] .sidebar-caution-title {
  color: #dc2626;
}

.sidebar-caution-text {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.35;
}

[data-theme="light"] .sidebar-caution-text {
  color: #64748b;
}

.btn-sidebar-restart {
  width: 100%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.25);
  transition: all 0.2s ease;
  margin-top: 0.15rem;
}

.btn-sidebar-restart:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(16, 185, 129, 0.35);
}

/* ==========================================================================
   Clean Risk Management Table & Custom Input Controls
   ========================================================================== */

/* Remove native browser input spinners for a clean modern feel */
.clean-risk-input::-webkit-outer-spin-button,
.clean-risk-input::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}
.clean-risk-input[type="number"] {
  -moz-appearance: textfield !important;
}

/* Input text override to ensure clean look in dark and light mode */
.clean-risk-input {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  font-family: var(--font-mono, monospace) !important;
  font-weight: 700 !important;
  font-size: 0.95rem !important;
  color: var(--text-main) !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

[data-theme="light"] .clean-risk-input {
  background: transparent !important;
  border: none !important;
  color: #0f172a !important;
}

/* Custom Input Container Pill */
.risk-input-container {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  padding: 0.4rem 0.75rem;
  transition: all 0.2s ease;
}

[data-theme="light"] .risk-input-container {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.risk-input-container:focus-within {
  border-color: var(--primary, #38bdf8);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

/* Accent Focus Glows for Input Pills */
.risk-input-container.accent-cyan:focus-within {
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}
.risk-input-container.accent-emerald:focus-within {
  border-color: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}
.risk-input-container.accent-amber:focus-within {
  border-color: #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}
.risk-input-container.accent-purple:focus-within {
  border-color: #a855f7;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.25);
}
.risk-input-container.accent-rose:focus-within {
  border-color: #f43f5e;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.25);
}
.risk-input-container.accent-slate:focus-within {
  border-color: #94a3b8;
  box-shadow: 0 0 12px rgba(148, 163, 184, 0.25);
}

/* Badge Pill Styling */
.risk-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.78rem;
  font-family: var(--font-mono, monospace);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* Color Accent Badges */
.risk-badge.badge-cyan { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.risk-badge.badge-emerald { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.risk-badge.badge-amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.risk-badge.badge-purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.risk-badge.badge-rose { background: rgba(244, 63, 94, 0.15); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.3); }
.risk-badge.badge-slate { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }

[data-theme="light"] .risk-badge.badge-cyan { background: #e0f2fe; color: #0284c7; border-color: #7dd3fc; }
[data-theme="light"] .risk-badge.badge-emerald { background: #d1fae5; color: #059669; border-color: #6ee7b7; }
[data-theme="light"] .risk-badge.badge-amber { background: #fef3c7; color: #d97706; border-color: #fde68a; }
[data-theme="light"] .risk-badge.badge-purple { background: #f3e8ff; color: #7e22ce; border-color: #d8b4fe; }
[data-theme="light"] .risk-badge.badge-rose { background: #ffe4e6; color: #e11d48; border-color: #fca5a5; }
[data-theme="light"] .risk-badge.badge-slate { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }

/* Table Component Classes */
.risk-table-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.8rem;
  box-shadow: var(--shadow-lg);
}

.risk-table-wrapper {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-surface);
}

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

.risk-table th {
  padding: 1rem 1.4rem;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-color);
}

[data-theme="light"] .risk-table th {
  background: #f1f5f9;
  color: #475569;
}

.risk-table td {
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.risk-table tbody tr {
  transition: background 0.15s ease;
}

.risk-table tbody tr:last-child td {
  border-bottom: none;
}

.risk-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.03);
}

[data-theme="light"] .risk-table tbody tr:hover {
  background: #f8fafc;
}

.risk-param-title {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.94rem;
}

.risk-param-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.4;
}




