/* ML Tutor — Live Presenter Styles */

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: system-ui, -apple-system, sans-serif; background: #0f172a; color: #e2e8f0; }

/* Top nav */
.topnav { display: flex; align-items: center; gap: 18px; padding: 10px 24px; background: #1e293b; }
.brand { font-weight: 800; font-size: 1rem; color: #f8fafc;
         display: inline-flex; align-items: center; gap: 8px; }
.brand-logo { height: 22px; width: auto; max-width: 120px; display: block; }
.topnav a { color: rgba(248,250,252,0.6); text-decoration: none; font-size: 0.88rem; font-weight: 600; }
.topnav a:hover { color: #f8fafc; }

/* Content pages */
.content { padding: 24px; max-width: 1000px; margin: 0 auto; }
.page h1 { margin-bottom: 8px; font-size: 1.6rem; }
.page h2 { margin: 24px 0 12px; font-size: 1.2rem; }
.page p { color: #94a3b8; line-height: 1.6; }

/* Upload */
.upload-form { display: flex; gap: 12px; align-items: center; margin: 20px 0; }
.file-label { cursor: pointer; }
.file-label input { display: none; }
.file-btn { padding: 10px 18px; border-radius: 10px; background: #1e293b; color: #e2e8f0; border: 1px dashed #475569; font-weight: 600; display: inline-block; }

/* Buttons */
.btn-primary, .btn-ghost { padding: 8px 18px; border-radius: 999px; border: 0; cursor: pointer; font: inherit; font-size: 0.88rem; font-weight: 600; text-decoration: none; display: inline-block; }
.btn-primary { background: linear-gradient(135deg, #0284c7, #0f172a); color: #f8fafc; }
.btn-ghost { background: rgba(14,165,233,0.1); color: #38bdf8; }

/* Cards */
.session-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card { padding: 18px; border-radius: 14px; background: #1e293b; border: 1px solid #334155; }
.card h3 { margin-bottom: 8px; color: #f8fafc; font-size: 1.05rem; }
.meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.meta span { padding: 3px 10px; border-radius: 999px; font-size: 0.76rem; font-weight: 600; background: rgba(14,165,233,0.1); color: #38bdf8; }
.card-actions { display: flex; gap: 8px; align-items: center; }
.btn-danger-sm { padding: 6px 14px; border-radius: 999px; border: 0; cursor: pointer; font: inherit; font-size: 0.82rem; font-weight: 600; background: rgba(220,38,38,0.15); color: #ef4444; }
.presented { background: rgba(34,197,94,0.15) !important; color: #22c55e !important; }
.empty { padding: 40px; text-align: center; color: #64748b; border: 1px dashed #334155; border-radius: 12px; }
.muted { color: #64748b; }

/* Info grid */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin: 18px 0; }
.info-card { padding: 16px; border-radius: 12px; background: #1e293b; }
.info-card h3 { margin-bottom: 10px; font-size: 0.95rem; color: #38bdf8; }
.info-card p { font-size: 0.88rem; color: #cbd5e1; margin: 4px 0; }

/* Slide list */
.slide-list { display: flex; flex-direction: column; gap: 6px; }
.slide-item { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 10px; background: #1e293b; }
.slide-num { width: 36px; height: 36px; border-radius: 10px; background: #334155; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #38bdf8; flex-shrink: 0; }
.slide-item p { font-size: 0.82rem; color: #64748b; margin: 2px 0 0; }

/* Action bar */
.action-bar { margin: 24px 0; padding: 18px; border-radius: 14px; background: #1e293b; }
.meeting-info { margin-bottom: 12px; }
.meeting-info a { color: #38bdf8; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ========== Full-screen Presenter View ========== */

.presenter-body { overflow: hidden; }

.presenter-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  height: 100vh;
}

.slide-area {
  position: relative;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.slide-img { max-width: 100%; max-height: 100%; object-fit: contain; }

.slide-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.7);
  font-size: 1.2rem; font-weight: 700; color: #94a3b8;
  text-align: center; padding: 24px;
}

.side-panel {
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px; background: #1e293b; overflow-y: auto;
}

.panel-header { display: flex; justify-content: space-between; align-items: center; }
.panel-header h2 { font-size: 1.1rem; color: #f8fafc; }
.counter { font-size: 0.88rem; color: #64748b; font-weight: 700; }

.script-label { font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #64748b; margin-bottom: 6px; }
.script-box { flex: 1; min-height: 0; overflow-y: auto; }
.script-text { font-size: 0.92rem; line-height: 1.7; color: #cbd5e1; padding: 10px; border-radius: 10px; background: #0f172a; max-height: 200px; overflow-y: auto; }

/* Controls */
.controls { display: flex; gap: 6px; flex-wrap: wrap; }
.ctrl-btn {
  padding: 8px 14px; border: 0; border-radius: 8px; cursor: pointer;
  font: inherit; font-size: 0.84rem; font-weight: 600;
  background: #334155; color: #e2e8f0;
}
.ctrl-btn:hover { background: #475569; }
.ctrl-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.ctrl-btn.primary { background: #0284c7; color: #fff; }
.ctrl-btn.accent { background: #7c3aed; color: #fff; }
.ctrl-btn.danger { background: #dc2626; color: #fff; }

/* Controls row */
.controls-row { display: flex; justify-content: space-between; align-items: center; }
.toggle-label { font-size: 0.84rem; color: #94a3b8; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.toggle-label input { cursor: pointer; }
.timer { font-size: 0.88rem; color: #64748b; font-weight: 700; }
.status-text { font-size: 0.82rem; color: #475569; margin: 4px 0 0; }

/* Q&A */
.qa-section { flex-shrink: 0; }
.qa-input-row { display: flex; gap: 6px; margin-bottom: 8px; }
.qa-input-row input { flex: 1; padding: 8px 12px; border-radius: 8px; border: 1px solid #475569; background: #0f172a; color: #e2e8f0; font: inherit; font-size: 0.88rem; }
.qa-list { max-height: 150px; overflow-y: auto; }
.qa-item { padding: 8px 10px; border-radius: 8px; background: #0f172a; margin-bottom: 4px; font-size: 0.84rem; line-height: 1.5; }
.qa-item small { color: #64748b; }
.qa-item.qa-thinking { opacity: 0.5; font-style: italic; }

/* Supervisor */
.supervisor-section { border-top: 1px solid #334155; padding-top: 12px; }
.pending-qa { padding: 10px; border-radius: 10px; background: rgba(234,179,8,0.1); border: 1px solid rgba(234,179,8,0.3); margin-top: 8px; }
.pending-qa p { font-size: 0.86rem; margin: 4px 0; }

@media (max-width: 900px) {
  .presenter-layout { grid-template-columns: 1fr; grid-template-rows: 50vh 1fr; }
}

/* ══════════════════════════════════════════════════════════════════════════
   Admin component layer
   ──────────────────────────────────────────────────────────────────────────
   The admin pages had each grown their own copy of the same dozen rules, so
   the same control looked slightly different on every screen. These are the
   shared pieces. A page may still override any of them in its own <style>
   block — page styles load after this file — but it should not need to.
   ══════════════════════════════════════════════════════════════════════════ */

/* Page furniture */
.page-sub { color: #64748b; font-size: 0.88rem; margin: 2px 0 20px;
            max-width: 74ch; line-height: 1.55; }
.page-sub strong { color: #94a3b8; }
.section { margin-bottom: 28px; }
.section-head { font-size: 0.95rem; color: #94a3b8; padding-bottom: 8px;
                border-bottom: 1px solid #334155; margin: 0 0 14px; }
.empty-note { color: #64748b; font-size: 0.88rem; line-height: 1.55; max-width: 74ch; }
.hint { color: #64748b; font-size: 0.78rem; line-height: 1.5; margin: 4px 0 0; max-width: 74ch; }

/* Flash messages */
.flash { border-radius: 8px; padding: 9px 14px; font-size: 0.85rem; margin-bottom: 14px; }
.flash.ok { background: rgba(22,163,74,0.12); color: #22c55e; border: 1px solid rgba(22,163,74,0.25); }
.flash.err { background: rgba(220,38,38,0.1); color: #f87171; border: 1px solid rgba(220,38,38,0.25); }

/* Surfaces.
   Named .panel, NOT .card: `.card` is defined higher up with its own padding
   and radius, and several pages depend on it. Redefining it here silently
   stripped their padding. */
.panel { background: #1e293b; border: 1px solid #334155; border-radius: 10px; }
.panel-pad { padding: 16px 18px; }

/* Forms — labels sit above their control, in small caps, always aligned */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 170px; }
.field > label { color: #64748b; font-size: 0.72rem; text-transform: uppercase;
                 letter-spacing: .06em; }
.field .opt { text-transform: none; letter-spacing: 0; color: #475569; }
.field.grow { flex: 1; }
.field.shrink { min-width: 0; flex-shrink: 0; }
.field-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.input { padding: 8px 12px; border-radius: 6px; border: 1px solid #475569;
         background: #0f172a; color: #e2e8f0; font: inherit; font-size: 0.85rem; width: 100%; }
.input:focus { outline: none; border-color: #38bdf8; }
.input.narrow { max-width: 130px; }
textarea.input { resize: vertical; }
.check { display: flex; align-items: center; gap: 7px; color: #cbd5e1;
         font-size: 0.82rem; font-weight: 400; }
.check input { width: auto; }

/* Buttons */
.btn { padding: 7px 13px; border-radius: 6px; border: 1px solid #334155; cursor: pointer;
       font: inherit; font-size: 0.78rem; font-weight: 600; text-decoration: none;
       display: inline-block; background: #0f172a; color: #cbd5e1; white-space: nowrap;
       transition: border-color .15s, background .15s; }
.btn:hover { border-color: #64748b; }
.btn.primary { background: #0284c7; border-color: #0284c7; color: #fff; }
.btn.primary:hover { background: #0369a1; }
.btn.manage { background: rgba(14,165,233,0.12); border-color: rgba(14,165,233,0.35); color: #38bdf8; }
.btn.danger { background: rgba(220,38,38,0.1); border-color: rgba(220,38,38,0.3); color: #ef4444; }
.btn.tiny { padding: 3px 9px; font-size: 0.72rem; }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.icon-btn { width: 26px; height: 26px; border-radius: 6px; border: 1px solid #334155;
            background: #1e293b; color: #94a3b8; cursor: pointer; font-size: 0.7rem; line-height: 1; }
.icon-btn:hover:not(:disabled) { border-color: #64748b; color: #e2e8f0; }
.icon-btn:disabled { opacity: 0.3; cursor: default; }
.icon-btn.danger { color: #ef4444; }

/* Chips and badges */
.chip { font-size: 0.66rem; text-transform: uppercase; letter-spacing: .06em;
        font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.chip.neutral { background: rgba(100,116,139,0.18); color: #94a3b8; }
.chip.blue    { background: rgba(14,165,233,0.14); color: #38bdf8; }
.chip.violet  { background: rgba(139,92,246,0.14); color: #a78bfa; }
.chip.green   { background: rgba(22,163,74,0.14); color: #22c55e; }
.chip.amber   { background: rgba(234,179,8,0.14); color: #eab308; }
.status-badge { padding: 2px 9px; border-radius: 999px; font-size: 0.68rem; font-weight: 700;
                text-transform: uppercase; letter-spacing: .05em; }
.status-badge.draft      { background: rgba(234,179,8,0.12); color: #eab308; }
.status-badge.published  { background: rgba(22,163,74,0.12); color: #22c55e; }
.status-badge.active     { background: rgba(22,163,74,0.12); color: #22c55e; }
.status-badge.archived,
.status-badge.withdrawn  { background: rgba(100,116,139,0.16); color: #94a3b8; }
.status-badge.requested  { background: rgba(234,179,8,0.12); color: #eab308; }
.status-badge.fulfilled  { background: rgba(22,163,74,0.12); color: #22c55e; }
.status-badge.cancelled  { background: rgba(100,116,139,0.16); color: #94a3b8; }

/* Data tables */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th { text-align: left; color: #64748b; font-size: 0.72rem; text-transform: uppercase;
                 letter-spacing: .05em; padding: 9px 12px; border-bottom: 1px solid #334155;
                 white-space: nowrap; font-weight: 600; }
.data-table td { padding: 10px 12px; color: #cbd5e1;
                 border-bottom: 1px solid rgba(51,65,85,0.5); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr.dim td { opacity: 0.55; }
.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .row-title { color: #f8fafc; font-weight: 600; }
.data-table .row-sub { color: #64748b; font-size: 0.78rem; margin-top: 2px; }
.data-table .row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* Stat tiles. Named .tile-row/.tile, because my_progress.html already owns
   .stat-row/.stat-card with a different shape. */
.tile-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.stat-tile { background: #1e293b; border: 1px solid #334155; border-radius: 10px;
             padding: 13px 16px; min-width: 132px; flex: 1; }
.stat-tile b { display: block; font-size: 1.5rem; color: #f8fafc; line-height: 1.2;
               font-variant-numeric: tabular-nums; }
.stat-tile span { color: #94a3b8; font-size: 0.78rem; }
.stat-tile small { display: block; color: #64748b; font-size: 0.72rem; margin-top: 2px; }
.stat-tile.accent b { color: #a78bfa; }
.stat-tile.warn { border-color: rgba(234,179,8,0.4); }
.stat-tile.warn b { color: #eab308; }

/* Progress bar */
.bar { display: inline-block; width: 110px; height: 7px; background: #0f172a;
       border-radius: 4px; overflow: hidden; vertical-align: middle; margin-right: 8px; }
.bar > i { display: block; height: 100%; background: #38bdf8; }
