/* ==========================================================================
   TradingWiser — main.css
   Complete design system, components, and layout
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Google Fonts Import
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* --------------------------------------------------------------------------
   2. CSS Custom Properties (Design Tokens — Dark Theme Default)
   -------------------------------------------------------------------------- */
:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #1c2128;
  --surface-3: #22272e;
  --border: #30363d;
  --border-muted: #21262d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --text-faint: #484f58;
  --green: #3fb950;
  --green-dark: #2da043;
  --green-bg: #0d1f0d;
  
  
  --gold: #d29922;
  --gold-bg: #2a1f06;
  --orange: #f0883e;
  --red: #f85149;
  --red-bg: #2a0e0c;
  --purple: #a371f7;
  --purple-bg: #1f1635;
  --blue: #58a6ff;
  --blue-bg: #0d1f3c;
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --transition: 150ms ease;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Nav */
  --nav-height: 60px;
}

/* --------------------------------------------------------------------------
   3. Light Theme Override
   -------------------------------------------------------------------------- */
[data-theme="light"] {
  --bg: #f6f8fa;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --surface-3: #e8eaed;
  --border: #d0d7de;
  --border-muted: #e1e4e8;
  --text: #1f2328;
  --text-muted: #57606a;
  --text-faint: #8c959f;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* --------------------------------------------------------------------------
   4. CSS Reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--blue);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--text);
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

button {
  cursor: pointer;
  font-family: inherit;
}

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

ul,
ol {
  list-style: none;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
}

/* --------------------------------------------------------------------------
   5. Typography
   -------------------------------------------------------------------------- */
h1 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
}

h2 {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text);
}

h3 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}

h4 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}

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

.text-faint {
  color: var(--text-faint);
}

.text-mono {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 13px;
}

.text-sm {
  font-size: 12px;
  line-height: 1.5;
}

.text-xs {
  font-size: 11px;
  line-height: 1.5;
}

.text-lg {
  font-size: 16px;
}

.text-xl {
  font-size: 18px;
}

.text-green { color: var(--green); }
.text-blue { color: var(--blue); }
.text-gold { color: var(--gold); }
.text-red { color: var(--red); }
.text-orange { color: var(--orange); }
.text-purple { color: var(--purple); }
.text-blue { color: var(--blue); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

/* --------------------------------------------------------------------------
   6. Layout Utilities
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container-sm {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.flex {
  display: flex;
}

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

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-end {
  justify-content: flex-end;
}

.flex-1 {
  flex: 1;
}

.flex-shrink-0 {
  flex-shrink: 0;
}

.grid {
  display: grid;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.p-0 { padding: 0; }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }

.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

.relative { position: relative; }
.absolute { position: absolute; }

.hidden { display: none !important; }
.visible { display: block !important; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   7. Navigation
   -------------------------------------------------------------------------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

.nav-brand:hover {
  text-decoration: none;
  color: var(--text);
}

.nav-logo {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--blue), var(--gold));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: white;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: var(--space-8);
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
}

.nav-link.active {
  color: var(--text);
  background: var(--surface-3);
}

.nav-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-left: auto;
  flex-shrink: 0;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-muted);
  font-size: 13px;
}

.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform var(--transition);
}

.nav-avatar:hover {
    transform: scale(1.05);
}

/* User Dropdown */
.nav-user-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 200px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-2) 0;
    display: none;
    flex-direction: column;
    z-index: 1000;
    transform-origin: top right;
    animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.nav-user-menu.show {
    display: flex;
}

.nav-user-menu .menu-header {
    padding: var(--space-3) var(--space-4);
    display: flex;
    flex-direction: column;
}

.nav-user-menu .username {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.nav-user-menu hr {
    margin: var(--space-1) 0;
    border: none;
    border-top: 1px solid var(--border-muted);
}

.menu-item {
    padding: var(--space-3) var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all var(--transition);
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.menu-item:hover {
    background: var(--surface-2);
    color: var(--text);
    text-decoration: none;
}

.menu-item svg {
    color: var(--text-faint);
}

.menu-item:hover svg {
    color: var(--blue);
}

.menu-item.text-red:hover {
    color: var(--red);
    background: var(--red-bg);
}

.menu-item.text-red:hover svg {
    color: var(--red);
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-size: 16px;
}

.theme-toggle:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border-muted);
}

/* Main content offset for fixed nav */
.page-content {
  padding-top: calc(var(--nav-height) + var(--space-6));
  padding-bottom: var(--space-12);
}

/* --------------------------------------------------------------------------
   8. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  gap: var(--space-1);
}

.btn-lg {
  padding: 12px 24px;
  font-size: 15px;
}

.btn-icon {
  padding: 8px;
  width: 34px;
  height: 34px;
}

/* Primary */
.btn-primary {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

.btn-primary:hover:not(:disabled) {
  background: #79b8ff;
  border-color: #79b8ff;
}

/* Secondary */
.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--border);
}

