/* OneVOne Meeting Hub — plain CSS, no framework. Light + dark aware. */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e2e5ea;
  --text: #1c1f26;
  --muted: #6b7280;
  --primary: #4f46e5;
  --primary-ink: #ffffff;
  --danger: #dc2626;
  --warn: #b45309;
  --success: #047857;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #1a1d24;
    --surface-2: #232730;
    --border: #2c313b;
    --text: #e6e8ec;
    --muted: #9aa1ac;
    --primary: #6366f1;
    --shadow: 0 1px 3px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Thai", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; }

/* ---------- buttons / inputs ---------- */
.btn {
  font: inherit; cursor: pointer; border: 1px solid transparent;
  border-radius: 8px; padding: .55rem .9rem; background: var(--surface-2);
  color: var(--text); transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.05); }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-sm { padding: .35rem .6rem; font-size: .85rem; }
.btn:disabled { opacity: .6; cursor: default; }

.input {
  font: inherit; width: 100%; padding: .55rem .7rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.input:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
textarea.input { resize: vertical; }
.hint { display: block; font-size: .78rem; color: var(--muted); margin-top: .2rem; }
.hint-inline { font-weight: 400; font-size: .75rem; color: var(--muted); }

.icon-btn {
  background: transparent; border: none; color: var(--muted); cursor: pointer;
  font-size: 1.4rem; line-height: 1; padding: .1rem .4rem; border-radius: 6px;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.sm { font-size: 1.1rem; }

/* ---------- login ---------- */
.login-view {
  min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
}
.login-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 2.5rem; max-width: 420px; width: 100%; text-align: center;
}
.brand { display: flex; align-items: center; justify-content: center; gap: .6rem; margin-bottom: .5rem; }
.brand h1 { font-size: 1.3rem; margin: 0; }
.brand-mark {
  display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem;
  background: var(--primary); color: #fff; border-radius: 9px; font-weight: 700; font-size: .95rem;
}
.btn-ms { width: 100%; margin-top: 1.2rem; display: flex; align-items: center; justify-content: center; gap: .6rem; }
.ms-logo { width: 16px; height: 16px; flex: none;
  background:
    linear-gradient(#f25022 0 0) 0 0/7px 7px,
    linear-gradient(#7fba00 0 0) 9px 0/7px 7px,
    linear-gradient(#00a4ef 0 0) 0 9px/7px 7px,
    linear-gradient(#ffb900 0 0) 9px 9px/7px 7px;
  background-repeat: no-repeat;
}

/* ---------- topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .7rem 1.2rem; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.topbar-brand { display: flex; align-items: center; gap: .55rem; }
.topbar-right { display: flex; align-items: center; gap: .7rem; }
.whoami { font-size: .9rem; }

/* ---------- layout ---------- */
.container { max-width: 1100px; margin: 0 auto; padding: 1.2rem; }
.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; margin-bottom: 1.2rem;
}
.filters { display: flex; gap: .6rem; flex-wrap: wrap; }
.filters .input { width: auto; min-width: 160px; }

/* ---------- badges / chips ---------- */
.badge {
  display: inline-block; font-size: .72rem; font-weight: 600; padding: .15rem .5rem;
  border-radius: 999px; background: var(--surface-2); color: var(--muted); text-transform: capitalize;
}
.badge-type.badge-one_on_one { background: #e0e7ff; color: #3730a3; }
.badge-type.badge-team { background: #dcfce7; color: #166534; }
.status-scheduled { background: #dbeafe; color: #1e40af; }
.status-completed { background: #dcfce7; color: #166534; }
.status-cancelled { background: #fee2e2; color: #991b1b; }
@media (prefers-color-scheme: dark) {
  .badge-type.badge-one_on_one { background: #312e81; color: #c7d2fe; }
  .badge-type.badge-team { background: #14532d; color: #bbf7d0; }
  .status-scheduled { background: #1e3a8a; color: #bfdbfe; }
  .status-completed { background: #14532d; color: #bbf7d0; }
  .status-cancelled { background: #7f1d1d; color: #fecaca; }
}
.chip {
  display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 600;
  padding: .15rem .55rem; border-radius: 999px; background: var(--surface-2); color: var(--text);
  border-left: 3px solid var(--chip, #888);
}
.pill {
  display: inline-block; font-size: .75rem; padding: .1rem .5rem; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); margin: .1rem;
}

/* ---------- meeting cards ---------- */
.meeting-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem;
}
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .5rem;
}
.card-top { display: flex; gap: .4rem; flex-wrap: wrap; }
.card-title { margin: .1rem 0; font-size: 1.05rem; }
.card-meta { display: flex; flex-direction: column; gap: .15rem; font-size: .85rem; color: var(--muted); }
.card-parts { display: flex; flex-wrap: wrap; gap: .1rem; }
.card-foot {
  display: flex; align-items: center; gap: .6rem; margin-top: auto; padding-top: .5rem;
  border-top: 1px solid var(--border); font-size: .85rem;
}
.focus-count { font-weight: 600; }
.card-foot .btn { margin-left: auto; }
.link { color: var(--primary); text-decoration: none; font-weight: 600; }
.link:hover { text-decoration: underline; }
.empty { text-align: center; color: var(--muted); padding: 3rem; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 1rem; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.modal-card {
  position: relative; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  width: 100%; max-width: 520px; max-height: 90vh; overflow: auto;
}
.modal-lg { max-width: 720px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.3rem; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface);
}
.modal-head h2 { margin: 0; font-size: 1.15rem; }

/* ---------- forms ---------- */
.form { padding: 1.3rem; display: flex; flex-direction: column; gap: .9rem; }
.form label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; font-weight: 600; }
.form label.check { flex-direction: row; align-items: center; gap: .5rem; font-weight: 400; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.form-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: .4rem; }

/* ---------- detail ---------- */
.detail-body { padding: 1.3rem; }
.detail-grid { display: grid; grid-template-columns: 1fr auto; gap: 1rem; margin-bottom: 1rem; }
.d-row { margin-bottom: .4rem; font-size: .9rem; }
.d-label { display: inline-block; min-width: 92px; color: var(--muted); font-weight: 600; font-size: .8rem; }
.d-status { min-width: 160px; }
.d-section { border-top: 1px solid var(--border); padding-top: 1rem; margin-top: 1rem; }
.d-section h4 { margin: 0 0 .6rem; }
.focus-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.focus-item { display: flex; align-items: flex-start; gap: .6rem; padding: .5rem; border: 1px solid var(--border); border-radius: 8px; }
.focus-item.focus-done { opacity: .65; }
.focus-toggle { flex: none; width: 1.7rem; height: 1.7rem; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; font-size: .9rem; }
.focus-done .focus-title { text-decoration: line-through; }
.focus-main { display: flex; flex-direction: column; flex: 1; }
.focus-title { font-weight: 600; }
.focus-sub { font-size: .78rem; color: var(--muted); }
.focus-add { display: grid; grid-template-columns: 1fr auto auto auto; gap: .5rem; margin-top: .7rem; align-items: center; }
.detail-foot { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: .7rem 1.1rem; border-radius: 8px;
  box-shadow: var(--shadow); z-index: 100; max-width: 90vw; font-size: .9rem;
}
.toast-success { background: var(--success); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }
.toast-warn { background: var(--warn); color: #fff; }

@media (max-width: 560px) {
  .grid-2 { grid-template-columns: 1fr; }
  .focus-add { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   DASHBOARD (Phase 2) — chart palette from the dataviz skill
   (validated: light + dark). Status colors are fixed (not themed).
   ============================================================ */
.viz-root {
  --series-1: #2a78d6; --series-2: #eda100; --series-3: #008300;
  --st-good: #0ca30c; --st-warn: #fab219; --st-crit: #d03b3b;
  --grid: #e1e0d9; --axis: #c3c2b7; --muted-ink: #898781;
}
@media (prefers-color-scheme: dark) {
  .viz-root {
    --series-1: #3987e5; --series-2: #c98500; --series-3: #008300;
    --grid: #2c2c2a; --axis: #383835;
  }
}

.page-tag { font-size: .75rem; color: var(--muted); border-left: 1px solid var(--border); padding-left: .55rem; margin-left: .2rem; }
.dash-head { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.dash-head h1 { margin: 0; font-size: 1.4rem; }
.live-dot { font-size: .72rem; color: var(--success); font-weight: 600; }

/* KPI tiles */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.kpi-value { font-size: 2rem; font-weight: 700; line-height: 1; }
.kpi-label { color: var(--muted); font-size: .85rem; margin-top: .4rem; }
.kpi-crit .kpi-value { color: var(--st-crit); }
.kpi-good .kpi-value { color: var(--st-good); }

/* panel grid */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow); }
.panel-wide { grid-column: 1 / -1; }
.panel h2 { margin: 0 0 .3rem; font-size: 1.05rem; }
.panel-sub { margin: 0 0 .9rem; font-size: .82rem; color: var(--muted); }

/* status dots */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.s-good { background: var(--st-good); } .s-good.cov-status, span.cov-status.s-good { color: var(--st-good); }
.s-warn { background: var(--st-warn); }
.s-crit { background: var(--st-crit); }
.cov-status { font-size: .8rem; font-weight: 600; text-align: right; }
.cov-status.s-good { color: var(--st-good); }
.cov-status.s-warn { color: #a9760a; }
.cov-status.s-crit { color: var(--st-crit); }
.dot-legend { display: inline-flex; align-items: center; gap: .35rem; }
.dot-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-left: .5rem; }
.dot-legend i.s-good { background: var(--st-good); } .dot-legend i.s-warn { background: var(--st-warn); } .dot-legend i.s-crit { background: var(--st-crit); }

/* team coverage list */
.coverage-list { display: flex; flex-direction: column; gap: .1rem; }
.coverage-row { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "dot name status" "dot meta status"; column-gap: .6rem; align-items: center; padding: .55rem .2rem; border-bottom: 1px solid var(--border); }
.coverage-row .dot { grid-area: dot; }
.cov-name { grid-area: name; font-weight: 600; }
.cov-meta { grid-area: meta; font-size: .78rem; color: var(--muted); }
.coverage-row .cov-status { grid-area: status; }

/* donut */
.donut-wrap { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.donut-total { font-size: 1.6rem; font-weight: 700; fill: var(--text); }
.donut-cap { font-size: .7rem; fill: var(--muted-ink); }
.legend { display: flex; flex-direction: column; gap: .45rem; }
.lg-row { display: flex; align-items: center; gap: .55rem; font-size: .88rem; }
.lg-swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.lg-label { color: var(--text); }
.lg-val { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; margin-left: auto; }

/* bars */
.bars-wrap svg { display: block; }
.bar-val { fill: var(--text); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.axis-lbl { fill: var(--muted-ink); font-size: 11px; }
.axis-line { stroke: var(--axis); stroke-width: 1; }

/* coverage table */
.table-scroll { overflow-x: auto; }
.cov-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.cov-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: .78rem; padding: .4rem .6rem; border-bottom: 1px solid var(--border); }
.cov-table td { padding: .5rem .6rem; border-bottom: 1px solid var(--border); }
.cov-table .tnum { font-variant-numeric: tabular-nums; color: var(--muted); }

/* timeline */
.timeline { display: flex; flex-direction: column; }
.tl-row { display: flex; align-items: center; gap: .7rem; padding: .55rem .2rem; border-bottom: 1px solid var(--border); }
.tl-date { font-size: .78rem; color: var(--muted); min-width: 56px; font-variant-numeric: tabular-nums; }
.tl-main { display: flex; flex-direction: column; }
.tl-who { font-size: .8rem; color: var(--muted); }

@media (max-width: 720px) {
  .dash-grid { grid-template-columns: 1fr; }
  .panel-wide { grid-column: auto; }
}

/* ============================================================
   Line icons (no emoji) — Lucide-style, inherit currentColor
   ============================================================ */
.ic { vertical-align: -0.16em; flex: none; }
.btn-ic { display: inline-flex; align-items: center; gap: .4rem; }
.card-meta span { display: inline-flex; align-items: center; gap: .4rem; }
.focus-count { display: inline-flex; align-items: center; gap: .35rem; }
.link { display: inline-flex; align-items: center; gap: .3rem; }

/* focus toggle now holds an SVG state icon */
.focus-toggle { display: inline-flex; align-items: center; justify-content: center; padding: 0; color: var(--muted); }
.focus-toggle-done { color: var(--success); border-color: var(--success); }
.focus-toggle-in_progress { color: var(--primary); }

/* live indicator pip (replaces the ● glyph) */
.live-dot { display: inline-flex; align-items: center; gap: .35rem; }
.live-pip { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
