:root {
  --red: #CB2026;
  --text: #212529;
  --text-muted: #4D4D4D;
  --border: #C0C0C0;
  --card: rgba(252, 252, 252, 0.95);
  --green: #2E9E5B;
  --pink: #E0457B;
  --blue: #2D7FF9;
  --sidebar-w: 252px;
  --offset: var(--sidebar-w); /* left edge of navbar/content; 0 when sidebar is a drawer */
  --nav-h: 111px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100vh;
  background: #F6F6F8;
  color: var(--text);
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Background ---------- */
.bg {
  position: fixed; inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(40% 50% at 90% 6%,  rgba(203, 32, 38, .16), transparent 70%),
    radial-gradient(45% 55% at 24% 90%, rgba(124, 92, 255, .16), transparent 70%),
    radial-gradient(36% 46% at 74% 94%, rgba(45, 127, 249, .14), transparent 70%),
    radial-gradient(32% 42% at 40% 10%, rgba(242, 153, 74, .12), transparent 70%),
    #F5F5F8;
}
.bg::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(33, 37, 41, .09) 1px, transparent 1.3px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .35) 100%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .35) 100%);
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0;
  width: var(--sidebar-w);
  z-index: 40;
  display: flex; flex-direction: column; align-items: center;
  padding: 42px 20px 26px;
  background: rgba(255, 255, 255, 0.9);
  border-right: 2px solid var(--border);
  overflow-x: hidden; overflow-y: auto;
}
.sidebar > * { position: relative; z-index: 1; }
.sidebar .deco { position: absolute; z-index: 0; pointer-events: none; }
.deco-red    { top: 22px; right: -26px; width: 150px; transform: rotate(-16deg); opacity: .55; }
.deco-red-2  { top: 262px; left: -30px; width: 96px; transform: rotate(10deg); opacity: .4; }
.deco-orange { bottom: 150px; left: -18px; width: 180px; transform: rotate(6deg); opacity: .5; }

.avatar {
  flex: none;
  width: 165px; height: 165px;
  border-radius: 50%;
  border: 10px solid #E6E6E6;
  overflow: hidden;
  background: #F1EFF4;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .06);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.student-name {
  margin: 18px 0 8px;
  font-size: 15px; font-weight: 700;
  text-align: center; color: var(--text);
}
.student-meta {
  margin: 0;
  font-size: 13px; line-height: 1.55;
  text-align: center; color: var(--text-muted);
}

.side-links {
  list-style: none;
  width: 100%; max-width: 196px;
  margin: 34px 0 0; padding: 0;
  display: grid; gap: 4px;
}
.side-links a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px; font-weight: 700;
  color: var(--text-muted);
  transition: background .15s, color .15s;
}
.side-links a:hover { background: rgba(203, 32, 38, .06); color: var(--red); }
.side-links svg { width: 22px; height: 22px; flex: none; }
.badge {
  margin-left: auto;
  min-width: 24px; height: 20px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  background: var(--red); color: #fff;
  font-size: 11.5px; font-weight: 700;
}

.logo-wrap { margin-top: auto; padding-top: 32px; }
.logo-wrap img { width: 100px; height: auto; display: block; }
.logo-wrap.no-logo img { display: none; }
.logo-wrap.no-logo::after {
  content: "logo.png";
  display: grid; place-items: center;
  width: 100px; height: 100px;
  border: 2px dashed var(--border); border-radius: 14px;
  font-size: 12px; color: #9A9A9A;
}

/* ---------- Top navbar ---------- */
.topbar {
  position: fixed; top: 0; right: 0; left: var(--offset);
  height: var(--nav-h);
  z-index: 30;
  display: flex; align-items: center; gap: 24px;
  padding: 0 40px;
  background: rgba(251, 251, 251, 0.85);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(192, 192, 192, .35);
}

.menu-btn {
  display: none; place-items: center;
  width: 40px; height: 40px; flex: none;
  border: 0; border-radius: 12px;
  background: transparent; color: var(--text-muted);
  cursor: pointer;
}
.menu-btn:hover { background: rgba(0, 0, 0, .05); }
.menu-btn svg { width: 24px; height: 24px; }

.main-nav { display: flex; align-items: center; gap: 52px; }
.main-nav a {
  display: flex; align-items: center; gap: 12px;
  font-size: 16px; font-weight: 800;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color .15s;
}
.main-nav a:hover { color: var(--text); }
.main-nav svg { width: 30px; height: 30px; flex: none; transition: transform .2s; }
.main-nav a:hover svg { transform: translateY(-2px); }
.ic-green { color: var(--green); }
.ic-pink  { color: var(--pink); }
.ic-blue  { color: var(--blue); }

.top-right { margin-left: auto; display: flex; align-items: center; gap: 26px; }