/* Danger */
.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  border-color: rgba(248, 81, 73, 0.3);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(248, 81, 73, 0.2);
  border-color: var(--red);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

/* Success */
.btn-success {
  background: var(--green-bg);
  color: var(--green);
  border-color: rgba(63, 185, 80, 0.3);
}

.btn-success:hover:not(:disabled) {
  background: rgba(63, 185, 80, 0.15);
  border-color: var(--green);
}

/* Loading state */
.btn.loading {
  pointer-events: none;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* --------------------------------------------------------------------------
   9. Cards
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition);
}

.card:hover {
  border-color: var(--border);
}

.card-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.card-header h3,
.card-header h4 {
  margin: 0;
}

.card-body {
  padding: var(--space-5);
}

.card-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border-muted);
  background: var(--surface-2);
}

/* --------------------------------------------------------------------------
   10. Badges
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Grade Badges */
.badge-aplus {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid rgba(63, 185, 80, 0.3);
}

.badge-a {
  background: var(--blue-bg);
  color: var(--blue);
  border: 1px solid rgba(88, 166, 255, 0.3);
}

.badge-b {
  background: var(--gold-bg);
  color: var(--gold);
  border: 1px solid rgba(210, 153, 34, 0.3);
}

.badge-bplus {
  background: var(--gold-bg);
  color: var(--gold);
  border: 1px solid rgba(210, 153, 34, 0.3);
}

.badge-c {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
  border: 1px solid rgba(107, 114, 128, 0.3);
}

.badge-watch {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
  border: 1px solid rgba(107, 114, 128, 0.3);
}

.badge-skip {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
  border: 1px solid rgba(107, 114, 128, 0.3);
}

/* Tier Badges */
.badge-tier-1 {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid rgba(63, 185, 80, 0.25);
  font-size: 11px;
  padding: 2px 7px;
}

.badge-tier-2 {
  background: var(--blue-bg);
  color: var(--blue);
  border: 1px solid rgba(88, 166, 255, 0.25);
  font-size: 11px;
  padding: 2px 7px;
}

.badge-tier-3 {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(248, 81, 73, 0.25);
  font-size: 11px;
  padding: 2px 7px;
}

/* --------------------------------------------------------------------------
   11. Chips (Signal Tags)
   -------------------------------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.chip-green {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid rgba(63, 185, 80, 0.2);
}

.chip-blue {
  background: var(--blue-bg);
  color: var(--blue);
  border: 1px solid rgba(88, 166, 255, 0.2);
}

.chip-gold {
  background: var(--gold-bg);
  color: var(--gold);
  border: 1px solid rgba(210, 153, 34, 0.2);
}

.chip-red {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(248, 81, 73, 0.2);
}

.chip-purple {
  background: var(--purple-bg);
  color: var(--purple);
  border: 1px solid rgba(163, 113, 247, 0.2);
}

.chip-orange {
  background: rgba(240, 136, 62, 0.1);
  color: var(--orange);
  border: 1px solid rgba(240, 136, 62, 0.2);
}

.chip-blue {
  background: var(--blue-bg);
  color: var(--blue);
  border: 1px solid rgba(88, 166, 255, 0.2);
}

.chip-muted {
  background: var(--surface-3);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* --------------------------------------------------------------------------
   12. Score Bar
   -------------------------------------------------------------------------- */
.score-bar-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.score-bar-label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.score-bar {
  height: 6px;
  background: var(--surface-3);
  border-radius: 3px;
  overflow: hidden;
  flex: 1;
  min-width: 40px;
}

.score-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.score-bar-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 28px;
  text-align: right;
}

/* Score color classes applied to fill */
.score-high .score-bar-fill {
  background: var(--green);
}
.score-high .score-bar-value {
  color: var(--green);
}

.score-good .score-bar-fill {
  background: var(--blue);
}
.score-good .score-bar-value {
  color: var(--blue);
}

.score-mid .score-bar-fill {
  background: var(--gold);
}
.score-mid .score-bar-value {
  color: var(--gold);
}

.score-low .score-bar-fill {
  background: var(--red);
}
.score-low .score-bar-value {
  color: var(--red);
}

/* --------------------------------------------------------------------------
   13. Table
   -------------------------------------------------------------------------- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

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

.table th {
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color var(--transition);
}

.table th:hover {
  color: var(--text);
}

.table th.sort-asc::after {
  content: ' ↑';
  color: var(--blue);
}

.table th.sort-desc::after {
  content: ' ↓';
  color: var(--blue);
}

.table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-muted);
  color: var(--text);
  vertical-align: middle;
}

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

.table tbody tr {
  transition: background var(--transition);
}

.table tbody tr:hover {
  background: var(--surface-2);
}

.table .col-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

.table .col-right {
  text-align: right;
}

.table .col-center {
  text-align: center;
}

/* Options Table (Strike Detail) */
.options-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.options-table th {
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-align: left;
}

.options-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-muted);
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  vertical-align: middle;
}

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

.options-table tbody tr:hover {
  background: var(--surface-2);
}

