:root {
  color-scheme: light;
  --navy: #14263c;
  --ink: #182a3d;
  --muted: #536478;
  --line: #dfe7ed;
  --surface: #f3f6f8;
  --green: #087557;
  --light-green: #e4f4ec;
  --white: #fff;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--surface); font-size: 1rem; }
button, input, select, textarea { font: inherit; }
button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.65rem; padding: .65rem .95rem; border: 1px solid transparent; border-radius: .65rem; background: transparent; color: var(--ink); font-size: .92rem; font-weight: 650; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #2fae8c; outline-offset: 2px; }
button.primary { color: #fff; background: var(--green); }
button.primary:hover:not(:disabled) { background: #046247; }
button.secondary { background: #fff; border-color: #d5e0e8; color: var(--ink); }
button.secondary:hover:not(:disabled) { background: #ecf2f6; }
button.text-button { color: #086854; padding-inline: 0; text-align: left; }
button.text-button:hover { text-decoration: underline; }
p, h1, h2 { margin: 0; }
h1 { line-height: 1.12; font-size: clamp(1.85rem, 4vw, 2.65rem); letter-spacing: -.055em; }
h2 { line-height: 1.25; font-size: 1.13rem; letter-spacing: -.02em; }
[hidden] { display: none !important; }
.icon { display: inline-grid; align-items: center; justify-items: center; width: 1em; line-height: 1; font-size: 1.18rem; }
.loading { padding: 2rem; color: var(--muted); }

.login-shell { max-width: 1120px; min-height: 600px; margin: clamp(2rem, 8vh, 6rem) auto; display: grid; grid-template-columns: 1.06fr 1fr; border: 1px solid var(--line); border-radius: 1.6rem; overflow: hidden; background: white; box-shadow: 0 18px 65px #23404414; }
.login-banner { color: #fff; background: radial-gradient(ellipse at 80% 65%, #1f6158 0%, #173a46 32%, var(--navy) 72%); padding: 2rem 2.7rem; display: grid; align-content: space-between; gap: 3rem; position: relative; isolation: isolate; overflow: hidden; }
.login-banner::before, .login-banner::after { content: ""; position: absolute; z-index: -1; width: 28rem; aspect-ratio: 1; border-radius: 50%; border: 1px solid #b3e7d42e; right: -11rem; bottom: -13rem; box-shadow: 0 0 0 2.7rem #96e8cd0b, 0 0 0 5.4rem #96e8cd0a; }
.login-banner::after { width: 18rem; right: -6rem; bottom: -8rem; }
.brand { display: flex; gap: .68rem; align-items: center; white-space: nowrap; }
.brand img { object-fit: contain; padding: 3px; border-radius: .65rem; background: #fff; border: 1px solid #e6ebef; flex: 0 0 auto; }
.brand strong { display: block; font-size: 1.04rem; letter-spacing: -.035em; font-weight: 750; }
.brand small { display: block; font-size: .69rem; opacity: .82; margin-top: .13rem; }
.banner-text h2 { font-size: clamp(2.45rem, 5.8vw, 4.5rem); font-weight: 730; line-height: .98; letter-spacing: -.067em; }
.banner-text p { margin-top: 1.35rem; line-height: 1.55; color: #dce9eb; max-width: 18rem; }
.banner-footer { display: flex; align-items: center; gap: .55rem; color: #cfe9e3; font-size: .85rem; }
.location-dot { display: inline-block; width: .5rem; height: .5rem; flex: 0 0 auto; background: #48ce9c; border-radius: 50%; }
.login-main { display: grid; align-items: center; padding: clamp(1.3rem, 5vw, 3rem); }
.login-card > p { margin: .85rem 0 1.4rem; line-height: 1.45; color: var(--muted); }
.login-form { display: grid; gap: .95rem; }
.login-form button.primary { margin-top: .26rem; }
.login-form .forgot-link { justify-self: end; min-height: 2rem; }
.login-card > button { margin-top: .4rem; }
.login-card .privacy { font-size: .82rem; margin: 1.1rem 0 0; }
.portal-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .25rem; padding: .3rem; background: #edf2f5; border-radius: .75rem; margin-bottom: 1.2rem; }
.portal-tabs button { min-height: 2.45rem; padding-inline: .22rem; font-size: .86rem; color: #344b61; }
.portal-tabs button.selected { background: white; color: #086854; box-shadow: 0 1px 5px #182a3d16; }
.portal-tabs button .icon { font-size: 1rem; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 221px minmax(0,1fr); }
.sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; background: var(--navy); color: #fff; padding: 1.5rem .8rem; }
.sidebar .brand { gap: .55rem; }
.sidebar .brand img { width: 37px; height: 37px; }
.sidebar .brand small { font-size: .6rem; }
.portal-badge { width: fit-content; display: flex; align-items: center; gap: .4rem; color: #cbefe4; background: #284655; border-radius: 2rem; font-size: .78rem; padding: .38rem .65rem; margin: 1.55rem .42rem .85rem; }
.nav { display: grid; gap: .22rem; }
.nav button, button.logout { width: 100%; justify-content: flex-start; color: #e5ecf5; text-align: left; gap: .65rem; }
.nav button:hover, .nav button.active { background: #29435a; color: #fff; }
.nav button.active .icon { color: #80e0c0; }
button.logout { margin-top: auto; }
button.logout:hover { background: #29435a; }
.main { width: 100%; max-width: 1440px; padding: clamp(1rem, 4vw, 2.6rem); margin: 0 auto; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.45rem; }
.eyebrow { font-size: .8rem; font-weight: 720; color: #3d586b; margin-bottom: .43rem; }
.hero { position: relative; isolation: isolate; overflow: hidden; border-radius: 1.12rem; color: white; background: linear-gradient(115deg,#142a43 32%,#1b4e59); margin-bottom: 1.1rem; padding: 1.5rem clamp(1rem,3vw,1.9rem); }
.hero::after { content: ""; position: absolute; z-index: -1; width: 16rem; aspect-ratio: 1; border-radius: 50%; border: 1px solid #ade8db45; right: -1rem; bottom: -13rem; box-shadow: 0 0 0 2.5rem #90cbba18, 0 0 0 5rem #90cbba12; }
.hero .eyebrow { color: #a7e4d0; }
.hero h2 { font-size: clamp(1.55rem, 3vw, 2.1rem); letter-spacing: -.045em; }
.hero p { margin: .5rem 0 0; line-height: 1.5; color: #dce9ee; }
.hero-actions, .form-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.hero-actions { margin-top: 1rem; }
.hero .primary { color: #143e34; background: #a7ebd4; }
.hero .primary:hover:not(:disabled) { background: #c0f7e6; }
.metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .75rem; margin-bottom: 1rem; }
.metric, .card { background: #fff; border: 1px solid var(--line); border-radius: .9rem; }
.metric { padding: .95rem; display: grid; gap: .3rem; }
.metric span { color: var(--muted); font-weight: 600; font-size: .88rem; }
.metric strong { letter-spacing: -.055em; font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.12; }
.metric small { color: var(--muted); font-size: .77rem; }
.card { padding: clamp(.95rem, 2.4vw, 1.4rem); margin-bottom: 1rem; min-width: 0; }
.card h2 { margin-bottom: .95rem; }
.card > button.secondary { margin-bottom: .65rem; }
.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .9rem; }
th, td { padding: .75rem .6rem; vertical-align: middle; min-width: 6rem; }
th { font-size: .84rem; font-weight: 650; white-space: nowrap; background: #f3f6f8; color: #435a6f; }
td { border-bottom: 1px solid #e8edf0; }
tr:last-child td { border-bottom: 0; }
td button { min-height: 2.2rem; white-space: nowrap; padding: .35rem .65rem; font-size: .84rem; }
.status { display: inline-flex; align-items: center; white-space: nowrap; padding: .23rem .55rem; border-radius: 2rem; background: #edf2f5; color: #405466; font-size: .79rem; font-weight: 650; text-transform: capitalize; }
.status-present, .status-approved, .status-active, .status-clocked_in, .status-class_present, .status-check_in, .status-check_out { background: #e2f4ec; color: #125a43; }
.status-late, .status-pending, .status-class_late { background: #f9eed2; color: #735009; }
.status-rejected, .status-absent, .status-missing_clock_out { background: #f9e9e8; color: #8c3732; }
.empty { color: var(--muted); padding: .8rem 0; }
.help { color: var(--muted); font-size: .9rem; margin-top: .6rem; line-height: 1.5; }
.help + form { margin-top: .9rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%, 11rem),1fr)); gap: .8rem; align-items: end; }
.form-grid > button { width: fit-content; }
.field { display: grid; gap: .38rem; min-width: 0; }
.field > span, legend, .check { font-size: .88rem; font-weight: 620; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; min-height: 2.65rem; padding: .58rem .72rem; border: 1px solid #cbd8e1; border-radius: .58rem; background: #fff; color: var(--ink); font-size: 1rem; }
.field textarea { resize: vertical; }
.field select { appearance: none; padding-right: 1.7rem; background-image: linear-gradient(45deg,transparent 50%,#50657a 50%),linear-gradient(135deg,#50657a 50%,transparent 50%); background-position: calc(100% - 14px) 53%,calc(100% - 9px) 53%; background-size: 5px 5px; background-repeat: no-repeat; }
.wide, .form-actions { grid-column: 1/-1; }
fieldset { min-width: 0; border: 1px solid var(--line); border-radius: .7rem; margin: 0; padding: .9rem; }
.days { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.days label, .check { display: inline-flex; align-items: center; gap: .22rem; min-height: 2rem; }
input[type="checkbox"] { accent-color: var(--green); }
.action-row { display: flex; align-items: end; flex-wrap: wrap; gap: .65rem; padding: .7rem 0; }
.action-row + .action-row { border-top: 1px solid var(--line); }
.action-row > div { flex: 1; min-width: 12rem; }
.action-row p { font-size: .85rem; color: var(--muted); margin-top: .25rem; }
.toolbar { display: flex; margin-bottom: .85rem; }
.row-actions, .reset-code { display: flex; align-items: center; gap: .5rem; }
.reset-code { flex-wrap: wrap; margin-top: .65rem; }
.reset-code code { padding: .6rem; background: var(--light-green); border-radius: .5rem; overflow-wrap: anywhere; user-select: all; }
.admin-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
#toast { position: fixed; z-index: 4; bottom: 1rem; right: 1rem; max-width: min(30rem,calc(100vw - 2rem)); border-radius: .7rem; color: white; background: #193a43; box-shadow: 0 7px 24px #0c283c30; line-height: 1.4; }
#toast:not(:empty) { padding: .8rem 1rem; }
#toast[data-mode="error"] { background: #8d362e; }
@media (max-width: 1170px) { .login-shell { margin-inline: 1rem; } }
@media (max-width: 850px) {
  .shell { grid-template-columns: 183px minmax(0,1fr); }
  .sidebar .brand small { display: none; }
  .admin-columns { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 650px) {
  .shell { display: block; }
  .sidebar { height: auto; position: static; padding: .7rem .7rem .35rem; display: grid; grid-template-columns: 1fr auto; gap: .38rem; }
  .sidebar .brand { padding-left: .35rem; }
  .portal-badge { display: none; }
  .nav { display: flex; grid-row: 2; grid-column: 1/-1; overflow-x: auto; }
  .nav button { width: auto; white-space: nowrap; padding: .58rem .54rem; min-height: 2.4rem; font-size: .83rem; gap: .38rem; }
  button.logout { grid-row: 1; grid-column: 2; margin: 0; width: auto; }
  .nav .icon { font-size: .94rem; }
  .login-shell { margin: 0; border: none; border-radius: 0; min-height: 100vh; display: block; }
  .login-banner { padding: 1rem 1.27rem; min-height: auto; }
  .login-banner .banner-text, .login-banner .banner-footer { display: none; }
  .login-main { padding: 2.1rem 1.25rem; }
  .metrics { gap: .4rem; }
  .metric { padding: .55rem; }
  .metric span { font-size: .81rem; }
  .metric small { font-size: .72rem; }
  .top { margin-bottom: 1rem; }
}
