/* Seminar Optimizer — Client Diagnostic System
   Brand theme: Playfair Display + Montserrat, amber/cream premium palette */
:root {
  --orange: #C8711A;
  --orange-light: #E08530;
  --orange-dark: #A85C10;
  --black: #0A0A0A;
  --dark: #111111;
  --dark2: #1C1C1C;
  --cream: #F4F3EF;
  --white: #FFFFFF;
  --muted: #777777;

  --bg: var(--cream);
  --panel: #FFFFFF;
  --panel-2: #FAF8F4;
  --border: rgba(200,113,26,0.22);
  --border-strong: rgba(200,113,26,0.45);
  --text: var(--black);
  --accent: var(--orange);

  --crit: #c0392b;
  --warn: #C8711A;
  --good: #2e8b57;
  --elite: #1f6f6a;

  --shadow: 0 10px 34px rgba(10,10,10,.08);
  --radius: 14px;
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans);
  background:
    radial-gradient(900px 500px at 88% -8%, rgba(224,133,48,.10) 0%, rgba(244,243,239,0) 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}
a { color: var(--orange); }
h1,h2,h3,h4 { font-family: var(--serif); }

/* Layout */
.app { display: grid; grid-template-columns: 288px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.main { padding: 30px 38px 90px; max-width: 1120px; }

/* Brand */
.brand { display: flex; align-items: center; gap: 11px; margin-bottom: 4px; }
.brand .logo { width: 40px; height: 40px; border-radius: 9px; object-fit: contain; background: var(--black); padding: 4px; }
.brand h1 { font-size: 16px; margin: 0; letter-spacing: .2px; font-weight: 700; }
.brand .sub { font-size: 10.5px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; font-family: var(--sans); }

/* Client selector */
.client-box { margin: 18px 0 14px; }
.client-box label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
select, input[type=text], input[type=number] {
  width: 100%; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px; padding: 9px 10px; font-size: 14px; font-family: var(--sans);
}
.client-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.btn {
  cursor: pointer; border: 1px solid var(--border-strong); background: var(--white);
  color: var(--text); border-radius: 9px; padding: 8px 11px; font-size: 13px; font-weight: 600; font-family: var(--sans);
  transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--orange); background: var(--panel-2); }