.options-table .best-row td {
  background: rgba(88, 166, 255, 0.05);
  border-bottom-color: rgba(88, 166, 255, 0.15);
}

/* --------------------------------------------------------------------------
   14. Form Elements
   -------------------------------------------------------------------------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.form-label.required::after {
  content: ' *';
  color: var(--red);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.12);
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--surface-3);
}

.form-input.error,
.form-select.error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(248, 81, 73, 0.12);
}

.form-error {
  font-size: 12px;
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  cursor: pointer;
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.5;
}

/* Input with icon */
.input-wrap {
  position: relative;
}

.input-wrap .input-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.input-wrap .form-input {
  padding-left: 34px;
}

/* Range slider */
.form-range {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--surface-3);
  outline: none;
  cursor: pointer;
}

.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--blue);
  cursor: pointer;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--blue);
}

.form-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--blue);
  cursor: pointer;
  border: 2px solid var(--surface);
}

/* Toggle / Checkbox */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}

.toggle {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: background var(--transition), border-color var(--transition);
  cursor: pointer;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-muted);
  top: 2px;
  left: 2px;
  transition: transform var(--transition), background var(--transition);
}

.toggle input:checked + .toggle-slider {
  background: rgba(88, 166, 255, 0.2);
  border-color: var(--blue);
}

.toggle input:checked + .toggle-slider::before {
  background: var(--blue);
  transform: translateX(16px);
}

/* Segmented control */
.seg-control {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px;
  gap: 2px;
}

.seg-btn {
  padding: 5px 12px;
  border-radius: calc(var(--radius) - 2px);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  white-space: nowrap;
}

.seg-btn.active {
  background: var(--surface-3);
  color: var(--text);
}

.seg-btn:hover:not(.active) {
  color: var(--text);
}

/* --------------------------------------------------------------------------
   15. KPI Bar
   -------------------------------------------------------------------------- */
.kpi-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--space-6);
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
}

.kpi-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: var(--space-4) var(--space-5);
  border-right: 1px solid var(--border-muted);
  min-width: 120px;
  flex-shrink: 0;
  cursor: default;
  transition: background var(--transition);
}

.kpi-tile:last-child {
  border-right: none;
}

.kpi-tile:hover {
  background: var(--surface-2);
}

.kpi-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.kpi-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
}

.kpi-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* --------------------------------------------------------------------------
   16. Signal Row (Dashboard)
   -------------------------------------------------------------------------- */
.signal-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-6);
}

.signal-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.signal-row:hover {
  border-color: rgba(88, 166, 255, 0.3);
  box-shadow: var(--shadow-sm);
}

.signal-row.expanded {
  border-color: rgba(88, 166, 255, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.signal-row-header {
  display: grid;
  grid-template-columns: 220px 120px 130px 130px 100px 100px 90px 90px 100px 36px;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}

.signal-row-header:hover {
  background: var(--surface-2);
}

.signal-ticker-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.signal-ticker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.signal-ticker a {
  color: inherit;
  text-decoration: none;
}

.signal-ticker a:hover {
  color: var(--blue);
  text-decoration: none;
}

.signal-company {
  font-size: 11px;
  color: var(--text-muted);
  truncate: true;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.signal-price-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.signal-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 600;
}

.signal-change {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 500;
}

.signal-change.positive { color: var(--green); }
.signal-change.negative { color: var(--red); }

.signal-score-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.signal-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.signal-prob {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.signal-pos {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.signal-expand-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
  font-size: 12px;
}

.signal-expand-btn:hover {
  background: var(--surface-3);
  color: var(--text);
}

.signal-row.expanded .signal-expand-btn {
  transform: rotate(180deg);
  color: var(--blue);
  border-color: rgba(88, 166, 255, 0.3);
}

/* Expanded Content */
.signal-expanded-content {
  border-top: 1px solid var(--border-muted);
  padding: var(--space-5);
  display: none;
  animation: slideDown 0.2s ease;
}

.signal-row.expanded .signal-expanded-content {
  display: block;
}

.signal-expanded-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

/* Checklist */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: 12px;
  line-height: 1.5;
}

.check-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  flex-shrink: 0;
  margin-top: 1px;
  font-weight: 700;
}

.check-icon.pass {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid rgba(63, 185, 80, 0.3);
}

.check-icon.warn {
  background: var(--gold-bg);
  color: var(--gold);
  border: 1px solid rgba(210, 153, 34, 0.3);
}

.check-icon.fail {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(248, 81, 73, 0.3);
}

.check-label.pass { color: var(--text); }
.check-label.warn { color: var(--text-muted); }
.check-label.fail { color: var(--text-faint); }

/* TradingView Chart */
.chart-container {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-muted);
  margin: var(--space-4) 0;
}

/* --------------------------------------------------------------------------
   17. Controls Bar
   -------------------------------------------------------------------------- */
.controls-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-6);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.controls-bar .ctrl-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.controls-bar .ctrl-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.controls-spacer {
  flex: 1;
}

