/* Project Moneyball — Performance Radar UI (dark mode, renewal-workshop look & feel).
   Tokens from BRAND-BOOK.md; gold (#FFBE17) = accent / running glow; green = met/exceeded. */
:root {
  --ink: #1e1e1e;
  --bg: #161616;            /* page */
  --panel: #232323;         /* cards */
  --panel-2: #2c2c2c;       /* inputs, raised */
  --header-bg: #111111;
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.22);
  --text: #e2e2e2;
  --muted: #9b9b9b;
  --heading: #ece9e1;       /* soft warm white — avoids the harsh pure-white "glow" */
  --gold: #ffbe17;
  --cream: #fff2d1;
  --green: #34c46a;
  --green-deep: #2a9d57;
  --red: #e0584f;
  --font-display: 'Bebas Neue', system-ui, sans-serif;
  --font-body: 'Open Sans', system-ui, sans-serif;
  --container: 1240px;
  --gutter: 32px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Shared width container — header, toolbar, and content all align to the same edges. */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); width: 100%; }
.band { width: 100%; }

/* Header band */
.band-header { background: var(--header-bg); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 18px; }
.logo { height: 40px; width: auto; }
.app-title { font-family: var(--font-display); font-size: 1.9rem; letter-spacing: 1px; color: var(--heading); }
.header-nav { display: flex; gap: 12px; }

