/* ============================================================
   HSPS 資訊系統 — Theme Tokens (Terminal Flux)
   light + dark, driven by [data-theme]
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; max-width: 100%; }
body {
  font-family: "Noto Sans TC", "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 17px;
  font-feature-settings: "palt", "tnum";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg);
  color: var(--text);
  transition: background 280ms ease, color 280ms ease;
  min-height: 100vh;
}
button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}
button { cursor: pointer; background: none; border: none; padding: 0; }
a { color: inherit; text-decoration: none; }

/* =========================================================
   BASE TOKENS
   ========================================================= */
:root {
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;

  --dur-fast: 120ms;
  --dur: 220ms;
  --dur-slow: 420ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  --mono: "JetBrains Mono", "SF Mono", Consolas, monospace;
  --display: "Space Grotesk", "Noto Sans TC", sans-serif;

  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f2f4fa;
  --surface-3: #e9ecf5;
  --border: #e3e6ef;
  --border-strong: #c9cfde;
  --text: #0f1222;
  --text-2: #48506a;
  --text-3: #7a8299;
  --muted: #9099ad;

  --accent: #4f46e5;
  --accent-2: #6366f1;
  --accent-soft: #eef0fe;
  --accent-ink: #ffffff;

  --success: #15803d;
  --success-soft: #dcf5e4;
  --warn: #b45309;
  --warn-soft: #fdf0d8;
  --danger: #dc2626;
  --danger-soft: #fde4e4;

  --shadow-sm: 0 1px 2px rgba(20,22,50,0.04), 0 1px 3px rgba(20,22,50,0.06);
  --shadow-md: 0 4px 10px rgba(20,22,50,0.06), 0 1px 3px rgba(20,22,50,0.04);
  --shadow-lg: 0 12px 32px rgba(20,22,50,0.10), 0 2px 6px rgba(20,22,50,0.06);

  --radius-card: 14px;
  --radius-btn: 10px;
  --radius-input: 10px;
}
:root[data-theme="dark"] {
  --bg: #0a0b14;
  --surface: #12141f;
  --surface-2: #181b29;
  --surface-3: #222638;
  --border: #262a3c;
  --border-strong: #363b52;
  --text: #e7e9f3;
  --text-2: #a4a9c0;
  --text-3: #6f7490;
  --muted: #585d75;
  --accent: #8b87ff;
  --accent-2: #a5a0ff;
  --accent-soft: #1e1e3a;
  --accent-ink: #0a0b14;
  --success: #5fd184;
  --success-soft: #0e2a1a;
  --warn: #e5b461;
  --warn-soft: #2a2010;
  --danger: #ff7a80;
  --danger-soft: #2a1218;
}

/* dark mode：登入畫面收斂掉亮紫漸層，跟登入後維持同色系 */
:root[data-theme="dark"] .login-wrap {
  background:
    radial-gradient(1200px 600px at 90% 10%, color-mix(in oklab, var(--accent) 5%, transparent), transparent 60%),
    radial-gradient(800px 500px at 10% 90%, color-mix(in oklab, var(--accent-2) 4%, transparent), transparent 60%),
    var(--bg);
}
:root[data-theme="dark"] .login-brand {
  background: linear-gradient(145deg, #1a2235, #2c3a55);
  color: var(--text);
}
:root[data-theme="dark"] .login-card {
  --accent: #6f86b3;
  --accent-2: #8ba2cd;
  --accent-soft: #1d2638;
  --accent-ink: #ffffff;
}

/* =========================================================
   APP SHELL
   ========================================================= */
.hsps-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-full); }
*::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* =========================================================
   NAVBAR
   ========================================================= */
.navbar {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  background: color-mix(in oklab, var(--surface) 84%, transparent);
  border-bottom: 1px solid var(--border);
}
.navbar-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 14px 28px;
  display: flex; align-items: center; gap: 8px;
  min-width: 0;
}
.navbar-inner > * { min-width: 0; }
.brand {
  display: flex; align-items: center; gap: 10px;
  padding-right: 18px;
  font-family: var(--display);
  font-weight: 700; font-size: 18px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}
