/* Rhythm & Melody — design system. No build step: edit and refresh.
   Use these classes in Blade; don't add inline styles. Tokens live in :root. */

:root {
  --bg: #f4f5fb;
  --surface: #ffffff;
  --surface-2: #faf9fd;
  --border: #e9e6f2;
  --text: #1c1530;
  --muted: #6e6787;
  --faint: #a19bb5;
  --primary: #5b4ee6;
  --primary-600: #4a3dd4;
  --primary-50: #eeecfd;
  --accent: #f2a516;
  --side-bg: #170f2e;
  --side-text: #e4e7fb;
  --side-muted: #98a0cf;
  --side-label: #7f88bf;
  --side-hover: rgba(255, 255, 255, .06);
  --side-active: rgba(108, 92, 231, .3);
  --green: #12a150; --green-50: #e6f7ee;
  --amber: #c27803; --amber-50: #fdf4e3;
  --red: #dc3545; --red-50: #fdecee;
  --blue: #2563eb; --blue-50: #e8effd;
  --violet: #7c3aed; --violet-50: #f1eafe;
  --gray: #6b7280; --gray-50: #f1f1f4;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(28, 21, 48, .04), 0 4px 16px rgba(28, 21, 48, .05);
  --shadow-lg: 0 10px 40px rgba(28, 21, 48, .12);
  --side-w: 256px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  --bg: #0f0b1a;
  --surface: #181227;
  --surface-2: #1d1630;
  --border: #2a2240;
  --text: #ece8f7;
  --muted: #a29bba;
  --faint: #6f6889;
  --primary: #8d62ff;
  --primary-600: #a283ff;
  --primary-50: rgba(141, 98, 255, .14);
  --side-bg: #0b0814;
  --green-50: rgba(18, 161, 80, .15);
  --amber-50: rgba(242, 165, 22, .14);
  --red-50: rgba(220, 53, 69, .15);
  --blue-50: rgba(37, 99, 235, .16);
  --violet-50: rgba(124, 58, 237, .18);
  --gray-50: rgba(255, 255, 255, .06);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-600); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