/* Toolbar band */
.band-toolbar { background: #1c1c1c; border-bottom: 1px solid var(--border); }
.toolbar-inner { display: flex; gap: 12px; height: 64px; align-items: center; }

/* Buttons — renewal-lab style: dark fill (same grey as the notification/cards), gold text. */
.btn { font-family: var(--font-body); font-weight: 700; font-size: 0.84rem; border: 1px solid #3a3a3a; border-radius: 6px; padding: 8px 18px; cursor: pointer; background: var(--panel); color: var(--gold); text-decoration: none; display: inline-flex; align-items: center; transition: background .15s, border-color .15s, color .15s; }
.btn:hover:not(:disabled) { background: var(--panel-2); border-color: var(--gold); }
.btn:disabled { color: rgba(255, 190, 23, 0.34); border-color: #2c2c2c; cursor: not-allowed; }

.app-main { padding: 28px var(--gutter) 72px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 30px 0; }
/* All section/column labels are identical in size + style (matches the perf-table headers). */
.section-h, .col-h, .pt-h { font-family: var(--font-display); font-size: 1.05rem; font-weight: 400; letter-spacing: .5px; color: var(--heading); }
.section-h, .col-h { margin: 0 0 14px; }

/* Cards */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; }

/* Row 1: Notification + Runtime Monitor */
.row-top { display: grid; grid-template-columns: 42% 1fr; gap: 28px; align-items: start; }
.notif-box { padding: 16px 18px; height: 214px; overflow-y: auto; font-size: .86rem; }
.notif-box.drop-active { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset; }
.notif-welcome { color: var(--muted); margin: 0 0 10px; }
.note { padding: 7px 12px; border-radius: 7px; border-left: 4px solid var(--border-strong); background: var(--panel-2); margin-bottom: 8px; font-size: .84rem; }
.note-info { border-left-color: var(--muted); }
.note-warn { border-left-color: var(--gold); }
.note-error { border-left-color: var(--red); }

/* Runtime Monitor grid (2×5) */
.control-board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.cb-box { border: 1px solid var(--border); border-radius: 9px; background: var(--panel); padding: 12px 8px; min-height: 60px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: .8rem; font-weight: 600; color: var(--text); }
.cb-done { background: #1d1d1d; color: var(--muted); }
.cb-running { border-color: var(--gold); background: var(--gold); color: var(--ink); box-shadow: 0 0 16px rgba(255,190,23,.6); animation: cb-pulse 1.1s ease-in-out infinite; }
@keyframes cb-pulse { 0%,100% { box-shadow: 0 0 8px rgba(255,190,23,.45); } 50% { box-shadow: 0 0 20px rgba(255,190,23,.85); } }
.cb-error { border-color: var(--red); background: rgba(224,88,79,.18); color: var(--red); }

/* Row 2: Call Details | Final Score | Performance table */
.row-results { display: grid; grid-template-columns: 200px 180px 1fr; gap: 32px; align-items: start; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; font-size: .78rem; color: var(--muted); }
.field input { font-family: var(--font-body); font-size: .9rem; color: var(--text); background: var(--panel-2); padding: 8px 10px; border: 1px solid var(--border); border-radius: 7px; }
.field input:focus { outline: none; border-color: var(--gold); }
/* Call Details are system-populated, display-only. */
.field input[readonly] { background: #1b1b1b; color: var(--muted); cursor: default; }
.field input[readonly]:focus { border-color: var(--border); }

/* Final Score column — heading + circle + meta centered together */
.col-score { text-align: center; }
.score-circle { width: 124px; height: 124px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 3rem; color: #fff; background: var(--panel-2); margin: 2px auto 16px; }
.score-circle.circle-good { background: var(--green-deep); }
.score-circle.circle-mid { background: #c79100; }
.score-circle.circle-bad { background: #b3433b; }
.score-meta { font-size: .82rem; }
.score-meaning-label, .score-coverage-label { color: var(--muted); font-weight: 600; margin-top: 10px; }
.score-meaning { font-weight: 700; color: var(--heading); }

/* Performance table — ONE grid so Actual and Expected rows align exactly */
.perf-grid { display: grid; grid-template-columns: minmax(110px, 1fr) auto 22px minmax(110px, 1fr) auto auto; align-items: center; row-gap: 2px; column-gap: 12px; }
.pt-h { padding-bottom: 10px; align-self: end; }
.pt-h.h-act { grid-column: 1 / 3; }
.pt-h.h-gap { grid-column: 3; }
.pt-h.h-exp { grid-column: 4 / 6; }
.pt-h.h-weight { grid-column: 6; font-size: .78rem; color: var(--muted); justify-self: end; }
.pt-label { font-size: .82rem; color: var(--text); padding: 6px 0; }
.pt-cell { display: inline-flex; gap: 4px; }
.pt-gap { width: 22px; }
.pt-weight select { width: 100%; }

/* Segment cells */
.seg-bar { display: inline-flex; gap: 4px; }
.seg-cell { width: 17px; height: 17px; border: 1px solid var(--border-strong); border-radius: 3px; background: transparent; padding: 0; }
button.seg-cell { cursor: pointer; }
.seg-editable button.seg-cell:hover { border-color: var(--gold); }
.seg-actual { background: var(--green); border-color: var(--green); }
.seg-expected { background: var(--gold); border-color: var(--gold); }
.pm-weight { font-size: .78rem; padding: 5px 7px; border: 1px solid var(--border); border-radius: 7px; background: var(--panel-2); color: var(--text); }
.perf-locked { opacity: .85; }
.template-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; }

/* Row 3: analysis + recommendations + footer brand */
.row-analysis { display: grid; grid-template-columns: 1fr 1fr 0.6fr; gap: 32px; align-items: stretch; }
.scroll-box { padding: 16px 18px; height: 300px; overflow-y: auto; font-size: .86rem; }
.analysis-section { margin-bottom: 14px; }
.analysis-title { font-weight: 700; text-decoration: underline; margin-bottom: 5px; color: var(--heading); }
.scroll-box ul { margin: 0 0 4px; padding-left: 18px; color: var(--text); }
.scroll-box li { margin-bottom: 4px; }
.rec-list { margin: 0; padding-left: 18px; }

.col-footerbrand { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding-top: 34px; }
.footer-logo { height: 84px; width: auto; }
.footer-email { font-size: .85rem; color: var(--muted); text-decoration: none; }
.footer-email:hover { text-decoration: underline; color: var(--text); }
.socials { display: flex; gap: 12px; }
.social { width: 34px; height: 34px; border-radius: 7px; display: flex; align-items: center; justify-content: center; color: #fff; }
.social-li { background: #0a66c2; }
.social-yt { background: #ff0000; }

@media (max-width: 1040px) {
  .row-top, .row-results, .row-analysis { grid-template-columns: 1fr; }
  .control-board { grid-template-columns: repeat(2, 1fr); }
  .perf-grid { grid-template-columns: minmax(90px, 1fr) auto 14px minmax(90px, 1fr) auto auto; column-gap: 8px; }
  .col-footerbrand { padding-top: 0; }
}
@media print {
  body { background: #fff; color: #000; }
  .band-header, .band-toolbar, .notif-col, .monitor-col, .template-actions, .col-footerbrand { display: none !important; }
  .card { border-color: #ccc; background: #fff; }
  .scroll-box { height: auto; overflow: visible; }
  .app-title, .section-h, .col-h, .pt-h, .score-meaning, .analysis-title { color: #000; }
}