.scan-meta {
  font-size: 11px;
  color: var(--text-faint);
  font-family: 'JetBrains Mono', monospace;
}

/* --------------------------------------------------------------------------
   18. Modal
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  animation: fadeIn 0.15s ease;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.2s ease;
}

.modal-lg {
  max-width: 800px;
}

.modal-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-shrink: 0;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: all var(--transition);
  line-height: 1;
  padding: 0;
}

.modal-close:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

.modal-body {
  padding: var(--space-6);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-muted);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   19. Toast Notifications
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  min-width: 280px;
  max-width: 400px;
  pointer-events: all;
  animation: toastIn 0.25s ease;
  font-size: 13px;
}

.toast.removing {
  animation: toastOut 0.2s ease forwards;
}

.toast-icon {
  font-size: 16px;
  flex-shrink: 0;
  line-height: 1.4;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

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

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  transition: color var(--transition);
}

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

.toast-success { border-color: rgba(63, 185, 80, 0.3); }
.toast-success .toast-icon { color: var(--green); }

.toast-error { border-color: rgba(248, 81, 73, 0.3); }
.toast-error .toast-icon { color: var(--red); }

.toast-info { border-color: rgba(88, 166, 255, 0.3); }
.toast-info .toast-icon { color: var(--blue); }

.toast-warn { border-color: rgba(210, 153, 34, 0.3); }
.toast-warn .toast-icon { color: var(--gold); }

/* --------------------------------------------------------------------------
   20. Spinner / Loading
   -------------------------------------------------------------------------- */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-sm {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

.spinner-lg {
  width: 36px;
  height: 36px;
  border-width: 3px;
}

.loading-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-12);
  color: var(--text-muted);
}

/* Skeleton Loaders */
.skeleton {
  background: var(--surface-2);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
  animation: shimmer 1.5s infinite;
}

.skeleton-row {
  height: 62px;
  margin-bottom: var(--space-2);
  border-radius: var(--radius-lg);
}

.skeleton-text {
  height: 14px;
  border-radius: var(--radius-sm);
}

.skeleton-text.w-60 { width: 60%; }
.skeleton-text.w-40 { width: 40%; }
.skeleton-text.w-30 { width: 30%; }

/* --------------------------------------------------------------------------
   21. Live Indicator
   -------------------------------------------------------------------------- */
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 2s ease infinite;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   22. Tab System
   -------------------------------------------------------------------------- */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  gap: 0;
  overflow-x: auto;
}

.tab-btn {
  padding: 10px 18px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  margin-bottom: -1px;
}

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

.tab-btn.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* --------------------------------------------------------------------------
   23. Empty & Error States
   -------------------------------------------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-12);
  color: var(--text-muted);
  text-align: center;
}

.empty-state-icon {
  font-size: 48px;
  opacity: 0.4;
  line-height: 1;
}

.empty-state h3 {
  color: var(--text-muted);
  font-size: 16px;
  margin: 0;
}

.empty-state p {
  font-size: 13px;
  color: var(--text-faint);
  max-width: 300px;
}

.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-12);
  text-align: center;
}

.error-state-icon {
  font-size: 40px;
  color: var(--red);
  opacity: 0.7;
}

.error-state h3 {
  color: var(--text);
  font-size: 16px;
}

.error-state p {
  color: var(--text-muted);
  font-size: 13px;
  max-width: 320px;
}

/* --------------------------------------------------------------------------
   24. Alert / Callout
   -------------------------------------------------------------------------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.5;
}

.alert-info {
  background: var(--blue-bg);
  border-color: rgba(88, 166, 255, 0.25);
  color: var(--blue);
}

.alert-success {
  background: var(--green-bg);
  border-color: rgba(63, 185, 80, 0.25);
  color: var(--green);
}

.alert-warn {
  background: var(--gold-bg);
  border-color: rgba(210, 153, 34, 0.25);
  color: var(--gold);
}

.alert-error {
  background: var(--red-bg);
  border-color: rgba(248, 81, 73, 0.25);
  color: var(--red);
}

/* --------------------------------------------------------------------------
   25. Ticker Hero (Ticker Page)
   -------------------------------------------------------------------------- */
.ticker-hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: var(--space-6);
}

.ticker-hero-inner {
  max-width: 1400px;
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: var(--space-8);
  flex-wrap: wrap;
}

.ticker-hero-left {
  flex: 0 0 auto;
  min-width: 240px;
}

.ticker-hero-symbol {
  font-family: 'JetBrains Mono', monospace;
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

.ticker-hero-name {
  font-size: 15px;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: var(--space-3);
}

.ticker-hero-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}

.ticker-hero-change {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 600;
  margin-left: var(--space-3);
}

.ticker-hero-right {
  display: flex;
  gap: var(--space-5);
  flex-wrap: wrap;
  align-items: flex-start;
}

.ticker-hero-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

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

.stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

/* --------------------------------------------------------------------------
   26. Config Page Layout
   -------------------------------------------------------------------------- */
.config-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0;
  min-height: calc(100vh - var(--nav-height));
}