.brand-dot {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  display: grid; place-items: center;
  color: var(--accent-ink);
  font-family: var(--mono); font-weight: 600; font-size: 15px;
}
.nav-sep {
  width: 1px; height: 20px; background: var(--border);
  margin: 0 6px;
}
.nav-links { display: flex; gap: 2px; align-items: center; }
.nav-link {
  padding: 9px 16px;
  border-radius: var(--radius-btn);
  font-size: 16px; font-weight: 500;
  color: var(--text-2);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  font-size: 15px; font-weight: 500;
  transition: background var(--dur);
  white-space: nowrap;
  color: inherit;
}
.user-chip:hover { background: var(--surface-3); }
.avatar {
  width: 26px; height: 26px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center;
  color: var(--accent-ink);
  font-family: var(--mono); font-weight: 600; font-size: 14px;
  flex-shrink: 0;
}

.icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-btn);
  display: grid; place-items: center;
  color: var(--text-2);
  transition: background var(--dur), color var(--dur);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* =========================================================
   PAGE CONTAINER
   ========================================================= */
.page {
  max-width: 1280px; margin: 0 auto;
  padding: 48px 28px 96px;
  width: 100%;
}
.page-narrow { max-width: 720px; }

.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.page-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 38px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  color: var(--text);
}
.page-sub {
  color: var(--text-2);
  font-size: 16px;
  line-height: 1.5;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 13px; font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 10px;
}
.eyebrow::before {
  content: ""; width: 24px; height: 1px;
  background: var(--text-3);
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-btn);
  font-size: 16px; font-weight: 600;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: var(--accent); color: var(--accent-ink);
}
.btn-primary:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-secondary {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface-3); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}
.btn-danger:hover { background: var(--danger-soft); }

.btn-sm { padding: 6px 12px; font-size: 14px; }
.btn-lg { padding: 14px 26px; font-size: 17px; }

/* =========================================================
   CARD
   ========================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 28px; }
.card-pad-lg { padding: 36px 40px; }

/* =========================================================
   FORMS
   ========================================================= */
.field { display: flex; flex-direction: column; gap: 8px; }
.label {
  font-size: 15px; font-weight: 600; color: var(--text-2);
  display: flex; align-items: center; gap: 8px;
}
.label-hint { font-weight: 400; color: var(--text-3); font-size: 14px; }

.input, .textarea, .select {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  font-size: 17px;
  color: var(--text);
  transition: border-color var(--dur), box-shadow var(--dur);
}
.input:hover, .textarea:hover, .select:hover { border-color: var(--border-strong); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 18%, transparent);
}
.input:disabled, .textarea:disabled, .select:disabled {
  opacity: 0.7; cursor: not-allowed;
  background: var(--surface-2);
}
.textarea { min-height: 140px; resize: vertical; font-family: inherit; }
.input-affix { position: relative; display: flex; align-items: center; }
.input-affix .input { padding-left: 40px; }
.input-affix .input-icon {
  position: absolute; left: 12px;
  color: var(--text-3); pointer-events: none;
  display: grid; place-items: center;
}

/* =========================================================
   BADGES / STATUS
   ========================================================= */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  font-size: 14px; font-weight: 600;
  white-space: nowrap;
  font-family: var(--mono);
  letter-spacing: 0.02em;
}
.badge-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warn    { background: var(--warn-soft); color: var(--warn); }
.badge.danger  { background: var(--danger-soft); color: var(--danger); }
.badge.info    { background: var(--accent-soft); color: var(--accent); }
.badge.neutral { background: var(--surface-2); color: var(--text-2); }

/* =========================================================
   TABLE
   ========================================================= */
.tbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 17px;
}
.tbl thead th {
  text-align: left;
  padding: 14px 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  font-family: var(--mono);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.tbl tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.tbl tbody tr { transition: background var(--dur); }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr.selected { background: var(--accent-soft); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl td.muted { color: var(--text-3); font-family: var(--mono); font-size: 16px; }
.tbl td.num { font-family: var(--mono); color: var(--text-3); font-size: 16px; }

/* =========================================================
   MISC
   ========================================================= */
.kbd {
  display: inline-grid; place-items: center;
  min-width: 20px; height: 20px;
  padding: 0 5px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: var(--radius-xs);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  background: var(--surface);
}
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }
.divider { height: 1px; background: var(--border); margin: 24px 0; }
.dot {
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.mono { font-family: var(--mono); }

.seg {
  display: inline-flex; padding: 3px;
  background: var(--surface-2);
  border-radius: var(--radius-btn);
  border: 1px solid var(--border);
}
.seg-btn {
  padding: 7px 14px;
  font-size: 15px; font-weight: 500;
  color: var(--text-2);
  border-radius: calc(var(--radius-btn) - 2px);
  transition: all var(--dur);
  white-space: nowrap;
  text-decoration: none;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  flex-wrap: wrap;
}
.toolbar + .card { border-radius: 0 0 var(--radius-card) var(--radius-card); overflow: hidden; }

.searchbox {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  width: 320px;
  transition: all var(--dur);
}
.searchbox:focus-within {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 15%, transparent);
}
.searchbox input {
  border: none; background: transparent;
  outline: none; flex: 1;
  font-size: 14px;
  color: var(--text);
}
.searchbox input::placeholder { color: var(--text-3); }

/* =========================================================
   FLASH MESSAGES
   ========================================================= */
.flash-stack {
  max-width: 720px;
  margin: 0 auto 24px;
  padding: 0 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.flash {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 44px 14px 16px;
  border-radius: var(--radius-input);
  font-size: 15px;
  border: 1px dashed currentColor;
  animation: fadeIn 200ms var(--ease);
  overflow: hidden;
}
.flash.success { background: var(--success-soft); color: var(--success); }
.flash.warning { background: var(--warn-soft); color: var(--warn); }
.flash.danger, .flash.error { background: var(--danger-soft); color: var(--danger); }
.flash.info { background: var(--accent-soft); color: var(--accent); }
.flash > span:first-child { flex: 1; }
.flash-countdown {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  opacity: 0.7;
  margin-right: 30px;
  min-width: 24px;
  text-align: right;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.flash-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: currentColor;
  opacity: 0.15;
}
.flash-progress-bar {
  height: 100%;
  width: 100%;
  background: currentColor;
  opacity: 0.7;
  transform-origin: left center;
}
.flash-close {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  color: inherit;
  background: var(--surface);
  border: 1px solid currentColor;
  opacity: .6;
  transition: opacity var(--dur);
}
.flash-close:hover { opacity: 1; }

/* =========================================================
   FOOTER
   ========================================================= */
.page-footer {
  margin: 32px 16px 16px;
  padding: 14px 22px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  color: var(--text-3);
  font-size: 13px;
  font-family: var(--mono);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* =========================================================
   ANIMATIONS
   ========================================================= */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes drawerIn {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
.page-enter { animation: fadeIn 320ms var(--ease); }

/* =========================================================
   LOGIN PAGE
   ========================================================= */
.login-wrap {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 90% 10%, color-mix(in oklab, var(--accent) 12%, transparent), transparent 60%),
    radial-gradient(800px 500px at 10% 90%, color-mix(in oklab, var(--accent-2) 10%, transparent), transparent 60%),
    var(--bg);
  position: relative;
  overflow: hidden;
}
.login-wrap::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.4;
  mask-image: radial-gradient(circle at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle at center, black 30%, transparent 70%);
  pointer-events: none;
}
.login-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(960px, 100%);
  min-height: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.login-brand {
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  padding: 48px 44px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-brand-deco {
  position: absolute; inset: 0; opacity: 0.25;
  pointer-events: none;
}
.login-brand-content { position: relative; z-index: 1; }
.login-form-pane {
  padding: 56px 52px;
  display: flex; flex-direction: column; justify-content: center;
}

/* =========================================================
   ANNOUNCEMENTS LAYOUT
   ========================================================= */
.announce-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  min-width: 0;
}
.announce-grid > * { min-width: 0; }
.announce-mobile-controls { display: none; min-width: 0; max-width: 100%; }

.announce-week-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--surface);
  margin-bottom: 12px;
}

.dept-chips {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  margin: 0 -2px 8px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  max-width: 100%;
  min-width: 0;
  mask-image: linear-gradient(to right, black 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
}
.dept-chips::-webkit-scrollbar { display: none; }
.dept-chip {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  font-size: 14px; font-weight: 500;
  color: var(--text-2);
  transition: all var(--dur);
  scroll-snap-align: start;
  white-space: nowrap;
}
.dept-chip:disabled { opacity: 0.4; cursor: not-allowed; }
.dept-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.dept-chip-count {
  font-family: var(--mono);
  font-size: 12px;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--text-3);
  min-width: 20px; text-align: center;
}
.dept-chip.active .dept-chip-count {
  background: color-mix(in oklab, var(--accent-ink) 25%, transparent);
  color: var(--accent-ink);
}

