/* Campus vAI — dashboard design system
   ডুয়াল থিম: html.theme-dark (ডিফল্ট) / html.theme-light (মকআপ)
   ফন্ট: Plus Jakarta Sans (EN) + Hind Siliguri (BN) — দুটোই লোকাল বান্ডেল
*/

html.theme-light {
  /* ক্যাম্পাস-সারথি অ্যাপের sarothiLight থিম থেকে পোর্ট করা (Navy + Green) */
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --border: #e7ecf2;
  --border-strong: #d0d5dd;
  --text: #182230;
  --text-dim: #667085;
  --text-faint: #98a2b3;
  --primary: #142743;
  --primary-2: #142743;
  --primary-soft: #1427431a;
  --green: #08785c;
  --green-soft: #08785c1a;
  --yellow: #d28b17;
  --yellow-soft: #d28b171f;
  --red: #b42318;
  --red-soft: #b4231814;
  --teal: #08785c;
  --teal-soft: #08785c14;
  --orange: #d28b17;
  --orange-soft: #d28b1714;
  --purple: #344054;
  --purple-soft: #34405414;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: none;
  --shadow-hover: 0 8px 20px #14274314;
  --track: #eef1f7;
  --font-bn: "Hind Siliguri", "Plus Jakarta Sans", system-ui, sans-serif;
  --font-en: "Plus Jakarta Sans", "Hind Siliguri", system-ui, sans-serif;
}

html.theme-dark {
  /* অ্যাপের sarothiDark — AMOLED: ফ্ল্যাট কালো + সাদা */
  --bg: #000000;
  --surface: #000000;
  --surface-2: #121214;
  --border: #3a3a3a;
  --border-strong: #525252;
  --text: #ffffff;
  --text-dim: #a3a3a3;
  --text-faint: #6f6f76;
  --primary: #ffffff;
  --primary-2: #ffffff;
  --primary-soft: #ffffff16;
  --green: #fafafa;
  --green-soft: #ffffff1f;
  --yellow: #b9b9be;
  --yellow-soft: #ffffff0e;
  --red: #dcdcdf;
  --red-soft: #ffffff0c;
  --teal: #e8e8ea;
  --teal-soft: #ffffff14;
  --orange: #cfcfd4;
  --orange-soft: #ffffff0d;
  --purple: #e0e0e4;
  --purple-soft: #ffffff10;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: none;
  --shadow-hover: 0 12px 34px #0000009a;
  --track: #1c1c1e;
  --font-bn: "Hind Siliguri", "Plus Jakarta Sans", system-ui, sans-serif;
  --font-en: "Plus Jakarta Sans", "Hind Siliguri", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; }
body {
  font-family: var(--font-bn);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
html.theme-dark body { background: var(--bg); }

/* EN/সংখ্যা ফন্ট হেল্পার — পুরনো .manrope ক্লাসের নাম রাখা হয়েছে (কম চার্ন) */
.manrope, .en, code, input[type=password], .badge, .kpi-badge, .chip, .mono {
  font-family: var(--font-en);
}
.en-label { font-family: var(--font-en); font-size: .8rem; letter-spacing: .04em; }

a { color: inherit; }

.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

/* ---------- sidebar ---------- */
.sidebar {
  display: flex; flex-direction: column;
  padding: 22px 14px 16px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 20px; }
.brand.center { justify-content: center; padding-bottom: 16px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--primary);
  font-family: var(--font-en); font-weight: 800; font-size: .82rem; color: #fff;
  letter-spacing: .01em;
}
html.theme-dark .brand-mark { color: #000; }
.brand-name { font-weight: 700; font-size: .98rem; line-height: 1.25; letter-spacing: -.01em; }
.brand-sub { color: var(--text-faint); font-size: .72rem; }

.sidebar-label {
  color: var(--text-faint); font-size: .68rem; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase;
  padding: 14px 12px 6px; font-family: var(--font-en);
}
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-dim); text-decoration: none; font-size: .92rem;
  transition: background .15s ease, color .15s ease;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary-2); font-weight: 600;
}
.nav-item .ic { opacity: .85; width: 18px; text-align: center; font-size: .9rem; }

