/* Shared theme for the verdict dashboard (index.html + login.html).
   Layout/typography trace back to the WebPageDesign mock; surfaces re-themed
   2026-07-18 (indigo background, original card panels, action-colored edges).
   Served unauthenticated - the auth gate in Program.cs allowlists this file
   so the login page renders styled while logged out. */

/* IBM Plex Mono, self-hosted (SIL OFL). Latin subset of the four weights
   the pages use - no runtime dependency on Google Fonts. */
@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/ibm-plex-mono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/fonts/ibm-plex-mono-500.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/fonts/ibm-plex-mono-600.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/fonts/ibm-plex-mono-700.woff2') format('woff2');
}

* { box-sizing: border-box; }

body {
  margin: 0; min-height: 100vh; background: #101290; color: #e9eef6;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
body.dash { padding: 36px 48px 80px; }
@media (max-width: 700px) { body.dash { padding: 20px 16px 60px; } }
body.login { display: flex; align-items: center; justify-content: center; }

::selection { background: #2ecc7133; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2c3a57; border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

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

/* ---- header ---- */
.header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 34px; flex-wrap: wrap; gap: 12px; }
.header h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; color: #f4f7fb; margin: 0; }
.header .sub { font-size: 13px; color: #8391a6; margin-top: 4px; }
.logout {
  font: 500 12px 'IBM Plex Mono', monospace; color: #8b99b0; border: 1px solid #26334f;
  padding: 7px 12px; border-radius: 7px; background: #12161b; cursor: pointer;
}
.logout:hover { border-color: #3b5484; color: #ccd6e4; }

/* ---- instrument grid ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.card {
  background: #12161b; border: 1px solid #26334f; border-radius: 12px; padding: 20px 22px;
  border-left-width: 5px;
  cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s;
}
.card:hover { border-color: #3b5484; transform: translateY(-2px); box-shadow: 0 10px 28px #05080f8c; }
/* Redundant with the labeled action badge - the colored edge only echoes it. */
.card.a-BUY   { border-left-color: #34d39966; }
.card.a-SELL  { border-left-color: #f8717166; }
.card.a-HOLD  { border-left-color: #9aa4b055; }
.card.a-CLOSE { border-left-color: #f0b42966; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.card-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.inst-symbol { font-size: 16px; font-weight: 700; color: #f4f7fb; }
.inst-name { font-size: 12px; color: #74849c; margin-top: 2px; }
.contract-line { font: 500 10px 'IBM Plex Mono', monospace; color: #5d6b82; margin-top: 4px; letter-spacing: .04em; }

/* ---- badges & chips ---- */
.badge { font: 700 12px 'IBM Plex Mono', monospace; padding: 5px 10px; border-radius: 20px; letter-spacing: .04em; white-space: nowrap; }
.badge.big { font-size: 15px; padding: 10px 18px; border-radius: 9px; letter-spacing: .05em; }
.badge.BUY   { color: #34d399; background: #34d39926; border: 1px solid #34d39955; }
.badge.SELL  { color: #f87171; background: #f8717126; border: 1px solid #f8717155; }
.badge.HOLD  { color: #9aa4b0; background: #9aa4b026; border: 1px solid #9aa4b055; }
.badge.CLOSE { color: #f0b429; background: #f0b42926; border: 1px solid #f0b42955; }
.badge.NONE  { color: #5d6b82; background: #5d6b8226; border: 1px solid #5d6b8255; }

.mode-chip { font: 600 9px 'IBM Plex Mono', monospace; letter-spacing: .08em; padding: 3px 8px; border-radius: 5px; }
.mode-chip.sim  { color: #60a5fa; background: #60a5fa20; border: 1px solid #60a5fa44; }
.mode-chip.data { color: #5d6b82; background: #5d6b8220; border: 1px solid #5d6b8244; }

.stance-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.stance { font-size: 13px; font-weight: 600; }
.stance.LONG { color: #34d399; } .stance.SHORT { color: #f87171; } .stance.FLAT { color: #8b99b0; }
.was-chip {
  font: 600 11px 'IBM Plex Mono', monospace; color: #f0b429; background: #f0b42926;
  border: 1px solid #f0b42944; padding: 2px 8px; border-radius: 5px;
}
.card-date { font-size: 12px; color: #5d6b82; margin-left: auto; }
.reason-clamp {
  font-size: 13px; line-height: 1.5; color: #b3bfd2;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---- stat tiles ---- */
.stats { display: flex; gap: 18px; margin-top: 16px; padding-top: 14px; border-top: 1px solid #223052; }
.stat-label { font-size: 10px; color: #5d6b82; text-transform: uppercase; letter-spacing: .06em; }
.stat-value { font: 600 13px 'IBM Plex Mono', monospace; color: #ccd6e4; margin-top: 2px; }
.stat-value.up { color: #34d399; } .stat-value.down { color: #f87171; }
.stat-value.detail-size { font-size: 18px; margin-top: 3px; }
.empty-note { font-size: 13px; color: #8391a6; padding: 8px 0 4px; }

.banner { font-size: 12px; padding: 8px 12px; border-radius: 7px; margin-bottom: 18px; }
.banner.warn { color: #f0b429; background: #f0b42920; border: 1px solid #f0b42945; }

/* ---- detail view ---- */
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #8b99b0; cursor: pointer; margin-bottom: 22px; background: none; border: none; padding: 0; font-family: inherit; }
.back:hover { color: #ccd6e4; }
.detail-card { background: #12161b; border: 1px solid #26334f; border-radius: 14px; padding: 28px 30px; margin-bottom: 32px; }
.detail-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.detail-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-symbol { font-size: 24px; font-weight: 700; color: #f4f7fb; }
.kind-chip { font: 500 11px 'IBM Plex Mono', monospace; color: #74849c; background: #223052; padding: 3px 8px; border-radius: 5px; }
.detail-date { font-size: 13px; color: #8b99b0; }
.detail-grid { display: grid; grid-template-columns: 1.1fr 1.4fr; gap: 32px; }
@media (max-width: 800px) { .detail-grid { grid-template-columns: 1fr; } }
.stance-line { margin-top: 16px; font-size: 13px; color: #93a1b8; }
.changed-note { color: #f0b429; }
.warn-box { margin-top: 14px; font-size: 12px; color: #f0b429; background: #f0b42920; border: 1px solid #f0b42945; padding: 8px 12px; border-radius: 7px; }
.detail-stats { display: flex; gap: 24px; margin-top: 22px; }
.section-label { font-size: 11px; color: #5d6b82; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.reason-full { font-size: 14.5px; line-height: 1.65; color: #ccd6e4; }
.sources { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.source-chip {
  font: 500 11px 'IBM Plex Mono', monospace; color: #8b99b0; background: #1a2436;
  border: 1px solid #26334f; padding: 4px 10px; border-radius: 20px; text-decoration: none;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.source-chip:hover { color: #ccd6e4; border-color: #3b5484; }
.generated { font-size: 11px; color: #5d6b82; margin-top: 14px; }

/* ---- price chart widget ---- */
.chart-card { background: #12161b; border: 1px solid #26334f; border-radius: 12px; padding: 18px 20px 12px; margin-bottom: 32px; }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.chart-key { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font: 500 10px 'IBM Plex Mono', monospace; letter-spacing: .05em; color: #8391a6; }
.key-chip { display: inline-flex; align-items: center; gap: 5px; }
.key-swatch { width: 14px; height: 9px; border-radius: 2px; display: inline-block; border: 1px solid #ffffff22; }
.chart-container { position: relative; height: min(45vh, 520px); overflow: hidden; }
.chart-note { font-size: 12px; color: #8391a6; padding: 6px 0 8px; }
.chart-tooltip {
  position: absolute; display: none; pointer-events: none; z-index: 3;
  background: #101827ee; border: 1px solid #26334f; border-radius: 7px; padding: 7px 10px;
  font: 500 11px 'IBM Plex Mono', monospace; color: #ccd6e4; white-space: nowrap;
}
.chart-tooltip .tip-time { color: #8391a6; margin-bottom: 3px; }
.chart-tooltip .tip-price { font-size: 13px; font-weight: 600; color: #e9eef6; }
.chart-tooltip .tip-stance { margin-top: 3px; }

/* ---- history table ---- */
.history-label { font-size: 11px; color: #5d6b82; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px; }
.table-wrap { background: #12161b; border: 1px solid #26334f; border-radius: 12px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
thead { background: #101827; }
th { font: 600 11px 'IBM Plex Mono', monospace; color: #5d6b82; text-transform: uppercase; letter-spacing: .05em; text-align: left; padding: 12px 22px; border-bottom: 1px solid #26334f; }
td { padding: 13px 22px; border-bottom: 1px solid #1e2942; font-size: 13px; }
tbody tr:hover { background: #1b2640; }
tbody tr:last-child td { border-bottom: none; }
td.date { font: 500 13px 'IBM Plex Mono', monospace; color: #b3bfd2; white-space: nowrap; }
td .badge { font-size: 11px; padding: 3px 9px; }
td.reason { color: #8391a6; font-size: 12.5px; max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 20px; }
.pager button {
  font: 500 12px 'IBM Plex Mono', monospace; background: #12161b; border: 1px solid #26334f;
  color: #ccd6e4; padding: 8px 14px; border-radius: 7px; cursor: pointer;
}
.pager button:disabled { opacity: .4; cursor: default; }
.pager .page-info { font: 500 12px 'IBM Plex Mono', monospace; color: #8b99b0; }
.center-note { text-align: center; color: #8391a6; font-size: 14px; padding: 60px 0; }

/* ---- login page ---- */
.login-card {
  background: #12161b; border: 1px solid #26334f; border-radius: 14px;
  padding: 34px 36px; width: min(360px, calc(100vw - 32px));
}
.login-card h1 { font-size: 18px; font-weight: 700; color: #f4f7fb; margin: 0 0 4px; }
.login-card .sub { font-size: 13px; color: #8391a6; margin-bottom: 24px; }
.login-card input {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid #26334f;
  background: #101827; color: #e9eef6; font-size: 14px; outline: none;
}
.login-card input:focus { border-color: #3b5484; }
.login-card button {
  width: 100%; margin-top: 14px; padding: 10px 12px; border-radius: 8px; border: 1px solid #34d39955;
  background: #34d39926; color: #34d399; font: 600 13px 'IBM Plex Mono', monospace;
  letter-spacing: .04em; cursor: pointer;
}
.login-card button:hover { background: #34d39938; }
.login-card button:disabled { opacity: .5; cursor: default; }
.login-card .error { margin-top: 12px; font-size: 13px; color: #f87171; min-height: 18px; }
