/* ── Reset & Variables ───────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:           #f0ede8;
  --surface:      #ffffff;
  --surface2:     #f7f5f2;
  --border:       rgba(0,0,0,0.09);
  --text:         #1c1917;
  --muted:        #78716c;
  --accent:       #1d4ed8;
  --accent-light: #eff6ff;
  --accent-mid:   #1e40af;
  --danger:       #b91c1c;
  --danger-light: #fef2f2;
  --success:      #15803d;
  --success-light:#f0fdf4;
  --warning:      #b45309;
  --warning-light:#fffbeb;
  --sidebar-w:    220px;
  --header-h:     52px;
  --radius:       8px;
  --radius-sm:    5px;
  --shadow:       0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}

/* ── Header ─────────────────────────────────────────────── */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--accent);
  display: flex;
  align-items: center;
  padding: 0 1rem 0 calc(var(--sidebar-w) + 1rem);
  z-index: 50;
  gap: 12px;
  transition: padding-left 0.22s ease;
}
.header-title {
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.2px;
  flex: 1;
}
.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.header-user:hover { background: rgba(255,255,255,0.1); }
.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 6px;
  margin-right: 4px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.menu-btn:hover { background: rgba(255,255,255,0.12); }

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 220px; /* fixed width so collapse animates without snapping */
  background: var(--text);
  padding-top: var(--header-h);
  z-index: 40;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transition: transform 0.22s ease;
}
.sidebar-close {
  display: none;
  position: absolute; top: calc(var(--header-h) + 6px); right: 8px;
  width: 32px; height: 32px; align-items: center; justify-content: center;
  background: none; border: none; color: rgba(255,255,255,0.6); cursor: pointer;
  border-radius: 6px;
}
.sidebar-close:hover { background: rgba(255,255,255,0.1); color: #fff; }
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  z-index: 39;
}
body.sidebar-collapsed { --sidebar-w: 0px; }
body.sidebar-collapsed .sidebar { transform: translateX(-220px); }
.sidebar-section {
  padding: 16px 12px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.3);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  margin: 1px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: rgba(255,255,255,0.65);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
  user-select: none;
}
.nav-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.nav-item.active { background: var(--accent); color: #fff; }
.nav-icon { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.8; }
.nav-item.active .nav-icon { opacity: 1; }
.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

/* ── Main ────────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  padding-top: var(--header-h);
  min-height: 100vh;
  transition: margin-left 0.22s ease;
}
.page { display: none; padding: 1.5rem; max-width: 1100px; }
.page.active { display: block; }
.page-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.page-sub { font-size: 13px; color: var(--muted); margin-bottom: 1.5rem; }

/* ── Card ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  overflow: hidden;
}
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-body { padding: 16px 18px; }

/* ── Filters ─────────────────────────────────────────────── */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.filter-label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted);
}
select.filter-select, input.filter-input {
  height: 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  font-size: 13px;
  color: var(--text);
  background: var(--surface2);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
  cursor: pointer;
}
select.filter-select:focus, input.filter-input:focus {
  border-color: var(--accent); background: #fff;
}
input.filter-input { cursor: text; min-width: 200px; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  height: 36px; padding: 0 18px;
  border: none; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-mid); }
.btn-ghost { background: none; border: 1.5px solid var(--border); color: var(--muted); }
.btn-ghost:hover { background: var(--surface2); color: var(--text); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12px; }

/* ── Table ───────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; padding: 9px 14px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--muted); border-bottom: 1px solid var(--border);
  background: var(--surface2); white-space: nowrap;
}
.data-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { cursor: pointer; transition: background 0.1s; }
.data-table tbody tr:hover td { background: var(--accent-light); }
.mono { font-family: 'Courier New', monospace; font-size: 12px; color: var(--accent); }

.att-table th,
.att-table td { font-size: 12px; }
.att-table tbody tr.att-row-active td { background: var(--accent-light); }
.att-main { font-weight: 700; color: var(--text); }
.att-muted { color: var(--muted); font-size: 12px; margin-top: 2px; }
.att-num { text-align: right; font-variant-numeric: tabular-nums; }
.att-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.att-pills { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

.lmh-card {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}
.lmh-toggle {
  width: 100%;
  border: 0;
  background: var(--surface2);
  color: var(--text);
  font-family: inherit;
  font-weight: 700;
  font-size: 12px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  text-align: left;
}
.lmh-toggle span:last-child { color: var(--muted); font-weight: 600; }
.lmh-body { padding: 0 12px 12px; }
.lmh-semester {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 10px;
  overflow: hidden;
}
.lmh-semester summary {
  cursor: pointer;
  background: var(--surface2);
  padding: 8px 10px;
  font-weight: 700;
  font-size: 12px;
  color: var(--accent);
}
.lmh-semester summary span {
  float: right;
  color: var(--muted);
  font-weight: 600;
}

.cdcq-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.cdcq-stat {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.cdcq-stat-num { font-weight: 800; font-size: 18px; }
.cdcq-stat-label { color: var(--muted); font-size: 11px; margin-top: 2px; }
.cdcq-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 14px 18px;
}
.cdcq-panel-title { font-weight: 700; margin-bottom: 8px; }
#page-cdcq-history .cdcq-detail-grid .data-table {
  min-width: 720px;
}
#page-cdcq-history .cdcq-detail-grid > div {
  min-width: 0;
  overflow-x: auto;
}

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-green  { background: var(--success-light); color: var(--success); }
.badge-red    { background: var(--danger-light);  color: var(--danger); }
.badge-yellow { background: var(--warning-light); color: var(--warning); }
.badge-blue   { background: var(--accent-light);  color: var(--accent); }
.badge-gray   { background: #f4f4f5; color: #71717a; }

/* ── States ──────────────────────────────────────────────── */
.loading-state, .empty-state, .error-state {
  padding: 2.5rem; text-align: center; color: var(--muted); font-size: 13px;
}
.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.6s linear infinite;
  margin-right: 6px; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 18px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--muted);
}
.pagination .spacer { flex: 1; }
.page-btn {
  height: 28px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); font-size: 12px;
  cursor: pointer; font-family: inherit; color: var(--text);
}
.page-btn:disabled { opacity: 0.35; cursor: default; }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Inline detail ───────────────────────────────────────── */
.inline-header {
  display: flex; align-items: center; gap: 14px; margin-bottom: 20px;
}
.inline-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent-light); color: var(--accent);
  font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.inline-tabs {
  display: flex; padding: 0; margin-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--surface);
  border: 1px solid var(--border); border-bottom: none;
}
.inline-body {
  background: var(--surface);
  border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 20px 22px;
}
.ptab {
  padding: 11px 16px; font-size: 13px; font-weight: 600;
  color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  white-space: nowrap; transition: color 0.12s;
}
.ptab:hover { color: var(--text); }
.ptab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Info grid & panel pieces ────────────────────────────── */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.info-item .lbl {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--muted); margin-bottom: 4px;
}
.info-item .val { font-size: 14px; font-weight: 500; }

.grade-score-pass { color: var(--success); font-weight: 700; }
.grade-score-fail { color: var(--danger);  font-weight: 700; }
.grade-score-null { color: #ccc; }

.tuition-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 20px; }
.tuition-box {
  background: var(--surface2); border-radius: var(--radius);
  padding: 16px 18px; border: 1px solid var(--border);
}
.tuition-box .lbl {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--muted); margin-bottom: 8px;
}
.tuition-box .val { font-size: 18px; font-weight: 700; line-height: 1.2; }

/* ── Profile panel (side) ────────────────────────────────── */
.profile-panel {
  display: none;
  position: fixed; top: var(--header-h); right: 0; bottom: 0;
  width: 500px; background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(0,0,0,0.1);
  z-index: 30; flex-direction: column; overflow: hidden;
  height: calc(100vh - var(--header-h));
}
.profile-panel.open { display: flex; }
.panel-head {
  padding: 18px 22px 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--surface); flex-shrink: 0;
}
.panel-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--accent-light); color: var(--accent);
  font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 2px;
}
.panel-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; line-height: 1.2; }
.panel-meta { font-size: 12px; color: var(--muted); line-height: 1.6; }
.panel-close {
  margin-left: auto; background: none;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  width: 32px; height: 32px; font-size: 18px; cursor: pointer;
  color: var(--muted); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.panel-close:hover { background: var(--surface2); color: var(--text); }
.panel-tabs {
  display: flex; border-bottom: 1px solid var(--border);
  padding: 0 22px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  flex-shrink: 0; background: var(--surface);
}
.panel-body {
  flex: 1 1 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  min-height: 0; background: var(--surface); display: flex; flex-direction: column;
}
.ptab-content { display: none; padding: 20px 22px; flex: 1; background: var(--surface); }
.ptab-content.active { display: flex !important; flex-direction: column; background: var(--surface); }
.panel-overlay { display: none; }

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-220px); transition: transform 0.2s; width: 220px; z-index: 60; }
  .sidebar.open { transform: translateX(0); }
  .sidebar.open + .sidebar-overlay { display: block; }
  .sidebar-close { display: flex; }
  .header { padding-left: 1rem; }
  .menu-btn { display: flex !important; }
  .profile-panel { width: 100%; z-index: 50; }
  .page { padding: 1rem; }
  .filters { flex-direction: column; }
  .filter-group { min-width: unset; width: 100%; }
  select.filter-select, input.filter-input { width: 100%; }
  .info-grid { grid-template-columns: 1fr; gap: 14px; }
  .tuition-row { grid-template-columns: 1fr; }
  .tuition-box .val { font-size: 20px; }
  .card, #inlineDetail > div:last-child { overflow-x: auto; }
  .data-table { min-width: 600px; }
  .panel-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.3); z-index: 45;
  }
}
/* ── Curriculum page ─────────────────────────── */
.curr-summary {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  padding: 10px 14px; background: var(--surface2); border-radius: var(--radius-sm);
  margin-bottom: 12px; font-size: 13px;
}
.curr-stat { color: var(--muted); }
.curr-stat b { color: var(--text); }
.curr-total-hp b { color: var(--accent); font-size: 14px; }
.curr-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.curr-class-label { font-weight: 600; font-size: 15px; color: var(--text); }
.curr-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.curr-table th {
  text-align: left; padding: 8px 10px; background: var(--surface2);
  color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.curr-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); }
