:root {
  --bg: #f5f6f4;
  --card: #ffffff;
  --ink: #2a2b2e;
  --muted: #6b7471;
  --line: #e2e5e1;
  --brand: #2f4f9e;
  --brand-2: #3f68c0;
  --good: #1e8a4c;
  --good-bg: #e2f4e9;
  --warn: #a86a00;
  --warn-bg: #fff3d6;
  --bad: #b3261e;
  --bad-bg: #fbe3e1;
  --info-bg: #e3edf9;
  --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar { background: #1d2a57; color: #fff; display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 56px; }
.topbar .brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 600; white-space: nowrap; }
.topbar .brand img { height: 30px; display: block; }
.topbar .brand span { border-left: 1px solid rgba(255,255,255,.35); padding-left: 10px; font-size: 14px; letter-spacing: .4px; }
.topbar .brand:hover { text-decoration: none; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a { color: #cdd6f0; padding: 8px 12px; border-radius: 6px; }
.topbar nav a:hover, .topbar nav a.active { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.topbar .who { font-size: 13px; color: #cdd6f0; text-align: right; line-height: 1.2; }
.topbar .who a { color: #fff; }

main { max-width: 1280px; margin: 0 auto; padding: 24px; }
h1 { font-size: 24px; margin: 0; }
h2 { font-size: 17px; margin: 0 0 12px; }
.sub { color: var(--muted); margin-top: 2px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 20px; }
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 20px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.kpi .value { font-size: 26px; font-weight: 700; margin-top: 4px; }
.kpi .hint { font-size: 12px; color: var(--muted); }
.two-col { grid-template-columns: 2fr 1fr; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); font-weight: 600; background: #fafbfa; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:hover td { background: #fafcfb; }
.table-wrap { overflow-x: auto; }

.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.good { color: var(--good); } .warn { color: var(--warn); } .bad { color: var(--bad); } .muted { color: var(--muted); }
.pill.good, .st-PRESENT { background: var(--good-bg); color: var(--good); }
.pill.warn, .st-LATE { background: var(--warn-bg); color: var(--warn); }
.pill.bad, .st-ABSENT { background: var(--bad-bg); color: var(--bad); }
.pill.info, .st-LEAVE { background: var(--info-bg); color: #24508a; }
.pill.muted { background: #eef0ee; }
.rs-DRAFT { background: #eef0ee; color: var(--muted); }
.rs-SUBMITTED { background: var(--warn-bg); color: var(--warn); }
.rs-RETURNED { background: var(--bad-bg); color: var(--bad); }
.rs-FORWARDED { background: var(--good-bg); color: var(--good); }

.btn { display: inline-block; background: var(--brand); color: #fff; border: 0; padding: 8px 14px; border-radius: 7px; font-size: 14px; cursor: pointer; font-weight: 600; }
.btn:hover { background: var(--brand-2); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--brand); border: 1px solid var(--line); }
.btn.danger { background: var(--bad); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.monthnav { display: flex; gap: 8px; align-items: center; }
.monthnav .label { font-weight: 600; min-width: 130px; text-align: center; }

.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.messages li { padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; background: var(--info-bg); }
.messages li.success { background: var(--good-bg); }
.messages li.error { background: var(--bad-bg); }
.messages li.warning { background: var(--warn-bg); }

.notice { padding: 10px 14px; border-radius: 8px; background: var(--warn-bg); margin-bottom: 16px; }

/* Bar trend (pure CSS, works offline) */
.trend { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 8px; border-bottom: 1px solid var(--line); }
.trend .bar { flex: 1; min-width: 6px; background: var(--brand-2); border-radius: 3px 3px 0 0; position: relative; }
.trend .bar.warn { background: #e0a526; } .trend .bar.bad { background: #d4574e; }
.trend-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }

/* Register grid */
.register td.c { text-align: center; padding: 6px 2px; font-weight: 600; font-size: 12px; min-width: 26px; }
.register td.c-P { background: var(--good-bg); color: var(--good); }
.register td.c-L { background: var(--warn-bg); color: var(--warn); }
.register td.c-A { background: var(--bad-bg); color: var(--bad); }
.register td.c-R { background: var(--info-bg); color: #24508a; }
.register th.d { text-align: center; padding: 6px 2px; font-size: 11px; }

form p { margin: 0 0 14px; }
form label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 14px; }
input[type=text], input[type=password], input[type=email], input[type=time], input[type=number], input[type=date], select, textarea { width: 100%; max-width: 420px; padding: 8px 10px; border: 1px solid #cfd5d1; border-radius: 7px; font: inherit; background: #fff; }
textarea { max-width: 100%; min-height: 80px; }
.helptext { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.errorlist { color: var(--bad); padding-left: 18px; margin: 4px 0; }

.login-wrap { max-width: 380px; margin: 10vh auto; }
.login-wrap h1 { margin-bottom: 4px; }

@media print {
  .topbar, .actions, .monthnav, .no-print { display: none !important; }
  main { padding: 0; max-width: none; }
  .card { border: 0; padding: 0; }
  body { background: #fff; }
}

footer.site { max-width: 1280px; margin: 0 auto; padding: 8px 24px 28px; color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
footer.site em { color: var(--brand); font-style: normal; font-weight: 600; }
.login-logo { display: block; width: 220px; margin: 0 auto 14px; }
.print-brand { display: none; }
@media print { .print-brand { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--brand); padding-bottom: 8px; margin-bottom: 14px; font-size: 12px; color: var(--muted); } .print-brand img { height: 34px; } footer.site { display: none; } }

/* ---- Sign-in page with education slogans ---- */
.login-split { display: grid; grid-template-columns: minmax(320px, 44%) 1fr; gap: 0; min-height: calc(100vh - 110px); margin: -24px -24px 0; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-panel .login-wrap { margin: 0; width: 100%; max-width: 380px; }
.login-hero { position: relative; overflow: hidden; color: #fff; padding: 40px 44px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(120% 90% at 0% 0%, #3f68c0 0%, #2f4f9e 45%, #1d2a57 100%); border-radius: 0 18px 18px 0; }
.hero-top img { height: 40px; display: block; }
.hero-kicker { margin-top: 22px; display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; color: #fff; }
.hero-kicker span { border-left: 3px solid #7fa2ec; padding-left: 12px; }
.hero-values { margin-top: 8px; padding-left: 15px; font-size: 13px; color: #c9d5f3; letter-spacing: .3px; }
.slogans { position: relative; min-height: 220px; z-index: 1; }
.slogan { position: absolute; inset: 0; margin: 0; display: flex; flex-direction: column; justify-content: center;
  opacity: 0; transform: translateY(12px); transition: opacity .8s ease, transform .8s ease; pointer-events: none; }
.slogan.show { opacity: 1; transform: none; pointer-events: auto; }
.slogan blockquote { margin: 0; font-size: clamp(26px, 2.6vw, 38px); line-height: 1.2; font-weight: 700; letter-spacing: -.3px; }
.slogan blockquote::before { content: "“"; display: block; font-size: 64px; line-height: .6; color: #7fa2ec; margin-bottom: 10px; }
.slogan figcaption { margin-top: 16px; font-size: 16px; color: #d6e0f7; }
.slogan figcaption span { color: #9fb6e8; font-size: 13px; }
.hero-bottom { position: relative; z-index: 1; }
.hero-bottom p { margin: 14px 0 0; font-size: 13px; color: #c9d5f3; }
.dots { display: flex; gap: 8px; }
.dots button { width: 8px; height: 8px; border-radius: 99px; border: 0; padding: 0; background: rgba(255,255,255,.35); cursor: pointer; transition: width .3s; }
.dots button.on { width: 26px; background: #fff; }
.hero-waves { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 160px; }
@media (max-width: 860px) {
  .login-split { grid-template-columns: 1fr; margin: -24px -24px 0; }
  .login-hero { border-radius: 0 0 18px 18px; padding: 24px; min-height: 260px; }
  .slogans { min-height: 140px; }
  .slogan blockquote { font-size: 24px; }
  .slogan blockquote::before { font-size: 44px; }
}
@media (prefers-reduced-motion: reduce) { .slogan { transition: none; } }
.lang-switch { display: flex; justify-content: flex-end; gap: 4px; margin: -6px -6px 6px 0; }
.lang-switch a { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; color: var(--muted); border: 1px solid var(--line); }
.lang-switch a.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.lang-switch a:hover { text-decoration: none; }

/* Offline banner */
#net-status { display: none; padding: 9px 24px; font-size: 14px; font-weight: 600; text-align: center; }
#net-status.offline { display: block; background: #3a3d45; color: #fff; }
#net-status.info { display: block; background: var(--warn-bg); color: #6a4a00; }
@media print { #net-status { display: none !important; } }
.edge-bar { background: #e7eefb; color: #24508a; font-size: 13px; padding: 7px 24px; text-align: center; border-bottom: 1px solid #cdd9f1; }
.login-stack { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 14px; }
.login-stack .login-wrap { max-width: none; }
.legal-notice { border: 1px solid var(--line); border-left: 4px solid var(--brand); background: #fff; border-radius: 10px; padding: 12px 16px; font-size: 12px; color: #444; line-height: 1.5; }
.legal-notice h2 { font-size: 13px; margin: 0 0 6px; text-transform: uppercase; letter-spacing: .5px; color: var(--brand); }
.legal-notice ul { margin: 6px 0; padding-left: 18px; }
.legal-notice li { margin-bottom: 3px; }
.legal-notice p { margin: 4px 0; }
.privacy h2 { margin-top: 22px; }
.privacy p, .privacy li { line-height: 1.6; }
.client-tag { font-size: 12px; color: #cdd6f0; border: 1px solid rgba(255,255,255,.3); border-radius: 99px; padding: 3px 10px; white-space: nowrap; }
.demo-bar { background: #fff3d6; color: #6a4a00; text-align: center; font-size: 13px; padding: 6px; font-weight: 600; }
.licence-bar { background: var(--bad-bg); color: var(--bad); text-align: center; font-size: 13px; padding: 7px; font-weight: 600; }

/* ================= Responsive: PC, tablet and phone ================= */
.nav-toggle { display: none; }
.menu-btn { display: none; }
.nav-panel { display: flex; align-items: center; gap: 24px; flex: 1; min-width: 0; }
.topbar nav { flex-wrap: wrap; }
.topbar nav a { white-space: nowrap; }
img, svg { max-width: 100%; height: auto; }
.topbar .brand img { height: 30px; width: auto; }

/* Mid-size screens: tighter top bar */
@media (max-width: 1200px) {
  .topbar { gap: 14px; padding: 0 16px; }
  .topbar nav a { padding: 8px 8px; font-size: 14px; }
}

/* Tablets and phones: menu button, drawer navigation */
@media (max-width: 1024px) {
  .topbar { position: sticky; top: 0; z-index: 50; height: 56px; }
  .menu-btn { display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; margin-left: auto; cursor: pointer; border-radius: 8px; padding: 0 10px; }
  .menu-btn span { display: block; height: 2px; transform-origin: center; background: #fff; border-radius: 2px; transition: transform .2s, opacity .2s; }
  .menu-btn:hover { background: rgba(255,255,255,.12); }
  .nav-panel { display: none; position: absolute; top: 56px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: #1d2a57; padding: 8px 12px 16px; box-shadow: 0 12px 24px rgba(0,0,0,.25); max-height: calc(100vh - 56px); overflow-y: auto; }
  .nav-toggle:checked ~ .nav-panel { display: flex; }
  .nav-toggle:checked ~ .menu-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle:checked ~ .menu-btn span:nth-child(2) { opacity: 0; }
  .nav-toggle:checked ~ .menu-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .topbar nav { flex-direction: column; gap: 2px; }
  .topbar nav a { padding: 12px 12px; font-size: 16px; border-radius: 8px; }
  .topbar .who { text-align: left; border-top: 1px solid rgba(255,255,255,.15); margin-top: 8px; padding: 12px 12px 0; font-size: 14px; line-height: 1.6; }
  .client-tag { overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
}

/* Phones */
@media (max-width: 700px) {
  body { font-size: 15px; }
  main { padding: 14px 12px; }
  footer.site { padding: 8px 12px 20px; flex-direction: column; }
  .topbar { padding: 0 8px 0 12px; gap: 10px; }
  .topbar .brand img { height: 24px; }
  .topbar .brand span { font-size: 13px; padding-left: 8px; }
  h1 { font-size: 20px; }
  h2 { font-size: 16px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 14px; }
  .page-head .actions, .page-head .monthnav { justify-content: flex-start; }
  .card { padding: 14px 12px; margin-bottom: 14px; border-radius: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
  .kpi { padding: 10px 12px; }
  .kpi .value { font-size: 22px; }
  .grid { gap: 12px; }
  table { font-size: 13px; }
  th, td { padding: 7px 8px; }
  th { white-space: nowrap; }
  .monthnav { flex-wrap: nowrap; width: 100%; }
  .monthnav .btn { flex: 0 0 auto !important; min-width: 44px; text-align: center; }
  .monthnav .label { min-width: 0; flex: 1; white-space: nowrap; }
  .btn { padding: 10px 14px; min-height: 40px; }
  .actions .btn, .actions select, .actions input { flex: 1 1 auto; }
  /* 16px inputs stop phones zooming in on focus */
  input[type=text], input[type=password], input[type=email], input[type=time], input[type=number], input[type=date], select, textarea { font-size: 16px; max-width: 100% !important; }
  [style*="max-width:560px"], [style*="max-width:640px"], [style*="max-width:860px"] { max-width: 100% !important; }
  .trend { height: 110px; gap: 2px; }
  .edge-bar, .demo-bar, .licence-bar { padding: 6px 12px; font-size: 12px; }
  .messages li { font-size: 14px; }
  /* Sign-in page */
  .login-split { margin: -14px -12px 0; min-height: auto; }
  .login-hero { min-height: 220px; padding: 20px; }
  .hero-top img { height: 30px; }
  .hero-kicker { font-size: 13px; letter-spacing: 2px; margin-top: 14px; }
  .slogans { min-height: 120px; }
  .slogan blockquote { font-size: 20px; }
  .slogan figcaption { font-size: 14px; }
  .hero-waves { height: 90px; }
  .login-panel { padding: 18px 12px; }
  .legal-notice { font-size: 12px; padding: 10px 12px; }
}

/* Monthly register: keep the name column visible while scrolling across the days */
.register th:first-child, .register td:first-child { position: sticky; left: 0; z-index: 1; background: #fff; }
.register th:first-child { background: #fafbfa; }
@media (max-width: 700px) {
  .register td:first-child { min-width: 120px; max-width: 150px; white-space: normal; font-size: 12px; }
}
@media print { .menu-btn, .nav-panel { display: none !important; } }