.btn.primary { background: linear-gradient(135deg, var(--orange), var(--orange-light)); border: none; color: #fff; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.sm { padding: 6px 9px; font-size: 12px; }
.btn.danger:hover { border-color: var(--crit); color: var(--crit); }

/* Nav */
.nav { margin-top: 12px; display: flex; flex-direction: column; gap: 3px; }
.nav button {
  text-align: left; display: flex; align-items: center; gap: 10px;
  background: transparent; border: none; color: #4a4a4a;
  padding: 9px 10px; border-radius: 9px; cursor: pointer; font-size: 13.5px; width: 100%; font-family: var(--sans); font-weight: 500;
}
.nav button:hover { background: var(--panel-2); color: var(--black); }
.nav button.active { background: var(--panel-2); color: var(--black); box-shadow: inset 3px 0 0 var(--orange); font-weight: 600; }
.nav .num {
  width: 22px; height: 22px; border-radius: 6px; background: var(--white);
  display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none;
  border: 1px solid var(--border-strong);
}
.nav .pill {
  margin-left: auto; font-size: 10.5px; padding: 2px 7px; border-radius: 20px;
  background: var(--white); border: 1px solid var(--border); color: var(--muted); font-weight: 600;
}
.nav .sep { height: 1px; background: var(--border); margin: 11px 4px; }

/* Headings */
.page-head { margin-bottom: 18px; }
.page-head .eyebrow { color: var(--orange); font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-family: var(--sans); }
.page-head h2 { margin: 6px 0 8px; font-size: 30px; font-weight: 800; line-height: 1.1; }
.page-head p { color: #555; margin: 0; max-width: 760px; }
.meta-line { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.meta-line b { color: var(--text); }
.framework {
  margin-top: 12px; padding: 11px 14px; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 10px; font-size: 13px; color: var(--text);
}
.framework span { color: var(--orange); font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; display: block; margin-bottom: 3px; font-weight: 700; }

/* Module score banner */
.score-banner {
  display: flex; align-items: center; gap: 20px; margin: 20px 0 26px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow);
}
.score-dial { display: grid; place-items: center; }
.dial-num { font-size: 34px; font-weight: 800; font-family: var(--serif); }
.dial-max { color: var(--muted); font-size: 13px; font-family: var(--sans); }
.score-banner .band { font-size: 17px; font-weight: 700; font-family: var(--serif); }
.score-banner .progress { flex: 1; }
.bar { height: 10px; border-radius: 20px; background: var(--panel-2); overflow: hidden; border: 1px solid var(--border); }
.bar > i { display: block; height: 100%; border-radius: 20px; transition: width .4s; }
.fill-crit { background: var(--crit); } .fill-warn { background: linear-gradient(90deg,var(--orange),var(--orange-light)); }
.fill-good { background: var(--good); } .fill-elite { background: var(--elite); }
.txt-crit { color: var(--crit); } .txt-warn { color: var(--orange-dark); }
.txt-good { color: var(--good); } .txt-elite { color: var(--elite); }

/* Section cards */
.section {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 16px; overflow: hidden; box-shadow: var(--shadow);
}
.section-head { display: flex; align-items: flex-start; gap: 16px; padding: 16px 18px; cursor: pointer; }
.section-head .s-num {
  width: 26px; height: 26px; border-radius: 7px; background: var(--panel-2); border: 1px solid var(--border-strong);
  display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; margin-top: 2px; font-family: var(--sans);
}
.section-head .s-title { flex: 1; }
.section-head .s-title h3 { margin: 0 0 2px; font-size: 17px; font-weight: 700; }
.section-head .s-title .goal { color: var(--muted); font-size: 12.5px; }
.section-head .chev { color: var(--muted); transition: .2s; margin-top: 4px; font-size: 18px; }
.section.open .chev { transform: rotate(90deg); }

/* Score buttons */
.scorer { display: flex; gap: 6px; align-items: center; flex: none; }
.scorer .dot {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--white); color: var(--muted); font-weight: 700; cursor: pointer; font-size: 13px; font-family: var(--sans);
}
.scorer .dot:hover { border-color: var(--orange); color: var(--black); }
.scorer .dot.sel { color: #fff; border-color: transparent; }
.scorer .dot.sel.v1, .scorer .dot.sel.v2 { background: var(--crit); }
.scorer .dot.sel.v3 { background: var(--orange); }
.scorer .dot.sel.v4, .scorer .dot.sel.v5 { background: var(--good); }

/* Section header score badge (replaces the old 1–5 scorer) */
.sec-badge { flex: none; text-align: right; margin-top: 1px; }
.sec-badge .b-num { font-family: var(--serif); font-weight: 800; font-size: 16px; }
.sec-badge .b-num small { font-family: var(--sans); font-weight: 600; color: var(--muted); font-size: 12px; }
.sec-badge .b-rated { display: block; font-size: 10.5px; color: var(--muted); }

.section-body { display: none; padding: 4px 18px 18px; border-top: 1px solid var(--border); }
.section.open .section-body { display: block; }

/* Per-item rows: checkbox + label + star rating + interview answer */
.items-hint { font-size: 12px; color: var(--muted); margin: 12px 0 4px; }
.items { display: grid; gap: 10px; margin-top: 6px; }
.item { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.item-head { display: flex; align-items: center; gap: 10px; }
.item-head input[type=checkbox] { accent-color: var(--orange); width: 16px; height: 16px; flex: none; }
.item-label { flex: 1; font-size: 13.5px; font-weight: 500; }
.stars { display: flex; gap: 1px; flex: none; }
.star { background: none; border: none; cursor: pointer; font-size: 20px; line-height: 1; color: #d8d2c7; padding: 0 1px; transition: color .1s; }
.star.on { color: var(--orange); }
.stars:hover .star { color: #d8d2c7; }
.stars:hover .star.hov { color: var(--orange-light); }
.star-clear { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 11px; margin-left: 6px; align-self: center; }
.star-clear:hover { color: var(--crit); }
.answer { width: 100%; margin-top: 8px; background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; font-family: var(--sans); resize: vertical; min-height: 36px; }
.reference { margin-top: 16px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; }
.sb-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; margin-top: 14px; }
@media (max-width: 860px){ .sb-grid { grid-template-columns: 1fr; } .app { grid-template-columns: 1fr; } .sidebar{ position: static; height:auto;} }
.sb-grid h4 { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--orange); margin: 0 0 8px; font-family: var(--sans); font-weight: 700; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 5px; }
.checklist li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.checklist input { margin-top: 3px; accent-color: var(--orange); }
.qlist, .flist { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; }
.flist li { color: #b34a3e; }
.note {
  width: 100%; margin-top: 14px; min-height: 60px; resize: vertical;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 9px; padding: 10px; font: inherit; font-size: 13px; font-family: var(--sans);
}

/* Dashboard cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px,1fr)); gap: 14px; margin-bottom: 22px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.card .k { color: var(--muted); font-size: 12px; }
.card .v { font-size: 30px; font-weight: 800; margin-top: 4px; font-family: var(--serif); }
.card .v small { font-size: 14px; color: var(--muted); font-weight: 600; font-family: var(--sans); }

.dash-section h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--orange); margin: 28px 0 12px; font-family: var(--sans); font-weight: 700; }
.mod-row {
  display: grid; grid-template-columns: 30px 1fr 150px 92px; align-items: center; gap: 14px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 11px; padding: 12px 16px; margin-bottom: 8px;
  cursor: pointer; box-shadow: var(--shadow);
}
.mod-row:hover { border-color: var(--orange); }
.mod-row .m-num { width: 26px; height: 26px; border-radius: 7px; background: var(--panel-2); border:1px solid var(--border-strong); display:grid; place-items:center; font-weight:700; font-size:12px; font-family: var(--sans);}
.mod-row .m-name { font-weight: 600; }
.mod-row .m-name small { display: block; color: var(--muted); font-weight: 400; font-size: 11.5px; }
.mod-row .m-score { text-align: right; font-weight: 700; font-family: var(--serif); }
.mod-row .m-score small { color: var(--muted); font-weight: 500; font-family: var(--sans); }
.mod-row .wtag { font-size: 10px; color: var(--orange-dark); font-weight: 600; }

.insight-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px){ .insight-grid { grid-template-columns: 1fr; } }
.insight-box { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.insight-box h4 { margin: 0 0 10px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.insight-box ul { margin: 0; padding-left: 18px; display: grid; gap: 7px; font-size: 13.5px; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 20px; border: 1px solid var(--border); color: var(--muted); }
.empty { color: var(--muted); font-size: 13px; font-style: italic; }

.rec { border-left: 3px solid var(--orange); padding: 10px 14px; background: var(--panel-2); border-radius: 8px; margin-bottom: 8px; font-size: 13.5px; }
.rec.crit { border-left-color: var(--crit); }
.rec b { display: block; margin-bottom: 2px; }
.rec .src { color: var(--muted); font-size: 12px; }

/* Comparison table */
.cmp-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table.cmp { border-collapse: collapse; width: 100%; background: var(--panel); font-size: 13px; min-width: 560px; }
table.cmp th, table.cmp td { padding: 10px 12px; text-align: center; border-bottom: 1px solid var(--border); }
table.cmp thead th { background: var(--panel-2); font-family: var(--sans); font-size: 12px; position: sticky; top: 0; }
table.cmp th.modcol, table.cmp td.modcol { text-align: left; font-weight: 600; white-space: nowrap; }
table.cmp td.modcol small { display:block; color: var(--muted); font-weight: 400; font-size: 11px; }
table.cmp tr.overall td { font-weight: 800; border-top: 2px solid var(--border-strong); background: var(--panel-2); font-family: var(--serif); }
.cell { display: inline-block; min-width: 56px; padding: 4px 8px; border-radius: 7px; font-weight: 700; }
.cell.crit { background: rgba(192,57,43,.12); color: var(--crit); }
.cell.warn { background: rgba(200,113,26,.14); color: var(--orange-dark); }
.cell.good { background: rgba(46,139,87,.14); color: var(--good); }
.cell.elite { background: rgba(31,111,106,.14); color: var(--elite); }
.cell.none { color: var(--muted); }

/* Weights / settings */
.weight-grid { display: grid; gap: 8px; }
.weight-row { display: grid; grid-template-columns: 30px 1fr 120px; align-items: center; gap: 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 11px; padding: 10px 16px; box-shadow: var(--shadow); }
.weight-row .w-name { font-weight: 600; }
.weight-row input[type=range] { width: 100%; accent-color: var(--orange); }
.weight-row .w-val { text-align: right; font-weight: 700; font-family: var(--serif); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--black); border: 1px solid var(--orange); color: #fff;
  padding: 10px 18px; border-radius: 10px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .25s; z-index: 50; font-size: 13px;
}
.toast.show { opacity: 1; }

/* Print */
@media print {
  .sidebar, .toolbar, .scorer, .section-head .chev, .note, .client-actions { display: none !important; }
  .app { grid-template-columns: 1fr; }
  body { background: #fff; }
  .card, .section, .mod-row, .insight-box, .score-banner, .framework, .cmp-wrap, .weight-row { box-shadow: none; }
  .section-body { display: block !important; }
}