.curr-sem-header td {
  background: var(--surface2); font-size: 12px;
  padding: 5px 10px; color: var(--muted);
}
.curr-row:hover td { background: var(--surface2); }
.curr-inactive td { opacity: 0.45; }
.curr-code { font-family: monospace; font-size: 12px; color: var(--accent); white-space: nowrap; }
.curr-name { max-width: 320px; }
.curr-note { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.curr-num { text-align: right; font-variant-numeric: tabular-nums; }
.curr-hp { color: var(--accent); font-weight: 500; }
.curr-actions { white-space: nowrap; text-align: right; }
.curr-btn-edit, .curr-btn-del {
  border: none; background: none; cursor: pointer; padding: 3px 6px;
  border-radius: var(--radius-sm); font-size: 13px; opacity: 0.5;
  transition: opacity 0.15s, background 0.15s;
}
.curr-btn-edit:hover { opacity: 1; background: var(--surface2); }
.curr-btn-del:hover  { opacity: 1; background: #fee2e2; color: var(--danger); }
.curr-loading, .curr-empty { text-align: center; color: var(--muted); padding: 32px; }
.curr-flatfee { color: var(--accent); font-style: italic; }
.curr-table th.curr-num { text-align: right; }

/* Commitments section */
.curr-commitments {
  background: var(--surface);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.commit-header {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: var(--accent-light);
  border-bottom: 1px solid var(--accent);
}
.commit-title { font-weight: 700; font-size: 13px; color: var(--accent); }
.commit-sub   { font-size: 11px; color: var(--muted); }
.commit-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.commit-table th {
  text-align: left; padding: 7px 12px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--muted);
  background: var(--surface2); border-bottom: 1px solid var(--border);
}
.commit-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.commit-table tr:last-child td { border-bottom: none; }
.commit-table tr:hover td { background: var(--accent-light); }
.curr-flatfee { color: var(--accent); font-style: italic; }
.curr-table th.curr-num { text-align: right; }

/* Finance col visibility */
.finance-col { display: none; }
body.role-admin .finance-col,
body.role-accountant .finance-col { display: table-cell; }
body.role-admin .form-group.finance-col,
body.role-accountant .form-group.finance-col { display: block; }

/* Subject search dropdown */
.subject-dropdown {
  position: absolute; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); max-height: 200px; overflow-y: auto;
  z-index: 100; width: 100%; margin-top: 2px;
}
.subj-result {
  padding: 8px 12px; cursor: pointer; font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.subj-result:hover { background: var(--surface2); }
.subj-code { font-family: monospace; color: var(--accent); margin-right: 8px; }
.subj-empty { padding: 8px 12px; color: var(--muted); font-size: 13px; }
.selected-subject {
  font-size: 13px; color: var(--accent); font-weight: 500;
  padding: 4px 0; min-height: 20px;
}
.form-group { position: relative; display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 12px; color: var(--muted); font-weight: 500; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 80px; }
/* ── Modals ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-box {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}
.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--muted);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  line-height: 1;
}
.modal-close:hover { background: var(--surface2); color: var(--text); }
.modal-body {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.form-input {
  height: 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  font-size: 13px;
  color: var(--text);
  background: var(--surface2);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
.form-input:focus { border-color: var(--accent); background: #fff; }

/* ─────────────────────────────────────────────────────────────
   GRADUATION PAGE STYLES
   ───────────────────────────────────────────────────────────── */
.grad-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 25px;
}

.grad-stat {
  background: var(--bg-secondary);
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}

.grad-stat-num {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 5px;
}

.grad-stat-label {
  font-size: 14px;
  color: var(--muted);
}

.grad-stat-success .grad-stat-num { color: var(--success); }
.grad-stat-danger .grad-stat-num { color: var(--danger); }
.grad-stat-warning .grad-stat-num { color: var(--warning); }

.grad-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
}

.grad-badge-success {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.grad-badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.grad-badge-warning {
  background: rgba(251, 191, 36, 0.1);
  color: var(--warning);
}

.grad-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

.grad-table th {
  background: var(--bg-secondary);
  padding: 12px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border);
}

.grad-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.grad-table tbody tr:hover {
  background: var(--bg-secondary);
}

.grad-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Mobile card view */
.grad-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 15px;
}

.grad-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.2s;
}

.grad-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.grad-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.grad-card-name {
  font-weight: 600;
  font-size: 15px;
  flex: 1;
}

.grad-card-info {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.grad-card-reason {
  margin-top: 8px;
  color: var(--danger);
  font-weight: 500;
}

/* Detail modal */
.grad-detail-modal {
  max-width: 600px;
}

.grad-detail-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  padding: 15px;
  background: var(--bg-secondary);
  border-radius: 6px;
  margin-bottom: 15px;
}

.grad-payment-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.grad-payment-table th {
  background: var(--bg-secondary);
  padding: 8px;
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.grad-payment-table td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 768px) {
  .grad-table {
    display: none;
  }
  
  .grad-summary {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grad-stat {
    padding: 15px;
  }
  
  .grad-stat-num {
    font-size: 24px;
  }
}

#page-legacy-graduation .card {
  overflow: hidden;
}

#page-legacy-graduation .grad-table {
  width: 100%;
  table-layout: fixed;
}

#page-legacy-graduation .grad-table th,
#page-legacy-graduation .grad-table td {
  vertical-align: middle;
  white-space: normal;
  word-break: break-word;
}

#page-legacy-graduation .grad-table th:nth-child(1),
#page-legacy-graduation .grad-table td:nth-child(1) { width: 120px; }

#page-legacy-graduation .grad-table th:nth-child(2),
#page-legacy-graduation .grad-table td:nth-child(2) { width: 190px; }

#page-legacy-graduation .grad-table th:nth-child(3),
#page-legacy-graduation .grad-table td:nth-child(3) { width: 90px; }

#page-legacy-graduation .grad-table th:nth-child(4),
#page-legacy-graduation .grad-table td:nth-child(4) { width: 120px; }

#page-legacy-graduation .legacy-grad-mini {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
}

#page-legacy-graduation .legacy-grad-reason {
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}

@media (max-width: 768px) {
  #page-legacy-graduation .filters {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  #page-legacy-graduation .filter-group {
    width: 100%;
    min-width: 0 !important;
  }

  #page-legacy-graduation .filter-input,
  #page-legacy-graduation .filter-select,
  #page-legacy-graduation .btn {
    width: 100%;
  }

  #page-legacy-graduation .grad-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  #page-legacy-graduation .grad-table,
  #page-legacy-graduation .grad-table thead,
  #page-legacy-graduation .grad-table tbody,
  #page-legacy-graduation .grad-table tr,
  #page-legacy-graduation .grad-table th,
  #page-legacy-graduation .grad-table td {
    display: block;
    width: 100% !important;
  }

  #page-legacy-graduation .grad-table thead {
    display: none;
  }

  #page-legacy-graduation .grad-table tr {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
  }

  #page-legacy-graduation .grad-table td {
    padding: 4px 0;
    border: 0;
  }

  #page-legacy-graduation .grad-table td:nth-child(1) {
    font-weight: 700;
  }

  #page-legacy-graduation .grad-table td:nth-child(2) {
    font-size: 16px;
    font-weight: 700;
  }
}

/* ── Create student button — role gated ──────────────────── */
.create-student-btn { display: none; }
body.can-create-student .create-student-btn { display: inline-flex; }

/* ── Create student modal — mobile ───────────────────────── */
#createStudentModal .modal-box { max-width: 560px; width: 95%; }
#createStudentModal .form-row { display: flex; gap: 12px; }
#createStudentModal .form-row .form-group { flex: 1; }
@media (max-width: 480px) {
  #createStudentModal .form-row { flex-direction: column; gap: 0; }
  .card-header { flex-wrap: wrap; gap: 8px; }
  .create-student-btn { width: 100%; justify-content: center; }
}

/* ── Conversations (Spec 2A) ───────────────────────────────── */
.conv-layout {
  display: flex;
  height: calc(100vh - var(--header-h) - 120px);
  min-height: 400px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.conv-sidebar {
  width: 320px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--surface2);
}

