/* ==========================================================================
   Điểm danh OU · giao diện xanh đậm, font Roboto Condensed (tự host trong /fonts)
   ========================================================================== */

@font-face {
  font-family: 'Roboto Condensed';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url(/fonts/roboto-condensed-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Roboto Condensed';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url(/fonts/roboto-condensed-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Roboto Condensed';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url(/fonts/roboto-condensed-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --navy-950: #061432;
  --navy-900: #0a1f47;
  --navy-800: #0f2c5f;
  --navy-700: #163a78;
  --primary: #123a7c;
  --primary-hover: #0c2d63;
  --link: #1a4a9b;
  --primary-soft: #e8eef9;
  --primary-line: #c6d4ee;

  --bg: #eef2f8;
  --surface: #ffffff;
  --surface-2: #f6f8fc;
  --text: #0f1b33;
  --muted: #5b6884;
  --border: #dbe2ee;

  --ok: #157347;
  --ok-soft: #e2f3e9;
  --late: #ad5b00;
  --late-soft: #fdf0db;
  --bad: #b3261e;
  --bad-soft: #fbe6e5;
  --warn: #c2410c; /* cam đậm: SV vắng nhiều buổi, khác màu "Trễ" */
  --warn-soft: #ffedd5;
  --excused: #5a3eb0;
  --excused-soft: #eeeafb;
  --gold: #e3a008;
  --gold-soft: #fff4d4;
  --gold-text: #7a5300;

  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(10, 31, 71, .06), 0 2px 8px rgba(10, 31, 71, .05);
  --shadow-lg: 0 12px 40px rgba(6, 20, 50, .22);

  font-family: 'Roboto Condensed', 'Arial Narrow', system-ui, sans-serif;
  font-size: 16.5px;
  color: var(--text);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); line-height: 1.5; min-height: 100vh; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; color: var(--navy-900); font-weight: 700; }
h1 { font-size: 1.75rem; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .8em; }
small, .muted { color: var(--muted); }
code { background: var(--primary-soft); color: var(--navy-800); padding: 1px 6px; border-radius: 4px; font-size: .92em; }
.num { font-variant-numeric: tabular-nums; }
.upper { text-transform: uppercase; letter-spacing: .06em; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- Thanh trên cùng ---------- */
.topbar { background: var(--navy-900); color: #fff; position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 10px rgba(6, 20, 50, .25); }
.topbar .inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; align-items: stretch; gap: 26px; min-height: 58px; flex-wrap: wrap; }
.brand { display: flex; flex-direction: column; justify-content: center; color: #fff; line-height: 1.05; }
.brand:hover { text-decoration: none; }
.brand b { font-size: 1.2rem; letter-spacing: .1em; text-transform: uppercase; }
.brand span { font-size: .72rem; color: #9fb3d9; letter-spacing: .18em; text-transform: uppercase; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a { display: flex; align-items: center; padding: 0 14px; color: #c5d3ee; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; font-size: .9rem; border-bottom: 3px solid transparent; }
.topbar nav a:hover { color: #fff; text-decoration: none; background: rgba(255, 255, 255, .05); }
.topbar nav a.active { color: #fff; border-bottom-color: var(--gold); }
.topbar .user { display: flex; align-items: center; gap: 12px; color: #c5d3ee; font-size: .95rem; }
.topbar form { margin: 0; }
.topbar .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .25); }
.topbar .btn-ghost:hover { background: rgba(255, 255, 255, .1); }

/* ---------- Khung trang ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 26px 20px 70px; }
.narrow { max-width: 480px; }
.crumb { display: inline-block; margin-bottom: 10px; color: var(--muted); font-size: .92rem; text-transform: uppercase; letter-spacing: .06em; }
.crumb:hover { color: var(--link); }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.eyebrow { font-size: .78rem; font-weight: 700; color: var(--link); text-transform: uppercase; letter-spacing: .14em; margin-bottom: 4px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.card.flush .card-head { padding: 16px 20px 0; }
.card-title { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 12px; }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.spacer { flex: 1; }

/* ---------- Form ---------- */
label { display: block; font-weight: 600; margin: 12px 0 5px; font-size: .9rem; color: var(--navy-800); }
label.inline { display: inline-flex; gap: 7px; align-items: center; font-weight: 400; margin: 6px 0; color: var(--text); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font: inherit; background: #fff; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(22, 58, 120, .15); }
input[type=file] { font: inherit; padding: 10px; border: 1px dashed var(--primary-line); border-radius: var(--radius-sm); width: 100%; background: var(--surface-2); }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--primary); }
textarea { min-height: 120px; font-family: ui-monospace, Consolas, monospace; font-size: .9rem; }
.form-grid { display: grid; gap: 0 14px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.form-grid .end { align-self: end; padding-bottom: 1px; }
.field-hint { font-size: .85rem; color: var(--muted); margin-top: 4px; }

/* ---------- Nút ---------- */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid var(--primary-line); background: #fff; color: var(--primary);
  font: inherit; font-weight: 600; letter-spacing: .02em; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .08s, box-shadow .15s;
}
button:hover, .btn:hover { text-decoration: none; background: var(--primary-soft); }
button:active, .btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 6px rgba(18, 58, 124, .25); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { color: var(--bad); border-color: #efc3c0; }
.btn-danger:hover { background: var(--bad-soft); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--navy-950); }
.btn-gold:hover { background: #f2b21a; }
.btn-big { font-size: 1.12rem; padding: 12px 24px; }
.btn-sm { padding: 4px 10px; font-size: .86rem; }
.btn-block { width: 100%; }
button:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.link-btn { background: none; border: 0; padding: 0; color: var(--link); font-weight: 500; }
.link-btn:hover { background: none; text-decoration: underline; }

/* ---------- Thông báo ---------- */
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 18px; border: 1px solid; border-left-width: 5px; }
.flash ul { margin: 6px 0 0; padding-left: 20px; font-size: .92rem; }
.flash-success { background: var(--ok-soft); border-color: #a9dbbd; border-left-color: var(--ok); color: #0f4d30; }
.flash-error { background: var(--bad-soft); border-color: #efc3c0; border-left-color: var(--bad); color: #7a1a14; }
.flash-warning, .flash-info { background: var(--late-soft); border-color: #f1d3a1; border-left-color: var(--late); color: #6b3a02; }

/* ---------- Tab ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 18px; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: .9rem; }
.tabs a:hover { color: var(--navy-800); text-decoration: none; }
.tabs a.active { color: var(--navy-900); border-bottom-color: var(--navy-900); }
.tabs a .count { display: inline-block; min-width: 22px; padding: 0 6px; margin-left: 6px; border-radius: 99px; background: var(--primary-soft); color: var(--navy-800); font-size: .78rem; text-align: center; }
.tabs a.active .count { background: var(--navy-900); color: #fff; }

.subtabs { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 3px; margin-bottom: 14px; flex-wrap: wrap; }
.subtabs button { border: 0; background: transparent; color: var(--muted); padding: 6px 14px; border-radius: 6px; box-shadow: none; }
.subtabs button.active { background: var(--navy-900); color: #fff; }
.subpanel:not(.active) { display: none; }

/* ---------- Bảng ---------- */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--surface); }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { font-size: .78rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; background: var(--surface-2); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
tbody tr:hover td { background: #f8faff; }
tr:last-child td { border-bottom: 0; }
td.actions { text-align: right; white-space: nowrap; }
td.actions > * + * { margin-left: 6px; }
td.idx { color: var(--muted); width: 1%; }
.mssv { font-variant-numeric: tabular-nums; letter-spacing: .02em; }

.matrix td, .matrix th { text-align: center; padding: 7px 8px; font-size: .92rem; }
.matrix td:nth-child(-n+3), .matrix th:nth-child(-n+3) { text-align: left; }
.matrix th:nth-child(3), .matrix td:nth-child(3) { position: sticky; left: 0; background: var(--surface); z-index: 2; box-shadow: 1px 0 0 var(--border); white-space: nowrap; }
.matrix th:nth-child(3) { background: var(--surface-2); z-index: 3; }
.absent-row td, .matrix .absent-row td:nth-child(3) { background: var(--bad-soft); }
.absent-row td:nth-child(2), .absent-row td:nth-child(3), .absent-row .absent-count { color: var(--bad); font-weight: 600; }
.absent-row input[type=text] { color: var(--bad); font-weight: 600; }

.empty { text-align: center; color: var(--muted); padding: 30px 16px; }
.empty b { display: block; color: var(--navy-800); font-size: 1.05rem; margin-bottom: 4px; }

/* ---------- Badge ---------- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; letter-spacing: .03em; background: #edf0f5; color: var(--muted); white-space: nowrap; }
.st-present { background: var(--ok-soft); color: var(--ok); }
.st-late { background: var(--late-soft); color: var(--late); }
.st-absent { background: var(--bad-soft); color: var(--bad); }
.st-excused { background: var(--excused-soft); color: var(--excused); }
.st-open { background: var(--ok); color: #fff; }
.st-closed { background: #edf0f5; color: var(--muted); }
.st-draft { background: var(--primary-soft); color: var(--navy-700); }
.points { display: inline-block; min-width: 46px; text-align: center; padding: 2px 10px; border-radius: 999px; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--gold-soft); color: var(--gold-text); }
.points.zero { background: #edf0f5; color: var(--muted); }

/* Nút trạng thái điểm danh */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button { border: 0; border-radius: 0; border-right: 1px solid var(--border); padding: 5px 11px; font-size: .86rem; background: #fff; color: var(--muted); font-weight: 600; box-shadow: none; }
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--surface-2); color: var(--text); }
.seg button.on-present { background: var(--ok); color: #fff; }
.seg button.on-late { background: var(--late); color: #fff; }
.seg button.on-absent { background: var(--bad); color: #fff; }
.seg button.on-excused { background: var(--excused); color: #fff; }

/* Nút lọc */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 5px 13px; border-radius: 999px; border: 1px solid var(--border); background: #fff; color: var(--muted); font-size: .88rem; font-weight: 600; box-shadow: none; }
.chip:hover { background: var(--surface-2); color: var(--text); }
.chip.active { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.chip .n { opacity: .75; margin-left: 4px; font-variant-numeric: tabular-nums; }
.chip-bad { color: var(--bad); }
.chip-bad.active { background: var(--bad); border-color: var(--bad); color: #fff; }
.chip-warn { color: var(--warn); }
.chip-warn.active { background: var(--warn); border-color: var(--warn); color: #fff; }

/* Chi tiết buổi: SV vắng nhiều buổi (tính cả các buổi khác) */
.many-absent .mssv, .many-absent .cell-name { color: var(--warn); font-weight: 700; }
.absent-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: .78rem; font-weight: 700; }
/* Học bù ở nhóm khác: đã lấy điểm danh ở buổi bù (đặc) / đã đăng ký, chưa có điểm danh (viền) */
.makeup-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: .78rem; font-weight: 700; }
.makeup-tag.pending { background: transparent; border: 1px dashed var(--primary-line); font-weight: 600; }
.makeup-list li form { margin-left: auto; }

/* ---------- Ô số liệu ---------- */
.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--navy-700); }
.stat .label { display: block; font-size: .78rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.stat .value { display: block; font-size: 1.9rem; font-weight: 700; color: var(--navy-900); line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 1.05rem; color: var(--muted); font-weight: 500; }
.stat .hint { font-size: .85rem; color: var(--muted); }
.stat.ok::before { background: var(--ok); }
.stat.late::before { background: var(--late); }
.stat.bad::before { background: var(--bad); }
.stat.excused::before { background: var(--excused); }
.stat.gold::before { background: var(--gold); }

/* ---------- Trang chủ giảng viên ---------- */
.today-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); margin-bottom: 28px; }
.today-card { background: var(--navy-900); color: #fff; border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow-lg); position: relative; overflow: hidden; }
.today-card::after { content: ''; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255, 255, 255, .05); }
.today-card .time { font-size: 2.1rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.today-card .course { color: #c5d3ee; }
.today-card .row { margin-top: 10px; position: relative; z-index: 1; }
.today-card .btn { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .3); }
.today-card .btn:hover { background: rgba(255, 255, 255, .1); }
.today-card .btn-gold { background: var(--gold); color: var(--navy-950); border-color: var(--gold); }
.today-card .badge { position: absolute; top: 18px; right: 20px; z-index: 1; }
.today-card .st-closed { background: rgba(255, 255, 255, .12); color: #c5d3ee; }
.today-card .st-draft { background: rgba(255, 255, 255, .12); color: #fff; }

.course-card { display: flex; flex-direction: column; gap: 4px; color: inherit; border-top: 4px solid var(--navy-700); transition: transform .12s, box-shadow .12s; margin: 0; }
.course-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 22px rgba(10, 31, 71, .12); }
.course-card .code { font-size: .85rem; font-weight: 700; color: var(--link); letter-spacing: .08em; text-transform: uppercase; }
.course-card .name { font-size: 1.2rem; font-weight: 700; color: var(--navy-900); line-height: 1.25; }
.course-card .meta { display: flex; gap: 18px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); color: var(--muted); font-size: .92rem; }
.course-card .meta b { color: var(--text); font-size: 1.05rem; }
.course-card .tags { margin-top: 6px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 6px; font-size: .82rem; font-weight: 700; letter-spacing: .03em; background: var(--navy-900); color: #fff; }
.tag-soft { background: var(--primary-soft); color: var(--navy-800); }

/* Bộ lọc học kỳ ở trang chủ */
.filter-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 0 14px; align-items: end; padding: 12px 18px 16px; }
.filter-bar label { margin-top: 0; font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.filter-actions { display: flex; gap: 4px; }
.school-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding-bottom: 8px; margin: 8px 0 14px; border-bottom: 2px solid var(--navy-900); }
.school-name { font-size: 1.25rem; font-weight: 700; color: var(--navy-900); letter-spacing: .06em; text-transform: uppercase; }

/* Trang danh mục */
.catalog-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
.catalog-grid .card { margin: 0; scroll-margin-top: 80px; }
.catalog-table td { padding: 6px 8px; }
.catalog-table th { padding: 8px; }
.catalog-table td:first-child, .catalog-table th:first-child { padding-left: 20px; }
.catalog-table input { padding: 5px 8px; }
.catalog-table { min-width: 640px; }
.catalog-table th:nth-child(1) { width: 28%; }
.catalog-table th:nth-child(2) { width: 36%; }
.catalog-table th:nth-child(3) { width: 8%; }
.catalog-table th:last-child { width: 1%; }
.catalog-table tr.is-default td { background: #f4f8ff; }
.catalog-table tr.is-default td:first-child { box-shadow: inset 4px 0 0 var(--gold); }
.catalog-table td > * + * { margin-left: 6px; }
.catalog-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }
.catalog-add input[type=text] { flex: 1; min-width: 140px; padding: 6px 10px; }
.catalog-add label.inline { margin: 0; }
.catalog-add select { width: auto; padding: 6px 10px; }
.catalog-table tr.group-row th { background: var(--surface-2); padding: 8px 20px; font-size: 13px; text-align: left; }
.catalog-hint { margin: 0; padding: 0 20px 14px; background: var(--surface-2); }
:target { animation: flashrow 1.6s ease-out; }
@media (max-width: 900px) {
  .filter-bar { grid-template-columns: 1fr 1fr; gap: 10px 12px; }
  .filter-actions { grid-column: 1 / -1; }
}

.new-card {display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 170px; border: 2px dashed var(--primary-line); background: transparent; color: var(--link); font-size: 1.05rem; box-shadow: none; }
.new-card:hover { background: var(--primary-soft); }

/* ---------- Danh sách buổi học ---------- */
.group-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 22px 0 8px; }
.group-title:first-child { margin-top: 0; }
.session-date b { color: var(--navy-900); }
.session-date .wd { display: inline-block; width: 30px; color: var(--muted); font-weight: 600; }
/* Hôm nay: viền vàng · Sắp tới: viền xanh, chữ đậm · Đã diễn ra: nền xám, chữ nhạt */
.group-title { display: flex; align-items: center; gap: 8px; }
.group-title::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.group-title.g-today { color: var(--gold-text); }
.group-title.g-upcoming { color: var(--link); }
.group-title.g-past { color: #8a94a8; }
.card.g-today { border-color: #f0d48a; }
.card.g-upcoming { border-color: var(--primary-line); }
.session-date .rel { display: block; margin-left: 30px; font-size: .82rem; font-weight: 600; }
.is-today td { background: #fffbef; }
.is-today td:first-child { box-shadow: inset 4px 0 0 var(--gold); }
.is-upcoming td:first-child { box-shadow: inset 4px 0 0 var(--link); }
.is-upcoming .rel { color: var(--link); }
.is-past td { background: var(--surface-2); color: var(--muted); }
.is-past td:first-child { box-shadow: inset 4px 0 0 #c3cad8; }
.is-past .session-date b { color: var(--muted); font-weight: 600; }
.is-past .rel { color: #8a94a8; font-weight: 500; }
.st-missed { background: var(--warn-soft); color: var(--warn); }

/* ---------- Trang buổi học: 2 cột ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
/* Cột phải luôn ghim trên màn hình; dài hơn màn hình thì tự cuộn riêng (không phải kéo hết danh sách SV) */
.split aside {
  position: sticky; top: 74px; display: flex; flex-direction: column; gap: 16px;
  max-height: calc(100vh - 86px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  padding: 4px 6px 12px; margin: -4px -6px 0;
}
.split aside .card { margin: 0; }
/* Nút Lưu của form sửa buổi luôn hiện ở đáy cột phải khi đang cuộn trong form */
.sticky-save { position: sticky; bottom: 0; margin: 14px -20px -20px; padding: 12px 20px; background: linear-gradient(to bottom, rgba(255, 255, 255, .85), #fff 30%); border-radius: 0 0 var(--radius) var(--radius); z-index: 1; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.toolbar input[type=search] { max-width: 340px; }
.toolbar select { width: auto; }
.quick-hint { font-size: .9rem; color: var(--muted); padding: 8px 16px 0; margin: 0; }
.quick-hint:empty { display: none; }
.cell-name { white-space: nowrap; }
.quick-hint.ok { color: var(--ok); font-weight: 600; }
.note-input { width: 110px !important; min-width: 90px; padding: 4px 8px !important; }
#roster th, #roster td { padding: 8px 10px; }
.sessions-table { table-layout: fixed; min-width: 980px; }
.sessions-table th:nth-child(1) { width: 15%; }
.sessions-table th:nth-child(2) { width: 6%; }
.sessions-table th:nth-child(3) { width: 13%; }
.sessions-table th:nth-child(4) { width: 10%; }
.sessions-table th:nth-child(5) { width: 11%; }
.sessions-table th:nth-child(6) { width: 7%; }
.sessions-table th:nth-child(7) { width: 12%; }
.action-card { background: var(--navy-900); color: #fff; border: 0; }
.action-card h3 { color: #fff; }
.action-card .muted { color: #a9bbdd; }
.action-card .btn { width: 100%; margin-top: 8px; background: transparent; color: #fff; border-color: rgba(255, 255, 255, .28); }
.action-card .btn:hover { background: rgba(255, 255, 255, .1); }
.action-card .btn-gold { background: var(--gold); color: var(--navy-950); border-color: var(--gold); }
.action-card .btn-gold:hover { background: #f2b21a; }
.action-card .btn-danger { color: #ffb4ae; border-color: rgba(255, 180, 174, .35); }
.action-card form { margin: 0; }
.progress { height: 8px; background: rgba(255, 255, 255, .14); border-radius: 99px; overflow: hidden; margin: 8px 0 4px; }
.progress div { height: 100%; background: var(--gold); width: 0; transition: width .4s; }
.big-num { font-size: 2.6rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.big-num small { font-size: 1.2rem; font-weight: 500; opacity: .7; }

.called-list { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; }
.called-list li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .95rem; }
.called-list li:last-child { border-bottom: 0; }
.called-list .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.called-list .who small { display: block; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.mini-stats div { background: var(--surface-2); border-radius: 8px; padding: 8px; text-align: center; }
.mini-stats b { display: block; font-size: 1.35rem; color: var(--navy-900); line-height: 1.1; font-variant-numeric: tabular-nums; }
.mini-stats span { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

details.card > summary { cursor: pointer; font-weight: 700; color: var(--navy-800); list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: '+'; float: right; font-weight: 400; font-size: 1.2rem; line-height: 1; }
details.card[open] > summary::after { content: '–'; }
details.card[open] > summary { margin-bottom: 8px; }

/* ---------- Hộp thoại ---------- */
dialog { border: 0; border-radius: 14px; padding: 0; max-width: 560px; width: calc(100% - 32px); box-shadow: var(--shadow-lg); color: var(--text); }
dialog::backdrop { background: rgba(6, 20, 50, .55); backdrop-filter: blur(2px); }
dialog .dlg-head { background: var(--navy-900); color: #fff; padding: 16px 22px; display: flex; align-items: center; }
dialog .dlg-head h2 { color: #fff; margin: 0; font-size: 1.2rem; }
dialog .dlg-head button { margin-left: auto; background: transparent; color: #c5d3ee; border-color: transparent; }
dialog .dlg-body { padding: 8px 22px 22px; }
dialog .dlg-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

/* ---------- Điểm cộng (tab lớp) ---------- */
.bonus-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.bonus-tools input[type=search] { max-width: 360px; flex: 1; min-width: 200px; }
.bonus-tools select { width: auto; }
.step-btns { display: inline-flex; gap: 4px; }
.step-btns button { min-width: 50px; padding: 4px 8px; font-size: .86rem; }
.history-row td { background: var(--surface-2) !important; padding: 8px 14px 12px 60px; }
.history-row ul { list-style: none; margin: 0; padding: 0; }
.history-row li { display: flex; gap: 12px; align-items: center; padding: 3px 0; font-size: .92rem; }
.history-row li .when { color: var(--muted); width: 130px; }
.history-row li .pts { width: 50px; font-weight: 700; font-variant-numeric: tabular-nums; }
.flash-row td { animation: flashrow 1.2s ease-out; }
@keyframes flashrow { from { background: var(--gold-soft); } to { background: transparent; } }

@media (max-width: 960px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .split aside { position: static; order: -1; max-height: none; overflow: visible; padding: 0; margin: 0; }
}
@media (max-width: 640px) {
  :root { font-size: 15.5px; }
  .container { padding: 18px 14px 60px; }
  .topbar .inner { padding: 0 14px; gap: 10px; }
  .brand span { display: none; }
  .brand b { font-size: 1.02rem; letter-spacing: .06em; }
  .topbar nav a { padding: 0 8px; white-space: nowrap; font-size: .85rem; }
  .topbar .user span { display: none; }
  .page-head .actions { margin-left: 0; }
  th, td { padding: 8px 10px; }
  .card { padding: 16px; }
}

/* ==========================================================================
   Màn hình trình chiếu QR
   ========================================================================== */
body.present { background: radial-gradient(ellipse at 30% 20%, #12306a 0%, var(--navy-950) 65%); color: #fff; overflow: hidden; }
.present-wrap { height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; padding: 22px 26px; }
.qr-col { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; }
.qr-box { background: #fff; border-radius: 20px; padding: 16px; height: min(calc(100vh - 120px), calc(100vw - 440px)); aspect-ratio: 1; position: relative; box-shadow: 0 0 0 6px rgba(227, 160, 8, .55), 0 20px 60px rgba(0, 0, 0, .45); }
.qr-box svg { width: 100%; height: 100%; display: block; }
.qr-box.stale svg { opacity: .12; }
.qr-overlay { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; text-align: center; color: var(--navy-900); font-size: 1.7rem; font-weight: 700; padding: 30px; }
.qr-box.stale .qr-overlay { display: flex; }
.countdown { width: min(calc(100vh - 120px), calc(100vw - 440px)); height: 10px; background: rgba(255, 255, 255, .1); border-radius: 99px; margin-top: 18px; overflow: hidden; }
.countdown div { height: 100%; background: #22c55e; width: 100%; }
.side { display: flex; flex-direction: column; gap: 18px; min-height: 0; }
.side h1 { font-size: 2rem; margin: 0; color: #fff; letter-spacing: .04em; }
.side .sub { color: #a9bbdd; }
.side .label { font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; color: #a9bbdd; font-weight: 700; }
.big-count { font-size: 5rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; color: var(--gold); }
.big-count small { font-size: 2rem; color: #a9bbdd; font-weight: 500; }
.recent { list-style: none; margin: 0; padding: 0; overflow: hidden; flex: 1; }
.recent li { padding: 7px 0; border-bottom: 1px solid rgba(255, 255, 255, .08); display: flex; justify-content: space-between; gap: 8px; font-size: 1.1rem; animation: slidein .4s ease-out; }
.recent li .late { color: #fbbf24; }
@keyframes slidein { from { opacity: 0; transform: translateX(16px); } }
.side .btn { background: rgba(255, 255, 255, .06); color: #fff; border-color: rgba(255, 255, 255, .18); }
.side .btn:hover { background: rgba(255, 255, 255, .14); }
.side .btn-gold { background: var(--gold); color: var(--navy-950); border-color: var(--gold); }
.side .btn-danger { background: rgba(179, 38, 30, .5); border-color: rgba(255, 180, 174, .4); color: #fff; }
.hint { color: #a9bbdd; font-size: 1rem; }
.hint b { color: #fff; }
.warn-box { background: rgba(173, 91, 0, .85); color: #fff; padding: 10px 12px; border-radius: 10px; font-size: .92rem; }
@media (max-width: 900px) {
  body.present { overflow: auto; }
  .present-wrap { grid-template-columns: 1fr; height: auto; }
  .qr-box, .countdown { width: min(92vw, 70vh); height: auto; }
}

/* ==========================================================================
   Màn hình gọi lên bảng (vòng quay)
   ========================================================================== */
body.board { background: radial-gradient(ellipse at 50% 35%, #173d80 0%, var(--navy-950) 70%); color: #fff; overflow: hidden; }
body.board.spinning { animation: bgpulse 1.1s ease-in-out infinite; }
@keyframes bgpulse { 50% { background-color: #0d2552; } }
.board-wrap { height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; padding: 20px 26px; }
.board-main { display: flex; flex-direction: column; align-items: center; min-height: 0; }
.board-top { width: 100%; display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.board-top h1 { color: #fff; margin: 0; font-size: 1.7rem; letter-spacing: .04em; }
.board-top .sub { color: #a9bbdd; }
.board-stats { margin-left: auto; display: flex; gap: 22px; }
.board-stats div { text-align: right; }
.board-stats b { display: block; font-size: 1.8rem; line-height: 1; font-variant-numeric: tabular-nums; }
.board-stats span { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: #a9bbdd; }
.board-stats .gold b { color: var(--gold); }

.board-stage { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: 18px; min-height: 0; overflow-y: auto; padding: 4px 0 10px; }
.board-stage > * { flex-shrink: 0; }
.board-title { font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4em; color: var(--gold); }

.reel-frame { --item: 92px; position: relative; width: min(980px, 100%); height: calc(var(--item) * 5); border-radius: 22px; background: rgba(4, 13, 34, .55); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .08), 0 30px 80px rgba(0, 0, 0, .45); overflow: hidden; }
.reel-frame::before, .reel-frame::after { content: ''; position: absolute; left: 0; right: 0; height: calc(var(--item) * 2); z-index: 2; pointer-events: none; }
.reel-frame::before { top: 0; background: linear-gradient(to bottom, rgba(6, 20, 50, .96), rgba(6, 20, 50, .35)); }
.reel-frame::after { bottom: 0; background: linear-gradient(to top, rgba(6, 20, 50, .96), rgba(6, 20, 50, .35)); }
.reel-window { position: absolute; left: 14px; right: 14px; top: calc(var(--item) * 2); height: var(--item); border-radius: 14px; border: 3px solid var(--gold); box-shadow: 0 0 30px rgba(227, 160, 8, .35), inset 0 0 24px rgba(227, 160, 8, .12); z-index: 3; pointer-events: none; transition: box-shadow .3s, transform .3s; }
.spinning .reel-window { animation: windowglow .5s ease-in-out infinite alternate; }
@keyframes windowglow { to { box-shadow: 0 0 60px rgba(227, 160, 8, .7), inset 0 0 30px rgba(227, 160, 8, .25); } }
.reel { position: absolute; left: 0; right: 0; top: 0; will-change: transform; }
.reel div { height: var(--item); display: flex; align-items: center; justify-content: center; font-size: calc(var(--item) * .48); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 30px; color: #dfe8fa; }
.spinning .reel { filter: blur(.6px); }
.reel div.two-line { white-space: normal; text-overflow: clip; line-height: 1.05; font-size: calc(var(--item) * .36); text-align: center; }
.reel div.win { color: var(--gold); text-shadow: 0 0 24px rgba(227, 160, 8, .6); animation: winpop .7s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes winpop { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1.06); } }
.landed .reel-window { transform: scale(1.03); box-shadow: 0 0 80px rgba(227, 160, 8, .8), inset 0 0 40px rgba(227, 160, 8, .3); }
.lights { position: absolute; inset: 6px; z-index: 4; pointer-events: none; border-radius: 18px; }
.lights i { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: rgba(227, 160, 8, .25); }
.spinning .lights i, .landed .lights i { animation: bulb .6s steps(2) infinite; }
.lights i:nth-child(odd) { animation-delay: .3s !important; }
@keyframes bulb { 50% { background: var(--gold); box-shadow: 0 0 10px var(--gold); } }

.winner-info { min-height: 1.6em; text-align: center; font-size: 1.3rem; color: #c5d3ee; }
.winner-info b { color: #fff; }
.winner-info .points { font-size: 1.15rem; vertical-align: middle; }
.board-actions { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; align-items: center; min-height: 86px; }
.board-actions .btn-spin { border-radius: 12px; min-width: 220px; font-size: 1.6rem; padding: 18px 60px; letter-spacing: .25em; text-transform: uppercase; background: var(--gold); color: var(--navy-950); border-color: var(--gold); box-shadow: 0 8px 0 #9c6c00, 0 14px 30px rgba(0, 0, 0, .35); }
.board-actions .btn-spin:hover { background: #f2b21a; }
.board-actions .btn-spin:active { transform: translateY(6px); box-shadow: 0 2px 0 #9c6c00, 0 6px 14px rgba(0, 0, 0, .35); }
.board-actions .btn-spin.skip { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .3); box-shadow: 0 8px 0 rgba(0, 0, 0, .35); letter-spacing: .12em; }

/* Chọn số bạn mỗi lượt */
.count-picker { display: inline-flex; align-items: center; gap: 4px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .18); border-radius: 12px; padding: 6px 8px 6px 16px; }
.count-picker span { font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; color: #a9bbdd; font-weight: 700; margin-right: 6px; }
.count-picker b { min-width: 46px; text-align: center; font-size: 2.1rem; line-height: 1; color: var(--gold); font-variant-numeric: tabular-nums; }
.count-picker button { width: 44px; height: 44px; padding: 0; font-size: 1.6rem; line-height: 1; border-radius: 10px; background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .2); }
.count-picker button:hover { background: rgba(255, 255, 255, .18); }

/* Vòng quay thu nhỏ khi gọi nhiều bạn, để danh sách có chỗ */
.has-picks .reel-frame { --item: 76px; }
.multi .reel-frame { --item: 62px; }
.multi.has-picks .reel-frame { --item: 46px; }
.multi.has-picks { gap: 12px; }

/* Danh sách các bạn được gọi trong lượt */
.picks { width: min(980px, 100%); display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.picks:empty { display: none; }
.pick-card { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .07); border: 2px solid rgba(255, 255, 255, .12); animation: cardin .45s cubic-bezier(.2, 1.4, .4, 1); transition: background .25s, border-color .25s, opacity .25s; }
@keyframes cardin { from { opacity: 0; transform: translateY(18px) scale(.92); } }
.pick-card.pending { border-color: rgba(227, 160, 8, .55); box-shadow: 0 0 22px rgba(227, 160, 8, .12); }
.pick-card.first { border-color: var(--gold); box-shadow: 0 0 26px rgba(227, 160, 8, .35); }
.pick-card.awarded { background: rgba(21, 115, 71, .38); border-color: #2fa36b; }
.pick-card.skipped { opacity: .55; }
.pick-card.saving { opacity: .7; pointer-events: none; }
.pick-no { flex: none; width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.15rem; background: var(--gold); color: var(--navy-950); }
.pick-card.awarded .pick-no { background: #2fa36b; color: #fff; }
.pick-card.skipped .pick-no { background: rgba(255, 255, 255, .2); color: #fff; }
.pick-who { flex: 1; min-width: 0; }
.pick-who b { display: block; font-size: 1.55rem; line-height: 1.15; color: #fff; text-transform: uppercase; letter-spacing: .02em; overflow-wrap: anywhere; }
.pick-who small { color: #a9bbdd; font-size: .95rem; }
.pick-actions { display: flex; gap: 6px; align-items: center; width: 100%; justify-content: flex-end; min-height: 42px; }
.pick-actions .act-right { margin-right: auto; }
.pick-card.awarded .pick-actions, .pick-card.skipped .pick-actions { justify-content: space-between; }
.pick-actions button { padding: 9px 14px; font-size: 1.02rem; border-radius: 10px; }
.pick-actions .act-right { background: var(--ok); border-color: var(--ok); color: #fff; }
.pick-actions .act-right:hover { background: #12643d; }
.pick-actions .act-wrong, .pick-actions .act-absent { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .25); color: #fff; }
.pick-actions .act-wrong:hover, .pick-actions .act-absent:hover { background: rgba(255, 255, 255, .16); }
.pick-actions .act-absent { font-size: .9rem; padding: 9px 10px; }
.pick-result { font-weight: 700; font-size: 1.3rem; }
.pick-card.awarded .pick-result { color: #8ff0bf; }
.pick-card.skipped .pick-result { color: #c5d3ee; font-size: 1.05rem; }
.pick-actions .link-btn { color: #a9bbdd; font-size: .9rem; margin-left: 6px; background: none; border: 0; }
.float-plus.small { font-size: 3rem; position: fixed; transform: translate(-50%, -50%); animation: floatsmall 1.2s ease-out forwards; }
@keyframes floatsmall { 0% { opacity: 0; transform: translate(-50%, -20%) scale(.6); } 25% { opacity: 1; transform: translate(-50%, -60%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -220%); } }
.board-msg { min-height: 1.6em; color: #ffd27a; font-size: 1.1rem; text-align: center; }

.float-plus { position: fixed; left: 50%; top: 45%; transform: translate(-50%, -50%); font-size: 7rem; font-weight: 800; color: var(--gold); text-shadow: 0 0 40px rgba(227, 160, 8, .7); pointer-events: none; z-index: 50; animation: floatup 1.6s ease-out forwards; }
@keyframes floatup { 0% { opacity: 0; transform: translate(-50%, -20%) scale(.5); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -160%) scale(1); } }
.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; }

.board-side { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.board-side .label { font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; color: #a9bbdd; font-weight: 700; }
.board-side .called-list { flex: 1; max-height: none; }
.board-side .called-list li { border-bottom-color: rgba(255, 255, 255, .08); }
.board-side .called-list small { color: #a9bbdd; }
.board-side .called-list .who { white-space: normal; overflow-wrap: anywhere; }
.board-side .btn, .board-side button { background: rgba(255, 255, 255, .06); color: #fff; border-color: rgba(255, 255, 255, .18); }
.board-side .btn:hover, .board-side button:hover { background: rgba(255, 255, 255, .14); }
.board-side .link-btn { background: none; border: 0; color: #a9bbdd; font-size: .85rem; }
/* Đồng hồ chuẩn bị: vàng khi chạy, cam khi còn ≤ 1 phút, đỏ nhấp nháy 10 giây cuối */
.timer { background: rgba(255, 255, 255, .06); border: 2px solid rgba(255, 255, 255, .14); border-radius: 14px; padding: 12px 14px; transition: border-color .3s, background .3s; }
.timer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.timer-len { display: inline-flex; align-items: center; gap: 4px; }
.timer-len b { min-width: 58px; text-align: center; font-size: .95rem; }
.board-side .timer-len button { width: 30px; height: 30px; padding: 0; font-size: 1.1rem; line-height: 1; border-radius: 8px; }
.timer-clock { font-size: 4.4rem; font-weight: 800; line-height: 1.05; text-align: center; font-variant-numeric: tabular-nums; letter-spacing: .03em; color: #dfe8fa; margin: 4px 0 8px; }
.timer-bar { display: flex; gap: 8px; }
.timer-bar button { flex: 1; }
.board-side .timer-bar #timer-toggle { background: var(--gold); color: var(--navy-950); border-color: var(--gold); font-weight: 700; }
.board-side .timer.running #timer-toggle { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .3); }
.timer-auto { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: .9rem; color: #a9bbdd; cursor: pointer; }
.timer-auto input { width: auto; margin: 0; }
.timer.running { border-color: var(--gold); }
.timer.running .timer-clock { color: var(--gold); }
.timer.warn { border-color: #f59e0b; background: rgba(245, 158, 11, .12); }
.timer.warn .timer-clock { color: #fbbf24; }
.timer.danger { border-color: #ef4444; background: rgba(239, 68, 68, .18); }
.timer.danger .timer-clock { color: #ff8a80; animation: timerblink 1s steps(2) infinite; }
.timer.done { border-color: #ef4444; background: rgba(239, 68, 68, .28); }
.timer.done .timer-clock { color: #ff8a80; }
@keyframes timerblink { 50% { opacity: .35; } }
.float-plus.time-up { color: #ff6b5e; text-shadow: 0 0 40px rgba(239, 68, 68, .7); }
.tag-award { color: #6fe0a4; font-weight: 700; }
.tag-skip { color: #a9bbdd; }
.tier-note { background: rgba(255, 255, 255, .06); border-radius: 10px; padding: 10px 12px; font-size: .95rem; color: #c5d3ee; }
.tier-note b { color: var(--gold); }
/* Màn hình thấp (laptop 768px): thu khung quay khi đã có thẻ để thẻ tên không đẩy khung quay ra khỏi màn hình */
@media (max-height: 860px) {
  .has-picks .reel-frame { --item: 58px; }
}
@media (max-width: 1000px) {
  body.board { overflow: auto; }
  .board-wrap { grid-template-columns: 1fr; height: auto; min-height: 100vh; }
  .reel-frame, .has-picks .reel-frame { --item: 64px; }
  .board-actions .btn-spin { padding: 14px 40px; font-size: 1.3rem; min-width: 0; }
  .multi .reel-frame, .multi.has-picks .reel-frame { --item: 46px; }
  .pick-who b { font-size: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ==========================================================================
   Trang đơn (đăng nhập, cài đặt lần đầu, thông báo cho giảng viên)
   ========================================================================== */
.card.hero { padding: 0; overflow: hidden; }
.hero-head { background: var(--navy-900); color: #fff; padding: 18px 22px; }
.hero-head h1 { color: #fff; margin: 4px 0 0; }
.hero-head .muted { color: #a9bbdd; }
.hero-body { padding: 20px 22px 22px; }
.student-result { text-align: center; padding: 0; overflow: hidden; }
.student-result .banner { padding: 26px 18px 20px; color: #fff; }
.student-result.ok .banner { background: var(--ok); }
.student-result.bad .banner { background: var(--bad); }
.student-result.info .banner { background: var(--navy-900); }
.student-result .banner h1 { color: #fff; margin: 0; font-size: 1.6rem; }
.student-result .banner .mark { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .3em; opacity: .85; margin-bottom: 6px; }
.student-result .body { padding: 20px 18px 22px; }
.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .75; } }

/* ==========================================================================
   Trang sinh viên (quét QR trên điện thoại): dải xanh phía trên, thẻ trắng nổi
   ========================================================================== */
body.student {
  background-color: var(--bg);
  background-image: linear-gradient(165deg, var(--navy-950) 0%, var(--navy-800) 70%, var(--navy-700) 100%);
  background-size: 100% 210px;
  background-repeat: no-repeat;
}
.s-wrap { max-width: 440px; margin: 0 auto; padding: 18px 16px 28px; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
.s-brand { color: #fff; text-align: center; font-weight: 700; font-size: .95rem; letter-spacing: .22em; text-transform: uppercase; margin: 4px 0 16px; opacity: .92; }
.s-card { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; animation: s-rise .35s ease-out; }
@keyframes s-rise { from { opacity: 0; transform: translateY(12px); } }

/* Thông tin buổi học */
.s-course { padding: 18px 20px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.s-code { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .08em; color: var(--navy-800); background: var(--primary-soft); border: 1px solid var(--primary-line); border-radius: 999px; padding: 1px 10px; }
.s-course-name { font-size: 1.2rem; font-weight: 700; color: var(--navy-900); line-height: 1.25; margin-top: 8px; }
.s-meta { color: var(--muted); font-size: .95rem; margin-top: 2px; }

.s-body { padding: 18px 20px 22px; }
.s-title { font-size: 1.55rem; margin: 0 0 4px; }
.s-lead { color: var(--muted); margin: 0 0 6px; }

/* Bước 1/2 – 2/2 và thời gian còn lại */
.s-steps { margin-bottom: 16px; }
.s-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.s-bars span { height: 5px; border-radius: 3px; background: var(--border); }
.s-bars span.on { background: var(--gold); }
.s-step-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; font-size: .85rem; }
.s-step-label { font-weight: 700; color: var(--navy-800); text-transform: uppercase; letter-spacing: .06em; }
.s-timer { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.s-timer b { color: var(--navy-800); }
.s-timer.low, .s-timer.low b { color: var(--late); }
.s-timer.expired { color: var(--bad); font-weight: 700; }

/* Ô nhập MSSV */
.s-body label { margin-top: 16px; }
.s-mssv { font-size: 1.7rem !important; padding: 12px 14px !important; letter-spacing: .14em; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; border-width: 2px !important; border-color: var(--primary-line) !important; }
.s-mssv::placeholder { color: #b4bfd3; font-weight: 400; letter-spacing: .04em; font-size: 1.15rem; }
.s-mssv:focus { border-color: var(--navy-700) !important; }
.s-mssv.is-invalid { border-color: var(--bad) !important; box-shadow: 0 0 0 3px rgba(179, 38, 30, .12); }
.s-submit { margin-top: 14px; min-height: 54px; border-radius: 12px; white-space: normal; }
.s-secondary { margin-top: 10px; min-height: 48px; border-radius: 12px; }
.s-alert { margin: 12px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--bad-soft); color: #7a1a14; border: 1px solid #efc3c0; font-size: .95rem; }

/* Bạn là ai */
.s-who { text-align: center; padding: 18px 14px; margin: 14px 0 4px; border-radius: 12px; background: var(--primary-soft); border: 1px solid var(--primary-line); }
.s-who-name { font-size: 1.6rem; font-weight: 700; color: var(--navy-900); line-height: 1.2; }
.s-who-mssv { color: var(--muted); margin-top: 4px; letter-spacing: .03em; }
.s-who-mssv b { color: var(--navy-800); }

/* Băng kết quả */
.s-banner { padding: 24px 20px 20px; color: #fff; text-align: center; }
.s-banner h1 { color: #fff; margin: 0; font-size: 1.6rem; }
.s-banner p { margin: 6px 0 0; opacity: .92; }
.s-banner.ok { background: linear-gradient(160deg, #0f5c38, var(--ok)); }
.s-banner.late { background: linear-gradient(160deg, #8a4800, #c56a06); }
.s-banner.bad { background: linear-gradient(160deg, #8f1d17, var(--bad)); }
.s-banner.info { background: var(--navy-900); }
.s-banner + .s-body .s-who { margin-top: 0; }

.s-facts { margin: 16px 0 0; display: grid; gap: 0; }
.s-facts > div { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.s-facts > div:last-child { border-bottom: 0; }
.s-facts dt { color: var(--muted); font-size: .92rem; }
.s-facts dd { margin: 0; }

.s-clock { margin-top: 16px; text-align: center; padding: 14px 12px 12px; border-radius: 12px; background: var(--navy-900); color: #fff; }
.s-clock-label { font-size: .75rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: #a9bbdd; }
.s-clock-time { font-size: 2.7rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .05em; line-height: 1.15; }
.s-clock-hint { font-size: .8rem; color: #a9bbdd; margin-top: 2px; }
.s-forget { margin: 16px 0 0; text-align: center; }
.s-forget .link-btn { color: var(--muted); font-size: .88rem; white-space: normal; }

.s-msg { margin: 0; font-size: 1.02rem; }
.s-next { margin-top: 16px; padding: 12px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.s-next-title { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--navy-800); }
.s-next ol { margin: 6px 0 0; padding-left: 20px; }
.s-next li + li { margin-top: 4px; }
.s-body .btn-block { margin-top: 16px; }

.s-tip { margin: 14px 4px 0; font-size: .9rem; color: var(--muted); text-align: center; }
.s-foot { margin: auto 0 0; padding-top: 22px; text-align: center; font-size: .82rem; color: var(--muted); }

/* ---------- Hình thức buổi học: Online / Offline, link Google Meet ---------- */
.mode-online { background: #e3f0ff; color: #0b57d0; }
.mode-offline { background: #edf0f5; color: var(--muted); }
.today-card .mode-online, .today-card .mode-offline { position: static; }
.today-card .mode-online { background: rgba(140, 190, 255, .18); color: #cfe3ff; }
.today-card .mode-offline { background: rgba(255, 255, 255, .1); color: #c5d3ee; }
.btn-meet { border-color: #a8c7fa; color: #0b57d0; }
.btn-meet:hover { background: #e3f0ff; }
.btn.btn-primary.btn-meet { background: #0b57d0; border-color: #0b57d0; color: #fff; }
.today-card .btn-meet { border-color: rgba(168, 199, 250, .6); color: #cfe3ff; }
.meet-link { font-weight: 700; font-size: .88rem; color: #0b57d0; margin-left: 6px; }
.meet-card .meet-url { display: block; font-weight: 700; word-break: break-all; color: #0b57d0; }
.page-head .sub .badge { vertical-align: 1px; }

/* Bảng xem trước khi nhập danh sách buổi */
.import-table td { vertical-align: top; }
.import-table input, .import-table select { min-width: 0; width: 100%; }
.import-table input[type=date] { min-width: 140px; }
.import-table input[type=time] { min-width: 100px; }
.import-table td:nth-child(2) select { min-width: 230px; }
.import-table td:nth-child(6) select { min-width: 110px; }
.import-table td:nth-child(5) input { min-width: 200px; }
.import-table td:nth-child(7) input { min-width: 220px; }
.import-table tr.is-skip td:not(:nth-child(2)) { opacity: .45; }
.warn-text { color: var(--late); }
[data-meet-wrap][hidden], .import-table [data-meet-field]:disabled { opacity: .45; }
.container.container-wide { max-width: 1480px; }

/* ==========================================================================
   Bài tập theo buổi · nhập điểm · bảng điểm
   ========================================================================== */
input[type=datetime-local] { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font: inherit; background: #fff; color: var(--text); }
.split-wide { grid-template-columns: minmax(0, 1fr) 400px; }
.asg-link { font-weight: 600; font-size: .9rem; }
.asg-empty { font-size: .88rem; color: var(--muted); border-bottom: 1px dashed var(--primary-line); }
.asg-empty:hover { color: var(--link); text-decoration: none; }
.asg-summary { list-style: none; margin: 0 0 12px; padding: 0; }
.asg-summary li { display: grid; grid-template-columns: 70px 1fr; gap: 0 8px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: .95rem; }
.asg-summary li:last-child { border-bottom: 0; }
.asg-summary li > span:first-child { color: var(--muted); font-weight: 600; }
.asg-summary small { grid-column: 2; color: var(--muted); }

/* Nội dung đề .md */
.md-body { line-height: 1.6; overflow-wrap: anywhere; }
.md-body > :first-child { margin-top: 0; }
.md-body h1 { font-size: 1.45rem; }
.md-body h2, .md-body h3, .md-body h4 { margin: 1.4em 0 .5em; }
.md-body [id^="cau-"] { padding: 6px 12px; background: var(--primary-soft); border-left: 4px solid var(--gold); border-radius: 0 6px 6px 0; scroll-margin-top: 80px; }
.md-body pre { background: var(--navy-950); color: #e6edf9; padding: 12px 14px; border-radius: var(--radius-sm); overflow-x: auto; font-size: .9rem; line-height: 1.45; }
.md-body pre code { background: none; color: inherit; padding: 0; font-size: inherit; }
.md-body code { font-family: ui-monospace, Consolas, monospace; }
.md-body table { width: auto; margin: 0 0 1em; }
.md-body th, .md-body td { border: 1px solid var(--border); padding: 6px 10px; }
.md-body th { position: static; }
.md-body blockquote { margin: 0 0 1em; padding: 4px 14px; border-left: 4px solid var(--primary-line); color: var(--muted); }
.md-body img { max-width: 100%; }
.md-body ul, .md-body ol { padding-left: 24px; }
textarea.md-source { min-height: 340px; }

/* Form giao bài */
.assign-table th, .assign-table td { padding: 7px 8px; text-align: center; }
.assign-table th:first-child, .assign-table td:first-child { text-align: left; }
.assign-table td:first-child small { display: block; color: var(--muted); max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assign-table input[type=radio] { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }
.assign-kind { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 14px 14px; margin: 14px 0 0; transition: opacity .15s; }
.assign-kind legend { font-weight: 700; color: var(--navy-900); padding: 0 6px; }
.assign-kind.is-off { opacity: .55; }
.form-grid.two { grid-template-columns: 120px minmax(0, 1fr); }

/* Trang nhập điểm */
.score-table th, .score-table td { padding: 6px 8px; }
.score-table .q-col { text-align: center; }
.score-in { width: 62px !important; padding: 5px 6px !important; text-align: center; font-variant-numeric: tabular-nums; }
.score-in.total-in { width: 70px !important; font-weight: 700; }
.score-in[readonly] { background: var(--surface-2); color: var(--navy-900); }
.score-in.bad, .score-in.bad:focus { border-color: var(--bad); background: var(--bad-soft); }
.at-in { width: 205px !important; padding: 5px 8px !important; font-size: .9rem !important; }
.ov-in { width: auto !important; padding: 5px 8px !important; font-size: .9rem; }
.score-table .note-input { width: 140px !important; }
.score-table tr.is-dirty td:first-child { box-shadow: inset 4px 0 0 var(--gold); }
.toolbar-foot { border-bottom: 0; border-top: 1px solid var(--border); }
.grid-2 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); margin-top: 18px; }
.grid-2 .card { margin: 0; }
.rule-list { margin: 0; padding-left: 22px; }
.rule-list li + li { margin-top: 6px; }

/* Ô điểm */
.g { display: inline-block; min-width: 34px; padding: 1px 6px; border-radius: 6px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.g-missing { background: var(--bad-soft); color: var(--bad); }
.g-late { background: var(--warn-soft); color: var(--warn); }
.g-exempt { background: var(--excused-soft); color: var(--excused); }
.g-pending { background: #edf0f5; color: var(--muted); }
.g-open { min-width: 0; }
.g-override { box-shadow: inset 0 -2px 0 var(--gold); }

/* Bảng điểm lớp */
.legend { line-height: 2; }
.gradebook th, .gradebook td { text-align: center; padding: 7px 6px; font-size: .92rem; border-right: 1px solid #edf0f5; }
.gradebook th:nth-child(-n+3), .gradebook td:nth-child(-n+3) { text-align: left; }
.gradebook thead tr:nth-child(2) th { text-align: center; }
.gradebook th.grp { border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.gradebook th.sub { padding-top: 4px; }
.gradebook th a { color: var(--navy-800); }
.gradebook .col-name { position: sticky; left: 0; background: var(--surface); z-index: 2; box-shadow: 1px 0 0 var(--border); white-space: nowrap; }
.gradebook th.col-name { background: var(--surface-2); z-index: 3; }
.gradebook .col-avg { background: var(--primary-soft); }
.gradebook th.col-avg { color: var(--navy-900); }
.gradebook tbody tr:hover td.col-name { background: #f8faff; }
.gradebook .low { color: var(--bad); font-weight: 700; }
@media (max-width: 960px) { .split-wide { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .form-grid.two { grid-template-columns: minmax(0, 1fr); } }

/* Các bước trên trang bài tập + màu phân biệt bài tại lớp (xanh) / về nhà (xanh lá) */
.steps { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.steps li { background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; }
.steps li > b { display: block; color: var(--navy-900); }
.steps span { font-size: .88rem; color: var(--muted); }
.steps span b { color: var(--navy-800); }
.steps li.now { border-top-color: var(--gold); box-shadow: var(--shadow); }
.steps li.done { border-top-color: var(--ok); }
.steps li.done > b::after { content: ' · xong'; color: var(--ok); font-weight: 600; }
.assign-kind.kind-class, .kind-card.kind-class { border-left: 4px solid var(--link); }
.assign-kind.kind-home, .kind-card.kind-home { border-left: 4px solid var(--ok); }
.assign-table th.kind-class { color: var(--link); }
.assign-table th.kind-home { color: var(--ok); }
.kind-card.is-off { opacity: .7; }
@media (max-width: 640px) { .steps { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Đang xử lý (public/ui.js) ---------- */
.busy-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .2s; }
.busy-bar.on { opacity: 1; }
.busy-bar::before { content: ''; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; background: var(--gold); box-shadow: 0 0 8px var(--gold); animation: busy-slide 1.1s ease-in-out infinite; }
@keyframes busy-slide { from { left: -40%; } to { left: 100%; } }
button.is-busy { cursor: progress; }
button.is-busy::before { content: ''; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .busy-bar::before { animation-duration: 3s; } }

/* Tạo email theo công thức (tab Sinh viên) */
.formula-box { background: var(--primary-soft); border: 1px solid var(--primary-line); border-radius: var(--radius); padding: 14px 16px; }
.formula-box h3 { margin: 0 0 4px; }
.formula-box p { margin: 0 0 6px; }
.formula-box form { margin: 0; }
.formula-box label.inline { margin-bottom: 10px; }

/* ---------- Thống kê gửi sinh viên + phản ánh ---------- */
.share-card { border-color: var(--primary-line); }
.share-form { align-items: flex-end; margin-bottom: 14px; }
.share-form select { width: auto; }
.appeal-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.appeal-box form { margin: 0; }
.tabs a .count.count-warn { background: var(--warn); color: #fff; }
.appeal-table td { vertical-align: top; }
.appeal-pending td { background: #fffbef; }
.appeal-msg { min-width: 220px; max-width: 360px; white-space: pre-wrap; }
.appeal-actions { display: flex; flex-direction: column; gap: 6px; min-width: 240px; margin: 0; }
.appeal-actions input { padding: 5px 8px; }

/* ---------- Bản in thống kê điểm danh ---------- */
.print-page { background: #fff; }
.print-wrap { max-width: 1400px; margin: 0 auto; padding: 18px 20px 40px; }
.print-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.print-head { display: flex; gap: 20px; justify-content: space-between; align-items: flex-start; border-bottom: 3px solid var(--navy-900); padding-bottom: 10px; margin-bottom: 10px; }
.print-head h1 { font-size: 1.45rem; margin: 2px 0 4px; }
.print-head p { margin: 0 0 4px; }
.print-legend { font-size: .85rem; color: var(--muted); }
.print-legend .badge { padding: 0 6px; }
.print-qr { display: flex; gap: 10px; align-items: center; max-width: 380px; font-size: .88rem; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; }
.print-link { font-weight: 700; color: var(--link); word-break: break-all; }
.print-table { font-size: .8rem; border: 1px solid var(--border); }
.print-table th, .print-table td { padding: 3px 5px; text-align: center; border: 1px solid var(--border); }
.print-table th { position: static; font-size: .72rem; letter-spacing: 0; }
.print-table .name { text-align: left; white-space: nowrap; }
.print-table .badge { padding: 0 6px; font-size: .75rem; }
.print-table tr.warn td { background: var(--warn-soft); }
@media print {
  .no-print, .busy-bar { display: none !important; }
  .print-wrap { padding: 0; max-width: none; }
  @page { size: A4 landscape; margin: 8mm; }
  .print-table tr { break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Trang SV xem điểm danh + phản ánh (/pa/<mã>) ---------- */
.pa-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 12px; }
.pa-sum div { border-radius: 10px; padding: 8px 4px; text-align: center; font-size: .8rem; font-weight: 600; }
.pa-sum b { display: block; font-size: 1.4rem; line-height: 1.1; }
.pa-list { list-style: none; margin: 0; padding: 0; }
.pa-list li { border-top: 1px solid var(--border); padding: 10px 0; }
.pa-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pa-date small { color: var(--muted); }
.pa-appeal { margin-top: 6px; font-size: .88rem; border-radius: 8px; padding: 6px 10px; background: var(--surface-2); }
.pa-appeal.pa-pending { background: var(--gold-soft); color: var(--gold-text); }
.pa-appeal.pa-accepted { background: var(--ok-soft); color: #0f4d30; }
.pa-appeal.pa-rejected { background: var(--bad-soft); color: #7a1a14; }
.pa-form { margin-top: 6px; }
.pa-form summary { cursor: pointer; color: var(--link); font-weight: 600; font-size: .92rem; }
.pa-form textarea { min-height: 80px; font-family: inherit; font-size: .95rem; }
.pa-form button { margin-top: 10px; }
.pa-ok { margin: 4px 0 10px; padding: 10px 14px; border-radius: 10px; background: var(--ok-soft); color: #0f4d30; font-weight: 600; }
.pa-closed { margin: 4px 0 10px; padding: 10px 14px; border-radius: 10px; background: var(--late-soft); color: #6b3a02; }
.print-table th.pending { background: #7a869c; color: #fff; }
.print-table .email { font-size: .72rem; color: var(--muted); }
.print-table td.mark-cell { font-weight: 700; }
.m-present { color: var(--ok); }
.m-late { color: var(--late); background: var(--late-soft); }
.m-excused { color: var(--excused); background: var(--excused-soft); }
.m-absent { color: #fff; background: #d92d20; }
.m-none { background: #eef0f4; }
.print-table td.total-warn { color: var(--bad); background: #ffe3e0; }
.print-legend .mark { display: inline-block; min-width: 20px; padding: 0 5px; border-radius: 4px; text-align: center; font-weight: 700; border: 1px solid var(--border); }

/* ==========================================================================
   Lịch dạy theo tuần (Thứ 2 – Chủ nhật) · /teacher/schedule & trang chủ
   ========================================================================== */
.week-nav { display: inline-flex; gap: 6px; align-items: center; }
.week-picker { margin: 0; }
.week-picker input[type=date] { width: auto; padding: 8px 10px; font-weight: 600; }

.week-strip { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 14px; box-shadow: var(--shadow); }
.week-strip-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); white-space: nowrap; }
.week-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; padding: 2px 0; }
.week-chips .chip { white-space: nowrap; text-decoration: none; }
.week-chips .chip.is-now { border-color: var(--gold); color: var(--gold-text); background: var(--gold-soft); }

.schedule-filter { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }

/* Nhãn ca dạy: Sáng / Chiều / Tối */
.period-tag { display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.period-tag.p-morning { background: #e0f2fe; color: #0369a1; }
.period-tag.p-afternoon { background: #fef3c7; color: #b45309; }
.period-tag.p-evening { background: #ede9fe; color: #5b21b6; }

/* Lưới 7 cột Thứ 2 – Chủ nhật */
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.day-col { background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--navy-700); border-radius: var(--radius); display: flex; flex-direction: column; box-shadow: var(--shadow); min-width: 0; }
.day-col.is-empty { border-top-color: #cbd5e1; background: var(--surface-2); }
.day-col.is-past:not(.is-today) { border-top-color: #94a3b8; }
.day-col.is-today { border-color: #e6b84a; border-top: 4px solid var(--gold); box-shadow: 0 4px 16px rgba(227, 160, 8, .16); background: #fffdf7; }

.day-head { padding: 10px 12px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; background: rgba(255, 255, 255, .6); }
.day-col.is-today .day-head { background: var(--gold-soft); border-bottom-color: #f3d98b; }
.day-name { font-weight: 700; font-size: 1.02rem; color: var(--navy-900); }
.day-date { font-size: .84rem; color: var(--muted); }
.day-today-badge { background: var(--gold); color: var(--navy-950); margin-left: 4px; font-size: .72rem; padding: 1px 7px; }
.day-count { background: var(--primary-soft); color: var(--navy-800); }

.day-body { padding: 10px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.day-empty { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 90px; color: var(--muted); font-size: .88rem; font-style: italic; text-align: center; }

.sched-card { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--navy-700); border-radius: var(--radius-sm); padding: 10px 11px; display: flex; flex-direction: column; gap: 5px; box-shadow: 0 1px 3px rgba(10, 31, 71, .05); transition: transform .12s, box-shadow .12s; }
.sched-card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(10, 31, 71, .1); }
.sched-card.period-morning { border-left-color: #0284c7; }
.sched-card.period-afternoon { border-left-color: #d97706; }
.sched-card.period-evening { border-left-color: #7c3aed; }
.sched-card.is-open { border-color: var(--ok); border-left-width: 4px; background: #f4fbf7; }

.sched-top { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.sched-time { font-size: 1.15rem; font-weight: 800; color: var(--navy-900); line-height: 1; }
.sched-course-row { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 2px; }
.sched-code { font-size: .82rem; font-weight: 700; color: var(--link); letter-spacing: .04em; text-transform: uppercase; }
.sched-school { font-size: .74rem; font-weight: 700; padding: 0 6px; border-radius: 4px; background: var(--navy-900); color: #fff; }
.sched-prog { font-size: .74rem; font-weight: 600; padding: 0 6px; border-radius: 4px; background: var(--primary-soft); color: var(--navy-800); }
.sched-name { font-weight: 700; color: var(--navy-900); line-height: 1.25; font-size: .98rem; overflow-wrap: anywhere; }
.sched-name a { color: inherit; }
.sched-title { font-size: .85rem; color: var(--muted); line-height: 1.3; overflow-wrap: anywhere; }
.sched-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; padding-top: 6px; border-top: 1px dashed var(--border); font-size: .82rem; color: var(--muted); }
.sched-att { font-weight: 600; }
.sched-actions { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.sched-actions form { margin: 0; }
.sched-actions .btn, .sched-actions button { padding: 3px 8px; font-size: .8rem; }

/* Bảng thời khoá biểu theo Ca (Sáng / Chiều / Tối) × Thứ 2 – CN */
.timetable { table-layout: fixed; min-width: 1020px; }
.timetable th, .timetable td { border-right: 1px solid var(--border); vertical-align: top; padding: 10px; }
.timetable th:last-child, .timetable td:last-child { border-right: 0; }
.timetable thead th { text-align: center; background: var(--surface-2); }
.timetable thead th.is-today-col { background: var(--gold-soft); color: var(--navy-950); }
.tt-period-col { width: 115px; text-align: left !important; }
.tt-day-name { font-size: .92rem; font-weight: 700; color: var(--navy-900); text-transform: none; letter-spacing: 0; }
.tt-day-date { font-size: .8rem; color: var(--muted); font-weight: 600; margin-top: 2px; }
.tt-period-cell { background: var(--surface-2); vertical-align: middle !important; white-space: normal; }
.tt-period-cell small { display: block; font-weight: 500; color: var(--muted); text-transform: none; letter-spacing: 0; margin-top: 4px; font-size: .78rem; }
.tt-cell { background: var(--surface); min-height: 90px; }
.tt-cell.is-empty { background: #fafbfd; }
.tt-cell.is-today-col { background: #fffdf7; }
.tt-item { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--navy-700); border-radius: var(--radius-sm); padding: 8px 10px; font-size: .9rem; }
.tt-item + .tt-item { margin-top: 8px; }
.tt-item.period-morning { border-left-color: #0284c7; }
.tt-item.period-afternoon { border-left-color: #d97706; }
.tt-item.period-evening { border-left-color: #7c3aed; }
.tt-school { font-size: .76rem; font-weight: 700; color: var(--muted); margin-top: 2px; }
.tt-course { font-weight: 700; color: var(--navy-900); line-height: 1.25; margin-top: 2px; overflow-wrap: anywhere; }
.tt-course a { color: inherit; }
.tt-title { font-size: .82rem; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.tt-foot { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: .8rem; }

/* Khung lịch tuần gọn trên Trang chủ (/teacher) */
.dash-week-card { padding: 16px 18px; margin-bottom: 24px; }
.dash-week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.dash-day { border: 1px solid var(--border); border-top: 3px solid var(--navy-700); border-radius: var(--radius-sm); padding: 8px; background: var(--surface); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dash-day.is-empty { border-top-color: #cbd5e1; background: var(--surface-2); }
.dash-day.is-today { border-color: #e6b84a; border-top: 3px solid var(--gold); background: #fffdf6; }
.dash-day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; font-size: .88rem; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.dash-day-head b { color: var(--navy-900); }
.dash-day-list { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.dash-empty { color: var(--muted); font-size: .82rem; font-style: italic; margin: auto 0; text-align: center; padding: 8px 0; }
.dash-sess { display: block; padding: 6px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--navy-700); color: inherit; font-size: .85rem; line-height: 1.25; transition: background .12s, transform .1s; }
.dash-sess:hover { text-decoration: none; background: var(--primary-soft); transform: translateY(-1px); }
.dash-sess.period-morning { border-left-color: #0284c7; }
.dash-sess.period-afternoon { border-left-color: #d97706; }
.dash-sess.period-evening { border-left-color: #7c3aed; }
.dash-sess.is-open { border-color: var(--ok); background: var(--ok-soft); }
.dash-sess-code { font-weight: 700; color: var(--link); font-size: .8rem; margin-top: 2px; }
.dash-sess-name { font-weight: 600; color: var(--navy-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-mode { font-size: .7rem; font-weight: 700; padding: 0 5px; border-radius: 4px; background: #e3f0ff; color: #0b57d0; margin-left: auto; }

@media (max-width: 1200px) {
  .week-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dash-week-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .schedule-filter { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
  .week-grid { grid-template-columns: 1fr; }
  .dash-week-grid { grid-template-columns: 1fr; }
}
@media print {
  .week-grid { grid-template-columns: repeat(7, minmax(0, 1fr)) !important; gap: 6px; }
  .day-col, .sched-card, .tt-item { box-shadow: none !important; break-inside: avoid; }
}


/* ---------- Toast Message dùng chung ---------- */
.toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(400px, calc(100vw - 28px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--navy-900);
  color: #fff;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid #60a5fa;
  opacity: 0;
  transform: translateY(-10px) scale(.98);
  transition: opacity .2s ease, transform .2s ease;
  font-size: .95rem;
  line-height: 1.4;
}
.toast.show { opacity: 1; transform: translateY(0) scale(1); }
.toast.leaving { opacity: 0; transform: translateY(-8px) scale(.97); }
.toast-success { background: #0f3d28; border-left-color: #34d399; }
.toast-error { background: #5c1614; border-left-color: #f87171; }
.toast-warning { background: #5a3406; border-left-color: #fbbf24; }
.toast-info { background: var(--navy-900); border-left-color: #60a5fa; }
.toast-icon {
  flex: 0 0 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .85rem;
}
.toast-body { flex: 1; min-width: 0; word-break: break-word; }
.toast-close {
  background: none;
  border: 0;
  color: rgba(255, 255, 255, .75);
  font-size: 1.25rem;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
}
.toast-close:hover { color: #fff; }
@media (max-width: 540px) {
  .toast-stack { top: auto; bottom: 16px; left: 14px; right: 14px; max-width: none; }
}

/* ---------- Nav badge cho Yêu cầu SV ---------- */
.topbar nav a .nav-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  min-width: 20px;
  text-align: center;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.45;
  vertical-align: middle;
}

/* ---------- Cổng sinh viên: Tìm kiếm lớp nhanh ---------- */
.course-picker { position: relative; }
.course-picker-list {
  margin-top: 6px;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  display: flex;
  flex-direction: column;
}
.course-opt {
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 9px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font: inherit;
  color: var(--text);
}
.course-opt:last-child { border-bottom: 0; }
.course-opt:hover { background: var(--primary-soft); }
.course-opt.selected { background: var(--primary-soft); border-left: 3px solid var(--primary); font-weight: 700; }
.course-opt small { display: block; color: var(--muted); font-weight: 400; font-size: .85rem; }
.course-opt .enrolled-pill {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: .75rem;
  font-weight: 700;
}

/* ---------- Cổng sinh viên: Thẻ chọn loại đơn ---------- */
.kind-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 12px; }
.kind-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.kind-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.kind-card input { width: auto; margin-top: 3px; }
.kind-card b { display: block; color: var(--navy-900); }
.kind-card small { display: block; color: var(--muted); font-size: .84rem; line-height: 1.3; }
@media (max-width: 540px) { .kind-grid { grid-template-columns: 1fr; } }

/* ---------- Tra cứu điểm: Cột điểm bấm để phản hồi ---------- */
.grade-col-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.grade-col-card {
  text-align: left;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font: inherit;
  color: inherit;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.grade-col-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.grade-col-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.grade-col-group { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.grade-col-name { font-weight: 700; color: var(--navy-900); font-size: 1rem; line-height: 1.25; }
.grade-col-val { font-size: 1.55rem; font-weight: 800; color: var(--navy-900); line-height: 1.1; }
.grade-col-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: auto; padding-top: 6px; border-top: 1px dashed var(--border); font-size: .82rem; color: var(--link); }
.grade-col-note { font-size: .83rem; color: var(--muted); }

/* ---------- Banner Admin xem thử giao diện điểm SV ---------- */
.preview-banner {
  background: var(--gold-soft);
  border: 1.5px solid var(--gold);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.preview-banner b { color: var(--gold-text); }
.preview-banner select { max-width: 280px; }

/* ---------- Trang chủ: lối vào dịch vụ SV ---------- */
.portal-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 18px; }
.portal-link {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--primary-line);
  background: var(--surface-2);
  color: var(--navy-900);
  transition: background .15s, border-color .15s;
}
.portal-link:hover { text-decoration: none; background: var(--primary-soft); border-color: var(--primary); }
.portal-link b { display: block; font-size: 1rem; }
.portal-link small { display: block; color: var(--muted); font-size: .85rem; margin-top: 2px; }
@media (max-width: 540px) { .portal-links { grid-template-columns: 1fr; } }

/* ---------- Trang Yêu cầu tập trung (GV) ---------- */
.req-item { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); margin-bottom: 12px; box-shadow: var(--shadow); }
.req-item.is-pending { border-left: 4px solid var(--warn); }
.req-item.is-approved, .req-item.is-resolved { border-left: 4px solid var(--ok); }
.req-item.is-rejected, .req-item.is-dismissed, .req-item.is-cancelled { border-left: 4px solid var(--muted); opacity: .88; }
.req-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.req-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px 14px; font-size: .92rem; margin-bottom: 10px; }
.req-reason { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; font-size: .94rem; margin-bottom: 10px; }
.req-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.req-actions input[type="text"] { flex: 1 1 220px; min-width: 180px; }
.publish-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--surface);
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.publish-bar.is-live { border-color: var(--ok); background: var(--ok-soft); }


/* ---------- Form bước gọn & khối minh chứng không bắt buộc ---------- */
.form-step { margin-bottom: 15px; }
.req-star { color: var(--bad); font-weight: 700; }
.optional-box {
  border: 1px dashed var(--primary-line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 10px 14px;
  margin-top: 4px;
}
.optional-box summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 700;
  color: var(--navy-900);
  font-size: .95rem;
}
.optional-box summary::-webkit-details-marker { display: none; }
.optional-box summary::after {
  content: '+';
  font-size: 1.15rem;
  line-height: 1;
  color: var(--muted);
  margin-left: auto;
}
.optional-box[open] summary::after { content: '−'; }
.opt-pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: .76rem;
  font-weight: 600;
}
.optional-box-body {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* ---------- Trang chủ dạng Metro UI ---------- */
.metro-shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 36px 20px 56px;
}
.metro-header {
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.metro-eyebrow {
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--link);
}
.metro-title {
  margin: 4px 0 6px;
  font-size: 2.2rem;
  color: var(--navy-900);
  letter-spacing: -.015em;
}
.metro-sub {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}
.metro-section { margin-bottom: 30px; }
.metro-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.metro-section-head h2 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--navy-900);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.metro-section-head span {
  font-size: .9rem;
  color: var(--muted);
}
.metro-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.metro-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 168px;
  padding: 18px;
  border-radius: 6px;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(10, 31, 71, .12);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
  overflow: hidden;
}
.metro-tile:hover {
  text-decoration: none;
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(10, 31, 71, .2);
  filter: brightness(1.05);
}
.metro-tile.is-static {
  cursor: default;
}
.metro-tile.is-static:hover {
  transform: none;
  filter: none;
  box-shadow: 0 4px 14px rgba(10, 31, 71, .12);
}
.metro-tile.tile-wide {
  grid-column: span 2;
}
.metro-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, .16);
}
.metro-icon svg { width: 24px; height: 24px; }
.metro-label { margin-top: 16px; }
.metro-label b {
  display: block;
  font-size: 1.2rem;
  line-height: 1.2;
  letter-spacing: -.01em;
}
.metro-label small {
  display: block;
  margin-top: 5px;
  font-size: .88rem;
  line-height: 1.32;
  color: rgba(255, 255, 255, .88);
}

/* Bảng màu Metro hài hoà */
.tile-blue { background: linear-gradient(135deg, #1d5bbf 0%, #123a7c 100%); }
.tile-teal { background: linear-gradient(135deg, #0d9488 0%, #0f6b63 100%); }
.tile-amber { background: linear-gradient(135deg, #d97706 0%, #b45309 100%); }
.tile-indigo { background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%); }
.tile-navy { background: linear-gradient(135deg, #0f2c5f 0%, #061432 100%); }
.tile-slate { background: linear-gradient(135deg, #334155 0%, #1e293b 100%); }
.tile-crimson { background: linear-gradient(135deg, #be123c 0%, #881337 100%); }

@media (max-width: 860px) {
  .metro-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 500px) {
  .metro-shell { padding: 22px 14px 40px; }
  .metro-title { font-size: 1.75rem; }
  .metro-grid { grid-template-columns: 1fr; }
  .metro-tile { min-height: 132px; }
  .metro-tile.tile-wide { grid-column: span 1; }
}
