@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
@import url('./vendor/remixicon/remixicon.css');

:root {
  /* Portal theme — matches the Knowledge Base admin (navy + blue) */
  --bg: #f5f8fa;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #647488;
  --accent: #008ce4;        /* KB brand blue */
  --accent-2: #0072c6;      /* darker blue */
  --accent-soft: #e6f4fd;   /* soft blue tint */
  --navy: #0f172a;          /* sidebar */
  --navy-border: #1e293b;
  --danger: #dc2f3a;
  --ok: #1f9d57;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 6px 24px rgba(15, 23, 42, 0.06);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Inter', system-ui, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); }
button { cursor: pointer; font: inherit; }
a { color: var(--accent); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.error-text { color: var(--danger); min-height: 1em; }
input, textarea, select {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; color: var(--text); font: inherit;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.primary { background: var(--accent); color: #fff; border: none; border-radius: 8px; padding: 10px 18px; font-weight: 600; font-size: 0.9rem; display: inline-flex; align-items: center; gap: 7px; }
.primary:hover { background: var(--accent-2); }

/* Modern app shell with sidebar (admin / recordings) */
.app-shell { display: flex; height: 100vh; overflow: hidden; background: var(--bg); }
.sidebar {
  width: 240px; flex-shrink: 0; background: var(--navy); color: #cbd5e1; border-right: 1px solid var(--navy-border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sb-brand { padding: 20px; border-bottom: 1px solid var(--navy-border); }
.sb-logo-img { height: 26px; filter: brightness(0) invert(1); display: block; }
.sb-sub { font-size: 10px; color: #475569; margin-top: 8px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.sb-nav { display: flex; flex-direction: column; flex: 1; overflow-y: auto; padding: 8px 0; }
.sb-nav a { display: flex; align-items: center; gap: 11px; padding: 10px 18px; color: #94a3b8; text-decoration: none; font-weight: 500; font-size: 0.86rem; border-left: 3px solid transparent; transition: all 0.15s; }
.sb-nav a i, .sb-nav a span { width: 20px; text-align: center; flex-shrink: 0; font-size: 16px; }
.sb-nav a:hover { background: rgba(255,255,255,0.04); color: #e2e8f0; }
.sb-nav a.active { background: rgba(0,140,228,0.15); color: #fff; border-left-color: var(--accent); font-weight: 600; }
.sb-foot { border-top: 1px solid var(--navy-border); padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; }
.sb-user { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; font-weight: 600; color: #e2e8f0; }
.sb-user::before { content: attr(data-i); width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 0.8rem; flex-shrink: 0; }
.sb-logout { color: #64748b; text-decoration: none; font-size: 0.8rem; display: flex; align-items: center; gap: 6px; }
.sb-logout:hover { color: #ef4444; }
.app-main { flex: 1; min-width: 0; min-height: 0; padding: 0; border-top: 3px solid var(--accent); display: flex; flex-direction: column; }
.app-head { flex-shrink: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; background: var(--surface); border-bottom: 1px solid var(--border); padding: 18px 28px; }
.app-head h1 { margin: 0 0 2px; font-size: 1.35rem; }
/* sub-header inside a settings tab panel (no own surface/border, sits in the flow) */
.app-head-sub { background: transparent; border-bottom: none; padding: 16px 28px 4px; align-items: center; flex-shrink: 0; }
/* Settings tab bar — fixed; only the panel below it scrolls */
.app-main > .set-tabs { display: flex; gap: 6px; margin: 14px 28px 0; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.set-tab { background: none; border: none; border-bottom: 2px solid transparent; color: var(--muted); cursor: pointer; padding: 10px 14px; font-size: 0.92rem; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; }
.set-tab:hover { color: var(--text); }
.set-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
/* the visible panel fills remaining height; its .settings-page is the scroll area */
.app-main > .set-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; margin: 0; }
.set-panel.hidden { display: none; }
/* Integrations setup guide */
.ig-guide .ig-step { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.ig-guide .ig-step > summary { cursor: pointer; list-style: none; padding: 12px 14px; font-weight: 600; display: flex; align-items: center; gap: 10px; background: var(--surface-2, #f5f7fb); }
.ig-guide .ig-step > summary::-webkit-details-marker { display: none; }
.ig-guide .ig-step[open] > summary { border-bottom: 1px solid var(--border); }
.ig-num { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-grid; place-items: center; font-size: 0.82rem; }
.ig-note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; margin: 0 0 14px; font-size: 0.88rem; line-height: 1.5; }
.ig-note i { flex-shrink: 0; font-size: 1.1rem; margin-top: 1px; }
.ig-note-warn { background: #fff7ed; border: 1px solid #fed7aa; color: #7c2d12; }
.ig-body { padding: 12px 16px 16px; }
.ig-steps { margin: 6px 0 14px; padding-left: 20px; display: grid; gap: 9px; }
.ig-steps li { font-size: 0.9rem; line-height: 1.5; }
.ig-steps code, .vc-desc code { background: var(--surface-2, #eef2f8); padding: 1px 5px; border-radius: 4px; font-size: 0.84em; }
.ig-code { display: block; margin-top: 6px; padding: 9px 11px; white-space: pre-wrap; line-height: 1.5; }
.vid-embed { position: relative; width: 100%; max-width: 640px; aspect-ratio: 16 / 9; margin: 6px 0 12px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.vid-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.app-main > :not(.app-head) { margin: 0 28px; }
.app-main .tabs2, .app-main .list-controls, .app-main #emptyState, .app-main > p { margin-left: 28px; margin-right: 28px; }
.app-main .tabs2, .app-main .list-controls { flex-shrink: 0; }
.app-main .tabs2 { margin-top: 20px; }
/* only the meeting list / recordings list scrolls — the header, tabs and search stay fixed */
.app-main #meetingList, .app-main #recList { flex: 1; min-height: 0; overflow-y: auto; overflow-x: auto; margin: 0 28px; padding-bottom: 24px; }
.mtable thead th { position: sticky; top: 0; z-index: 3; }
@media (max-width: 720px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: static; flex-direction: row; align-items: center; padding: 8px 14px; }
  .sb-brand { padding: 0 10px 0 0; border: none; font-size: 1rem; }
  .sb-nav { flex-direction: row; flex: 1; justify-content: center; overflow: visible; padding: 0; }
  .sb-nav a { border-left: none; border-radius: 8px; padding: 8px 12px; }
  .sb-nav a span { display: none; }
  .sb-foot { border: none; padding: 0; flex-direction: row; align-items: center; }
  .sb-user span, .sb-user { font-size: 0; }
  .app-main { border-top: none; }
  .app-head, .app-main > :not(.app-head), .app-main #meetingList, .app-main .tabs2, .app-main .list-controls, .app-main #recList, .app-main #emptyState, .app-main > p { margin-left: 14px; margin-right: 14px; padding-left: 0; padding-right: 0; }
  .app-head { padding: 14px; }
}

/* Top nav (admin / recordings pages) */
.topnav { display: flex; align-items: center; gap: 16px; padding: 14px 22px; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
.topnav h1 { font-size: 1.1rem; margin: 0; }
.topnav .spacer { flex: 1; }
.topnav a { text-decoration: none; color: var(--muted); font-weight: 500; padding: 6px 10px; border-radius: 8px; }
.topnav a.active, .topnav a:hover { color: var(--accent); background: var(--accent-soft); }

/* Join */
.join { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.join-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.join-card h1 { margin: 0; }
.login-logo { height: 38px; width: auto; object-fit: contain; align-self: flex-start; margin-bottom: 4px; }
.join-card label { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; }
.role-toggle { display: flex; gap: 10px; }
.role-toggle button { flex: 1; display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; color: var(--text); }
.role-toggle button span { font-size: 0.72rem; color: var(--muted); }
.role-toggle button.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.join-meta { font-size: 0.82rem; color: var(--muted); background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.join-links { display: flex; gap: 14px; justify-content: center; font-size: 0.85rem; }

/* ---- Portal join popup ---- */
.portal-gate { background: linear-gradient(160deg, #e9f2fb 0%, #f5f8fa 55%); }
.portal-card { width: 100%; max-width: 432px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 28px 30px 20px; box-shadow: 0 24px 70px rgba(15,23,42,0.14); display: flex; flex-direction: column; gap: 16px; }
.portal-brand { display: flex; }
.portal-logo { height: 32px; width: auto; object-fit: contain; }
.portal-meeting { display: flex; gap: 13px; align-items: center; background: var(--accent-soft); border: 1px solid #d3e8fa; border-radius: 13px; padding: 13px 14px; }
.portal-meeting.hidden { display: none; }
.pm-icon { width: 42px; height: 42px; flex-shrink: 0; border-radius: 11px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.pm-text h1 { margin: 0; font-size: 1.1rem; color: var(--navy); }
.pm-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pm-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 0.7rem; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: #fff; border: 1px solid var(--border); color: var(--muted); }
.pm-badge.b-meeting { color: var(--accent-2); border-color: #bfe2fa; }
.pm-badge.b-webinar { color: #7c3aed; border-color: #e2d4fb; }
.pm-badge.b-lock { color: #b45309; border-color: #fde68a; }
.portal-form { display: flex; flex-direction: column; gap: 12px; }
.portal-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; font-weight: 500; color: var(--text); }
.portal-form label span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; }
.portal-form input { padding: 11px 12px; border: 1px solid var(--border); border-radius: 9px; font-size: 0.92rem; font-family: inherit; background: var(--surface); color: var(--text); }
.portal-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.portal-form .primary { justify-content: center; margin-top: 4px; padding: 12px; }
#hostBox { display: flex; flex-direction: column; gap: 10px; }
#hostBox .primary { justify-content: center; padding: 12px; }
.host-note { display: flex; align-items: center; gap: 8px; background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; font-size: 0.82rem; padding: 10px 12px; border-radius: 9px; }
.portal-foot { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 0.74rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: 12px; }
.portal-foot i { color: #16a34a; font-size: 0.95rem; }
.gate-ended { text-align: center; padding: 12px 6px 4px; }
.gate-ended.hidden { display: none; }
.gate-ended .ge-icon { font-size: 46px; line-height: 1; color: var(--accent); }
.gate-ended h2 { margin: 8px 0 6px; color: var(--navy); }

/* Call layout */
.call { display: grid; grid-template-columns: 1fr 340px; height: 100vh; }
.call-main { display: flex; flex-direction: column; min-width: 0; background: #0d1117; }
.stage { flex: 1; min-height: 0; display: grid; gap: 8px; padding: 8px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-content: center; overflow: auto; }
.stage-empty { grid-column: 1/-1; display: grid; place-items: center; color: #aab2c5; height: 100%; }
.tile { position: relative; background: #000; border: 1px solid #222a38; border-radius: 10px; overflow: hidden; aspect-ratio: 16/9; }
.tile video { width: 100%; height: 100%; object-fit: cover; }
.tile-label { position: absolute; left: 8px; bottom: 8px; background: rgba(0,0,0,0.6); color: #fff; padding: 2px 8px; border-radius: 6px; font-size: 0.8rem; }

/* Toolbar */
.toolbar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--surface); border-top: 1px solid var(--border); }
.toolbar-controls { display: flex; gap: 8px; }
.toolbar-controls.viewer .publisher-only { display: none; }
.ctrl, .leave { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 8px 12px; }
.ctrl:hover { background: var(--accent-soft); }
.ctrl.off { border-color: var(--danger); color: var(--danger); background: #fdeaeb; }
.ctrl.rec-on { border-color: var(--danger); color: #fff; background: var(--danger); }
.leave { background: var(--danger); color: #fff; border: none; margin-left: auto; }
.status { margin-left: auto; color: var(--muted); }

/* Side panel */
.side { display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--border); min-height: 0; position: relative; }
.tabs { display: flex; border-bottom: 1px solid var(--border); }
.tab { flex: 1; background: transparent; border: none; color: var(--muted); padding: 12px 4px; border-bottom: 2px solid transparent; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab.hidden { display: none; }
.tabpane { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.messages, .qa-list { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.msg { font-size: 0.9rem; line-height: 1.35; }
.msg-from { color: var(--accent); font-weight: 600; }
.composer { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.composer input { flex: 1; }
.composer button { background: var(--accent-2); border: none; color: #fff; border-radius: 8px; padding: 0 14px; }
.composer button:hover { background: var(--accent); }

/* Q&A */
.qa-item { display: flex; align-items: flex-start; gap: 8px; background: var(--surface-2); border-radius: 8px; padding: 8px; }
.qa-item.answered { opacity: 0.55; }
.vote { background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 4px 6px; font-size: 0.8rem; white-space: nowrap; }
.qa-text { display: flex; flex-direction: column; flex: 1; font-size: 0.88rem; }
.qa-from { color: var(--accent); font-size: 0.75rem; }
.answered-btn { background: var(--ok); border: none; color: #fff; border-radius: 6px; padding: 4px 8px; }

/* Polls */
#pollArea { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.poll-create { display: flex; flex-direction: column; gap: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.poll-create label { display: flex; flex-direction: column; gap: 5px; font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.poll-create::before { content: '📊 Create a poll'; font-weight: 700; font-size: 0.95rem; color: var(--text); }
#pollArea > button { background: var(--accent-2); border: none; color: #fff; border-radius: 9px; padding: 11px; font-weight: 600; }
#pollArea > button:hover { background: var(--accent); }
.poll-question { margin: 0 0 2px; font-size: 1.05rem; }
.poll-options { display: flex; flex-direction: column; gap: 9px; }
.poll-option {
  position: relative; text-align: left; background: var(--surface) !important;
  border: 1.5px solid var(--border); border-radius: 10px; padding: 12px 14px;
  color: var(--text) !important; overflow: hidden; font-size: 0.92rem; transition: border-color .15s;
}
.poll-option:not(:disabled):hover { border-color: var(--accent); }
.poll-option:disabled { cursor: default; }
.poll-bar { position: absolute; inset: 0 auto 0 0; background: var(--accent-soft); transition: width 0.4s ease; }
.poll-label { position: relative; display: flex; justify-content: space-between; gap: 8px; }
.poll-label em { font-style: normal; font-weight: 700; color: var(--accent-2); }

/* Reactions */
.reaction-bar { display: flex; justify-content: center; gap: 4px; padding: 8px; border-top: 1px solid var(--border); }
.reaction-bar.hidden { display: none; }
.reaction-bar button { background: transparent; border: none; font-size: 1.2rem; }
.reaction-floats { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.float { position: absolute; bottom: 60px; font-size: 1.6rem; animation: floatUp 2.5s ease-out forwards; }
@keyframes floatUp {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  15% { opacity: 1; transform: translateY(-20px) scale(1.1); }
  100% { transform: translateY(-220px) scale(1); opacity: 0; }
}

/* Admin + recordings pages share a centered content column */
.page { max-width: 760px; margin: 0 auto; padding: 28px 20px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card h2 { margin-top: 0; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label { font-weight: 600; font-size: 0.9rem; }
.field .hint { font-size: 0.78rem; color: var(--muted); }
.seg { display: flex; gap: 10px; }
.seg button { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px; color: var(--text); text-align: left; }
.seg button b { display: block; }
.seg button span { font-size: 0.78rem; color: var(--muted); }
.seg button.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.check input { width: 18px; height: 18px; }
.row { display: flex; gap: 12px; align-items: center; }
.toast { padding: 10px 14px; border-radius: 8px; font-size: 0.88rem; }
.toast.ok { background: #e6f6ee; color: var(--ok); }
.toast.err { background: #fdeaeb; color: var(--danger); }

/* Dashboard tabs + rows */
.row.between { display: flex; align-items: center; justify-content: space-between; }
.tabs2 { display: inline-flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 10px; margin: 16px 0; }
.tabs2 button { background: transparent; border: none; padding: 8px 18px; border-radius: 8px; color: var(--muted); font-weight: 600; }
.tabs2 button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.mcard { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow); }
.mcard .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mcard h3 { margin: 0 0 4px; }
.mcard .badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 0.72rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.pill i { font-size: 0.95rem; line-height: 1; }
.pill.brand { background: var(--accent-soft); color: var(--accent-2); }
.mcard .actions { display: flex; gap: 8px; align-items: center; position: relative; }
.icon-btn { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; color: var(--text); display: inline-flex; align-items: center; justify-content: center; }
.icon-btn i { font-size: 1rem; line-height: 1; }
.kebab-menu { position: absolute; top: 42px; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; min-width: 210px; z-index: 20; }
.kebab-menu.hidden { display: none; }
.kebab-menu button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: transparent; border: none; padding: 9px 12px; border-radius: 7px; font-size: 0.88rem; color: var(--text); }
.kebab-menu button i { font-size: 1.05rem; color: var(--muted); width: 18px; text-align: center; }
.kebab-menu button.danger i { color: var(--danger); }
.kebab-menu button:hover { background: var(--surface-2); }
.kebab-menu button.danger { color: var(--danger); }
.kebab-menu .sep { height: 1px; background: var(--border); margin: 4px 2px; }
.share-row { display: flex; gap: 8px; margin-top: 12px; }
.share-row input { flex: 1; }

/* List controls (search + page size) */
.list-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.list-controls .spacer { flex: 1; }
.search-input { width: 320px; max-width: 100%; }
.pagesize { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--muted); }
.pagesize select { padding: 8px 10px; }

/* Meetings table */
.mtable { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.mtable th.sortable { cursor: pointer; user-select: none; }
.mtable th.sortable:hover { color: var(--accent); }
.mtable th .arr { color: var(--accent); }
.mtable th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--border); background: #f8fafc; }
.mtable td { padding: 12px 16px; border-bottom: 1px solid #f1f5f9; font-size: 13px; vertical-align: middle; }
.mtable tr:last-child td { border-bottom: none; }
.mtable tbody tr:hover td { background: #f8fbfe; }
.mt-title { display: block; font-weight: 600; color: #1e293b; }
.mt-title { display: block; }
.mt-actions { position: relative; white-space: nowrap; text-align: right; }
.mt-actions .sm { padding: 6px 10px; font-size: 0.82rem; border-radius: 8px; margin-left: 6px; }
.icon-btn.sm { padding: 6px 9px; }
.icon-btn.sm.rec { position: relative; color: var(--accent-2); }
.rec-badge { position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.62rem; font-weight: 700; display: grid; place-items: center; }
.primary.sm { background: var(--accent-2); color: #fff; border: none; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 16px; font-size: 0.88rem; color: var(--muted); }
.pager .ghost { padding: 8px 14px; }
.pager .ghost:disabled { opacity: 0.4; cursor: default; }
@media (max-width: 640px) {
  .mtable th:nth-child(3), .mtable td:nth-child(3),
  .mtable th:nth-child(5), .mtable td:nth-child(5) { display: none; }
}

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(20,28,46,0.45); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal-overlay.hidden { display: none; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 480px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); max-height: 90vh; display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; }
.modal-head .x { background: transparent; border: none; font-size: 1.2rem; color: var(--muted); }
.modal-body { padding: 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: space-between; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); }
.seg.vertical { flex-direction: column; }
.ghost { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 11px 18px; color: var(--text); }

/* Single meeting detail modal */
.detail-modal { max-width: 640px; }
.detail-tabs { display: flex; gap: 4px; padding: 10px 18px 0; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.detail-tabs button { display: inline-flex; align-items: center; gap: 7px; background: transparent; border: none; border-bottom: 2px solid transparent; padding: 10px 14px; margin-bottom: -1px; color: var(--muted); font-weight: 600; font-size: 0.9rem; cursor: pointer; }
.detail-tabs button i { font-size: 1.05rem; }
.detail-tabs button:hover { color: var(--text); }
.detail-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.detail-body { flex: 1; min-height: 0; }
.detail-body [data-dpane][hidden] { display: none; }
#dSettings { display: flex; flex-direction: column; gap: 14px; }
#dSettings[hidden], #dParticipants[hidden], #dRecordings[hidden] { display: none; }
.completed-notice { display: flex; align-items: center; gap: 8px; background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; font-size: 0.85rem; padding: 10px 12px; border-radius: 9px; }
.completed-notice.hidden { display: none; }
#dSettings.locked { opacity: 0.75; }
.mt-link { cursor: pointer; }
.mt-link:hover { color: var(--accent); text-decoration: underline; }

/* meeting detail PAGE (meeting.html) */
.dh-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.dh-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.back-link { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.85rem; padding: 7px 11px; border: 1px solid var(--border); border-radius: 8px; flex-shrink: 0; }
.back-link:hover { color: var(--accent); border-color: var(--accent); }
.app-main > .detail-tabs { margin: 0 28px; padding: 12px 0 0; }
.detail-page-body { flex: 1; min-height: 0; overflow-y: auto; margin: 0 28px; padding: 18px 0 24px; }
.detail-page-body > [data-dpane] { display: block; }
.detail-page-body > [data-dpane][hidden] { display: none; }
.detail-foot { flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 14px 28px; border-top: 1px solid var(--border); background: var(--surface); }
/* proper bordered tables inside the detail page + a horizontal scroll wrapper */
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.table-wrap .mtable { margin: 0; }
.table-wrap .mtable th { background: #f8fafc; }
.src-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 0.7rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.src-pill i { font-size: 0.9rem; }
.src-pill.src-csv { background: #eef2ff; color: #4338ca; }
.src-pill.src-join { background: #ecfdf5; color: #047857; }

/* Developer Docs page */
.dev-layout { flex: 1; min-height: 0; display: flex; overflow: hidden; }
.dev-nav { width: 180px; flex-shrink: 0; border-right: 1px solid var(--border); padding: 18px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.dev-nav a { padding: 8px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 0.86rem; font-weight: 500; }
.dev-nav a:hover { background: var(--surface-2); color: var(--text); }
.dev-nav a.active { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }
.dev-content { flex: 1; min-width: 0; overflow-y: auto; padding: 22px 28px 60px; }
.dev-sec { padding: 14px 0 26px; border-bottom: 1px solid var(--border); scroll-margin-top: 12px; }
.dev-sec h2 { margin: 0 0 10px; }
.dev-sec h3 { margin: 18px 0 8px; font-size: 0.95rem; }
.dev-sec code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-size: 0.85em; }
.code { background: #0f172a; color: #e2e8f0; padding: 14px 16px; border-radius: 10px; overflow-x: auto; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.8rem; line-height: 1.5; white-space: pre; }
.callout { display: flex; gap: 8px; align-items: flex-start; background: var(--accent-soft); border: 1px solid #d3e8fa; color: var(--navy); padding: 12px 14px; border-radius: 10px; font-size: 0.88rem; }
.callout i { color: var(--accent); font-size: 1.1rem; }
.pg-row { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.pg-row select, .pg-row input { padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; font: inherit; }
.pg-row #pgPath { flex: 1; min-width: 180px; }
#pgBody { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 10px; font-family: ui-monospace, monospace; font-size: 0.82rem; }
.pg-resp { margin-top: 10px; }
.pg-status { font-weight: 700; font-size: 0.85rem; margin-bottom: 6px; }
.pg-status.ok { color: #047857; } .pg-status.err { color: #b91c1c; }
.method { font-weight: 700; font-size: 0.72rem; padding: 2px 7px; border-radius: 6px; color: #fff; }
.m-get { background: #047857; } .m-post { background: #2563eb; } .m-put { background: #b45309; } .m-delete { background: #b91c1c; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; font-size: 0.78rem; }

/* Developer Docs — responsive: stack the side-nav into a scrollable tab bar */
@media (max-width: 860px) {
  .dev-layout { flex-direction: column; }
  .dev-nav { width: auto; flex-direction: row; flex-shrink: 0; overflow-x: auto; gap: 4px; padding: 8px 10px; border-right: none; border-bottom: 1px solid var(--border); }
  .dev-nav a { white-space: nowrap; flex: 0 0 auto; }
  .dev-content { padding: 16px 16px 50px; }
  .app-head { flex-wrap: wrap; }
  .dh-actions { flex-wrap: wrap; }
  .pg-row { flex-direction: column; align-items: stretch; }
  .pg-row select, .pg-row input, .pg-row button { width: 100%; }
}

/* VC Settings page */
.settings-page { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 28px 60px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-content: start; align-items: start; }
.vc-card.vc-wide { grid-column: 1 / -1; } /* the long section gets its own full-width row */
@media (max-width: 900px) { .settings-page { grid-template-columns: 1fr; } }
.vc-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; }
.vc-card h2 { margin: 0 0 14px; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.vc-card h2 i { color: var(--accent); }
.vc-grid { display: flex; flex-direction: column; gap: 16px; }
.vc-row { display: flex; flex-direction: column; gap: 3px; }
.vc-desc { font-size: 0.78rem; color: var(--muted); line-height: 1.35; }
.vc-check + .vc-desc { margin-left: 26px; }
.vc-field { display: flex; flex-direction: column; gap: 5px; font-size: 0.85rem; }
.vc-field span { color: var(--muted); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.vc-field input, .vc-field select { padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; font: inherit; background: var(--surface); }
.vc-field input[type=color] { padding: 2px; height: 38px; width: 60px; }
.vc-check { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; }
.vc-check .src-pill { margin-left: auto; }
.vc-row { display: flex; flex-direction: column; gap: 3px; }
.vc-desc { font-size: 0.76rem; color: var(--muted); line-height: 1.35; }
.vc-field .vc-desc { margin-top: 2px; }
.vc-note { font-size: 0.82rem; color: var(--muted); background: var(--surface-2); border-radius: 8px; padding: 10px 12px; margin: 0; line-height: 1.45; }

/* Attendance table */
.att-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin-top: 10px; }
.att-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.att-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.attbar { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 4px 0; max-width: 160px; }
.attbar span { display: block; height: 100%; background: var(--accent); }

/* Recordings list */
.rec { display: flex; gap: 16px; align-items: center; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); margin-bottom: 12px; }
.rec video { width: 220px; border-radius: 8px; background: #000; }
.rec-info { flex: 1; }
.rec-info h3 { margin: 0 0 4px; font-size: 1rem; }
.rec-info .meta { font-size: 0.8rem; color: var(--muted); }
.rec .del { background: var(--surface-2); border: 1px solid var(--border); color: var(--danger); border-radius: 8px; padding: 8px 10px; }
.empty-state { text-align: center; color: var(--muted); padding: 40px; }

@media (max-width: 760px) {
  .call { grid-template-columns: 1fr; grid-template-rows: 1fr 45vh; }
  .side { border-left: none; border-top: 1px solid var(--border); }
  .checks { grid-template-columns: 1fr; }
  .rec { flex-direction: column; align-items: stretch; }
  .rec video { width: 100%; }
}