.conv-sidebar-head {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.conv-sidebar-head .filter-select {
  width: 100%;
  font-size: 13px;
}

.conv-list {
  flex: 1;
  overflow-y: auto;
}

.conv-item {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s ease;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.conv-item:hover { background: var(--accent-light); }
.conv-item--active { background: var(--accent-light); border-left: 3px solid var(--accent); }

.conv-item-body {
  flex: 1;
  min-width: 0;
}

.conv-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 15px;
  flex-shrink: 0;
  letter-spacing: 0;
  user-select: none;
}

.conv-thread-title .conv-avatar {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

.conv-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.conv-item-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.conv-item-time {
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
  margin-left: 8px;
}

.conv-item-subject {
  font-size: 12px;
  color: var(--accent-mid);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-item-preview {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-thread {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
}

.conv-thread-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: var(--surface);
}

.conv-thread-title {
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.conv-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}

.conv-status--open { background: var(--success-light); color: var(--success); }
.conv-status--closed { background: var(--danger-light); color: var(--danger); }

.conv-thread-actions {
  display: flex;
  gap: 8px;
}

.conv-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface2);
}

.conv-reply {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
  background: var(--surface);
}

.conv-reply-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  resize: none;
  outline: none;
  background: var(--surface2);
  color: var(--text);
}

.conv-reply-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(29,78,216,0.12);
}

.conv-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
}

/* ── Message bubbles ─────────────────────────────────────── */
.msg-row {
  display: flex;
  max-width: 75%;
}

.msg-student {
  align-self: flex-start;
}

.msg-staff {
  align-self: flex-end;
}

.msg-bubble {
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

.msg-student .msg-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.msg-staff .msg-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.msg-body {
  white-space: pre-wrap;
}

.msg-time {
  font-size: 10px;
  margin-top: 3px;
  opacity: 0.7;
  text-align: right;
}

/* ── Unread state (client-side, per-browser proxy) ───────── */
.conv-item { position: relative; }
.conv-item--unread .conv-item-name { font-weight: 700; color: var(--text); }
.conv-item--unread .conv-item-preview { color: var(--text); font-weight: 500; }
.conv-item--unread::after {
  content: '';
  position: absolute;
  top: 14px; right: 12px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* ── Back button (mobile only) ───────────────────────────── */
.conv-back-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  padding: 4px;
  margin-right: 6px;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.conv-back-btn:hover { background: var(--accent-light); }

/* ── Mobile chat: sidebar and thread are mutually exclusive ─ */
@media (max-width: 768px) {
  .conv-layout {
    flex-direction: row;
    height: calc(100vh - var(--header-h) - 110px);
    min-height: 360px;
  }
  /* Default view on mobile: full-width sidebar list, thread hidden. */
  .conv-sidebar {
    width: 100%;
    max-height: none;
    border-right: none;
    border-bottom: none;
  }
  .conv-thread { display: none !important; }
  .conv-empty { display: none !important; }

  /* When a conversation is open: hide list, show full-width thread. */
  .conv-layout.conv-mobile--thread .conv-sidebar { display: none; }
  .conv-layout.conv-mobile--thread .conv-thread { display: flex !important; width: 100%; }
  .conv-layout.conv-mobile--thread .conv-back-btn { display: inline-flex; }

  .conv-thread-head { flex-wrap: wrap; }
  .msg-row { max-width: 85%; }
  .conv-reply { padding: 10px 12px; }
}

/* ── Solo-chat student info panel ─────────────────────────── */
/* Default (desktop ≥1024px): persistent right sidebar. */
.conv-info {
  width: 300px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  background: var(--surface2);
  overflow-y: auto;
  display: none; /* shown only when a solo conversation is open */
}
.conv-layout.conv-has-panel .conv-info { display: block; }
.conv-info-inner { padding: 16px; }
.conv-info-scrim { display: none; }

/* Wallet-style student-ID-card header (house standard, /hoso language). */
.sp-card {
  background: linear-gradient(135deg, #2563eb 0%, #1e3a8a 100%);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(30,58,138,.28);
  color: #fff;
  padding: 16px 18px;
  margin-bottom: 14px;
}
.sp-card-name {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 6px;
  word-break: break-word;
}
.sp-card-mssv {
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1.5px;
  line-height: 1.15;
}
.sp-card-meta {
  margin-top: 8px;
  font-size: 12.5px;
  opacity: .92;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sp-card-meta a { color: #fff; text-decoration: underline; }

/* Info sections */
.sp-section { margin-bottom: 14px; }
.sp-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: 6px;
}
.sp-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.sp-row:last-child { border-bottom: none; }
.sp-row-label { color: var(--muted); flex-shrink: 0; }
.sp-row-val { color: var(--text); text-align: right; word-break: break-word; }
.sp-row-val.num { font-variant-numeric: tabular-nums; }

.sp-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}
.sp-badge--green  { background: var(--success-light); color: var(--success); }
.sp-badge--yellow { background: var(--warning-light); color: var(--warning); }
.sp-badge--red    { background: var(--danger-light);  color: var(--danger); }
.sp-badge--muted  { background: var(--surface);       color: var(--muted); border: 1px solid var(--border); }

/* Profile completeness bar */
.sp-progress {
  height: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}
.sp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #1e3a8a);
  border-radius: 4px;
  transition: width .3s;
}

/* Skeleton placeholders while loading */
.sp-skel {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface2) 37%, var(--surface) 63%);
  background-size: 400% 100%;
  animation: sp-shimmer 1.3s ease-in-out infinite;
  border-radius: 6px;
}
@keyframes sp-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.sp-skel-card { height: 108px; border-radius: 16px; margin-bottom: 14px; }
.sp-skel-line { height: 12px; margin-bottom: 8px; }

.sp-retry {
  font-size: 12.5px;
  color: var(--muted);
  padding: 10px 0;
  text-align: center;
}
.sp-retry button {
  margin-top: 6px;
  font-size: 12px;
  background: none;
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: 32px;
}

/* Header chip (mobile trigger) — hidden on desktop. */
.conv-info-chip {
  display: none;
  align-items: center;
  gap: 6px;
  background: var(--accent-light);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 4px 10px 4px 4px;
  cursor: pointer;
  min-height: 36px;
}
.conv-info-chip .conv-avatar { width: 26px; height: 26px; font-size: 11px; }
.conv-info-chip-label { font-size: 12px; font-weight: 600; color: var(--accent-mid); }

/* Below 1024px: panel becomes a right slide-in drawer over the thread. */
@media (max-width: 1023px) {
  .conv-info {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(340px, 88vw);
    z-index: 90;
    border-left: 1px solid var(--border);
    box-shadow: -4px 0 24px rgba(0,0,0,.18);
    transform: translateX(100%);
    transition: transform .22s ease;
    display: block;            /* present, just off-screen */
    background: var(--surface2);
  }
  .conv-layout.conv-info-open .conv-info { transform: translateX(0); }
  .conv-info-scrim {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.32);
    z-index: 89;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
  }
  .conv-layout.conv-info-open .conv-info-scrim { display: block; opacity: 1; pointer-events: auto; }
  /* The chip only makes sense once a thread (and its panel) is open. */
  .conv-layout.conv-has-panel .conv-info-chip { display: inline-flex; }
}