/* sidebar ফুটার — সার্ভার স্ট্যাটাস (মকআপ) */
.sidebar-foot { display: flex; flex-direction: column; gap: 10px; }
.server-stat {
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 3px;
}
.server-stat-line { display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: 0 0 auto; }
html.theme-dark .dot { box-shadow: none; }
.dot.warn { background: var(--yellow); }
.dot.off { background: var(--text-faint); }
.sim { font-size: .82rem; font-weight: 600; }
.sim-sub { color: var(--text-faint); font-family: var(--font-en); font-size: .72rem; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--surface-2); border-radius: var(--radius-sm); }
.me-name { font-size: .86rem; font-weight: 500; }
.me-role { font-size: .66rem; color: var(--text-faint); letter-spacing: .06em; text-transform: uppercase; font-family: var(--font-en); }

/* ---------- content ---------- */
.content { padding: 26px 34px 56px; min-width: 0; }
.content-wrap { width: 100%; min-width: 0; }
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 20px; gap: 16px; flex-wrap: wrap;
}
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; font-family: var(--font-en); }
h2 { font-size: 1rem; font-weight: 700; margin-bottom: 14px; font-family: var(--font-en); }
.page-sub { color: var(--text-dim); font-size: .86rem; margin-top: 3px; }
.head-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-en); font-weight: 700; font-size: .82rem;
}
html.theme-dark .avatar { color: #000; }

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
html.theme-dark .card { background: var(--surface); }
.mt0 { margin-top: 0; }
.mt16 { margin-top: 16px; }
.mb12 { margin-bottom: 12px; }
.mb16 { margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2-1 { grid-template-columns: 2fr 1fr; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.w100 { width: 100%; }

.card-label {
  color: var(--text-faint); font-size: .7rem; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase;
  font-family: var(--font-en); margin-bottom: 14px;
}

/* kpi কার্ড (মকআপ) */
.kpi-label { color: var(--text-dim); font-size: .8rem; margin-bottom: 8px; }
.kpi-value {
  font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em;
  font-family: var(--font-en); display: flex; align-items: baseline; gap: 4px;
}
.kpi-value small { font-size: .8rem; font-weight: 600; color: var(--text-faint); }
.kpi-foot { margin-top: 8px; color: var(--text-faint); font-size: .74rem; }

/* মিটার */
.meter { height: 6px; background: var(--track); border-radius: 99px; margin-top: 10px; overflow: hidden; }
.meter-fill { height: 100%; border-radius: 99px; background: var(--primary); transition: width .4s ease; }
.meter-fill.ok { background: var(--teal); }
.meter-fill.warn { background: var(--yellow); }
.meter-fill.crit { background: var(--red); }

/* ---------- bar chart (pure CSS) ---------- */
.bars {
  display: flex; align-items: flex-end; gap: 5px;
  height: 132px; padding-top: 6px;
}
.bar {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  height: 100%; justify-content: flex-end;
}
.bar-fill {
  width: 100%; max-width: 26px;
  border-radius: 5px 5px 2px 2px;
  background: var(--primary);
  opacity: .9; min-height: 3px;
  transition: height .4s ease, opacity .15s ease;
}
.bar:hover .bar-fill { opacity: 1; }
.bar.zero .bar-fill { background: var(--track); opacity: 1; height: 3px !important; }
.bar-time { color: var(--text-faint); font-family: var(--font-en); font-size: .62rem; }
.bar-live .bar-fill { box-shadow: 0 0 0 2px var(--primary-soft); }

/* ---------- badges & chips & alerts ---------- */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 99px;
  font-size: .68rem; font-weight: 700; letter-spacing: .03em; white-space: nowrap;
}
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-blue { background: var(--primary-soft); color: var(--primary-2); }
.badge-teal { background: var(--teal-soft); color: var(--teal); }
.badge-yellow { background: var(--yellow-soft); color: var(--yellow); }
.badge-orange { background: var(--orange-soft); color: var(--orange); }
.badge-purple { background: var(--purple-soft); color: var(--purple); }
.badge-gray { background: var(--surface-2); color: var(--text-faint); }

.chip {
  padding: 5px 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 99px; font-size: .74rem; color: var(--text-dim);
}
.chip-btn {
  padding: 7px 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 99px; font-size: .82rem; color: var(--text-dim); text-decoration: none;
  transition: all .15s ease;
}
.chip-btn:hover { color: var(--text); border-color: var(--border-strong); }
.chip-on { background: var(--primary-soft); color: var(--primary-2); border-color: var(--primary); font-weight: 600; }

.running-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px; border-radius: 99px;
  background: var(--green-soft); color: var(--green);
  border: 1px solid transparent;
  font-family: var(--font-en); font-size: .74rem; font-weight: 700;
}
.running-pill.off {
  background: var(--yellow-soft); color: var(--yellow);
}

.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: .88rem; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.alert-red { background: var(--red-soft); border: 1px solid #b4231833; color: var(--red); }
.alert-ok { background: var(--green-soft); border: 1px solid #08785c33; color: var(--green); }
html.theme-dark .alert-red { background: #ffffff0c; border-color: #ffffff2a; color: #f4f4f5; }
html.theme-dark .alert-ok { background: #ffffff1f; border-color: #ffffff22; color: #f4f4f5; }
.alert-item { display: inline-block; }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer;
  font-family: var(--font-bn); font-size: .88rem; font-weight: 600;
  text-decoration: none; transition: all .15s ease; background: none;
  color: inherit;
}
.btn-sm { padding: 6px 11px; font-size: .78rem; border-radius: 8px; }
.btn-primary { background: var(--primary); color: #fff; }
html.theme-dark .btn-primary { color: #000; box-shadow: 0 6px 16px #ffffff14; }
html.theme-dark .btn-primary:hover { box-shadow: 0 8px 22px #ffffff22; }
.btn-ghost { background: var(--surface); color: var(--text-dim); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--border-strong); }
.btn-danger:hover { border-color: var(--red); color: var(--red); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { color: var(--text-dim); font-size: .8rem; }
.field input, .field select, .field textarea {
  padding: 9px 13px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border-strong);
  color: var(--text); font-family: var(--font-bn); font-size: .9rem;
  outline: none; transition: border .15s ease; width: 100%;
}
html.theme-dark .field input, html.theme-dark .field select, html.theme-dark .field textarea { background: var(--surface-2); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.field.check { flex-direction: row; align-items: center; gap: 10px; font-size: .86rem; color: var(--text-dim); }
.field.check input { width: 17px; height: 17px; accent-color: var(--primary); }
.field input[type=file] { padding: 8px; }
.field textarea { resize: vertical; max-width: 100%; }
.pop-panel input { font-family: var(--font-en); }

.form-card form { display: flex; flex-direction: column; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-card { margin-bottom: 0; }

/* ---------- table ---------- */
.table-card { padding: 18px 20px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th {
  text-align: left; color: var(--text-faint); font-weight: 600;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  font-family: var(--font-en); white-space: nowrap;
}
td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
.cell-strong { font-weight: 600; }
.cell-sub { color: var(--text-dim); font-size: .78rem; }
.notice-att { display: inline-flex; align-items: center; gap: 4px; margin-top: 5px; font-size: .74rem; font-weight: 600; color: var(--green); text-decoration: none; }
.notice-att:hover { text-decoration: underline; }
.mono-num { font-family: var(--font-en); }
.empty { color: var(--text-faint); text-align: center; padding: 26px !important; }
.row-off { opacity: .45; }
.actions { white-space: nowrap; }
.actions form { display: inline-block; vertical-align: middle; }
.actions form + form { margin-left: 8px; }

/* স্ট্যাটাস পিল (recent requests) */
.status-code {
  display: inline-block; min-width: 38px; text-align: center;
  padding: 2px 7px; border-radius: 6px;
  font-family: var(--font-en); font-size: .72rem; font-weight: 700;
}
.sc-2 { background: var(--green-soft); color: var(--green); }
.sc-3 { background: var(--primary-soft); color: var(--primary-2); }
.sc-4 { background: var(--yellow-soft); color: var(--yellow); }
.sc-401 { background: var(--orange-soft); color: var(--orange); }
.sc-5 { background: var(--red-soft); color: var(--red); }
/* dark থিমে monochrome status tones */
html.theme-dark .sc-2 { background: #ffffff1c; color: #fafafa; }
html.theme-dark .sc-3 { background: #ffffff12; color: #d4d4d8; }
html.theme-dark .sc-4 { background: #ffffff0c; color: #a1a1aa; }
html.theme-dark .sc-401 { background: #ffffff0a; color: #d4d4d8; }
html.theme-dark .sc-5 { background: transparent; border: 1px solid #ffffff30; color: #ffffff; }

/* ---------- popover ---------- */
.pop { position: relative; display: inline-block; }
.pop summary { list-style: none; cursor: pointer; display: inline-flex; }
.pop summary::-webkit-details-marker { display: none; }
.pop-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 12px; width: 240px;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: 0 10px 30px #10182822;
}

/* ---------- notification bell ---------- */
.pop summary.btn { position: relative; }
.bell-badge {
  position: absolute; top: -6px; right: -6px;
  min-width: 17px; height: 17px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 99px; background: var(--red); color: #fff;
  font-family: var(--font-en); font-size: .62rem; font-weight: 700;
  border: 2px solid var(--surface);
}
html.theme-dark .bell-badge { background: #fff; color: #000; border-color: var(--surface); }
.notif-panel { width: 268px; gap: 6px; }
.notif-item {
  font-size: .82rem; padding: 7px 9px; border-radius: 8px;
  background: var(--surface-2); color: var(--text-dim);
}
.notif-item.ok { color: var(--green); }
.notif-meta { font-size: .7rem; color: var(--text-faint); padding: 4px 2px 0; }

/* হেডার popover ফর্ম (নতুন ইউজার/রুম) */
.form-panel { width: 330px; gap: 10px; }
.form-panel .field > span { font-size: .74rem; }
.form-panel .field input, .form-panel .field select { padding: 8px 11px; font-size: .85rem; }
.form-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-block { display: flex; flex-direction: column; gap: 10px; }
.role-block[hidden] { display: none !important; }
.row-inline { display: flex; gap: 6px; }
.row-inline input { flex: 1; min-width: 0; }

/* ---------- collapsible batch group (users পেজ) ---------- */
details.batch-block {
  border-left-width: 4px;
  border-left-style: solid;
  border-left-color: var(--primary);
  padding: 16px 20px;
  margin-bottom: 16px;
}
details.batch-block.bc-0 { border-left-color: #142743; }
details.batch-block.bc-1 { border-left-color: #08785c; }
details.batch-block.bc-2 { border-left-color: #d28b17; }
details.batch-block.bc-3 { border-left-color: #b42318; }
details.batch-block.bc-4 { border-left-color: #344054; }
details.batch-block.bc-5 { border-left-color: #667085; }
html.theme-dark details.batch-block.bc-0 { border-left-color: #ffffff; }
html.theme-dark details.batch-block.bc-1 { border-left-color: #d4d4d8; }
html.theme-dark details.batch-block.bc-2 { border-left-color: #a1a1aa; }
html.theme-dark details.batch-block.bc-3 { border-left-color: #71717a; }
html.theme-dark details.batch-block.bc-4 { border-left-color: #52525b; }
html.theme-dark details.batch-block.bc-5 { border-left-color: #e4e4e7; }
details.batch-block > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
}
details.batch-block > summary::-webkit-details-marker { display: none; }
details.batch-block > summary:hover .card-label { color: var(--text); }
details.batch-block .batch-count {
  color: var(--text-faint); font-size: .74rem; font-family: var(--font-en); white-space: nowrap;
}
details.batch-block .batch-count.ok { color: var(--green); }
details.batch-block .batch-count.bad { color: var(--red); }
details.batch-block .batch-spacer { flex: 1 1 0; min-width: 8px; }
details.batch-block .batch-coord select {
  padding: 5px 10px; border-radius: 8px; max-width: 190px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  color: var(--text); font-family: var(--font-bn); font-size: .8rem; outline: none; cursor: pointer;
}
details.batch-block .batch-coord select:hover { border-color: var(--primary); }
details.batch-block .batch-coord { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; }
details.batch-block .batch-coord-now {
  font-size: .76rem; color: var(--green); white-space: nowrap; font-weight: 600;
}
details.batch-block .batch-del { display: flex; flex: 0 0 auto; }
details.batch-block .batch-chevron {
  color: var(--text-faint); font-size: .78rem;
  transition: transform .15s ease; width: 12px; text-align: center;
}
details.batch-block[open] .batch-chevron { transform: rotate(90deg); }
details.batch-block[open] > table { margin-top: 10px; }
details.batch-block:not([open]) { padding-bottom: 16px; }

/* ---------- controls কার্ড ---------- */
.control-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border);
}
.control-row:first-of-type { padding-top: 0; }
.control-row:last-child { border-bottom: none; padding-bottom: 0; }
.control-name { font-weight: 600; font-size: .9rem; }
.control-desc { color: var(--text-dim); font-size: .78rem; margin-top: 2px; }
.control-state { font-family: var(--font-en); font-weight: 700; font-size: .72rem; }

/* ---------- filter bar ---------- */
.filterbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.searchbox { display: flex; gap: 8px; margin-left: auto; }
.searchbox input {
  padding: 8px 14px; border-radius: 99px; width: 230px;
  background: var(--surface); border: 1px solid var(--border-strong);
  color: var(--text); font-family: var(--font-bn); font-size: .86rem; outline: none;
}
html.theme-dark .searchbox input { background: var(--surface-2); }
.searchbox input:focus { border-color: var(--green); }

/* ---------- login ---------- */
.login-body {
  display: grid; place-items: center; min-height: 100vh;
  background: var(--bg);
}
html.theme-dark .login-body { background: var(--bg); }
.login-wrap { width: min(400px, 92vw); }
.login-card { padding: 34px; display: flex; flex-direction: column; gap: 18px; }
.login-card h1 { text-align: center; font-size: 1.2rem; }
.hint { text-align: center; color: var(--text-faint); font-size: .72rem; }
.theme-fab {
  position: fixed; top: 16px; right: 16px;
  padding: 8px 11px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-dim); cursor: pointer; font-size: .95rem;
  box-shadow: var(--shadow);
}

/* ---------- routine weekly grid ---------- */
.rt-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rt-head .card-label { margin-bottom: 4px; }
.rt-week-sub { color: var(--text-faint); font-size: .78rem; margin-bottom: 14px; }
.tt-scroll { overflow-x: auto; }
table.tt { border-collapse: separate; border-spacing: 6px; }
table.tt th, table.tt td { border: none; padding: 0; }
table.tt th.tt-day {
  color: var(--text-faint); font-weight: 700; font-size: .68rem;
  text-transform: uppercase; letter-spacing: .07em; padding: 2px 4px; text-align: center;
}
table.tt th.tt-corner { min-width: 54px; }
table.tt td.tt-time {
  color: var(--text-faint); font-family: var(--font-en); font-size: .68rem;
  white-space: nowrap; vertical-align: top; padding: 12px 6px 0 0; text-align: right;
}
table.tt td.tt-cell {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; min-width: 104px; padding: 5px; vertical-align: top;
}
table.tt td.tt-has { border-color: var(--border-strong); }
.tt-free { color: var(--text-faint); font-size: .66rem; text-align: center; display: block; padding-top: 15px; }

details.tt-x { display: block; }
details.tt-x > summary { list-style: none; }
details.tt-x > summary::-webkit-details-marker { display: none; }
.tt-chip {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: var(--primary-soft); color: var(--primary-2);
  border: 1px solid transparent; border-radius: 8px;
  padding: 6px 8px; font-size: .72rem; font-weight: 700;
  font-family: var(--font-en); line-height: 1.3;
  transition: border .15s ease;
}
.tt-chip:hover { border-color: var(--primary); }
.tt-chip + .tt-chip { margin-top: 4px; }
.tt-chip .tt-room { display: block; font-weight: 600; font-size: .64rem; opacity: .75; }
.tt-chip.lab { background: var(--teal-soft); color: var(--teal); }
.tt-chip.cancelled { background: transparent; color: var(--red); border: 1px dashed var(--red); text-decoration: line-through; }
.tt-chip.cancelled .tt-room { text-decoration: none; }
details.tt-x[open] > summary.tt-chip { border-color: var(--primary); }
.tt-pop {
  margin-top: 6px; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 9px; display: flex; flex-direction: column; gap: 7px;
  font-weight: 400; color: var(--text);
}
.tt-pop .pop-title { font-weight: 700; font-size: .78rem; }
.tt-pop .pop-meta { color: var(--text-dim); font-size: .72rem; display: flex; flex-direction: column; gap: 2px; }
.tt-pop form { display: block; }
.tt-pop .btn { width: 100%; }

.rt-check {
  width: 38px; height: 38px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; margin-bottom: 12px;
}
.rt-check.ok { background: var(--green-soft); color: var(--green); }
.rt-check.bad { background: var(--red-soft); color: var(--red); }
.rt-status-t { font-weight: 700; font-size: .95rem; }
.rt-status-sub { color: var(--text-faint); font-size: .76rem; margin-top: 5px; }
.rt-clash { font-size: .74rem; color: var(--red); margin-top: 9px; display: flex; flex-direction: column; gap: 4px; font-family: var(--font-en); }
.rt-grid-note {
  color: var(--yellow); background: var(--yellow-soft); border-radius: 8px;
  padding: 7px 10px; font-size: .74rem; margin-bottom: 12px;
}
.crs-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.crs-row:last-child { border-bottom: none; }
.crs-code { font-family: var(--font-en); font-weight: 700; font-size: .8rem; }
.crs-title { color: var(--text-dim); font-size: .72rem; }
.crs-teacher { color: var(--text-faint); font-size: .72rem; margin-left: auto; text-align: right; max-width: 42%; }
.crs-week { flex: 0 0 auto; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .cols-3, .cols-4, .cols-2-1, .cols-2 { grid-template-columns: 1fr; }
  .content { padding: 20px 16px 40px; }
  .searchbox { margin-left: 0; width: 100%; }
  .searchbox input { width: 100%; flex: 1; }
  .bars { height: 110px; }
}

/* htmx swap fade */
#stats.htmx-settling { opacity: .55; transition: opacity .2s ease; }
#stats { transition: opacity .2s ease; }

/* ---------- user detail page ---------- */
.detail-table { width: 100%; border-collapse: collapse; margin: 6px 0 4px; }
.detail-table th {
  text-align: left; width: 150px; color: var(--text-dim); font-weight: 500;
  font-size: .8rem; vertical-align: top; padding: 7px 10px 7px 0;
}
.detail-table td { padding: 7px 0; font-size: .88rem; }
.code-sub, .pw-code { font-family: var(--font-en); font-size: .8rem; word-break: break-all; }
.pw-code {
  background: var(--surface-2); border: 1px solid var(--border-strong);
  padding: 3px 10px; border-radius: 8px; font-size: .85rem;
}
.detail-form { margin-top: 10px; }
.detail-form .btn { flex: 0 0 auto; }
.detail-actions-manrope { display: flex; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