.config-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: var(--space-5) 0;
  position: sticky;
  top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
  overflow-y: auto;
}

.config-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-5);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border-left: 2px solid transparent;
}

.config-nav-item:hover {
  color: var(--text);
  background: var(--surface-2);
}

.config-nav-item.active {
  color: var(--blue);
  background: var(--blue-bg);
  border-left-color: var(--blue);
}

.config-main {
  padding: var(--space-8);
  overflow-y: auto;
}

.config-section {
  max-width: 720px;
  display: none;
}

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

.config-section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.config-section-desc {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: var(--space-6);
}

.config-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

/* --------------------------------------------------------------------------
   27. Dividers and Spacing
   -------------------------------------------------------------------------- */
.divider {
  height: 1px;
  background: var(--border-muted);
  margin: var(--space-5) 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* --------------------------------------------------------------------------
   28. Password / API Key Field
   -------------------------------------------------------------------------- */
.password-wrap {
  position: relative;
}

.password-wrap .form-input {
  padding-right: 40px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  transition: color var(--transition);
}

.password-toggle:hover {
  color: var(--text);
}

/* --------------------------------------------------------------------------
   29. Chart Tabs
   -------------------------------------------------------------------------- */
.chart-panel-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.chart-tabs {
  display: flex;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--space-4);
}

.chart-tab {
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  margin-bottom: -1px;
}

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

.chart-tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.chart-content {
  display: none !important;
}

.chart-content.active {
  display: flex !important;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
}

/* --------------------------------------------------------------------------
   30. Misc Utilities
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.no-select { user-select: none; }

.cursor-pointer { cursor: pointer; }

.opacity-50 { opacity: 0.5; }

.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: 9999px; }

.border { border: 1px solid var(--border); }
.border-muted { border: 1px solid var(--border-muted); }

/* Positive/negative colors */
.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }
.neutral { color: var(--text-muted) !important; }

/* --------------------------------------------------------------------------
   31. Animations & Keyframes
   -------------------------------------------------------------------------- */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.4);
  }
  50% {
    opacity: 0.85;
    box-shadow: 0 0 0 5px rgba(63, 185, 80, 0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(20px);
    max-height: 0;
    padding: 0;
    margin: 0;
  }
}

/* --------------------------------------------------------------------------
   32. Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .signal-row-header {
    grid-template-columns: 180px 110px 120px 120px 90px 90px 80px 80px 90px 36px;
    gap: var(--space-2);
  }

  .signal-expanded-grid {
    grid-template-columns: 1fr 1fr;
  }

  .config-field-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --nav-height: 56px;
  }

  .container {
    padding: 0 var(--space-4);
  }

  .nav-links {
    display: none;
  }

  .kpi-bar {
    padding: 0 var(--space-4);
    overflow-x: auto;
  }

  .kpi-tile {
    min-width: 100px;
    padding: var(--space-3) var(--space-4);
  }

  .kpi-value {
    font-size: 18px;
  }

  .controls-bar {
    padding: var(--space-3) var(--space-4);
    gap: var(--space-2);
  }

  .signal-list {
    padding: var(--space-3) var(--space-4);
  }

  .signal-grid {
    grid-template-columns: 1fr;
  }

  .signal-row-header {
    grid-template-columns: 1fr auto auto auto;
    gap: var(--space-2);
    padding: var(--space-3);
  }

  .signal-score-block,
  .signal-chips,
  .signal-pos {
    display: none;
  }

  .signal-expanded-grid {
    grid-template-columns: 1fr;
  }

  .config-layout {
    grid-template-columns: 1fr;
  }

  .config-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: var(--space-3) 0;
    display: flex;
    overflow-x: auto;
  }

  .config-nav-item {
    flex-shrink: 0;
    border-left: none;
    border-bottom: 2px solid transparent;
  }

  .config-nav-item.active {
    border-left-color: transparent;
    border-bottom-color: var(--blue);
  }

  .config-main {
    padding: var(--space-4);
  }

  .ticker-hero-inner {
    flex-direction: column;
    gap: var(--space-4);
  }

  .modal {
    max-width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 90vh;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  h1 { font-size: 22px; }
  h2 { font-size: 18px; }
  h3 { font-size: 16px; }
}

/* --------------------------------------------------------------------------
   32. Dashboard Card Grid & Components
   -------------------------------------------------------------------------- */

.signal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  padding: 16px 24px;
}

.signal-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.signal-card {
  background: var(--surface-2);
}

.signal-card:hover {
  border-color: var(--blue);
  box-shadow: 0 4px 12px rgba(88, 166, 255, 0.15);
  transform: translateY(-2px);
}

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