svg.lucide { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }
[x-cloak] { display: none !important; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--side-w); background: linear-gradient(180deg, #1f2a63 0%, #18214f 100%); color: var(--side-text); position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 40; transition: transform .25s ease; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px; margin: 0 0 14px; background: #161e47; color: #fff; border-radius: 0 0 22px 22px; box-shadow: 0 8px 24px rgba(10, 14, 40, .25); border-bottom: 1px solid rgba(255, 255, 255, .08); }
.brand-logo { width: auto; height: 40px; max-height: 44px; max-width: 80px; object-fit: contain; flex-shrink: 0; }
.brand b { display: block; font-size: 17px; font-weight: 800; letter-spacing: -.01em; color: #f7f2dc; }
.brand small { display: block; font-size: 9.5px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: #c3c9f2; }
img.brand-mark { width: auto; height: 32px; max-height: 36px; object-fit: contain; vertical-align: middle; flex-shrink: 0; }
.nav { flex: 1; overflow-y: auto; padding: 4px 14px 20px; scrollbar-width: thin; scrollbar-color: #33407e transparent; }
.nav-section { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--side-label); padding: 14px 12px 6px; }
.nav a, .nav span.soon { display: flex; align-items: center; gap: 13px; padding: 10px 14px; border-radius: 11px; color: var(--side-text); font-weight: 500; font-size: 14px; margin-bottom: 2px; }
.nav a svg, .nav span.soon svg { width: 19px; height: 19px; }
.nav a svg { color: #c3c9f2; }
.nav a:hover { background: var(--side-hover); color: #fff; }
.nav a:hover svg { color: #fff; }
.nav a.active { background: linear-gradient(90deg, #6c5ce7, #5848e0); color: #fff; font-weight: 600; box-shadow: 0 8px 20px rgba(88, 72, 224, .45); }
.nav a.active svg { color: #fff; }
.nav span.soon { color: var(--side-muted); cursor: default; }
.nav span.soon svg { color: #6f78ad; }
.nav span.soon em { margin-left: auto; font-style: normal; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #9aa2d6; background: rgba(255, 255, 255, .07); border-radius: 6px; padding: 1px 6px; }
.side-foot { padding: 14px; border-top: 1px solid rgba(255, 255, 255, .08); }
.side-user { display: flex; align-items: center; gap: 10px; color: #fff; }
.side-user small { display: block; color: var(--side-muted); font-size: 11.5px; }

.main { flex: 1; margin-left: var(--side-w); min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: 70px; display: flex; align-items: center; gap: 16px; padding: 0 28px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.topbar .search { flex: 1; max-width: 560px; position: relative; }
.topbar .search input { padding-left: 40px; height: 42px; background: var(--surface-2); border-color: transparent; border-radius: 12px; }
.topbar .search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 17px; }
.topbar .spacer { flex: 1; }
.top-date { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text); line-height: 1.35; }
.top-date svg { width: 26px; height: 26px; color: var(--muted); stroke-width: 1.6; }
.icon-btn { width: 40px; height: 40px; border-radius: 11px; display: inline-grid; place-items: center; background: transparent; border: 1px solid transparent; color: var(--muted); cursor: pointer; position: relative; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn .dot { position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 10px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--surface); }
.user-chip { position: relative; }
.user-chip summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 6px; border-radius: 12px; }
.user-chip summary::-webkit-details-marker { display: none; }
.user-chip summary:hover { background: var(--surface-2); }
.user-chip b { display: block; font-size: 13.5px; }
.user-chip small { display: block; color: var(--muted); font-size: 12px; }
.user-chip .menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 180px; }
.user-chip .menu button, .user-chip .menu a { display: flex; gap: 9px; align-items: center; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 8px; font: 500 13.5px var(--font); color: var(--text); cursor: pointer; }
.user-chip .menu button:hover, .user-chip .menu a:hover { background: var(--surface-2); }
.menu-toggle { display: none; }
.content { padding: 26px 28px 48px; width: 100%; max-width: 1560px; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 23px; font-weight: 700; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.crumbs { font-size: 12.5px; color: var(--faint); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.crumbs a { color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Grid ---------- */
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mt { margin-top: 18px; }
.mb { margin-bottom: 18px; }

/* ---------- Card ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card-head h3 svg { color: var(--primary); width: 17px; }
.card-head small { color: var(--muted); font-size: 12.5px; }
.card-body { padding: 18px 20px; }
.card-body.flush { padding: 0; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

/* ---------- Stat ---------- */
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-label { color: var(--muted); font-size: 13px; font-weight: 550; }
.stat-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; }
.stat-icon svg { width: 20px; height: 20px; }
.stat-value { font-size: 27px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
.stat-sub { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat-sub b { font-weight: 650; }
.tone-violet { background: var(--violet-50); color: var(--violet); }
.tone-green { background: var(--green-50); color: var(--green); }
.tone-amber { background: var(--amber-50); color: var(--amber); }
.tone-red { background: var(--red-50); color: var(--red); }
.tone-blue { background: var(--blue-50); color: var(--blue); }
.tone-gray { background: var(--gray-50); color: var(--gray); }
.text-green { color: var(--green); } .text-red { color: var(--red); } .text-amber { color: var(--amber); }
.text-muted { color: var(--muted); } .text-faint { color: var(--faint); }

/* Hero banner */
.hero { background: linear-gradient(120deg, #2a1660 0%, #5b2fd1 55%, #8d4bff 100%); color: #fff; border-radius: var(--radius); padding: 22px 26px; display: flex; align-items: center; justify-content: space-between; gap: 18px; position: relative; overflow: hidden; margin-bottom: 18px; }
.hero::after { content: ""; position: absolute; right: -40px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(242, 165, 22, .45), transparent 65%); }
.hero h2 { font-size: 20px; font-weight: 700; }
.hero p { margin: 4px 0 0; opacity: .85; }
.hero .hero-stats { display: flex; gap: 28px; position: relative; z-index: 1; }
.hero .hero-stats div b { display: block; font-size: 22px; font-weight: 750; }
.hero .hero-stats div span { font-size: 12px; opacity: .8; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 600 13.5px var(--font); cursor: pointer; white-space: nowrap; transition: .15s; }
.btn:hover { border-color: var(--faint); color: var(--text); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(109, 58, 232, .28); }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); color: #fff; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { height: 31px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field label .req { color: var(--red); }
.input, select.input, textarea.input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: 500 13.5px var(--font); outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.input.is-invalid { border-color: var(--red); }
.error { color: var(--red); font-size: 12px; }
.hint { color: var(--faint); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section { font-size: 13px; font-weight: 700; color: var(--text); grid-column: 1 / -1; margin-top: 8px; padding-bottom: 6px; border-bottom: 1px dashed var(--border); display: flex; align-items: center; gap: 8px; }
.form-section svg { color: var(--primary); width: 16px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check input { accent-color: var(--primary); width: 16px; height: 16px; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.filters .input { height: 36px; width: auto; min-width: 150px; }
.filters .grow { flex: 1; min-width: 200px; }

/* Segmented tabs / chips */
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.seg a { padding: 5px 12px; border-radius: 7px; color: var(--muted); font-weight: 600; font-size: 12.5px; }
.seg a.on { background: var(--primary-50); color: var(--primary); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 20px; overflow-x: auto; }
.tabs a { padding: 13px 12px; color: var(--muted); font-weight: 600; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; gap: 7px; align-items: center; }
.tabs a.on { color: var(--primary); border-color: var(--primary); }
.tabs a .count { background: var(--gray-50); color: var(--muted); font-size: 11px; padding: 0 7px; border-radius: 20px; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 700; padding: 11px 20px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table a.rowlink { color: var(--text); font-weight: 600; }
.table a.rowlink:hover { color: var(--primary); }

/* ---------- Badge / avatar ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 650; text-transform: capitalize; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; background: var(--primary-50); color: var(--primary); text-transform: uppercase; }
.avatar.lg { width: 72px; height: 72px; font-size: 24px; }
.avatar.sm { width: 30px; height: 30px; font-size: 11.5px; }
.person { display: flex; align-items: center; gap: 11px; min-width: 0; }
.person b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person small { color: var(--muted); font-size: 12px; }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .time { font-weight: 700; font-size: 13px; min-width: 62px; }
.list .time small { display: block; color: var(--faint); font-weight: 500; font-size: 11.5px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 9px 14px; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; font-weight: 550; }

.bar { height: 8px; background: var(--gray-50); border-radius: 10px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 10px; background: var(--primary); }
.bar.green > span { background: var(--green); } .bar.amber > span { background: var(--accent); } .bar.red > span { background: var(--red); }

.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty svg { width: 34px; height: 34px; color: var(--faint); margin-bottom: 8px; }
.empty b { display: block; color: var(--text); margin-bottom: 2px; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 11px; margin-bottom: 18px; font-weight: 550; }
.alert.success { background: var(--green-50); color: var(--green); }
.alert.error { background: var(--red-50); color: var(--red); }

.chart-box { position: relative; height: 260px; }
.chart-box.sm { height: 200px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* Pagination */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.pager .pages { display: flex; gap: 4px; }
.pager .pages a, .pager .pages span { min-width: 32px; height: 32px; padding: 0 8px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--border); color: var(--text); font-weight: 600; background: var(--surface); }
.pager .pages span.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager .pages span.off { opacity: .4; }

/* Profile header */
.profile { display: flex; gap: 18px; align-items: center; padding: 22px; flex-wrap: wrap; }
.profile h2 { font-size: 20px; }
.profile .meta { display: flex; gap: 16px; color: var(--muted); font-size: 13px; margin-top: 6px; flex-wrap: wrap; }
.profile .meta span { display: inline-flex; align-items: center; gap: 5px; }
.profile .meta svg { width: 14px; height: 14px; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { background: radial-gradient(circle at 80% 10%, rgba(242, 165, 22, .35), transparent 40%), linear-gradient(150deg, #170f2e 0%, #3b1d8f 60%, #6d3ae8 100%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art h1 { font-size: 38px; font-weight: 750; line-height: 1.15; max-width: 460px; }
.auth-art p { opacity: .8; max-width: 420px; font-size: 15px; }
.auth-art .notes { position: absolute; right: 40px; bottom: 120px; opacity: .14; }
.auth-art .notes svg { width: 220px; height: 220px; }
.auth-form { display: grid; place-items: center; padding: 32px; background: var(--surface); }
.auth-form .box { width: 100%; max-width: 380px; }
.auth-form h2 { font-size: 24px; margin-bottom: 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) { .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.nav-open .scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 35; }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-grid; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
  .g-2, .g-3, .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .hero { flex-direction: column; align-items: flex-start; }
  .topbar .search { display: none; }
}
@media (max-width: 560px) { .g-4 { grid-template-columns: 1fr; } .kv { grid-template-columns: 1fr; } }

/* ---------- Timetable & attendance (Claude) ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.week.one { grid-template-columns: 1fr; }
.day-col { border-right: 1px solid var(--border); min-height: 220px; display: flex; flex-direction: column; min-width: 0; }
.day-col:last-child { border-right: 0; }
.day-head { padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); display: flex; justify-content: space-between; align-items: baseline; }
.day-head b { font-size: 13px; }
.day-head span { color: var(--faint); font-size: 12px; }
.day-col.today .day-head { background: var(--primary-50); }
.day-col.today .day-head b { color: var(--primary); }
.day-body { padding: 8px; display: flex; flex-direction: column; gap: 7px; }
.slot { border: 1px solid var(--border); border-left: 3px solid var(--c, var(--primary)); border-radius: 9px; padding: 8px 10px; background: var(--surface); font-size: 12.5px; position: relative; }
.slot:hover { box-shadow: var(--shadow); }
.slot .t { font-weight: 700; font-size: 12px; color: var(--muted); }
.slot .n { font-weight: 650; line-height: 1.3; margin: 2px 0; color: var(--text); display: block; }
.slot .m { color: var(--muted); font-size: 11.5px; }
.slot .acts { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.slot .acts .btn { height: 26px; padding: 0 8px; font-size: 11.5px; }
.slot.cancelled, .slot.rescheduled { opacity: .55; }
.slot.cancelled .n, .slot.rescheduled .n { text-decoration: line-through; }
.slot .tag { position: absolute; top: 7px; right: 8px; }
.day-empty { color: var(--faint); font-size: 12px; text-align: center; padding: 18px 0; }

.att-row { display: flex; align-items: center; gap: 14px; padding: 11px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.att-row:last-child { border-bottom: 0; }
.att-row .person { flex: 1; min-width: 200px; }
.att-opts { display: inline-flex; gap: 6px; }
.att-opts input { position: absolute; opacity: 0; pointer-events: none; }
.att-opts label { min-width: 74px; height: 34px; padding: 0 10px; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: 9px; font-weight: 650; font-size: 12.5px; color: var(--muted); cursor: pointer; background: var(--surface); user-select: none; }
.att-opts label:hover { border-color: var(--faint); }
.att-opts input:checked + label.present { background: var(--green-50); border-color: var(--green); color: var(--green); }
.att-opts input:checked + label.absent { background: var(--red-50); border-color: var(--red); color: var(--red); }
.att-opts input:checked + label.leave { background: var(--blue-50); border-color: var(--blue); color: var(--blue); }
.att-opts input:checked + label.late { background: var(--amber-50); border-color: var(--amber); color: var(--amber); }
.att-opts input:focus-visible + label { box-shadow: 0 0 0 3px var(--primary-50); }
.att-row .remarks { width: 200px; height: 34px; }
.sticky-foot { position: sticky; bottom: 0; z-index: 5; }

dialog.modal { border: 0; border-radius: var(--radius); padding: 0; width: min(460px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
dialog.modal::backdrop { background: rgba(15, 10, 30, .45); }
dialog.modal .card-head { border-radius: var(--radius) var(--radius) 0 0; }

@media (max-width: 900px) {
  .week { grid-template-columns: 1fr; }
  .day-col { border-right: 0; border-bottom: 1px solid var(--border); min-height: 0; }
  .att-opts label { min-width: 0; padding: 0 9px; }
  .att-row .remarks { width: 100%; }
}

/* ---------- Dashboard (Claude) ---------- */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 20px; align-items: start; }
.dash-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.dash-head h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.dash-head p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.range-select { position: relative; display: inline-flex; align-items: center; }
.range-select svg { position: absolute; left: 12px; width: 17px; color: var(--muted); pointer-events: none; }
.range-select select { height: 42px; padding: 0 34px 0 38px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); font: 600 13.5px var(--font); color: var(--text); box-shadow: var(--shadow); cursor: pointer; }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.kpi { display: flex; gap: 12px; padding: 16px 14px; align-items: flex-start; color: inherit; }
.kpi:hover { color: inherit; box-shadow: var(--shadow-lg); }
.kpi-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.kpi-icon svg { width: 21px; height: 21px; }
.kpi-label { color: var(--text); font-size: 13px; font-weight: 550; line-height: 1.3; }
.kpi-value { font-size: clamp(17px, 1.45vw, 23px); font-weight: 800; letter-spacing: -.02em; margin: 2px 0 6px; white-space: nowrap; }
.kpi-sub { font-size: 12px; color: var(--muted); line-height: 1.45; }
.kpi-sub .up { color: var(--green); font-weight: 700; }
.kpi-sub .down { color: var(--red); font-weight: 700; }
.card-head a.more { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.card-head a.more svg { width: 15px; }
.donut-wrap { display: grid; grid-template-columns: 170px 1fr; gap: 22px; align-items: center; }
.donut { position: relative; height: 170px; }
.donut .center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.donut .center b { font-size: 24px; font-weight: 800; line-height: 1.1; }
.donut .center span { font-size: 11.5px; color: var(--muted); }
.legend-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.legend-list li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.legend-list li i { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.legend-list li b { margin-left: auto; font-weight: 700; }
.foot-link { text-align: right; margin-top: 14px; font-size: 13px; font-weight: 600; }
.adj-card { background: linear-gradient(160deg, #fff7e6, #fdefd2); border-color: #f6dfb0; }
[data-theme="dark"] .adj-card { background: var(--amber-50); border-color: transparent; }
.adj-card .big { font-size: 40px; font-weight: 800; color: var(--red); line-height: 1; }
.sched { list-style: none; margin: 0; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.sched li { display: grid; grid-template-columns: 74px 1fr 42px; align-items: center; gap: 12px; border: 1px solid var(--border); border-left: 3px solid var(--c, var(--primary)); border-radius: 11px; padding: 10px 12px; }
.sched .st { font-size: 12px; font-weight: 700; color: var(--muted); border-right: 1px solid var(--border); padding-right: 8px; }
.sched b { display: block; font-size: 13.5px; }
.sched small { display: block; color: var(--muted); font-size: 12px; line-height: 1.5; }
.sched .ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--c, var(--primary)) 14%, transparent); color: var(--c, var(--primary)); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 7px; font-size: 11.5px; font-weight: 650; white-space: nowrap; text-transform: capitalize; }
.table.compact th { padding: 9px 14px; }
.table.compact td { padding: 10px 14px; font-size: 13px; }
.avatar.c1 { background: #fde2e4; color: #c0392b; } .avatar.c2 { background: #e0f2fe; color: #0369a1; } .avatar.c3 { background: #dcfce7; color: #15803d; }
.avatar.c4 { background: #fef3c7; color: #b45309; } .avatar.c5 { background: #ede9fe; color: #6d28d9; } .avatar.c0 { background: #fce7f3; color: #be185d; }
.bday li { display: flex; align-items: center; gap: 12px; padding: 10px 18px; }
.bday .grow { flex: 1; min-width: 0; }
.bday small { display: block; color: var(--muted); font-size: 12px; }
@media (max-width: 1400px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1250px) { .dash { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .top-date, .user-chip .hide-sm { display: none; } }
@media (max-width: 640px) { .kpis { grid-template-columns: 1fr 1fr; } .donut-wrap { grid-template-columns: 1fr; } .donut { height: 190px; } }
.dash-two { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.dash-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-bottom { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, .8fr); }
@media (max-width: 1500px) { .dash-bottom { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash-bottom > :last-child { grid-column: 1 / -1; } }
@media (max-width: 1000px) { .dash-two, .dash-three, .dash-bottom { grid-template-columns: 1fr; } }

/* ---------- Fees & receipts (Claude) ---------- */
.alloc-input { width: 120px; height: 34px; text-align: right; }
.sum-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 20px; background: var(--primary-50); border-top: 1px solid var(--border); }
.sum-bar b { font-size: 20px; color: var(--primary); }
.receipt { max-width: 720px; margin: 0 auto; }
.receipt-head { display: flex; justify-content: space-between; gap: 16px; padding: 22px 26px; border-bottom: 2px solid var(--text); }
.receipt-head h2 { font-size: 20px; }
.receipt-head .brand-mark { height: 38px; width: auto; margin-right: 12px; }
.receipt .meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; padding: 18px 26px; font-size: 13.5px; }
.receipt .meta span { color: var(--muted); display: inline-block; min-width: 135px; }
.receipt .total { display: flex; justify-content: space-between; padding: 14px 26px; font-size: 16px; border-top: 1px solid var(--border); }
.receipt .words { padding: 0 26px 16px; color: var(--muted); font-style: italic; }
.receipt .sign { display: flex; justify-content: space-between; padding: 40px 26px 22px; font-size: 12.5px; color: var(--muted); }
.stamp { border: 2px solid currentColor; border-radius: 8px; padding: 2px 10px; font-weight: 800; letter-spacing: .1em; transform: rotate(-6deg); display: inline-block; }
@media print {
  @page { size: A5; margin: 8mm; }
  body { background: #fff; }
  .sidebar, .topbar, .scrim, .no-print, .alert { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; }
  .receipt { max-width: none; }
}

/* ---------- Progress sheet (Claude) ---------- */
.prog-row { display: grid; grid-template-columns: minmax(190px, 1fr) auto minmax(260px, 1.4fr); gap: 16px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.prog-skills { display: flex; gap: 8px; flex-wrap: wrap; }
.prog-skills .field { gap: 3px; }
.prog-skills .field span { font-size: 11px; font-weight: 600; color: var(--muted); }
.prog-skills select.input { height: 34px; width: 74px; padding: 0 8px; }
.prog-skills .field:last-child select.input { width: 120px; }
.prog-notes { display: flex; flex-direction: column; gap: 6px; }
.prog-notes .input { height: 34px; }
@media (max-width: 1100px) { .prog-row { grid-template-columns: 1fr; } }

/* ---------- Portal (Claude): attendance calendar, notifications ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-h { font-size: 11.5px; font-weight: 700; color: var(--faint); text-transform: uppercase; text-align: center; padding-bottom: 2px; }
.cal-d { min-height: 64px; border: 1px solid var(--border); border-radius: 10px; padding: 6px 8px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4px; }
.cal-d span { width: 100%; font-size: 12.5px; font-weight: 600; }
.cal-d.out { opacity: .35; }
.cal-d.today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.cal-d i, .cal-legend span::before { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--faint); }
.cal-d i.present, .cal-legend .present::before { background: var(--green); }
.cal-d i.late, .cal-legend .late::before { background: var(--amber); }
.cal-d i.absent, .cal-legend .absent::before { background: var(--red); }
.cal-d i.leave, .cal-legend .leave::before { background: var(--blue); }
.cal-legend { display: flex; gap: 12px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend span::before { content: ""; }
.list li.unread { background: var(--primary-50); }
@media (max-width: 640px) { .cal { gap: 3px; } .cal-d { min-height: 46px; padding: 4px; } .cal-d i { width: 7px; height: 7px; } .cal-legend { display: none; } }

/* ---------- Public pages (Claude): payment return, public enquiry form ---------- */
.public-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 40px max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px)); background: var(--bg); }
.public-brand { display: flex; gap: 12px; align-items: center; }
.public-brand b { display: block; font-size: 17px; }
.public-brand small { color: var(--muted); }
.public-brand .brand-mark { height: 34px; width: auto; }
.public-card { width: 100%; max-width: 520px; padding: 28px; }
.public-card h1 { font-size: 22px; }
.public-foot { color: var(--muted); font-size: 12.5px; margin: auto 0 0; }

/* ---------- Reports (Claude): monthly P&L strip ---------- */
.pl-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pl-strip span { display: block; color: var(--muted); font-size: 12.5px; }
.pl-strip b { font-size: 18px; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .pl-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
