:root {
  --sidebar-w: 220px;
  --header-h: 56px;
  --bg: #f1f5f9;
  --sidebar: #ffffff;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --live: #16a34a;
  --warn: #ea580c;
  --danger: #dc2626;
  --border: #e2e8f0;
  --banner: linear-gradient(90deg, #fce7f3 0%, #fbcfe8 100%);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 1rem 0;
  flex-shrink: 0;
}
.sidebar .brand {
  padding: 0 1.1rem 1rem;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--accent);
}
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .65rem 1.1rem;
  color: var(--text);
  text-decoration: none;
  font-size: .92rem;
  border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: #f8fafc; }
.sidebar nav a.active {
  background: var(--accent-soft);
  border-left-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--header-h);
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  gap: 1rem;
}
.topbar h1 { margin: 0; font-size: 1.05rem; flex: 1; }
.topbar .who { opacity: .9; font-size: .88rem; }
.topbar button {
  border: 1px solid rgba(255,255,255,.35);
  background: transparent;
  color: #fff;
  border-radius: 8px;
  padding: .4rem .75rem;
  cursor: pointer;
  font-weight: 600;
}
.content { padding: 1.25rem; overflow: auto; }
.welcome {
  background: var(--banner);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  gap: .75rem;
  align-items: center;
}
.welcome strong { font-size: 1.05rem; }
.tz-bar {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: .75rem 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  font-size: .88rem;
}
.tz-bar select {
  margin-left: auto;
  padding: .4rem .6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.stat {
  background: var(--card);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.stat .label { color: var(--muted); font-size: .8rem; }
.stat .value { font-size: 1.75rem; font-weight: 800; margin-top: .25rem; }
.card {
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.card h2 { margin: 0 0 .75rem; font-size: 1rem; }
.card .sub { color: var(--muted); font-size: .85rem; margin: -.35rem 0 .85rem; }
table.sessions {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
table.sessions th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  padding: .5rem .4rem;
  border-bottom: 1px solid var(--border);
}
table.sessions td {
  padding: .65rem .4rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.badge {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: lowercase;
}
.badge.scheduled { background: #dbeafe; color: #1d4ed8; }
.badge.live { background: #dcfce7; color: #15803d; }
.badge.completed { background: #e2e8f0; color: #475569; }
.badge.canceled { background: #fee2e2; color: #b91c1c; }
.btn {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: .45rem .7rem;
  font-weight: 600;
  font-size: .8rem;
  text-decoration: none;
  display: inline-block;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.ghost { background: #f8fafc; color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: #fee2e2; color: var(--danger); }
.btn.success { background: #dcfce7; color: #15803d; }
.actions { display: flex; flex-wrap: wrap; gap: .35rem; }
label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: .3rem; }
input, select, textarea {
  width: 100%;
  padding: .5rem .65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: .75rem;
  font: inherit;
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 700px) { .row2 { grid-template-columns: 1fr; } .sidebar { display: none; } }
.login-wrap { max-width: 400px; margin: 4rem auto; padding: 0 1rem; }
.login-wrap .card { margin: 0; }
.hidden { display: none !important; }
.err { color: var(--danger); font-size: .85rem; }
.ok { color: var(--live); font-size: .85rem; }

/* ----- Compact schedule modal ----- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: modal-fade-in .18s ease-out;
}
@keyframes modal-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.schedule-modal {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow:
    0 24px 48px rgba(15, 23, 42, .18),
    0 0 0 1px rgba(255, 255, 255, .6) inset;
  overflow: hidden;
  animation: modal-slide-up .22s ease-out;
}
@keyframes modal-slide-up {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.schedule-modal__head {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: 1rem 1.1rem .85rem;
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 55%, #fdf4ff 100%);
  border-bottom: 1px solid var(--border);
}
.schedule-modal__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .35);
}
.schedule-modal__head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.schedule-modal__head p {
  margin: .2rem 0 0;
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.35;
}
.schedule-modal__close {
  margin-left: auto;
  border: none;
  background: rgba(255, 255, 255, .7);
  color: var(--muted);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
}
.schedule-modal__close:hover {
  background: #fff;
  color: var(--text);
}
.schedule-modal__body {
  padding: .9rem 1.1rem .25rem;
}
.schedule-form .field {
  margin-bottom: .65rem;
}
.schedule-form .field label {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: .25rem;
}
.schedule-form input,
.schedule-form select {
  margin-bottom: 0;
  padding: .45rem .55rem;
  font-size: .88rem;
  border-radius: 8px;
  background: #f8fafc;
}
.schedule-form input:focus,
.schedule-form select:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .15);
  background: #fff;
}
.schedule-form .row-title {
  display: grid;
  grid-template-columns: 1fr 88px;
  gap: .5rem;
}
.schedule-form .row-time {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
}
.schedule-form .tz-row {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-bottom: .65rem;
}
.schedule-form .tz-row label {
  margin: 0;
  flex-shrink: 0;
}
.schedule-form .tz-row select {
  flex: 1;
  font-size: .8rem;
}
.duration-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .35rem;
}
.duration-chips button {
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 600;
  padding: .25rem .55rem;
  border-radius: 999px;
  cursor: pointer;
}
.duration-chips button:hover,
.duration-chips button.active {
  border-color: #93c5fd;
  background: var(--accent-soft);
  color: var(--accent);
}
.schedule-form select[multiple] {
  min-height: 72px;
  font-size: .82rem;
}
.schedule-form .hint {
  font-size: .7rem;
  color: var(--muted);
  margin: .25rem 0 0;
}
.schedule-modal__foot {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.1rem 1rem;
  border-top: 1px solid #f1f5f9;
  background: #fafbfc;
}
.schedule-modal__foot .msg {
  flex: 1;
  font-size: .78rem;
  min-height: 1.1em;
}
.schedule-modal__foot .msg.ok { color: var(--live); }
.schedule-modal__foot .msg.err { color: var(--danger); }
.schedule-modal__foot .btns {
  display: flex;
  gap: .4rem;
  flex-shrink: 0;
}
.schedule-modal__foot .btn {
  padding: .5rem .95rem;
  font-size: .82rem;
}
.btn-create {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 2px 8px rgba(37, 99, 235, .35);
}
.btn-create:hover { filter: brightness(1.05); }
.card-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .75rem;
}
.card-head-row h2 { margin: 0; }
.card-head-row .sub { margin: 0; }

/* ===========================================================
 * Matte frosted-glass button treatment (LMS dashboards)
 * ===========================================================
 * Mirrors the whiteboard's matte-glass look: subtle vertical
 * gradient + light backdrop blur + thin hairline border + soft
 * inner highlight + grounded shadow. Applied to every shared
 * `.btn` (and its colour variants), the duration chips, the
 * topbar icon button, and the schedule modal's primary CTA.
 * Sits at the END of the sheet so it cascades over the simpler
 * solid-fill rules earlier in the file.
 * =========================================================== */

.btn,
.duration-chips button,
.topbar button,
.btn-create {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .65) 0%,
                            rgba(255, 255, 255, .30) 55%,
                            rgba(255, 255, 255, .15) 100%),
    rgba(248, 250, 252, .55);
  border: 1px solid rgba(15, 23, 42, .14);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .60),
    0 1px 2px rgba(15, 23, 42, .04),
    0 4px 12px rgba(15, 23, 42, .06);
  color: var(--text);
  transition: background .14s ease, border-color .14s ease,
              transform .14s ease, box-shadow .14s ease;
}

.btn:hover,
.duration-chips button:hover,
.topbar button:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .78) 0%,
                            rgba(255, 255, 255, .40) 55%,
                            rgba(255, 255, 255, .22) 100%),
    rgba(248, 250, 252, .70);
}

.btn:active,
.duration-chips button:active,
.topbar button:active,
.btn-create:active {
  transform: translateY(1px);
}

/* Primary, danger, success — use a translucent tinted overlay so
 * the matte glass survives. The hue identifies the action; the
 * gradient + border still read as one frosted family. */
.btn.primary {
  background:
    linear-gradient(180deg, rgba(59, 130, 246, .92) 0%,
                            rgba(37, 99, 235, .92) 100%);
  color: #ffffff;
  border-color: rgba(37, 99, 235, .92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .35),
    0 1px 2px rgba(37, 99, 235, .14),
    0 6px 16px rgba(37, 99, 235, .26);
}
.btn.primary:hover {
  background:
    linear-gradient(180deg, rgba(96, 165, 250, .96) 0%,
                            rgba(59, 130, 246, .96) 100%);
}

.btn.ghost {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .70) 0%,
                            rgba(255, 255, 255, .35) 55%,
                            rgba(255, 255, 255, .18) 100%),
    rgba(248, 250, 252, .55);
  color: var(--text);
  border-color: rgba(15, 23, 42, .14);
}
.btn.ghost:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .85) 0%,
                            rgba(255, 255, 255, .50) 55%,
                            rgba(255, 255, 255, .28) 100%),
    rgba(248, 250, 252, .75);
}