.signal-card .ticker-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.signal-card .ticker-symbol {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.signal-card .company-name {
  font-size: 13px;
  color: var(--text-muted);
}

.signal-card .sector-chip {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  width: fit-content;
}

.signal-card .grade-badge {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.signal-card .grade-a\+ {
  background: rgba(63, 185, 80, 0.2);
  color: #3fb950;
}

.signal-card .grade-a {
  background: rgba(88, 166, 255, 0.2);
  color: #58a6ff;
}

.signal-card .grade-b\+ {
  background: rgba(210, 153, 34, 0.2);
  color: #d29922;
}

.signal-card .grade-watch {
  background: rgba(248, 81, 73, 0.2);
  color: #f85149;
}

.signal-card .grade-skip {
  background: rgba(248, 81, 73, 0.2);
  color: #f85149;
}

.signal-card .card-middle {
  display: flex;
  gap: 16px;
  align-items: center;
}

.signal-card .conviction-gauge {
  flex-shrink: 0;
}

.signal-card .card-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.signal-card .chip {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  width: fit-content;
}

.signal-card .chip-green {
  background: rgba(63, 185, 80, 0.2);
  color: #3fb950;
}

.signal-card .chip-red {
  background: rgba(248, 81, 73, 0.2);
  color: #f85149;
}

.signal-card .chip-neutral {
  background: var(--border);
  color: var(--text-muted);
}

.signal-card .chip-orange {
  background: rgba(210, 153, 34, 0.2);
  color: #d29922;
}

.signal-card .momentum-bars {
  display: flex;
  gap: 4px;
  height: 24px;
  align-items: flex-end;
}

.signal-card .mbar-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  flex: 1;
}

.signal-card .mbar {
  width: 100%;
  border-radius: 2px;
  min-height: 2px;
}

.signal-card .mbar-label {
  font-size: 9px;
  color: var(--text-muted);
}

.signal-card .card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.signal-card .price {
  font-weight: 600;
  color: var(--text);
}

.signal-card .change {
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

.signal-card .change.positive {
  color: #3fb950;
}

.signal-card .change.negative {
  color: #f85149;
}

.signal-card .support {
  color: var(--text-muted);
  font-size: 11px;
}

/* --------------------------------------------------------------------------
   33. Scrollbar Styling
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border);
}

/* --------------------------------------------------------------------------
   34. Print Styles
   -------------------------------------------------------------------------- */
@media print {
  .nav,
  .kpi-bar,
  .controls-bar,
  .toast-container,
  .modal-overlay {
    display: none !important;
  }

  .page-content {
    padding-top: 0;
  }

  body {
    background: white;
    color: black;
  }
}

/* --------------------------------------------------------------------------
   35. Login Page Specific
   -------------------------------------------------------------------------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: var(--space-6);
  position: relative;
}

.login-page::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 60% 40%, rgba(88, 166, 255, 0.04) 0%, transparent 60%),
              radial-gradient(ellipse at 20% 80%, rgba(88, 166, 255, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: var(--space-8);
  position: relative;
  z-index: 1;
  animation: slideUp 0.3s ease;
}

.login-logo {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--blue), var(--gold));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  color: white;
  margin: 0 auto var(--space-4);
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  margin-bottom: 4px;
}

.login-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: var(--space-6);
}

.login-version {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.login-version-wrap {
  text-align: center;
  margin-bottom: var(--space-6);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.login-error {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 14px;
  background: var(--red-bg);
  border: 1px solid rgba(248, 81, 73, 0.3);
  border-radius: var(--radius);
  color: var(--red);
  font-size: 13px;
  animation: slideDown 0.2s ease;
}

.login-footer {
  margin-top: var(--space-4);
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
}

/* --- V2 Dashboard & Settings Extensions --- */

.ticker-tag {
    display: inline-flex;
    align-items: center;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 6px;
    margin-bottom: 6px;
    font-family: 'JetBrains Mono', monospace;
}

.ticker-tag .remove-btn {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    margin-left: 6px;
    font-size: 1.2rem;
    line-height: 1;
    opacity: 0.5;
    transition: opacity 0.2s;
    padding: 0;
}

.ticker-tag .remove-btn:hover {
    opacity: 1;
    color: var(--red);
}

.watchlist-manager {
    background: var(--surface-2);
    padding: 1.25rem;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.settings-section h4 {
    border-left: 3px solid var(--blue);
    padding-left: 0.75rem;
    margin-bottom: 0.5rem;
}

/* Settings Dashboard Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.settings-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.threshold-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.input-with-label {
    display: flex;
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
}

.input-with-label .prefix {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-right: 8px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.input-with-label input {
    background: transparent;
    border: none;
    color: var(--text);
    width: 100%;
    outline: none;
    font-family: inherit;
}

.provider-toggle {
    display: flex;
    background: var(--surface-2);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.provider-btn {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.provider-btn.active {
    background: var(--blue);
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* --------------------------------------------------------------------------
   36. Settings Panel Modal
   -------------------------------------------------------------------------- */
.settings-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.settings-panel.hidden {
  display: none;
}

.settings-panel > div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

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

.settings-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.settings-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
}

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

.settings-content {
  overflow-y: auto;
  padding: 16px;
  flex: 1;
}

.settings-section {
  margin-bottom: 24px;
}

.settings-section h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.settings-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
  flex: 0 0 auto;
}

.settings-row label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.settings-row input[type="number"] {
  width: 60px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  font-family: monospace;
}

.settings-row input[type="number"]:focus {
  outline: none;
  border-color: var(--blue);
  background: var(--surface-3);
}

.settings-label {
  font-size: 12px;
  color: var(--text-muted);
  min-width: fit-content;
}

.mult-input {
  width: 50px;
}

.macd-input {
  width: 50px;
}

.settings-footer {
  display: flex;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}

.btn-primary {
  background: var(--green);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--green-dark);
  opacity: 0.9;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary:hover {
  background: var(--surface-3);
}

/* Settings Button in Chart Header */
.chart-settings-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  margin-right: 8px;
}