.lang { display: flex; align-items: center; font-size: 14px; font-weight: 700; color: #A3A3A3; }
.lang button {
  padding: 4px 3px;
  border: 0; background: none;
  color: inherit; letter-spacing: .02em;
  cursor: pointer;
}
.lang button:hover { color: var(--text-muted); }
.lang button[aria-pressed="true"] { color: var(--text); }

.bell {
  position: relative;
  padding: 6px;
  border: 0; border-radius: 50%;
  background: none; color: var(--text-muted);
  cursor: pointer;
}
.bell:hover { background: rgba(0, 0, 0, .05); }
.bell svg { width: 24px; height: 24px; }
.bell .dot {
  position: absolute; top: 5px; right: 6px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid #FBFBFB;
}
.bell.read .dot { display: none; }

.top-avatar {
  flex: none;
  width: 55px; height: 55px;
  border-radius: 50%;
  border: 3px solid #E6E6E6;
  overflow: hidden;
}
.top-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Content ---------- */
.content {
  position: relative; z-index: 1;
  min-height: 100vh;
  margin-left: var(--offset);
  padding: calc(var(--nav-h) + 26px) 40px 56px;
}

.crumb-row { display: flex; justify-content: flex-end; }
.breadcrumb {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 186px; height: 40px; padding: 0 20px;
  border-radius: 15px;
  background: var(--red); color: #fff;
  font-size: 14px;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb [aria-current] { font-weight: 700; }

.page-title {
  margin: 14px 0 22px;
  text-align: center;
  font-size: 30px; font-weight: 700;
  color: var(--text);
}

.table-wrap { overflow-x: auto; margin: 0 -6px; padding: 0 6px 8px; }

.schedule {
  width: 100%; min-width: 900px;
  border-collapse: separate;
  border-spacing: 0 7.5px;
}
.schedule tr { filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .07)); }
.schedule th,
.schedule td {
  background: var(--card);
  padding: 14.5px 10px;
  text-align: left;
  vertical-align: middle;
}
.schedule th:first-child,
.schedule td:first-child { padding-left: 45px; border-radius: 20px 0 0 20px; }
.schedule th:last-child,
.schedule td:last-child { border-radius: 0 20px 20px 0; }
.schedule th { font-size: 16.6px; font-weight: 700; color: #212529; white-space: nowrap; }
.schedule td { font-size: 13.5px; color: var(--text-muted); transition: background .15s; }
.schedule .center { text-align: center; }
.schedule .nowrap { white-space: nowrap; }
.schedule tbody tr:hover td { background: #fff; }
.schedule tbody tr:hover td:first-child { box-shadow: inset 4px 0 0 var(--red); }
.remote { color: var(--red); }

.icon-btn {
  width: 32px; height: 32px; margin: -8px 0;
  display: inline-grid; place-items: center;
  border: 0; border-radius: 50%;
  background: transparent; color: #8F8F8F;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { color: var(--red); background: rgba(203, 32, 38, .08); }

.empty { text-align: center; padding: 28px 10px; }

/* ---------- Toast / backdrop ---------- */
.toast {
  position: fixed; bottom: 28px;
  left: calc(var(--offset) + (100% - var(--offset)) / 2);
  z-index: 60;
  max-width: calc(100% - 32px);
  padding: 11px 18px;
  border-radius: 12px;
  background: #212529; color: #fff;
  font-size: 13.5px;
  opacity: 0; pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.backdrop {
  position: fixed; inset: 0; z-index: 35;
  background: rgba(33, 37, 41, .35);
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}

/* ---------- Responsive ---------- */
@media (max-width: 1320px) {
  .topbar { padding: 0 28px; }
  .main-nav { gap: 32px; }
  .content { padding-left: 28px; padding-right: 28px; }
}

@media (max-width: 1160px) {
  .main-nav { gap: 24px; }
  .main-nav a { font-size: 15px; gap: 9px; }
  .main-nav svg { width: 26px; height: 26px; }
  .top-right { gap: 18px; }
}

@media (max-width: 992px) {
  :root { --offset: 0px; }
  .menu-btn { display: inline-grid; }
  .sidebar { background: #fff; transform: translateX(-100%); transition: transform .28s ease, box-shadow .28s; }
  body.nav-open .sidebar { transform: none; box-shadow: 8px 0 30px rgba(0, 0, 0, .12); }
  body.nav-open .backdrop { opacity: 1; pointer-events: auto; }
}

@media (max-width: 860px) {
  .main-nav { gap: 6px; }
  .main-nav a { padding: 8px; border-radius: 12px; }
  .main-nav a:hover { background: rgba(0, 0, 0, .04); }
  .main-nav .label {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
  }
}

@media (max-width: 768px) {
  :root { --nav-h: 72px; }
  .topbar { padding: 0 16px; gap: 10px; }
  .top-right { gap: 12px; }
  .top-avatar { width: 42px; height: 42px; border-width: 2px; }
  .content { padding: calc(var(--nav-h) + 18px) 16px 40px; }
  .page-title { font-size: 24px; margin: 16px 0 14px; }

  /* Table -> stacked cards */
  .table-wrap { overflow: visible; margin: 0; padding: 0; }
  .schedule { min-width: 0; border-spacing: 0; }
  .schedule thead { display: none; }
  .schedule, .schedule tbody, .schedule tr, .schedule td { display: block; width: 100%; }
  .schedule tr {
    margin-bottom: 14px; padding: 6px 20px;
    border-radius: 20px;
    background: var(--card);
    filter: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .07);
  }
  .schedule td,
  .schedule td:first-child,
  .schedule td:last-child {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 10px 0;
    border-radius: 0;
    background: transparent;
    text-align: right;
  }
  .schedule td + td { border-top: 1px solid #EFEFEF; }
  .schedule td::before {
    content: attr(data-label);
    flex: none;
    font-size: 13px; font-weight: 700;
    color: var(--text);
    text-align: left;
  }
  .schedule .center { text-align: right; }
  .schedule tbody tr:hover td { background: transparent; }
  .schedule tbody tr:hover td:first-child { box-shadow: none; }
  .icon-btn { margin: -6px -6px -6px 0; }
}

@media (max-width: 420px) {
  .topbar { padding: 0 12px; gap: 6px; }
  .main-nav { gap: 0; }
  .main-nav a { padding: 6px; }
  .main-nav svg { width: 24px; height: 24px; }
  .top-right { gap: 8px; }
  .lang { font-size: 13px; }
  .breadcrumb { min-width: 0; height: 36px; padding: 0 16px; font-size: 13px; }
}