.btn.danger {
  background:
    linear-gradient(180deg, rgba(254, 226, 226, .92) 0%,
                            rgba(252, 165, 165, .55) 100%);
  color: var(--danger);
  border-color: rgba(220, 38, 38, .35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .55),
    0 1px 2px rgba(220, 38, 38, .10),
    0 4px 12px rgba(220, 38, 38, .12);
}
.btn.danger:hover {
  background:
    linear-gradient(180deg, rgba(254, 226, 226, 1) 0%,
                            rgba(252, 165, 165, .68) 100%);
}

.btn.success {
  background:
    linear-gradient(180deg, rgba(220, 252, 231, .92) 0%,
                            rgba(134, 239, 172, .55) 100%);
  color: #15803d;
  border-color: rgba(22, 163, 74, .35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .55),
    0 1px 2px rgba(22, 163, 74, .10),
    0 4px 12px rgba(22, 163, 74, .12);
}
.btn.success:hover {
  background:
    linear-gradient(180deg, rgba(220, 252, 231, 1) 0%,
                            rgba(134, 239, 172, .68) 100%);
}

/* Duration chip's "active" state — accent overlay on top of the
 * matte base. The earlier rule used a flat `accent-soft` fill; we
 * keep the colour identity and add the gradient + glow. */
.duration-chips button.active {
  background:
    linear-gradient(180deg, rgba(59, 130, 246, .22) 0%,
                            rgba(59, 130, 246, .08) 100%),
    rgba(255, 255, 255, .55);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .55),
    0 0 0 2px rgba(59, 130, 246, .14);
}

/* Schedule modal's "Create" CTA — keep the accent gradient but add
 * the same blur + inner highlight family used everywhere else. */
.btn-create {
  background:
    linear-gradient(180deg, rgba(59, 130, 246, .94) 0%,
                            rgba(37, 99, 235, .94) 100%);
  color: #ffffff;
  border-color: rgba(37, 99, 235, .94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .35),
    0 6px 18px rgba(37, 99, 235, .32);
}
.btn-create:hover {
  background:
    linear-gradient(180deg, rgba(96, 165, 250, .98) 0%,
                            rgba(59, 130, 246, .98) 100%);
  filter: none;
}

/* Topbar icon button (white-on-accent) — keep the white text and
 * subtle outline against the coloured topbar. The matte gradient
 * still applies but stays bright since the topbar is dark. */
.topbar button {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .22) 0%,
                            rgba(255, 255, 255, .10) 55%,
                            rgba(255, 255, 255, .05) 100%);
  border-color: rgba(255, 255, 255, .35);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .25),
    0 1px 3px rgba(0, 0, 0, .12);
}
.topbar button:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .32) 0%,
                            rgba(255, 255, 255, .16) 55%,
                            rgba(255, 255, 255, .08) 100%);
}