.chart-settings-btn:hover {
  background: var(--surface-2);
}

.chart-settings-btn.active {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

/* Signal Marker Tooltips */
.lightweight-charts-marker {
  font-size: 14px;
  font-weight: 600;
  border-radius: 4px;
  padding: 4px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  z-index: 100;
}

.lightweight-charts-marker:hover {
  background: var(--surface-3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Signal colors for consistency */
.signal-bullish {
  color: #3fb950;
}

.signal-bearish {
  color: #f85149;
}

.signal-pattern {
  color: #fbbf24;
}

/* Settings section for signals */
.settings-section:last-child {
  border-bottom: none;
}

#signal-confidence {
  width: 60px;
}

/* ==========================================================================
   Options Unusual Volume Panel — Redesign
   ========================================================================== */

/* Controls Bar */
.unusual-controls-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  flex-wrap: wrap;
  flex-shrink: 0;
}

.unusual-toggle-group {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.unusual-toggle-btn {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  background: transparent;
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.unusual-toggle-btn + .unusual-toggle-btn {
  border-left: 1px solid var(--border);
}

.unusual-toggle-btn.active {
  background: var(--blue);
  color: #fff;
}

.unusual-toggle-btn:hover:not(.active) {
  background: var(--surface-3);
  color: var(--text);
}

.unusual-snapshot-info {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-faint);
  font-family: 'JetBrains Mono', monospace;
}

/* DTE Bucket Summary Table */
.unusual-bucket-summary {
  width: 100%;
  overflow-x: auto;
  padding: 0;
}

.unusual-bucket-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.unusual-bucket-table thead th {
  padding: 10px 12px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color var(--transition);
}

.unusual-bucket-table thead th:hover {
  color: var(--text);
}

.unusual-bucket-table thead th[data-sortable],
.strike-ladder-table thead th[data-sortable],
.expiry-panel-table thead th[data-sortable] {
  cursor: pointer;
  user-select: none;
  position: relative;
}

.unusual-bucket-table thead th[data-sortable]:hover,
.strike-ladder-table thead th[data-sortable]:hover,
.expiry-panel-table thead th[data-sortable]:hover {
  color: var(--blue);
}

.unusual-bucket-table thead th.sort-asc::after,
.strike-ladder-table thead th.sort-asc::after,
.expiry-panel-table thead th.sort-asc::after {
  content: " ▲";
  font-size: 8px;
  color: var(--blue);
  margin-left: 4px;
}

.unusual-bucket-table thead th.sort-desc::after,
.strike-ladder-table thead th.sort-desc::after,
.expiry-panel-table thead th.sort-desc::after {
  content: " ▼";
  font-size: 8px;
  color: var(--blue);
  margin-left: 4px;
}

.unusual-bucket-table thead th.text-right,
.unusual-bucket-table tbody td.text-right {
  text-align: right;
}

.unusual-bucket-table thead th.text-center,
.unusual-bucket-table tbody td.text-center {
  text-align: center;
}

.unusual-bucket-table tbody tr {
  border-bottom: 1px solid var(--border-muted);
  cursor: pointer;
  transition: background var(--transition);
}

.unusual-bucket-table tbody tr:hover {
  background: var(--surface-2);
}

.unusual-bucket-table tbody tr.selected {
  background: var(--surface-3);
  border-left: 3px solid var(--blue);
}

.unusual-bucket-table tbody td {
  padding: 10px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  white-space: nowrap;
}

/* Score Badge */
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.score-badge.score-high {
  background: rgba(63, 185, 80, 0.15);
  color: var(--green);
  border: 1px solid rgba(63, 185, 80, 0.3);
}

.score-badge.score-mid {
  background: rgba(210, 153, 34, 0.15);
  color: var(--gold);
  border: 1px solid rgba(210, 153, 34, 0.3);
}

.score-badge.score-low {
  background: rgba(139, 148, 158, 0.1);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Bucket Label */
.dte-bucket-label {
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--text);
}

/* Call/Put mini bar */
.cp-bar-wrap {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--border-muted);
  min-width: 60px;
}

.cp-bar-call {
  background: var(--green);
  transition: width 0.3s ease;
}

.cp-bar-put {
  background: var(--red);
  transition: width 0.3s ease;
}

/* RVOL indicator */
.rvol-indicator {
  font-weight: 700;
}

.rvol-hot {
  color: var(--red);
}

.rvol-warm {
  color: var(--gold);
}

.rvol-normal {
  color: var(--text-muted);
}

/* Top Strikes inline chips */
.top-strike-chip {
  display: inline-block;
  padding: 1px 6px;
  margin: 1px 2px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  background: var(--surface-3);
  color: var(--text-muted);
  border: 1px solid var(--border-muted);
}

/* Strike Ladder Detail Panel */
.unusual-detail-panel {
  border-top: 2px solid var(--blue);
  background: var(--surface);
  animation: slideDown 0.25s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    max-height: 2000px;
    transform: translateY(0);
  }
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-muted);
  background: var(--surface-2);
}

