:root {
  color-scheme: dark;
  --bg: #07101d;
  --bg-soft: #0a1626;
  --panel: #0e1b2c;
  --panel-2: #122238;
  --panel-3: #162941;
  --line: rgba(151, 179, 211, .14);
  --line-strong: rgba(151, 179, 211, .24);
  --text: #edf5ff;
  --text-soft: #a8b8ca;
  --muted: #73869d;
  --primary: #3dd9c5;
  --primary-deep: #149d93;
  --primary-soft: rgba(61, 217, 197, .12);
  --blue: #5a8cff;
  --blue-soft: rgba(90, 140, 255, .14);
  --amber: #f3b84b;
  --amber-soft: rgba(243, 184, 75, .14);
  --danger: #ff6b7a;
  --danger-soft: rgba(255, 107, 122, .13);
  --success: #4bd596;
  --success-soft: rgba(75, 213, 150, .13);
  --purple: #a98af8;
  --shadow: 0 24px 64px rgba(0, 0, 0, .28);
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar-width: 252px;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a, select, label[for] { -webkit-tap-highlight-color: transparent; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.is-hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 10px; color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }

/* Login */
.login-view {
  display: grid;
  grid-template-columns: minmax(420px, 1.18fr) minmax(420px, .82fr);
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 12%, rgba(37, 146, 184, .2), transparent 30%),
    radial-gradient(circle at 70% 100%, rgba(61, 217, 197, .09), transparent 34%),
    #07111f;
}
.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: clamp(48px, 7vw, 112px);
  border-right: 1px solid var(--line);
}
.login-brand::before,
.login-brand::after {
  position: absolute;
  content: "";
  pointer-events: none;
}
.login-brand::before {
  width: 520px; height: 520px;
  right: -220px; bottom: -220px;
  border: 1px solid rgba(61, 217, 197, .13);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(61,217,197,.025), 0 0 0 140px rgba(61,217,197,.018);
}
.login-brand::after {
  inset: 0;
  opacity: .18;
  background-image: linear-gradient(rgba(112,160,198,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(112,160,198,.08) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(135deg, black, transparent 72%);
}
.brand-mark {
  position: relative;
  display: grid;
  width: 42px; height: 42px;
  flex: 0 0 auto;
  place-items: center;
  color: #06141f;
  border-radius: 13px;
  background: linear-gradient(135deg, #6ce9d9, #2ab5aa);
  box-shadow: 0 10px 30px rgba(42, 181, 170, .22);
  z-index: 1;
}
.brand-mark svg { width: 27px; height: 27px; fill: currentColor; stroke: none; }
.brand-mark-large { width: 60px; height: 60px; margin-bottom: 44px; border-radius: 18px; }
.brand-mark-large svg { width: 38px; height: 38px; }
.login-brand h1 {
  position: relative;
  margin: 0;
  max-width: 650px;
  font-size: clamp(42px, 5vw, 72px);
  line-height: 1.16;
  letter-spacing: -.045em;
  z-index: 1;
}
.login-lead { position: relative; max-width: 570px; margin: 30px 0 36px; color: var(--text-soft); font-size: 17px; line-height: 1.9; z-index: 1; }
.login-highlights { position: relative; display: flex; flex-wrap: wrap; gap: 14px 28px; color: #bfd0e1; font-size: 13px; z-index: 1; }
.login-highlights span { display: inline-flex; align-items: center; gap: 9px; }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 5px rgba(61,217,197,.1); }
.login-panel-wrap { display: grid; place-items: center; padding: 50px; background: rgba(4, 12, 23, .42); }
.login-panel { width: min(100%, 420px); }
.login-panel h2 { margin: 0 0 8px; font-size: 34px; letter-spacing: -.03em; }
.login-panel > .muted { margin: 0 0 34px; font-size: 14px; }
.mobile-brand { display: none; align-items: center; gap: 13px; margin-bottom: 44px; font-size: 18px; }
.form-stack { display: grid; gap: 20px; }
.field { display: grid; gap: 8px; color: var(--text-soft); font-size: 13px; font-weight: 600; }
.field > span b { color: var(--danger); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > svg { position: absolute; left: 14px; width: 18px; color: var(--muted); pointer-events: none; }
.input-wrap input { width: 100%; padding-left: 45px; padding-right: 46px; }
input, select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--text);
  outline: none;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #0a1727;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
input::placeholder, textarea::placeholder { color: #64788e; }
input:focus, select:focus, textarea:focus { border-color: rgba(61,217,197,.7); box-shadow: 0 0 0 3px rgba(61,217,197,.1); background: #0c1b2c; }
input:disabled, select:disabled, textarea:disabled { opacity: .62; cursor: not-allowed; }
select { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg,transparent 50%,#71869a 50%),linear-gradient(135deg,#71869a 50%,transparent 50%); background-position: calc(100% - 17px) 18px,calc(100% - 12px) 18px; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { resize: vertical; line-height: 1.6; }
.input-action { position: absolute; right: 8px; width: 34px !important; height: 34px !important; }
.checkbox-line { display: flex; align-items: center; gap: 9px; width: fit-content; color: var(--text-soft); font-size: 13px; cursor: pointer; }
.checkbox-line input { width: 16px; min-height: 16px; accent-color: var(--primary-deep); }
.login-foot { margin: 34px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.server-settings { margin-top: -4px; color: var(--muted); font-size: 12px; }
.server-settings summary { width: fit-content; cursor: pointer; }
.compact-field { margin-top: 12px; }

/* Buttons */
.button, .icon-button, .nav-item, .top-user, .page-number {
  border: 0;
  cursor: pointer;
}
.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: transform .15s, filter .15s, border-color .15s, background .15s;
}
.button:hover { filter: brightness(1.07); }
.button:active { transform: translateY(1px); }
.button:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.button svg { width: 17px; height: 17px; }
.button-primary { color: #031b1b; background: linear-gradient(135deg, #55e1d0, #28b8ad); box-shadow: 0 10px 24px rgba(40,184,173,.16); }
.button-secondary { color: var(--text-soft); border-color: var(--line-strong); background: #122238; }
.button-secondary:hover { color: var(--text); border-color: rgba(151,179,211,.38); }
.button-danger { color: #fff; background: #d9475b; }
.button-danger-ghost { color: #ff8793; border-color: rgba(255,107,122,.25); background: var(--danger-soft); }
.button-ghost { color: var(--text-soft); border-color: transparent; background: transparent; }
.button-block { width: 100%; min-height: 48px; }
.button-block svg { margin-left: auto; }
.icon-button {
  display: grid;
  width: 38px; height: 38px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  color: var(--text-soft);
  border-radius: 9px;
  background: transparent;
  transition: color .16s, background .16s;
}
.icon-button:hover { color: var(--text); background: rgba(148,177,207,.1); }
.icon-button svg { width: 19px; height: 19px; }

/* App shell */
.admin-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: #091525;
  z-index: 50;
}
.sidebar::before { position: absolute; inset: 0; content: ""; pointer-events: none; background: radial-gradient(circle at 50% 0, rgba(47,190,181,.08), transparent 27%); }
.sidebar-head { position: relative; display: flex; min-height: 82px; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.sidebar-head strong, .sidebar-head span { display: block; }
.sidebar-head strong { font-size: 15px; }
.sidebar-head span { margin-top: 4px; color: var(--muted); font-size: 10px; letter-spacing: .12em; }
.sidebar-close { display: none; margin-left: auto; }
.main-nav { position: relative; flex: 1; overflow: auto; padding: 18px 13px 24px; scrollbar-width: thin; scrollbar-color: #20364d transparent; }
.nav-caption { margin: 18px 12px 7px; color: #536880; font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.nav-caption:first-child { margin-top: 0; }
.nav-item {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 43px;
  align-items: center;
  gap: 12px;
  margin: 3px 0;
  padding: 0 13px;
  color: #91a5bb;
  border-radius: 9px;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  transition: color .16s, background .16s;
}
.nav-item svg { width: 18px; height: 18px; }
.nav-item:hover { color: #dce9f7; background: rgba(123,159,194,.08); }
.nav-item.is-active { color: var(--primary); background: var(--primary-soft); }
.nav-item.is-active::before { position: absolute; left: 0; width: 3px; height: 21px; content: ""; border-radius: 0 4px 4px 0; background: var(--primary); }
.sidebar-footer { position: relative; display: flex; align-items: center; gap: 10px; padding: 15px 14px; border-top: 1px solid var(--line); background: rgba(5,14,25,.4); }
.sidebar-user-avatar, .top-avatar { display: grid; flex: 0 0 auto; place-items: center; color: #061a1a; border-radius: 10px; background: linear-gradient(135deg,#5be2d3,#259f98); font-weight: 800; }
.sidebar-user-avatar { width: 36px; height: 36px; font-size: 13px; }
.sidebar-user-copy { min-width: 0; flex: 1; }
.sidebar-user-copy strong, .sidebar-user-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-copy strong { font-size: 12px; }
.sidebar-user-copy span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.sidebar-backdrop { display: none; }
.workspace { min-height: 100vh; margin-left: var(--sidebar-width); background: #07111f; }
.topbar { position: sticky; top: 0; display: flex; height: 82px; align-items: center; gap: 16px; padding: 0 30px; border-bottom: 1px solid var(--line); background: rgba(7,17,31,.89); backdrop-filter: blur(18px); z-index: 30; }
.menu-button { display: none; }
.page-heading { min-width: 0; }
.page-heading span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.page-heading h1 { margin: 0; font-size: 19px; letter-spacing: -.01em; }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.live-clock { margin-right: 9px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.top-user { display: flex; align-items: center; gap: 10px; margin-left: 6px; padding: 4px 8px 4px 4px; color: inherit; border-radius: 10px; background: transparent; text-align: left; }
.top-user:hover { background: rgba(148,177,207,.08); }
.top-avatar { width: 36px; height: 36px; font-size: 13px; }
.top-user-copy strong, .top-user-copy small { display: block; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-user-copy strong { font-size: 12px; }
.top-user-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.view-root { min-height: calc(100vh - 127px); padding: 26px 30px 38px; }
.workspace-footer { min-height: 45px; padding: 0 30px 24px; color: #50647b; font-size: 10px; text-align: right; }

/* Shared content */
.page-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-intro h2 { margin: 0 0 7px; font-size: 24px; letter-spacing: -.025em; }
.page-intro p { margin: 0; color: var(--muted); font-size: 13px; }
.page-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(17,33,53,.97), rgba(11,25,42,.97));
  box-shadow: 0 8px 28px rgba(0,0,0,.1);
}
.panel-head { display: flex; min-height: 65px; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.panel-head h3 { margin: 0; font-size: 15px; }
.panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.panel-body { padding: 18px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-bottom: 14px; }
.toolbar .field { min-width: 150px; flex: 0 1 200px; }
.toolbar .field-search { min-width: 230px; flex: 1 1 280px; }
.toolbar .field-search .input-wrap input { padding-left: 40px; }
.toolbar-spacer { flex: 1; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-card { position: relative; min-height: 132px; overflow: hidden; padding: 19px; }
.stat-card::after { position: absolute; right: -30px; bottom: -38px; width: 110px; height: 110px; content: ""; border-radius: 50%; background: var(--card-glow, rgba(61,217,197,.07)); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stat-label { color: var(--text-soft); font-size: 12px; }
.stat-icon { display: grid; width: 36px; height: 36px; place-items: center; color: var(--card-color,var(--primary)); border-radius: 10px; background: var(--card-bg,var(--primary-soft)); }
.stat-icon svg { width: 18px; height: 18px; }
.stat-value { margin: 15px 0 4px; font-size: 30px; font-weight: 800; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-note { color: var(--muted); font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(290px, .75fr); gap: 16px; }
.dashboard-stack { display: grid; align-content: start; gap: 16px; }
.chart-wrap { padding: 5px 0 0; }
.bar-chart { display: flex; min-height: 245px; align-items: flex-end; gap: clamp(10px, 3vw, 28px); padding: 24px 12px 0; border-bottom: 1px solid var(--line); background-image: repeating-linear-gradient(to top, transparent 0, transparent 49px, rgba(145,174,204,.08) 50px); }
.bar-column { display: flex; min-width: 26px; height: 220px; flex: 1; flex-direction: column; justify-content: flex-end; align-items: center; gap: 9px; }
.bar-value { color: var(--text-soft); font-size: 10px; font-variant-numeric: tabular-nums; }
.bar { width: min(36px, 72%); min-height: 4px; border-radius: 7px 7px 2px 2px; background: linear-gradient(to top, #239f99, #62e4d3); box-shadow: 0 -8px 24px rgba(61,217,197,.12); transition: height .6s cubic-bezier(.2,.8,.2,1); }
.bar-label { min-height: 28px; color: var(--muted); font-size: 10px; text-align: center; }
.status-overview { display: grid; grid-template-columns: 145px 1fr; align-items: center; gap: 20px; }
.donut { --approved: 0deg; --submitted: 0deg; position: relative; display: grid; width: 132px; height: 132px; place-items: center; border-radius: 50%; background: conic-gradient(var(--success) 0 var(--approved), var(--amber) var(--approved) var(--submitted), #3b5470 var(--submitted) 360deg); }
.donut::before { position: absolute; width: 86px; height: 86px; content: ""; border-radius: 50%; background: #102036; }
.donut strong, .donut span { position: relative; display: block; text-align: center; z-index: 1; }
.donut strong { font-size: 23px; }
.donut span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.legend { display: grid; gap: 11px; }
.legend-row { display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 8px; color: var(--text-soft); font-size: 11px; }
.legend-row i { width: 7px; height: 7px; border-radius: 50%; }
.legend-row strong { color: var(--text); font-variant-numeric: tabular-nums; }
.quick-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.quick-action { display: flex; min-height: 70px; align-items: center; gap: 11px; padding: 12px; color: var(--text-soft); border: 1px solid var(--line); border-radius: 11px; background: rgba(10,24,40,.65); cursor: pointer; text-align: left; transition: border-color .16s, transform .16s, background .16s; }
.quick-action:hover { transform: translateY(-1px); color: var(--text); border-color: rgba(61,217,197,.3); background: var(--primary-soft); }
.quick-action svg { flex: 0 0 auto; color: var(--primary); }
.quick-action strong, .quick-action span { display: block; }
.quick-action strong { color: inherit; font-size: 12px; }
.quick-action span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.timeline { display: grid; }
.timeline-item { position: relative; display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 0 0 17px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { position: absolute; top: 20px; bottom: 0; left: 12px; width: 1px; content: ""; background: var(--line); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { display: grid; width: 25px; height: 25px; place-items: center; color: var(--primary); border-radius: 50%; background: var(--primary-soft); z-index: 1; }
.timeline-dot svg { width: 12px; height: 12px; }
.timeline-copy strong { display: block; font-size: 11px; font-weight: 600; line-height: 1.5; }
.timeline-copy span { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }

/* Tables */
.table-shell { overflow: hidden; }
.table-scroll { overflow-x: auto; scrollbar-color: #29435f transparent; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th { height: 43px; padding: 0 14px; color: #758aa1; background: rgba(7,17,31,.45); font-size: 10px; font-weight: 700; letter-spacing: .05em; text-align: left; white-space: nowrap; }
.data-table td { height: 58px; padding: 10px 14px; color: var(--text-soft); border-top: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr { transition: background .14s; }
.data-table tbody tr:hover { background: rgba(75,126,163,.055); }
.data-table td strong { color: var(--text); font-size: 12px; }
.cell-main, .cell-sub { display: block; }
.cell-sub { margin-top: 4px; color: var(--muted); font-size: 10px; }
.mono { font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.row-actions .icon-button { width: 31px; height: 31px; }
.row-actions .danger-action:hover { color: var(--danger); background: var(--danger-soft); }
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 99px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.status-badge::before { width: 5px; height: 5px; content: ""; border-radius: 50%; background: currentColor; }
.status-active, .status-approved { color: var(--success); background: var(--success-soft); }
.status-draft { color: #91a6bb; background: rgba(145,166,187,.12); }
.status-submitted, .status-pending { color: var(--amber); background: var(--amber-soft); }
.status-rejected, .status-disabled { color: var(--danger); background: var(--danger-soft); }
.table-footer { display: flex; min-height: 62px; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); }
.table-summary { color: var(--muted); font-size: 10px; }
.pagination { display: flex; align-items: center; gap: 5px; }
.page-number { display: grid; min-width: 31px; height: 31px; place-items: center; padding: 0 8px; color: var(--text-soft); border: 1px solid var(--line); border-radius: 7px; background: transparent; font-size: 10px; }
.page-number:hover:not(:disabled) { color: var(--text); border-color: var(--line-strong); }
.page-number.is-current { color: #061b1b; border-color: var(--primary); background: var(--primary); font-weight: 800; }
.page-number:disabled { opacity: .35; cursor: not-allowed; }
.empty-state { display: grid; min-height: 280px; place-items: center; padding: 40px 20px; color: var(--muted); text-align: center; }
.empty-state svg { width: 46px; height: 46px; margin-bottom: 14px; color: #3a526d; }
.empty-state strong { display: block; margin-bottom: 7px; color: var(--text-soft); font-size: 14px; }
.empty-state p { max-width: 360px; margin: 0 0 17px; font-size: 11px; line-height: 1.7; }
.skeleton-line { display: block; width: 85%; height: 10px; border-radius: 5px; background: linear-gradient(90deg,#172b43 25%,#203850 45%,#172b43 65%); background-size: 300% 100%; animation: shimmer 1.5s infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* Timetable */
.schedule-filters { display: grid; grid-template-columns: repeat(4,minmax(140px,1fr)) auto; align-items: end; gap: 10px; margin-bottom: 16px; padding: 15px; }
.schedule-filters .field { min-width: 0; }
.schedule-head { display: flex; align-items: center; gap: 12px; }
.schedule-title-copy { min-width: 0; }
.schedule-title-copy h3, .schedule-title-copy p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schedule-toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.schedule-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 7px; }
.schedule-grid-wrap { overflow: auto; }
.schedule-grid { width: 100%; min-width: 850px; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.schedule-grid th, .schedule-grid td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.schedule-grid tr > :last-child { border-right: 0; }
.schedule-grid tbody tr:last-child > * { border-bottom: 0; }
.schedule-grid thead th { height: 54px; padding: 8px; color: var(--text-soft); background: rgba(7,17,31,.42); font-size: 11px; text-align: center; }
.schedule-grid thead th:first-child { width: 74px; }
.schedule-grid thead th strong, .schedule-grid thead th span { display: block; }
.schedule-grid thead th span { margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 400; }
.period-cell { width: 74px; padding: 8px; color: var(--muted); background: rgba(7,17,31,.4); font-size: 10px; text-align: center; }
.period-cell strong { display: block; margin-bottom: 4px; color: var(--text-soft); font-size: 12px; }
.course-cell { height: 92px; padding: 5px; vertical-align: top; }
.course-button { display: grid; width: 100%; height: 100%; min-height: 80px; align-content: center; gap: 4px; padding: 8px; color: var(--text-soft); border: 1px solid transparent; border-radius: 9px; background: transparent; cursor: pointer; text-align: left; transition: background .15s,border-color .15s,transform .15s; }
.course-button:hover { transform: translateY(-1px); border-color: rgba(61,217,197,.28); background: rgba(61,217,197,.05); }
.course-button.is-filled { border-left: 3px solid var(--course-color,var(--primary)); background: color-mix(in srgb, var(--course-color,var(--primary)) 9%, transparent); }
.course-button.is-conflict { border-color: rgba(255,107,122,.48); background: var(--danger-soft); }
.course-button strong { overflow: hidden; color: var(--text); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.course-button span { display: flex; align-items: center; gap: 4px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.course-button span svg { width: 11px; height: 11px; flex: 0 0 auto; }
.empty-course { place-items: center; color: #4c6279; font-size: 18px; text-align: center; }
.conflict-panel { margin-bottom: 16px; border-color: rgba(255,107,122,.26); background: linear-gradient(145deg,rgba(55,27,38,.72),rgba(20,25,39,.9)); }
.conflict-summary { display: flex; align-items: center; gap: 10px; padding: 13px 16px; color: #ff9ba5; cursor: pointer; font-size: 12px; font-weight: 700; list-style: none; }
.conflict-summary::-webkit-details-marker { display: none; }
.conflict-summary svg { width: 18px; height: 18px; }
.conflict-list { display: grid; gap: 7px; margin: 0; padding: 0 16px 14px 44px; color: var(--text-soft); font-size: 11px; line-height: 1.6; }
.dirty-indicator { color: var(--amber); }
.dirty-indicator::before { content: "●"; margin-right: 5px; }

/* Dialogs */
.dialog {
  width: min(620px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  padding: 0;
  color: var(--text);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: #0e1b2c;
  box-shadow: var(--shadow);
}
.dialog::backdrop { background: rgba(1,8,16,.72); backdrop-filter: blur(4px); }
.dialog-small { width: min(440px, calc(100vw - 28px)); padding: 25px; text-align: center; }
.dialog-small .dialog-head { margin: -25px -25px 0; text-align: left; }
.dialog-head { position: sticky; top: 0; display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 20px; border-bottom: 1px solid var(--line); background: rgba(14,27,44,.96); backdrop-filter: blur(12px); z-index: 2; }
.dialog-head .eyebrow { margin-bottom: 5px; font-size: 9px; }
.dialog-head h2 { margin: 0; font-size: 18px; }
.dialog-body { padding: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px 14px; }
.form-span-2 { grid-column: span 2; }
.dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 14px 20px; border-top: 1px solid var(--line); }
.split-actions { display: grid; grid-template-columns: auto 1fr auto auto; }
.confirm-icon { display: grid; width: 52px; height: 52px; margin: 0 auto 16px; place-items: center; color: var(--danger); border-radius: 50%; background: var(--danger-soft); }
.confirm-icon svg { width: 26px; height: 26px; }
.dialog-small h2 { margin: 0 0 9px; font-size: 18px; }
.dialog-small > form > .muted { margin: 0 0 21px; font-size: 12px; line-height: 1.7; }
.dialog-small .dialog-actions { margin: 0 -25px -25px; }
.form-help { margin: 13px 0 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.file-drop { display: grid; min-height: 180px; place-items: center; align-content: center; gap: 8px; padding: 24px; color: var(--text-soft); border: 1px dashed rgba(61,217,197,.35); border-radius: 13px; background: rgba(61,217,197,.04); cursor: pointer; text-align: center; }
.file-drop:hover, .file-drop.is-dragging { border-color: var(--primary); background: var(--primary-soft); }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-drop svg { width: 32px; height: 32px; color: var(--primary); }
.file-drop strong { font-size: 13px; }
.file-drop span { color: var(--muted); font-size: 10px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 17px; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: grid; min-height: 40px; place-items: center; color: var(--text-soft); border: 1px solid var(--line); border-radius: 9px; background: #0b192a; font-size: 12px; }
.segmented input:checked + span { color: var(--primary); border-color: rgba(61,217,197,.5); background: var(--primary-soft); }

/* Feedback */
.global-loader { position: fixed; top: 14px; left: 50%; display: flex; align-items: center; gap: 9px; padding: 10px 15px; color: var(--text-soft); border: 1px solid var(--line-strong); border-radius: 99px; background: rgba(10,24,40,.94); box-shadow: 0 10px 30px rgba(0,0,0,.24); transform: translateX(-50%); font-size: 11px; z-index: 1000; }
.loader-ring { width: 15px; height: 15px; border: 2px solid rgba(61,217,197,.22); border-top-color: var(--primary); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast-region { position: fixed; right: 18px; bottom: 18px; display: grid; width: min(370px,calc(100vw - 36px)); gap: 9px; z-index: 1100; }
.toast { display: grid; grid-template-columns: 29px 1fr auto; align-items: center; gap: 10px; padding: 12px 13px; color: var(--text-soft); border: 1px solid var(--line-strong); border-radius: 11px; background: rgba(13,29,47,.97); box-shadow: 0 18px 45px rgba(0,0,0,.32); animation: toast-in .22s ease-out; }
.toast.is-leaving { opacity: 0; transform: translateX(15px); transition: .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateX(15px); } }
.toast-icon { display: grid; width: 28px; height: 28px; place-items: center; color: var(--primary); border-radius: 8px; background: var(--primary-soft); }
.toast-error .toast-icon { color: var(--danger); background: var(--danger-soft); }
.toast-warning .toast-icon { color: var(--amber); background: var(--amber-soft); }
.toast strong, .toast span { display: block; }
.toast strong { color: var(--text); font-size: 11px; }
.toast span { margin-top: 3px; font-size: 10px; line-height: 1.45; }
.toast-close { width: 28px; height: 28px; }

/* Errors */
.error-banner { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; padding: 13px 15px; color: #ff9ba5; border: 1px solid rgba(255,107,122,.25); border-radius: 11px; background: var(--danger-soft); font-size: 11px; line-height: 1.6; }
.error-banner svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; }
.error-banner button { margin-left: auto; }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-stack { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .schedule-filters { grid-template-columns: repeat(2,minmax(170px,1fr)) auto; }
}

@media (max-width: 920px) {
  .login-view { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel-wrap { min-height: 100vh; padding: 34px 22px; }
  .mobile-brand { display: flex; }
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
  .sidebar.is-open { transform: translateX(0); box-shadow: 30px 0 70px rgba(0,0,0,.42); }
  .sidebar-close, .menu-button { display: grid; }
  .sidebar-backdrop { position: fixed; inset: 0; display: block; visibility: hidden; opacity: 0; background: rgba(0,6,13,.62); transition: .2s; z-index: 45; }
  .sidebar-backdrop.is-visible { visibility: visible; opacity: 1; }
  .workspace { margin-left: 0; }
}

@media (max-width: 700px) {
  .topbar { height: 70px; padding: 0 14px; }
  .view-root { min-height: calc(100vh - 110px); padding: 18px 14px 30px; }
  .workspace-footer { padding: 0 14px 18px; text-align: center; }
  .live-clock, .top-user-copy { display: none; }
  .page-heading span { display: none; }
  .page-heading h1 { font-size: 16px; }
  .page-intro { align-items: stretch; flex-direction: column; }
  .page-intro h2 { font-size: 21px; }
  .page-actions { justify-content: flex-start; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 112px; }
  .dashboard-stack { grid-template-columns: 1fr; }
  .status-overview { grid-template-columns: 120px 1fr; }
  .donut { width: 112px; height: 112px; }
  .donut::before { width: 72px; height: 72px; }
  .schedule-filters { grid-template-columns: 1fr; }
  .schedule-filters .button { width: 100%; }
  .toolbar { align-items: stretch; }
  .toolbar .field, .toolbar .field-search { max-width: none; flex-basis: 100%; }
  .toolbar-spacer { display: none; }
  .table-footer { align-items: flex-start; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .form-span-2 { grid-column: span 1; }
  .split-actions { grid-template-columns: 1fr 1fr; }
  .split-actions span { display: none; }
  .dialog-actions { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  :root { color-scheme: light; }
  body, .workspace { color: #17212b; background: #fff; }
  .sidebar, .topbar, .workspace-footer, .page-intro, .schedule-filters, .schedule-toolbar, .conflict-panel, .global-loader, .toast-region { display: none !important; }
  .workspace { margin: 0; }
  .view-root { padding: 0; }
  .panel { border-color: #bbb; background: #fff; box-shadow: none; }
  .schedule-grid th, .schedule-grid td { border-color: #ccc; }
  .schedule-grid thead th, .period-cell { color: #333; background: #f3f5f7; }
  .course-button strong { color: #111; }
}