/* ── Teacher list page ─────────────────────────────────── */
.counts-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.count-chip { font-size: 13px; padding: 4px 12px; border-radius: 20px; background: var(--bg); border: 1px solid var(--border); }
.count-chip strong { font-weight: 700; }
.count-gvch { border-color: #3b82f6; color: #1d4ed8; background: #eff6ff; }
.count-gvtg { border-color: #8b5cf6; color: #6d28d9; background: #f5f3ff; }
.count-total { border-color: #6b7280; color: #374151; background: #f9fafb; }

.teacher-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }

.teacher-card {
  display: flex; gap: 14px; padding: 14px;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.teacher-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.08); border-color: var(--accent); }

.tc-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.tc-avatar.type-gvch { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.tc-avatar.type-gvtg { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }

.tc-body { flex: 1; min-width: 0; }
.tc-name { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.tc-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.tc-type { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 10px; text-transform: uppercase; }
.tc-type.gvch { background: #dbeafe; color: #1d4ed8; }
.tc-type.gvtg { background: #ede9fe; color: #6d28d9; }
.tc-degree { font-size: 12px; color: var(--muted); }
.tc-code { font-size: 11px; color: var(--muted); font-family: monospace; background: var(--bg); padding: 0 5px; border-radius: 3px; }
.tc-contact { font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 2px; }
.tc-khoa { font-size: 11px; color: #6b7280; margin-top: 2px; }
.tc-sems { font-size: 11px; color: var(--muted); margin-top: 2px; }

.page-info { font-size: 13px; color: var(--muted); }

/* ── Teacher detail panel ──────────────────────────────── */
.teacher-detail-backdrop {
  position: fixed; top:0; left:0; width:100vw; height:100vh;
  background: rgba(0,0,0,0.25); z-index: 998; opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.teacher-detail-backdrop.open { opacity: 1; pointer-events: auto; }

.teacher-detail-panel {
  position: fixed; top: 0; right: -540px; width: 520px; max-width: 90vw;
  height: 100vh; background: #ffffff; box-shadow: -4px 0 24px rgba(0,0,0,0.2);
  z-index: 999; overflow-y: auto; transition: right 0.25s ease;
  padding: 0 0 40px 0;
}
.teacher-detail-panel.open { right: 0; }

.detail-header { display: flex; gap: 14px; padding: 22px 20px 16px; border-bottom: 1px solid var(--border); position: sticky; top:0; background: var(--card-bg); z-index: 2; }
.detail-close { position: absolute; right: 14px; top: 14px; width: 32px; height: 32px; border-radius: 50%; border: none; background: var(--bg); font-size: 18px; cursor: pointer; color: var(--muted); }
.detail-close:hover { background: #fee2e2; color: #dc2626; }
.detail-avatar { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; color: #fff; flex-shrink: 0; }
.detail-avatar.type-gvch { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.detail-avatar.type-gvtg { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.detail-info { flex: 1; min-width: 0; }
.detail-name { font-size: 18px; font-weight: 700; color: var(--text); }
.detail-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-size: 12px; color: var(--muted); }
.detail-contact { font-size: 13px; color: var(--accent); margin-top: 4px; }

.detail-stats { display: flex; gap: 0; border-bottom: 1px solid var(--border); }
.stat-item { flex: 1; text-align: center; padding: 16px 8px; }
.stat-item + .stat-item { border-left: 1px solid var(--border); }
.stat-num { font-size: 22px; font-weight: 700; color: var(--text); }
.stat-label { font-size: 11px; color: var(--muted); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.3px; }

.semester-group { padding: 0 14px; }
.semester-header { font-size: 14px; font-weight: 700; color: var(--text); padding: 14px 6px 8px; border-bottom: 1px solid var(--border); }
.semester-header span { font-weight: 400; color: var(--muted); font-size: 12px; }

.detail-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 12px; }
.detail-table th { text-align: left; padding: 6px 6px 4px; color: var(--muted); font-weight: 500; font-size: 10px; text-transform: uppercase; letter-spacing: 0.3px; border-bottom: 1px solid var(--border); }
.detail-table td { padding: 5px 6px; border-bottom: 1px solid var(--border); color: var(--text); }
.detail-table tr:hover td { background: var(--bg); }

@media (max-width: 640px) {
  .teacher-detail-panel { width: 100vw; right: -100vw; }
  .teacher-grid { grid-template-columns: 1fr; }
}

.sched-week-btn {
  padding: 5px 14px; border: 1px solid var(--border); border-radius: 6px;
  background: #fff; cursor: pointer; font-size: 12px; font-weight: 500;
}
.sched-week-btn.active { background: var(--text); color: #fff; border-color: var(--text); }

/* ── PDT intake page ─────────────────────────────────────── */
.pdt-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 12px 0 10px; flex-wrap: wrap;
}
.pdt-tabs { display: flex; gap: 4px; background: var(--surface2); padding: 4px; border-radius: 8px; }
.pdt-tab {
  padding: 6px 14px; border: none; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 13px; font-weight: 500; border-radius: 6px;
  transition: background .15s, color .15s;
}
.pdt-tab:hover { color: var(--text); }
.pdt-tab.active { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.pdt-toolbar-right { display: flex; gap: 8px; align-items: center; }

.pdt-counts { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.pdt-count-chip {
  padding: 4px 12px; border-radius: 12px; font-size: 12px; font-weight: 500;
  background: var(--surface2); color: var(--text);
}
.pdt-count-chip.open   { background: #fff7ed; color: #c2410c; }
.pdt-count-chip.closed { background: #f0fdf4; color: #15803d; }
.pdt-count-chip.total  { background: #eef2ff; color: #4338ca; }

.pdt-table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.pdt-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 1400px; }
.pdt-table th {
  text-align: left; padding: 10px 12px; background: #fafbfc; color: var(--muted);
  font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .3px;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1;
}
.pdt-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top;
  color: var(--text);
}
.pdt-table tr:hover td { background: #fafbfc; }
.pdt-table td.pdt-cell-muted { color: var(--muted); font-style: italic; }
.pdt-scope-tag {
  display: inline-block; font-size: 10px; font-weight: 600; padding: 2px 6px;
  border-radius: 4px; margin-left: 6px; letter-spacing: .3px;
}
.pdt-scope-tag.cd15 { background: #fef3c7; color: #92400e; }
.pdt-scope-tag.cdcq { background: #dbeafe; color: #1e40af; }
.pdt-status-badge {
  display: inline-block; font-size: 10px; font-weight: 600; padding: 2px 8px;
  border-radius: 10px; text-transform: uppercase; letter-spacing: .3px;
}
.pdt-status-badge.open   { background: #fff7ed; color: #c2410c; }
.pdt-status-badge.closed { background: #f0fdf4; color: #15803d; }
.pdt-guest-name { font-weight: 600; }
.pdt-guest-contact { font-size: 11px; color: var(--muted); margin-top: 2px; }
.pdt-subject { font-weight: 500; }
.pdt-question-body { font-size: 12px; color: var(--muted); margin-top: 4px; white-space: pre-wrap; max-height: 4em; overflow: hidden; }
.pdt-edit-btn { padding: 4px 10px; font-size: 12px; }

.pdt-pagination { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; }

.pdt-student-info {
  margin-top: 6px; padding: 8px 12px; background: var(--surface2); border-radius: 6px;
  font-size: 12px; color: var(--muted);
}
.pdt-student-info.found  { background: #f0fdf4; color: #15803d; }
.pdt-student-info.missing { background: #fef2f2; color: #dc2626; }
.pdt-modal-approvals summary { cursor: pointer; font-weight: 600; padding: 6px 0; color: var(--text); }
.pdt-comment-show {
  font-size: 12px; color: var(--muted); background: var(--surface2);
  padding: 6px 10px; border-radius: 6px; margin-bottom: 6px; white-space: pre-wrap;
}
.pdt-comment-show:empty { display: none; }

/* ── Notification bell (header) ──────────────────────────── */
.notif-wrap { position: relative; }
.notif-bell {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.9); border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.notif-bell:hover { background: rgba(255,255,255,0.12); }
.notif-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px;
  text-align: center; border-radius: 8px;
  box-shadow: 0 0 0 2px var(--accent);
}
.notif-dropdown {
  display: none;
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 340px; max-width: calc(100vw - 24px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  z-index: 60; overflow: hidden;
}
.notif-dropdown.open { display: block; }
.notif-dropdown-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: 13px; color: var(--text);
}
.notif-markall {
  background: none; border: none; cursor: pointer;
  color: var(--accent); font-size: 12px; font-weight: 600;
}
.notif-markall:hover { text-decoration: underline; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item {
  display: block; width: 100%; text-align: left;
  padding: 10px 14px; border: none; border-bottom: 1px solid var(--border);
  background: none; cursor: pointer;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface2); }
.notif-item.unread { background: var(--accent-light); }
.notif-item.unread:hover { background: #e0ecff; }
.notif-item-title { font-weight: 600; font-size: 13px; color: var(--text); }
.notif-item-body  { font-size: 12px; color: var(--muted); margin-top: 2px; }
.notif-item-time  { font-size: 11px; color: var(--muted); margin-top: 3px; }
.notif-empty { padding: 22px 14px; text-align: center; color: var(--muted); font-size: 13px; }

/* ── Nhiệm vụ của tôi (teacher tasks) ────────────────────── */
/* Color is used ONLY to convey status. Layout reuses the warm bg + blue accent. */
.tk-progress-card { border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; }
.tk-progress-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.tk-progress-head > span:first-child { font-weight: 700; font-size: 14px; }
.tk-progress-count { font-size: 13px; color: var(--muted); }
.tk-bar { height: 8px; background: var(--surface2); border-radius: 6px; overflow: hidden; }
.tk-bar-fill { height: 100%; width: 0; background: var(--accent); border-radius: 6px; transition: width 0.3s ease; }

.tk-tabs { display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tk-tab {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tk-tab:hover { background: var(--surface2); }
.tk-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.tk-tab-count {
  min-width: 18px; padding: 0 5px; border-radius: 9px; font-size: 11px; line-height: 16px;
  background: var(--surface2); color: var(--muted); text-align: center;
}
.tk-tab.active .tk-tab-count { background: rgba(255,255,255,0.25); color: #fff; }

.tk-group { margin-bottom: 18px; }
.tk-group-head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); margin: 0 2px 8px; }

.tk-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 8px; cursor: pointer; transition: box-shadow 0.15s, border-color 0.15s;
}
.tk-row:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.tk-circle { flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); }
.tk-circle.done { border-color: var(--success); background: var(--success); box-shadow: inset 0 0 0 2px var(--surface); }
.tk-row-main { flex: 1 1 auto; min-width: 0; }
.tk-row-title { font-size: 14px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 7px; }
.tk-row-sub { font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-row-meta { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.tk-meta-ic { font-size: 12px; color: var(--muted); }
.tk-plus { font-size: 11px; font-weight: 700; color: var(--muted); background: var(--surface2); border-radius: 9px; padding: 1px 7px; }

/* Priority dot — only Cao/Khẩn cấp are rendered by the JS. */
.tk-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; }
.tk-dot-high { background: var(--warning); }
.tk-dot-urgent { background: var(--danger); }

/* Due chip */
.tk-due { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.tk-due-overdue { background: var(--danger-light); color: var(--danger); }
.tk-due-today   { background: var(--warning-light); color: var(--warning); }
.tk-due-muted   { background: var(--surface2); color: var(--muted); }

/* Status pill */
.tk-pill { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.tk-assigned    { background: var(--surface2);      color: var(--muted); }
.tk-in-progress { background: var(--accent-light);  color: var(--accent-mid); }
.tk-submitted   { background: var(--warning-light); color: var(--warning); }
.tk-in-review   { background: #f3e8ff;              color: #7c3aed; }
.tk-done        { background: var(--success-light); color: var(--success); }
.tk-blocked     { background: var(--danger-light);  color: var(--danger); }
.tk-cancelled   { background: var(--surface2);      color: var(--muted); text-decoration: line-through; }

.tk-empty { padding: 44px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.tk-muted { color: var(--muted); font-size: 13px; }

/* Detail modal */
.tk-detail-box { max-width: 560px; width: 100%; }
.tk-detail-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.tk-meta-tag { font-size: 12px; color: var(--muted); background: var(--surface2); padding: 2px 9px; border-radius: 6px; }
.tk-detail-section { margin-bottom: 16px; }
.tk-detail-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); margin-bottom: 8px; }
.tk-detail-desc { font-size: 14px; color: var(--text); white-space: pre-wrap; line-height: 1.5; }
.tk-timeline { display: flex; flex-direction: column; gap: 8px; }
.tk-timeline-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tk-timeline-when { font-size: 12px; color: var(--muted); }
.tk-timeline-note { flex-basis: 100%; font-size: 13px; color: var(--text); background: var(--surface2); padding: 6px 10px; border-radius: 6px; }
.tk-comment { padding: 8px 0; border-bottom: 1px solid var(--border); }
.tk-comment:last-of-type { border-bottom: none; }
.tk-comment-head { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.tk-comment-body { font-size: 14px; color: var(--text); white-space: pre-wrap; }
.tk-comment-add { display: flex; gap: 8px; margin-top: 10px; align-items: flex-start; }
.tk-comment-add textarea { flex: 1; resize: vertical; }
.tk-attach { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; }
.tk-attach-name { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-attach-upload { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.tk-error { color: var(--danger); font-size: 13px; background: var(--danger-light); padding: 8px 12px; border-radius: 6px; }

@media (max-width: 768px) {
  .tk-row { flex-wrap: wrap; }
  .tk-row-meta { width: 100%; justify-content: flex-start; padding-left: 30px; }
}

/* ── Tiến độ giáo viên (manager dashboard) ───────────────── */
.tk-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tk-metric { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; text-align: center; }
.tk-metric-value { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1.1; }
.tk-metric-label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.tk-metric-review  .tk-metric-value { color: #7c3aed; }
.tk-metric-overdue .tk-metric-value { color: var(--danger); }
.tk-metric-done    .tk-metric-value { color: var(--success); }

.tk-filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 16px; }
.tk-filter-bar .form-input { width: auto; min-width: 150px; }
.tk-filter-lbl { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.tk-filter-lbl .form-input { min-width: 140px; }

.tk-teacher-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.tk-teacher-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; flex-wrap: wrap; }
.tk-teacher-name { font-size: 15px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tk-teacher-rates { display: flex; gap: 14px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.tk-stack { display: flex; height: 8px; border-radius: 6px; overflow: hidden; background: var(--surface2); margin: 10px 0 8px; }
.tk-stack-seg { height: 100%; }
.tk-seg-assigned    { background: #cbd5e1; }
.tk-seg-in-progress { background: var(--accent); }
.tk-seg-in-review   { background: var(--warning); }
.tk-seg-blocked     { background: var(--danger); }
.tk-seg-done        { background: var(--success); }
.tk-teacher-counts { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.tk-teacher-tasks { margin-top: 10px; }
.tk-teacher-tasks:empty { margin-top: 0; }

/* Assign form — teacher multi-select */
.tk-pick-list { max-height: 200px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-top: 6px; }
.tk-pick { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: 14px; cursor: pointer; }
.tk-pick:hover { background: var(--surface2); }
.tk-pick input { width: 16px; height: 16px; }
.tk-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }

/* Manager detail — per-assignee blocks */
.tk-assignee { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; }
.tk-assignee-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.tk-assignee-name { font-weight: 600; font-size: 14px; }
.tk-assignee-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Toast */
.tk-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 200;
}
.tk-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Giám sát công việc (Admin task oversight) ───────────────
   crm-art-law LOCKED SCHOOL ORANGE (#CE470C→#9A3412, AA 4.63:1). Scoped so
   this admin surface reads as the school's oversight page: override the blue
   --accent family to warm orange within #page-task-oversight only — the tk-*
   tokens (tabs, row hover, in-progress segment/pill, btn-primary) inherit it.
   Legible-for-older-teachers: ≥14px body, 44px tap targets. */
#page-task-oversight {
  --accent:       #CE470C;
  --accent-mid:   #9A3412;
  --accent-light: #FBEDE6;   /* warm tint for the in-progress pill background */
}
#page-task-oversight .tk-in-progress { color: #9A3412; }        /* AA on the tint */
#page-task-oversight .tk-seg-in-progress { background: #CE470C; }

.to-banner {
  background: #FBF0E2; color: #9A5A16; border: 1px solid #F0DCC0;
  padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 14px;
}
.to-compliance { font-size: 14px; color: var(--muted); margin: 2px 2px 16px; font-weight: 500; }

.to-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 16px; justify-content: space-between;
}
.to-toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.to-search { width: auto; min-width: 220px; min-height: 44px; }
.to-toolbar .tk-tab { min-height: 44px; font-size: 14px; }
.to-toolbar .btn { min-height: 44px; }
#toAttentionBtn.active { background: #CE470C; color: #fff; border-color: #CE470C; }

/* Roster row extras */
.to-khoa { font-size: 12px; font-weight: 500; color: var(--muted); background: var(--surface2);
  padding: 1px 8px; border-radius: 6px; }
.tk-teacher-card.to-attention { border-color: #E7B7A6; box-shadow: inset 3px 0 0 #CE470C; }

/* Compliance flag chips */
.to-flag { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.to-flag-high   { background: #F8E9E6; color: #A33529; }
.to-flag-medium { background: #FBF0E2; color: #9A5A16; }

/* Opened / Chưa mở badge */
.to-open-badge { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.to-open-yes { background: var(--success-light); color: var(--success); }
.to-open-no  { background: #F8E9E6; color: #A33529; }
.to-open-na  { background: var(--surface2); color: var(--muted); }

/* Per-task drill-down assignee rows */
.to-assignee {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px;
}
.to-assignee-silent { border-color: #E7B7A6; background: #FDF6F3; }
.to-assignee-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.to-assignee-side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ═════════════════════════════════════════════════════════════
   WORK SURFACE — "Công việc" (design-lock work-surface-mockup-school)
   crm-art-law: SCHOOL ORANGE candidate A. Swap to candidate B by
   changing the two hex values below — everything derives from them.
   ═════════════════════════════════════════════════════════════ */
#page-work{
  --wk-brand:#CE470C;        /* candidate A light end (4.63:1 on white) — B: #C2410C */
  --wk-deep:#9A3412;         /* candidate A deep end — B: #7C2D12 */
  --wk-grad:linear-gradient(135deg,var(--wk-brand),var(--wk-deep));
  --wk-canvas:#FAF8F4;
  --wk-ink:#231E1A;
  --wk-ink2:#4A423C;
  --wk-muted:#7A7169;
  --wk-line:#ECE6DE;
  --wk-success:#3F7A44; --wk-success-bg:#EAF2E9;
  --wk-warn:#9A5A16;    --wk-warn-bg:#FBF0E2;
  --wk-danger:#A33529;  --wk-danger-bg:#F8E9E6;
  --wk-pill:#F1ECE4;    --wk-pill-ink:#5A514A;
}
#page-work .wk-shell{max-width:760px;margin:0 auto;color:var(--wk-ink)}
#page-work .num{font-variant-numeric:tabular-nums}

/* wallet hero — THE one gradient of the surface */
.wk-wallet{
  position:relative;overflow:hidden;color:#fff;background:var(--wk-grad);
  border-radius:16px;padding:18px 18px 16px;margin-bottom:14px;
  box-shadow:0 8px 20px rgba(154,52,18,.28);
  border:1px solid rgba(212,175,110,.35);
}
.wk-wallet::after{content:"";position:absolute;right:-40px;top:-60px;width:180px;height:180px;
  background:radial-gradient(closest-side,rgba(255,255,255,.18),transparent);pointer-events:none}
.wk-eyebrow{font-size:11px;letter-spacing:.14em;text-transform:uppercase;opacity:.85;margin:0 0 2px}
.wk-wname{font-size:19px;font-weight:600;margin:0}
.wk-wctx{font-size:13px;opacity:.92;margin:2px 0 0}
.wk-wfoot{display:flex;justify-content:space-between;align-items:flex-end;margin-top:14px;gap:12px}
.wk-wprog{flex:1}
.wk-wlab{font-size:12px;opacity:.9;margin:0 0 6px}
.wk-wbar{height:6px;border-radius:999px;background:rgba(255,255,255,.28);overflow:hidden}
.wk-wbar>i{display:block;height:100%;background:#fff;border-radius:999px;transition:width .3s}
.wk-wbig{text-align:right}
.wk-wbig .n{font-size:34px;font-weight:700;line-height:1}
.wk-wbig .u{font-size:11px;opacity:.85}

/* filter chips */
.wk-chips{display:flex;gap:8px;overflow-x:auto;padding:2px 2px 10px;-webkit-overflow-scrolling:touch}
.wk-chips::-webkit-scrollbar{display:none}
.wk-chip{flex:0 0 auto;border:1px solid var(--wk-line);background:#fff;border-radius:999px;
  padding:9px 14px;font-size:14px;color:var(--wk-ink2);min-height:44px;
  display:inline-flex;align-items:center;gap:7px;cursor:pointer;font-family:inherit}
.wk-chip:active{transform:scale(.98)}
.wk-chip.active{background:var(--wk-ink);color:#fff;border-color:var(--wk-ink)}
.wk-chip .cnt{font-size:12px;background:rgba(0,0,0,.08);border-radius:999px;padding:1px 7px}
.wk-chip.active .cnt{background:rgba(255,255,255,.22)}

/* the ONE plain list */
.wk-seclabel{font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:var(--wk-muted);
  margin:14px 4px 8px;font-weight:600}
.wk-list{display:flex;flex-direction:column;gap:10px}
.wk-card{
  background:#fff;border:1px solid var(--wk-line);border-radius:12px;padding:14px;
  display:flex;gap:12px;align-items:flex-start;box-shadow:0 1px 2px rgba(60,40,24,.05);
  cursor:pointer;transition:transform .08s ease;width:100%;text-align:left;font-family:inherit;font-size:15px;color:var(--wk-ink)}
.wk-card:active{transform:scale(.98)}
.wk-circle{flex:0 0 auto;width:22px;height:22px;border-radius:999px;border:2px solid #CBBFB0;margin-top:2px}
.wk-circle.done{border-color:var(--wk-success);background:var(--wk-success)}
.wk-main{flex:1;min-width:0}
.wk-title{font-size:16px;font-weight:600;display:flex;align-items:center;gap:7px;line-height:1.35}
.wk-pdot{flex:0 0 auto;width:9px;height:9px;border-radius:999px}
.wk-pdot.high{background:var(--wk-warn)}
.wk-pdot.urgent{background:var(--wk-danger)}
.wk-sub{font-size:13px;color:var(--wk-muted);margin-top:3px}
.wk-meta{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:9px}
.wk-due{font-size:12px;font-weight:600;padding:2px 8px;border-radius:999px;background:var(--wk-pill);color:var(--wk-pill-ink)}
.wk-due.today{background:var(--wk-warn-bg);color:var(--wk-warn)}
.wk-due.over{background:var(--wk-danger-bg);color:var(--wk-danger)}
.wk-pill{font-size:12px;font-weight:600;padding:2px 10px;border-radius:999px;background:var(--wk-pill);color:var(--wk-pill-ink)}
.wk-pill.in_progress{background:#F6E6D6;color:#8A461A}
.wk-pill.submitted,.wk-pill.in_review{background:var(--wk-warn-bg);color:var(--wk-warn)}
.wk-pill.done{background:var(--wk-success-bg);color:var(--wk-success)}
.wk-pill.blocked{background:#F3E6E2;color:#8C3A2A}
.wk-mic{font-size:12px;color:var(--wk-muted)}

/* skeleton — a slow panel never blocks the shell */
.wk-skel{background:#fff;border:1px solid var(--wk-line);border-radius:12px;padding:14px;display:flex;gap:12px}
.wk-skel .sk{background:linear-gradient(90deg,#F0EAE1,#FAF8F4,#F0EAE1);background-size:200% 100%;
  border-radius:8px;animation:wk-shimmer 1.3s linear infinite}
.wk-skel .skc{width:22px;height:22px;border-radius:999px;flex:0 0 auto}
.wk-skel .l1{height:12px;width:70%;margin-bottom:8px}
.wk-skel .l2{height:10px;width:45%}
@keyframes wk-shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}

/* detail */
.wk-back{background:#fff;border:1px solid var(--wk-line);border-radius:12px;min-height:44px;
  padding:0 16px;font-family:inherit;font-size:15px;font-weight:600;color:var(--wk-ink2);
  cursor:pointer;margin-bottom:12px;display:inline-flex;align-items:center;gap:6px}
.wk-hero{background:#fff;border:1px solid var(--wk-line);border-radius:16px;padding:18px;
  box-shadow:0 1px 2px rgba(60,40,24,.05)}
.wk-hero h2{font-size:20px;margin:0 0 12px;line-height:1.25}
.wk-facts{margin-top:14px;border-top:1px solid var(--wk-line);padding-top:6px}
.wk-fact{display:flex;justify-content:space-between;gap:14px;padding:8px 0;font-size:14px;border-bottom:1px solid var(--wk-line)}
.wk-fact:last-child{border-bottom:0}
.wk-fact .k{color:var(--wk-muted);flex-shrink:0}
.wk-fact .v{font-weight:600;text-align:right;word-break:break-word}
.wk-desc{margin-top:12px;font-size:14px;color:var(--wk-ink2);background:var(--wk-canvas);
  border:1px solid var(--wk-line);border-radius:12px;padding:12px 14px;white-space:pre-wrap}
.wk-primary{width:100%;min-height:52px;border:none;border-radius:14px;background:var(--wk-brand);
  color:#fff;font-family:inherit;font-size:18px;font-weight:700;cursor:pointer;margin-top:14px;
  transition:transform .08s ease;box-shadow:0 6px 14px rgba(206,71,12,.28)}
.wk-primary:active{transform:scale(.98)}
.wk-primary[disabled]{opacity:.6;cursor:default}
.wk-ghost{width:100%;min-height:46px;margin-top:10px;border:1px solid var(--wk-line);border-radius:14px;
  background:#fff;color:var(--wk-ink2);font-family:inherit;font-size:15px;font-weight:600;cursor:pointer}
.wk-dsection{margin-top:20px}
.wk-dsection h3{font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:var(--wk-muted);margin:0 0 10px;font-weight:700}
.wk-timeline{position:relative;padding-left:20px}
.wk-timeline::before{content:"";position:absolute;left:5px;top:4px;bottom:6px;width:2px;background:var(--wk-line)}
.wk-tl{position:relative;margin-bottom:12px}
.wk-tl::before{content:"";position:absolute;left:-19px;top:4px;width:12px;height:12px;border-radius:999px;
  background:#fff;border:2px solid var(--wk-brand)}
.wk-tl.done::before{background:var(--wk-success);border-color:var(--wk-success)}
.wk-tl-when{font-size:12px;color:var(--wk-muted);margin-top:3px}
.wk-tl-note{font-size:13px;color:var(--wk-ink2);margin-top:3px}
.wk-attach{display:flex;align-items:center;justify-content:space-between;gap:10px;background:#fff;
  border:1px solid var(--wk-line);border-radius:12px;padding:11px 12px;margin-bottom:8px;font-size:14px}
.wk-attach .fn{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.wk-link{font-size:14px;font-weight:600;color:var(--wk-brand);cursor:pointer;background:none;border:none;font-family:inherit;min-height:44px;padding:0 6px}
.wk-comment{background:#fff;border:1px solid var(--wk-line);border-radius:12px;padding:11px 13px;margin-bottom:8px}
.wk-ch{font-size:13px;font-weight:600}
.wk-ct{font-size:12px;color:var(--wk-muted);font-weight:400;margin-left:6px}
.wk-cb{font-size:14px;color:var(--wk-ink2);margin-top:4px;white-space:pre-wrap}
#page-work textarea,#page-work input,#page-work select{font-size:17px;font-family:inherit;color:var(--wk-ink);
  border:1px solid var(--wk-line);border-radius:12px;padding:11px 12px;background:#fff;width:100%}
#page-work textarea{min-height:64px;resize:vertical}
.wk-send{margin-top:8px;min-height:44px;padding:0 18px;border-radius:12px;border:1px solid var(--wk-brand);
  background:#fff;color:var(--wk-brand);font-family:inherit;font-size:15px;font-weight:600;cursor:pointer;width:auto}

/* manager */
.wk-mact{display:flex;gap:8px;margin-top:11px}
.wk-approve{flex:1;min-height:44px;border:none;border-radius:12px;background:var(--wk-brand);color:#fff;
  font-family:inherit;font-size:15px;font-weight:700;cursor:pointer;transition:transform .08s ease;
  box-shadow:0 4px 10px rgba(206,71,12,.22)}
.wk-approve:active{transform:scale(.98)}
.wk-return{flex:1;min-height:44px;border:1px solid var(--wk-line);border-radius:12px;background:#fff;
  color:var(--wk-ink2);font-family:inherit;font-size:15px;font-weight:600;cursor:pointer}
.wk-prog{display:block;height:6px;border-radius:999px;background:#EFE8DE;overflow:hidden;margin-top:9px}
.wk-prog>i{display:block;height:100%;background:var(--wk-grad);border-radius:999px;transition:width .3s}
.wk-prog-lab{display:flex;justify-content:space-between;font-size:12px;color:var(--wk-muted);margin-top:5px}
.wk-assign-new{width:100%;min-height:52px;margin:4px 0 8px;background:#fff;color:var(--wk-brand);
  border:2px dashed rgba(206,71,12,.45);border-radius:14px;font-family:inherit;font-size:16px;
  font-weight:700;cursor:pointer;transition:transform .08s ease}
.wk-assign-new:active{transform:scale(.98)}
.wk-flag{display:inline-block;font-size:12px;font-weight:700;padding:2px 9px;border-radius:999px;margin-left:6px}
.wk-flag.over{background:var(--wk-danger-bg);color:var(--wk-danger)}
.wk-flag.stall{background:var(--wk-warn-bg);color:var(--wk-warn)}
.wk-flag.rev{background:#F6E6D6;color:#8A461A}
.wk-trow{display:flex;align-items:center;gap:10px;background:#fff;border:1px solid var(--wk-line);
  border-radius:12px;padding:11px 14px;margin-bottom:8px;font-size:14px}
.wk-trow .nm{font-weight:600;flex:1;min-width:0}
.wk-composer{background:#fff;border:1px solid var(--wk-line);border-radius:16px;padding:16px;margin-bottom:14px}
.wk-composer .row2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
@media (max-width:560px){.wk-composer .row2{grid-template-columns:1fr}}
.wk-composer label{display:block;font-size:12px;font-weight:700;color:var(--wk-muted);
  text-transform:uppercase;letter-spacing:.04em;margin:12px 0 5px}
.wk-picked{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.wk-picked .pk{display:inline-flex;align-items:center;gap:6px;background:var(--wk-pill);color:var(--wk-ink2);
  border-radius:999px;padding:6px 10px;font-size:13px}
.wk-picked .pk button{background:none;border:none;cursor:pointer;font-size:15px;color:var(--wk-muted);padding:0 2px;min-height:0}
.wk-pickres{max-height:180px;overflow-y:auto;border:1px solid var(--wk-line);border-radius:12px;margin-top:6px}
.wk-pickres button{display:flex;width:100%;text-align:left;background:#fff;border:none;font-family:inherit;
  border-bottom:1px solid var(--wk-line);padding:10px 12px;font-size:14px;cursor:pointer;min-height:44px;align-items:center;gap:8px}
.wk-pickres button:last-child{border-bottom:0}
.wk-pickres button:hover{background:var(--wk-canvas)}
.wk-note{font-size:13px;color:var(--wk-muted);padding:8px 2px}
.wk-error{background:var(--wk-danger-bg);color:var(--wk-danger);border-radius:12px;padding:11px 14px;
  font-size:14px;margin:8px 0;text-align:center}
.wk-error button{background:none;border:1px solid var(--wk-danger);color:var(--wk-danger);border-radius:8px;
  min-height:36px;padding:0 14px;margin-left:10px;font-family:inherit;font-size:13px;cursor:pointer;width:auto}

@media (prefers-reduced-motion:reduce){
  #page-work *{animation:none !important;transition:none !important}
  #page-work .wk-card:active,#page-work .wk-primary:active,#page-work .wk-chip:active,
  #page-work .wk-approve:active,#page-work .wk-assign-new:active{transform:none}
}

/* ── Xét tốt nghiệp (graduation review) surface ─────────────── */
.xtn-tabs { display:flex; gap:6px; margin-bottom:16px; flex-wrap:wrap; }
.xtn-tab {
  padding:10px 16px; min-height:44px; border:1px solid var(--border);
  background:var(--surface); color:var(--muted); border-radius:8px;
  font-size:14px; font-weight:600; cursor:pointer; transition:all .12s;
}
.xtn-tab:hover { border-color:var(--accent); color:var(--accent); }
.xtn-tab.active { background:var(--accent); color:#fff; border-color:var(--accent); }

.xtn-scoreboard {
  display:grid; grid-template-columns:repeat(auto-fit,minmax(120px,1fr));
  gap:10px; margin-bottom:12px;
}
.xtn-stat {
  background:var(--surface); border:1px solid var(--border);
  border-radius:10px; padding:12px 14px; text-align:center;
}
.xtn-stat-val { font-size:22px; font-weight:700; color:var(--text,#1c1917); }
.xtn-stat-val.xtn-money { font-size:15px; color:var(--accent); }
.xtn-stat-lbl { font-size:11px; color:var(--muted); margin-top:2px; }

.xtn-chips { display:flex; gap:6px; flex-wrap:wrap; align-items:center; margin-bottom:8px; }
.xtn-chips-lbl { font-size:12px; color:var(--muted); font-weight:600; }
.xtn-chip {
  padding:5px 10px; min-height:32px; border:1px solid var(--border);
  background:var(--surface2); border-radius:20px; font-size:12px; cursor:pointer;
  color:var(--muted);
}
.xtn-chip:hover { border-color:var(--accent); }
.xtn-chip.active { background:var(--accent); color:#fff; border-color:var(--accent); }
.xtn-chip b { margin-left:2px; }

.xtn-table th.num, .xtn-table td.num { text-align:right; }
.xtn-dim { color:var(--muted); font-size:12px; }
.xtn-na { color:var(--muted); }
.xtn-owe { color:#b91c1c; font-weight:600; }
.xtn-tag {
  display:inline-block; padding:2px 7px; margin:1px; border-radius:10px;
  font-size:10px; font-weight:600; background:#fef3c7; color:#92400e;
  white-space:nowrap;
}
.table-scroll { overflow-x:auto; }

.xtn-warn {
  background:#fffbeb; border:1px solid #fde68a; color:#92400e;
  padding:10px 14px; border-radius:8px; font-size:13px; margin-bottom:14px;
}
.xtn-khac-note {
  background:var(--surface2); border:1px solid var(--border);
  padding:14px 16px; border-radius:10px; font-size:14px; line-height:1.6;
  margin-bottom:12px;
}

.xtn-hero {
  display:flex; justify-content:space-between; align-items:center; gap:16px;
  flex-wrap:wrap; background:var(--surface); border:1px solid var(--border);
  border-radius:12px; padding:16px 18px; margin-bottom:16px;
}
.xtn-hero-name { font-size:20px; font-weight:700; }
.xtn-hero-sub { font-size:13px; color:var(--muted); margin-top:4px; }
.xtn-dims { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:12px; margin-bottom:16px; }
.xtn-dim-card { background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:14px 16px; }
.xtn-dim-lbl { font-size:12px; color:var(--muted); font-weight:600; margin-bottom:6px; }
.xtn-dim-val { font-size:24px; font-weight:700; }
.xtn-dim-note { font-size:12px; color:var(--muted); margin-top:4px; }
/* ═════════════════════════════════════════════════════════════
   VP ANALYTICS — Học sinh + LMH (crm-art-law SCHOOL ORANGE, locked A)
   Two admin-gated analytics surfaces. Reuses the work-surface palette.
   ═════════════════════════════════════════════════════════════ */
#page-hs-analytics, #page-lmh-analytics{
  --an-brand:#CE470C; --an-deep:#9A3412;
  --an-grad:linear-gradient(135deg,var(--an-brand),var(--an-deep));
  --an-canvas:#FAF8F4; --an-ink:#231E1A; --an-ink2:#4A423C; --an-muted:#7A7169;
  --an-line:#ECE6DE; --an-pill:#F1ECE4;
  --an-danger:#A33529; --an-danger-bg:#F8E9E6;
  --an-warn:#9A5A16;   --an-warn-bg:#FBF0E2;
  --an-ok:#3F7A44;     --an-ok-bg:#EAF2E9;
  color:var(--an-ink);
}
.an-num{font-variant-numeric:tabular-nums}

/* summary tiles */
.an-tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px;margin:14px 0}
.an-tile{background:#fff;border:1px solid var(--an-line);border-radius:12px;padding:14px 16px;
  box-shadow:0 1px 2px rgba(60,40,24,.05)}
.an-tile .k{font-size:12px;color:var(--an-muted);text-transform:uppercase;letter-spacing:.04em;margin-bottom:6px}
.an-tile .v{font-size:26px;font-weight:700;line-height:1;color:var(--an-ink);font-variant-numeric:tabular-nums}
.an-tile.warn{background:var(--an-warn-bg);border-color:#E7D2B4}
.an-tile.warn .v{color:var(--an-warn)}

/* debt bands — clickable */
.an-bands{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:12px;margin:8px 0 4px}
.an-band{background:#fff;border:1px solid var(--an-line);border-radius:12px;padding:14px 16px;cursor:pointer;
  text-align:left;font-family:inherit;transition:transform .08s ease,border-color .1s;box-shadow:0 1px 2px rgba(60,40,24,.05)}
.an-band:hover{border-color:var(--an-brand)}
.an-band:active{transform:scale(.99)}
.an-band.active{border-color:var(--an-brand);box-shadow:0 0 0 2px rgba(206,71,12,.18)}
.an-band .lbl{font-size:13px;color:var(--an-ink2);font-weight:600;margin-bottom:8px}
.an-band .cnt{font-size:28px;font-weight:700;color:var(--an-danger);font-variant-numeric:tabular-nums}
.an-band .sum{font-size:12px;color:var(--an-muted);margin-top:4px}
.an-band.incomputable .cnt{color:var(--an-muted)}
.an-band.incomputable{background:var(--an-canvas)}

/* simple bars (no chart lib) */
.an-bars{margin:6px 0}
.an-barrow{display:flex;align-items:center;gap:10px;margin:6px 0;font-size:14px}
.an-barrow .name{flex:0 0 150px;color:var(--an-ink2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.an-barrow .track{flex:1;height:14px;background:var(--an-pill);border-radius:999px;overflow:hidden}
.an-barrow .track>i{display:block;height:100%;background:var(--an-grad);border-radius:999px}
.an-barrow .n{flex:0 0 60px;text-align:right;font-variant-numeric:tabular-nums;color:var(--an-ink);font-weight:600}

/* active filter chips */
.an-active-filters{display:flex;flex-wrap:wrap;gap:8px;margin:4px 0 10px}
.an-fchip{display:inline-flex;align-items:center;gap:6px;background:var(--an-pill);color:var(--an-ink2);
  border-radius:999px;padding:5px 12px;font-size:13px}
.an-fchip b{color:var(--an-ink)}
.an-fchip .x{cursor:pointer;font-weight:700;opacity:.6;padding:0 2px}
.an-fchip .x:hover{opacity:1}

/* section headings + toolbar */
.an-sec{font-size:13px;text-transform:uppercase;letter-spacing:.05em;color:var(--an-muted);
  font-weight:600;margin:20px 4px 8px}
.an-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:4px 0 8px;flex-wrap:wrap}
.an-btn{min-height:44px;border:1px solid var(--an-line);background:#fff;color:var(--an-ink);border-radius:10px;
  padding:0 16px;font-size:14px;font-family:inherit;cursor:pointer;display:inline-flex;align-items:center;gap:7px}
.an-btn:hover{border-color:var(--an-brand);color:var(--an-deep)}
.an-btn-primary{background:var(--an-grad);color:#fff;border:none}
.an-btn-primary:hover{color:#fff;filter:brightness(1.05)}

/* data table */
.an-table{width:100%;border-collapse:collapse;font-size:14px;background:#fff;border:1px solid var(--an-line);border-radius:12px;overflow:hidden}
.an-table th{background:var(--an-canvas);color:var(--an-ink2);text-align:left;padding:11px 12px;font-weight:600;font-size:13px;border-bottom:1px solid var(--an-line);white-space:nowrap}
.an-table td{padding:10px 12px;border-bottom:1px solid var(--an-line);color:var(--an-ink)}
.an-table tbody tr:last-child td{border-bottom:none}
.an-table tbody tr:hover td{background:var(--an-canvas)}
.an-table td.r{text-align:right;font-variant-numeric:tabular-nums}
.an-tablewrap{overflow-x:auto;border-radius:12px}
.an-owe{color:var(--an-danger);font-weight:600}
.an-badge{display:inline-block;font-size:11px;padding:2px 8px;border-radius:999px;background:var(--an-pill);color:var(--an-pill-ink,#5A514A)}
.an-badge.na{background:var(--an-warn-bg);color:var(--an-warn)}
.an-empty{padding:28px;text-align:center;color:var(--an-muted)}
.an-loading{padding:24px;text-align:center;color:var(--an-muted)}

/* ── Trung tâm công việc & trao đổi (Admin work cockpit) ──────────────────────
   Art-Law orange (#CE470C → #9A3412), scoped to #page-work-cockpit so the other
   roles' task pages (blue --accent) are untouched. Reuses tk-* / to-* tokens. */
#page-work-cockpit { --wc-orange: #CE470C; --wc-orange-dark: #9A3412; --wc-orange-light: #fff3ec; }
#page-work-cockpit .tk-tab.active { background: var(--wc-orange); border-color: var(--wc-orange); color: #fff; }
.wc-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 720px) { .wc-cards { grid-template-columns: repeat(2, 1fr); } }
.wc-card { cursor: pointer; border-top: 3px solid var(--wc-orange); transition: box-shadow .12s ease, transform .12s ease; }
.wc-card:hover { box-shadow: 0 2px 10px rgba(154,52,18,.12); transform: translateY(-1px); }
.wc-card .tk-metric-value { color: var(--wc-orange-dark); }
.wc-card-sub { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.35; }
.wc-empty-sub { font-size: 12px; color: var(--muted); margin-top: 6px; }
.wc-mssv { font-size: 12px; color: var(--muted); font-weight: 500; }

/* Section 3 attention strip */
.wc-attention { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 12px;
  background: var(--wc-orange-light); border: 1px solid #f6d3c2; border-radius: 10px; }
.wc-attention-lbl { font-size: 12px; font-weight: 700; color: var(--wc-orange-dark); }
.wc-attention-chip { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: #fff; border: 1px solid #f0c4ae; color: var(--wc-orange-dark); }

/* Section 4 internal-talk strip (task comments) */
.wc-internal { padding: 10px 12px; margin-bottom: 12px; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; }
.wc-internal-lbl { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.wc-internal-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wc-internal-chip { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--border); color: var(--text); cursor: pointer; }
.wc-internal-chip:hover { border-color: var(--wc-orange); color: var(--wc-orange-dark); }

/* Section 4 transcript modal thread */
.wc-thread { display: flex; flex-direction: column; gap: 10px; }
.wc-msg { padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); }
.wc-msg-staff { background: var(--wc-orange-light); border-color: #f6d3c2; }
.wc-msg-student { background: var(--surface2); }
.wc-msg-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin-bottom: 4px; font-size: 12px; }
.wc-msg-who { font-weight: 600; color: var(--text); }
.wc-msg-role { font-size: 11px; padding: 1px 7px; border-radius: 10px; background: var(--wc-orange); color: #fff; }
.wc-msg-student .wc-msg-role { background: #8e8e93; }
.wc-msg-when { color: var(--muted); margin-left: auto; }
.wc-msg-body { white-space: pre-wrap; word-break: break-word; font-size: 14px; }

/* ── NHÓM (Spaces) ────────────────────────────────────────────────────────────
   crm-art-law LOCKED SCHOOL ORANGE (#CE470C → #9A3412, AA 4.63:1), scoped to
   #page-nhom so it never bleeds into the blue-accented rest of the app. Reuses
   the shared card / btn / badge tokens; only group-specific pieces are new. */
#page-nhom { --nh-orange: #CE470C; --nh-orange-dark: #9A3412; --nh-orange-light: #fff3ec; }

.nhom-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* List — cards */
.nhom-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.nhom-card {
  background: var(--surface, #fff); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .08s;
}
.nhom-card:hover { border-color: var(--nh-orange); box-shadow: 0 2px 10px rgba(206,71,12,0.10); transform: translateY(-1px); }
.nhom-card:focus-visible { outline: 2px solid var(--nh-orange); outline-offset: 2px; }
.nhom-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.nhom-card-name { font-weight: 700; font-size: 15px; color: var(--text); line-height: 1.3; }
.nhom-card-desc { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.nhom-card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; font-size: 12px; color: var(--muted); }
.nhom-card-when { margin-left: auto; }

.nhom-type-badge { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 11px; white-space: nowrap; }
.nhom-type-office { background: var(--nh-orange-light); color: var(--nh-orange-dark); }
.nhom-type-khoa   { background: #eef2ff; color: #3730a3; }
.nhom-type-custom { background: #f1f5f9; color: #475569; }

/* Feed layout */
.nhom-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; margin-top: 12px; align-items: start; }
.nhom-main { min-width: 0; }
.nhom-side { position: sticky; top: 12px; }
@media (max-width: 860px) { .nhom-grid { grid-template-columns: 1fr; } .nhom-side { position: static; } }

/* Compose box */
.nhom-compose { padding: 0; margin-bottom: 14px; overflow: hidden; }
.nhom-compose-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); background: var(--nh-orange-light); }
.nhom-ctab {
  border: none; background: transparent; padding: 10px 16px; font-size: 13px; font-weight: 600;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent;
}
.nhom-ctab.active { color: var(--nh-orange-dark); border-bottom-color: var(--nh-orange); background: #fff; }
.nhom-compose-body { padding: 12px; }
.nhom-compose-foot { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.nhom-task-extra { display: flex; gap: 12px; flex-wrap: wrap; }
.nhom-inline-label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
#page-nhom .btn-primary { background: var(--nh-orange); border-color: var(--nh-orange); }
#page-nhom .btn-primary:hover { background: var(--nh-orange-dark); border-color: var(--nh-orange-dark); }

/* Posts */
.nhom-post { background: var(--surface, #fff); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.nhom-post-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.nhom-post-author { font-weight: 600; font-size: 13px; color: var(--text); }
.nhom-post-when { margin-left: auto; font-size: 12px; color: var(--muted); }
.nhom-post-body { font-size: 14px; color: var(--text); white-space: pre-wrap; word-break: break-word; line-height: 1.5; }

.nhom-kind-badge { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 10px; }
.nhom-kind-announcement { background: var(--nh-orange-light); color: var(--nh-orange-dark); }
.nhom-kind-status       { background: #eff6ff; color: #1d4ed8; }
.nhom-kind-discussion   { background: #f1f5f9; color: #475569; }

/* Task card inside a post */
.nhom-task-card {
  margin-top: 10px; border: 1px solid #f0d3c4; border-left: 3px solid var(--nh-orange);
  border-radius: var(--radius-sm); padding: 10px 12px; background: var(--nh-orange-light);
  cursor: pointer; transition: box-shadow .12s;
}
.nhom-task-card:hover { box-shadow: 0 1px 6px rgba(206,71,12,0.14); }
.nhom-task-card:focus-visible { outline: 2px solid var(--nh-orange); outline-offset: 2px; }
.nhom-task-card-head { display: flex; align-items: center; gap: 8px; }
.nhom-task-icon { width: 18px; height: 18px; border-radius: 50%; background: var(--nh-orange); color: #fff; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.nhom-task-title { font-weight: 700; font-size: 14px; color: var(--text); }
.nhom-task-prio { margin-left: auto; font-size: 11px; color: var(--nh-orange-dark); font-weight: 600; }
.nhom-task-card-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.nhom-task-open { color: var(--nh-orange-dark); font-weight: 600; }

/* Members panel */
.nhom-member { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.nhom-member:last-child { border-bottom: none; }
.nhom-member-info { min-width: 0; }
.nhom-member-name { font-size: 13px; font-weight: 600; color: var(--text); }
.nhom-member-sub { font-size: 11px; color: var(--muted); }
.nhom-lead-tag { font-size: 10px; font-weight: 700; color: var(--nh-orange-dark); background: var(--nh-orange-light); padding: 1px 6px; border-radius: 8px; margin-left: 6px; }
.nhom-member-x { margin-left: auto; border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; padding: 4px; border-radius: 4px; flex: none; }
.nhom-member-x:hover { color: var(--danger); background: var(--danger-light); }

/* Inline flash */
.nhom-flash { padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 10px; }
.nhom-flash-ok  { background: var(--success-light); color: var(--success); border: 1px solid #bbf7d0; }
.nhom-flash-err { background: var(--danger-light); color: var(--danger); border: 1px solid #fecaca; }