.detail-header h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.detail-close-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: all var(--transition);
}

.detail-close-btn:hover {
  background: var(--surface-3);
  color: var(--text);
}

/* Bucket Metrics Bar */
.bucket-metrics-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-muted);
  background: var(--surface-2);
}

.bucket-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bucket-metric .metric-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}

.bucket-metric .metric-value {
  font-size: 14px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
}

/* Strike Ladder Table */
.strike-ladder-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.strike-ladder-table thead th {
  padding: 8px 10px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.strike-ladder-table tbody tr {
  border-bottom: 1px solid var(--border-muted);
  transition: background var(--transition);
}

.strike-ladder-table tbody tr:hover {
  background: var(--surface-3);
}

.strike-ladder-table tbody td {
  padding: 8px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  white-space: nowrap;
}

/* Call-heavy / Put-heavy row tinting */
.strike-ladder-table tbody tr.call-heavy {
  background: rgba(63, 185, 80, 0.04);
}

.strike-ladder-table tbody tr.put-heavy {
  background: rgba(248, 81, 73, 0.04);
}

.strike-ladder-table tbody tr.call-heavy:hover {
  background: rgba(63, 185, 80, 0.08);
}

.strike-ladder-table tbody tr.put-heavy:hover {
  background: rgba(248, 81, 73, 0.08);
}

/* Click-to-expand strike row */
.strike-ladder-table tbody tr.strike-row {
  cursor: pointer;
}

.strike-ladder-table tbody tr.strike-row.expanded {
  background: var(--surface-3);
}

.strike-ladder-table tbody tr.strike-detail-row {
  background: var(--surface-1);
}

.strike-ladder-table tbody tr.strike-detail-row:hover {
  background: var(--surface-1);
}

.strike-detail-cell {
  padding: 12px !important;
  border-top: 1px solid var(--border-muted);
}

.strike-detail-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: var(--text-muted);
}

.strike-detail-wrap {
  overflow-x: auto;
}

.strike-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}

.strike-detail-table thead th {
  text-align: right;
  padding: 6px 8px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-muted);
  white-space: nowrap;
}

.strike-detail-table thead th:first-child,
.strike-detail-table tbody td:first-child {
  text-align: left;
}

.strike-detail-table tbody td {
  padding: 6px 8px;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-muted);
}

.cp-badge {
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 18px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 10px;
}

.cp-badge.call {
  background: rgba(63, 185, 80, 0.15);
  color: var(--green);
}

.cp-badge.put {
  background: rgba(248, 81, 73, 0.15);
  color: var(--red);
}

.action-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.action-badge.action-open {
  background: rgba(63, 185, 80, 0.15);
  color: var(--green);
}

.action-badge.action-close {
  background: rgba(248, 81, 73, 0.15);
  color: var(--red);
}

.action-badge.action-churn {
  background: rgba(255, 193, 7, 0.15);
  color: var(--gold);
}

.action-badge.action-na {
  color: var(--text-muted);
}

/* Moneyness chip */
.moneyness-chip {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.moneyness-itm {
  background: rgba(63, 185, 80, 0.1);
  color: var(--green);
}

.moneyness-atm {
  background: rgba(88, 166, 255, 0.1);
  color: var(--blue);
}

.moneyness-otm {
  background: rgba(210, 153, 34, 0.1);
  color: var(--gold);
}

.moneyness-far-otm {
  background: rgba(248, 81, 73, 0.1);
  color: var(--red);
}

/* Expiry Panel */
.expiry-panel-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.expiry-panel-table thead th {
  padding: 8px 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.expiry-panel-table tbody tr {
  border-bottom: 1px solid var(--border-muted);
}

.expiry-panel-table tbody td {
  padding: 8px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

/* Detail section dividers */
.detail-section-title {
  padding: 10px 16px 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border-muted);
}

/* Empty / Loading states for unusual panel */
.unusual-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 8px;
}

.unusual-empty-state .empty-icon {
  font-size: 32px;
  opacity: 0.5;
}

.unusual-empty-state p {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 400px;
}

/* Quality flags */
.quality-flag-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(210, 153, 34, 0.06);
  border-top: 1px solid rgba(210, 153, 34, 0.2);
  font-size: 11px;
  color: var(--gold);
}