/* sidebar dept list */
.dept-list { display: flex; flex-direction: column; gap: 2px; }
.dept-list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  text-align: left;
  border-radius: var(--radius-btn);
  background: transparent;
  border-left: 2px solid transparent;
  color: var(--text);
  transition: all var(--dur);
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  width: 100%;
}
.dept-list-item:hover { background: var(--surface-2); }
.dept-list-item.active {
  background: var(--accent-soft);
  border-left-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.dept-list-item.disabled { opacity: 0.5; cursor: default; }
.dept-list-item .code {
  font-family: var(--mono); font-size: 12px;
  color: var(--text-3);
}
.dept-list-item .name { flex: 1; }
.dept-list-item .count {
  font-family: var(--mono); font-size: 12px;
  color: var(--text-3);
  min-width: 20px; text-align: right;
}
.dept-list-item.active .count { color: var(--accent); }

.dept-card-foot {
  padding: 10px 22px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-3); font-family: var(--mono);
}

/* =========================================================
   MOBILE NAV
   ========================================================= */
.nav-burger { display: none; }
.brand-text-sm { display: none; }

.nav-drawer-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: color-mix(in oklab, var(--bg) 60%, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 180ms var(--ease);
}
.nav-drawer {
  position: absolute; top: 0; left: 0; bottom: 0;
  width: min(320px, 86vw);
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: drawerIn 240ms var(--ease);
}
.nav-drawer-head {
  padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.nav-drawer-links {
  flex: 1; padding: 14px 12px;
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto;
}
.nav-drawer-link {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius-btn);
  font-size: 16px; font-weight: 500;
  color: var(--text-2);
  text-align: left;
  transition: background var(--dur), color var(--dur);
  text-decoration: none;
}
.nav-drawer-link:hover { background: var(--surface-2); color: var(--text); }
.nav-drawer-link.active {
  background: var(--accent-soft); color: var(--accent);
  font-weight: 600;
}
.nav-drawer-link span { flex: 1; }
.nav-drawer-sep {
  height: 1px; background: var(--border); margin: 12px 4px;
}
.nav-drawer-foot {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

/* =========================================================
   RESPONSIVE BREAKPOINTS
   ========================================================= */

/* Tablet */
@media (max-width: 960px) {
  .announce-grid {
    grid-template-columns: 200px 1fr;
    gap: 20px;
  }
  .navbar-inner { padding: 12px 20px; gap: 6px; }
  .page { padding: 32px 20px 72px; }
  .nav-link-label { display: none; }
  .nav-link { padding: 9px 12px; }
  .page-title { font-size: 32px; }
  .searchbox { width: 220px; }
  .user-chip-role { display: none; }
  .card-pad-lg { padding: 28px; }
}

/* Mobile */
@media (max-width: 680px) {
  .announce-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .announce-sidebar { display: none; }
  .announce-mobile-controls { display: block; }

  .navbar-inner {
    padding: 10px 14px;
    gap: 6px;
  }
  .nav-burger { display: grid; }
  .nav-desktop { display: none !important; }
  .brand { padding-right: 6px; }
  .brand-text { display: none; }
  .brand-text-sm { display: inline; }
  .user-chip {
    padding: 4px 4px 4px 4px;
    gap: 0;
  }
  .user-chip-name { display: none; }

  .page {
    padding: 20px 14px 64px;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 24px;
    padding-bottom: 18px;
  }
  .page-title { font-size: 26px; }
  .page-sub { font-size: 14px; }

  .card-pad { padding: 20px; }
  .card-pad-lg { padding: 22px; }

  .toolbar {
    padding: 12px;
    gap: 8px;
  }
  .searchbox { width: 100%; }

  /* Table → stacked card rows */
  .tbl { font-size: 15px; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td {
    display: block;
    width: 100%;
  }
  .tbl tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 12px 14px;
    margin-bottom: 10px;
  }
  .tbl tbody tr:hover { background: var(--surface); }
  .tbl tbody td {
    border: none;
    padding: 4px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
  }
  .tbl tbody td::before {
    content: attr(data-label);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-3);
    flex-shrink: 0;
  }
  .tbl tbody td:not([data-label])::before { display: none; }
  .tbl tbody td[data-primary="1"] {
    padding: 0 0 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 16px;
  }
  .tbl tbody td[data-primary="1"]::before { display: none; }

  .row { flex-direction: column; gap: 12px; }

  /* Login mobile */
  .login-wrap { padding: 0; }
  .login-card {
    grid-template-columns: 1fr;
    min-height: 100vh;
    width: 100%;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }
  .login-brand {
    padding: 28px 24px 32px;
    min-height: 220px;
  }
  .login-form-pane { padding: 32px 24px 40px; }
}

/* Very small */
@media (max-width: 400px) {
  .user-chip { display: none; }
}
