:root{color-scheme:light;--navy:#102e39;--navy-deep:#0c252e;--teal:#00665e;--green:#c6ed9e;--ink:#17323a;--muted:#4b656c;--paper:#fff;--wash:#f1f6f5;--line:#d8e5e2;--danger:#963825;--radius:16px}
*,*::before,*::after{box-sizing:border-box}
body{margin:0;background:var(--wash);font:16px/1.52 Inter,"Segoe UI",system-ui,sans-serif;color:var(--ink)}
button,input,select,textarea{font:inherit}
button,a{touch-action:manipulation}
a{color:var(--teal);text-underline-offset:.18em}
button{cursor:pointer}
:focus-visible{outline:3px solid #00887b;outline-offset:3px}
h1,h2,h3,p{margin:0 0 .65rem}
h1,h2,h3{line-height:1.15;letter-spacing:-.035em}
h1{font-size:clamp(2rem,5vw,3.55rem);font-weight:720}
h2{font-size:1.35rem}
h3{font-size:1.06rem}
p{color:var(--muted)}
[hidden]{display:none!important}
.skip{position:fixed;top:8px;left:12px;z-index:10;background:white;padding:.65rem 1rem;transform:translateY(-150%)}
.skip:focus{transform:translateY(0)}
.initial{padding:2rem}
.brand{display:flex;align-items:center;gap:.75rem;font-size:1.15rem;line-height:1.1;font-weight:700;letter-spacing:-.025em}
.brand img{width:42px;height:42px}
.brand small{display:block;font-size:.68rem;font-weight:650;letter-spacing:.06em;text-transform:uppercase;margin-top:.32rem;color:inherit;opacity:.86}
.auth{min-height:100vh;display:grid;place-items:center;padding:1.5rem;background:radial-gradient(ellipse at 0 12%,#16595a,transparent 55%),var(--navy-deep)}
.auth-grid{width:min(940px,100%);display:grid;grid-template-columns:1.16fr 1fr;align-items:center;gap:clamp(1.3rem,5vw,5.5rem)}
.auth-intro{color:#f5fffd}
.auth-intro p{color:#bed6d3;max-width:380px}
.auth-intro .brand{margin-bottom:2.5rem}
.auth-intro h1{font-size:clamp(2.35rem,6vw,4rem)}
.auth-intro .eyebrow{color:var(--green)}
.auth-card{background:var(--paper);border-radius:22px;padding:clamp(1.2rem,4vw,2.1rem);box-shadow:0 18px 55px #041e2870}
.auth-card .button{width:100%;margin-top:.4rem}
.layout{display:grid;grid-template-columns:242px minmax(0,1fr);min-height:100vh}
.sidebar{background:var(--navy);color:#ecf8f4;padding:1.35rem 1rem;position:sticky;top:0;height:100vh;overflow:auto}
.sidebar .brand{padding:.4rem .5rem 1.4rem}
.sidebar nav{display:grid;gap:.28rem}
.nav-button{border:1px solid transparent;text-align:left;color:#c3dcd7;background:transparent;padding:.55rem .65rem;min-height:43px;border-radius:8px;display:flex;align-items:center;gap:.65rem;font-size:.9rem}
.nav-button:hover{background:#1b4350}
.nav-button[aria-current=page]{background:#e0f2ea;color:#103941;font-weight:700}
.nav-icon{display:inline-grid;place-items:center;width:1.6rem;font-weight:700}
.sidebar :focus-visible,.hero :focus-visible,.auth-intro :focus-visible{outline-color:#b9ee84}
.sidebar-foot{padding:.9rem .5rem 0;color:#a7c6c2;font-size:.78rem}
.workspace{min-width:0}
.topbar{padding:1rem clamp(1rem,4vw,2.8rem);display:flex;justify-content:space-between;gap:.8rem;align-items:center;border-bottom:1px solid var(--line);background:#fff;min-width:0}
.topbar .label{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}
.topbar .account{display:flex;gap:.55rem;align-items:center;justify-content:flex-end;flex-wrap:wrap}
main.content{width:min(1360px,100%);margin:auto;padding:clamp(1.2rem,4vw,2.8rem)}
.page-head{display:flex;align-items:end;justify-content:space-between;gap:1.2rem;flex-wrap:wrap;margin-bottom:1.25rem}
.page-head p{max-width:650px;margin:0}
.eyebrow{display:block;color:var(--teal);font-size:.72rem;font-weight:800;letter-spacing:.125em;text-transform:uppercase;margin-bottom:.55rem}
.hero{background:linear-gradient(115deg,#103d49,#0b625a);border-radius:22px;padding:clamp(1.3rem,5vw,2.8rem);color:white;display:flex;align-items:end;justify-content:space-between;gap:1.25rem;flex-wrap:wrap;margin-bottom:1.15rem}
.hero p{color:#d0e8e3;max-width:625px}
.hero .eyebrow{color:var(--green)}
.hero .button{background:var(--green);border-color:var(--green);color:#16381f}
.grid{display:grid;gap:1rem;min-width:0}
.metrics{grid-template-columns:repeat(auto-fit,minmax(min(100%,150px),1fr));margin-bottom:1.1rem}
.pair{grid-template-columns:1.35fr 1fr;align-items:start}
.tiles{grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr))}
.card{border:1px solid var(--line);border-radius:var(--radius);background:#fff;padding:1.12rem;min-width:0}
.card + .card.stack{margin-top:1rem}
.card header{display:flex;justify-content:space-between;gap:.8rem;align-items:start;margin-bottom:.85rem;flex-wrap:wrap}
.metric strong{display:block;color:var(--teal);font-size:2rem;line-height:1.1;margin-bottom:.36rem}
.metric span,.subtle{font-size:.83rem;color:var(--muted)}
.badge{display:inline-block;color:#164940;background:#e5f3ed;padding:.25rem .55rem;border-radius:99px;font-size:.77rem;font-weight:650}
.badge.warn{color:#764b19;background:#fbf0dd}
.badge.dark{color:#d8efec;background:#244a55}
.button{display:inline-flex;align-items:center;justify-content:center;gap:.4rem;min-height:41px;padding:.48rem .85rem;border:1px solid var(--teal);background:var(--teal);color:#fff;border-radius:9px;font-size:.9rem;font-weight:660;text-decoration:none;line-height:1.25}
.button:hover{filter:brightness(.92)}
.button.secondary{color:var(--teal);background:#fff;border-color:#bfd6cf}
.button.tiny{min-height:34px;padding:.32rem .65rem;font-size:.79rem}
.button.danger{color:var(--danger);background:white;border-color:#e1bcb3}
.button[aria-pressed=true]{color:#fff;background:#124c54;border-color:#124c54}
.actions{display:flex;align-items:center;gap:.55rem;flex-wrap:wrap}
.fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,175px),1fr));gap:.8rem;margin-bottom:.85rem}
.fields.compact{gap:.65rem}
label.field{display:grid;gap:.26rem;color:#294c53;font-weight:680;font-size:.87rem;min-width:0}
label.check{display:flex;gap:.5rem;align-items:start;color:var(--ink);font-size:.9rem}
input:not([type=checkbox]),select,textarea{width:100%;min-width:0;border:1px solid #b8cbc8;border-radius:8px;padding:.53rem .62rem;background:#fff;color:var(--ink)}
input:not([type=checkbox]),select{min-height:41px}
textarea{min-height:82px;resize:vertical}
fieldset{border:1px solid var(--line);border-radius:10px;margin:0 0 .9rem;padding:.7rem}
legend{color:var(--teal);font-weight:700;font-size:.88rem}
.form-message{color:var(--danger);font-size:.9rem;min-height:1.4rem}
.top-space{margin-top:1rem}
.rows{list-style:none;padding:0;margin:0}
.rows li{border-bottom:1px solid var(--line);padding:.7rem 0;display:flex;justify-content:space-between;gap:.75rem;align-items:start}
.rows li:last-child{border:0}
.rows strong{display:block}
.rows span,.rows small{display:block;color:var(--muted);font-size:.84rem}
.table-wrap{overflow:auto}
table{width:100%;border-collapse:collapse;font-size:.9rem}
td,th{text-align:left;border-bottom:1px solid var(--line);padding:.65rem .55rem;vertical-align:middle}
th{color:#35535c;font-size:.78rem;white-space:nowrap}
td strong{display:block}
tr:last-child td{border-bottom:0}
.tabs{display:flex;gap:.4rem;flex-wrap:wrap;border-bottom:1px solid var(--line);padding-bottom:.75rem;margin-bottom:1rem}
.empty{padding:.85rem;color:var(--muted);background:#f1f6f5;border-radius:9px}
.detail{display:grid;gap:.45rem;grid-template-columns:repeat(auto-fit,minmax(145px,1fr));margin-bottom:1rem}
.detail div{background:#edf5f2;border-radius:10px;padding:.6rem}
.detail dt{font-size:.76rem;color:#45636a}.detail dd{margin:0;font-weight:670;overflow-wrap:anywhere}
.chat{max-height:470px;overflow:auto;display:grid;gap:.75rem;padding:.25rem .3rem .8rem;margin:.45rem 0 .85rem}
.attendance-history{max-height:none;overflow:visible}
.bubble{background:#e9f5ef;padding:.72rem .86rem;border-radius:13px;max-width:min(94%,650px)}
.bubble.user{justify-self:end;background:#e7f0f7}
.bubble p{margin:0;color:var(--ink);overflow-wrap:anywhere;white-space:pre-wrap}
.bubble .eyebrow{margin-bottom:.22rem}
dialog{border:1px solid var(--line);border-radius:18px;padding:0;width:min(680px,calc(100% - 1.5rem));max-height:calc(100% - 1.5rem);color:var(--ink)}
dialog::backdrop{background:#0b2939a3}
.dialog-content{padding:1.25rem}
.dialog-head{display:flex;justify-content:space-between;gap:1rem;align-items:start;margin-bottom:1rem}
#notice:not(:empty){position:fixed;right:1rem;bottom:1rem;max-width:min(450px,calc(100vw - 2rem));z-index:4;background:var(--navy);color:white;box-shadow:0 8px 20px #14303855;border-radius:12px;padding:.72rem 1rem}
.credential{overflow-wrap:anywhere;background:#eaf5ef;padding:.7rem;border-radius:8px}
@media(max-width:900px){.layout{grid-template-columns:185px minmax(0,1fr)}.sidebar{padding:1rem .62rem}.pair{grid-template-columns:1fr}}
@media(max-width:680px){.layout{display:block}.sidebar{height:auto;position:static;padding:.6rem .85rem}.sidebar .brand{padding:.3rem 0 .65rem}.sidebar nav{display:flex;overflow-x:auto;gap:.35rem;padding:3px}.nav-button{white-space:nowrap;padding:.42rem .55rem;min-height:39px}.sidebar-foot{display:none}.auth-grid{grid-template-columns:1fr}.auth-intro .brand{margin-bottom:1.2rem}.topbar{align-items:start}.topbar .label{font-size:.83rem}.topbar .account{font-size:.8rem}}

.whatsapp-qr{display:block;width:min(232px,100%);height:auto;margin:.65rem 0;padding:.45rem;border:1px solid var(--line);border-radius:10px;background:#fff}

/* Operational records reuse the existing spacing, colours and components. */
.compact-card { margin-bottom: 1.25rem; }
.word-editor { min-height: 24rem; font-family: Georgia, serif; line-height: 1.7; background: #fff; }
.contract-preview { white-space: pre-wrap; overflow-wrap: anywhere; padding: 1.5rem; background: #f6f8f9; border: 1px solid #dce5e8; border-radius: 12px; max-height: 55vh; overflow-y: auto; font: 1rem/1.7 Georgia, serif; }
.reminder-entry { border-top: 1px solid #dce5e8; padding: 1rem 0; }
