:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #17211d;
  --muted: #64716b;
  --line: #dde5e1;
  --surface: #ffffff;
  --canvas: #f4f7f5;
  --brand: #12664f;
  --brand-dark: #0b4938;
  --soft: #e6f2ed;
  --danger: #a53a3a;
  --warning: #9a6713;
  --shadow: 0 16px 40px rgba(21, 42, 33, 0.08);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(18, 102, 79, .24);
  outline-offset: 2px;
}

.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr);
  align-items: center;
  gap: 8vw;
  padding: clamp(32px, 8vw, 120px);
  background:
    radial-gradient(circle at 15% 15%, rgba(18, 102, 79, .15), transparent 30%),
    var(--canvas);
}
.login-copy { max-width: 700px; }
.login-copy h1 { margin: 8px 0 20px; font-size: clamp(2.5rem, 6vw, 5.5rem); line-height: .96; letter-spacing: -.055em; }
.login-copy > p:last-child { max-width: 560px; font-size: 1.15rem; color: var(--muted); }
.eyebrow { margin: 0 0 4px; color: var(--brand); font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.login-card { display: grid; gap: 18px; padding: 34px; }
.login-card h2 { margin: 0 0 6px; }

label { display: grid; gap: 7px; font-size: .85rem; font-weight: 700; }
input, select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #cbd6d1;
  border-radius: 9px;
}
button {
  min-height: 42px;
  padding: 9px 15px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-weight: 750;
}
button:hover { background: #f0f5f2; }
button.primary { color: #fff; background: var(--brand); border-color: var(--brand); }
button.primary:hover { background: var(--brand-dark); }
button.danger { color: var(--danger); }
button:disabled { cursor: not-allowed; opacity: .5; }
.hint, .subtle { margin: 0; color: var(--muted); font-size: .85rem; }
.message { min-height: 20px; margin: 10px 0; color: var(--brand); }
.message.error { color: var(--danger); }

.app-layout { min-height: 100vh; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  color: #fff;
  background: #123d31;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 28px; font-weight: 800; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; color: #123d31; background: #fff; border-radius: 9px; }
.sidebar nav { display: grid; gap: 6px; }
.nav-item { width: 100%; color: rgba(255,255,255,.75); text-align: left; background: transparent; border-color: transparent; }
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,.12); }
.logout { margin-top: auto; }
.content { min-width: 0; padding: 32px clamp(24px, 5vw, 72px) 60px; }
.topbar, .toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topbar { margin-bottom: 28px; }
.topbar h1 { margin: 0; font-size: clamp(1.9rem, 4vw, 3rem); letter-spacing: -.04em; }
.admin-identity { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.status-dot { width: 10px; height: 10px; background: #46a879; border-radius: 50%; box-shadow: 0 0 0 4px rgba(70,168,121,.14); }
.toolbar { margin-bottom: 20px; }
.toolbar h2 { margin: 0 0 4px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.stat span { display: block; color: var(--muted); font-size: .8rem; font-weight: 700; }
.stat strong { display: block; margin-top: 6px; font-size: 1.9rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 18px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: .75rem; letter-spacing: .05em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
td:last-child, th:last-child { text-align: right; }
.person-name { font-weight: 750; }
.badge { display: inline-flex; padding: 4px 9px; border-radius: 999px; font-size: .75rem; font-weight: 800; background: var(--soft); color: var(--brand); }
.badge.inactive, .badge.rejected { color: var(--danger); background: #fae9e9; }
.badge.pending { color: var(--warning); background: #fff2d8; }
.request-list { display: grid; gap: 12px; }
.request { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, .8fr) auto; gap: 22px; align-items: center; padding: 20px; }
.request h3 { margin: 0 0 5px; }
.request-actions { display: flex; gap: 8px; }
.date-filter { display: flex; align-items: end; gap: 9px; }
.date-filter label { min-width: 145px; }
.empty { padding: 36px; color: var(--muted); text-align: center; }

dialog { width: min(760px, calc(100% - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 30px 90px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(10, 25, 19, .55); }
dialog form { padding: 26px; }
.dialog-header, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-header h2 { margin: 0; }
.icon-button { min-width: 42px; padding: 0; font-size: 1.5rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0 10px; }
.check-row { display: flex; align-items: center; align-self: end; min-height: 44px; }
.check-row input { width: 18px; min-height: 18px; }
.schedule-fieldset { margin: 20px 0 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.schedule-fieldset legend { padding: 0 7px; font-weight: 800; }
.schedule-head, .schedule-grid { display: grid; grid-template-columns: minmax(130px, 1fr) 120px 120px; gap: 8px 12px; align-items: center; }
.schedule-head { margin-bottom: 7px; color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.schedule-day { display: flex; align-items: center; gap: 8px; }
.schedule-day input { width: 18px; min-height: 18px; }
.schedule-grid input[type="time"] { min-height: 38px; }
.dialog-actions { justify-content: flex-end; margin-top: 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 820px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-copy h1 { font-size: 3rem; }
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .brand { padding: 0; margin-right: auto; }
  .sidebar nav { display: flex; }
  .logout { width: auto; margin: 0; }
  .request { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 580px) {
  .content { padding: 22px 14px 40px; }
  .topbar, .toolbar, .date-filter { align-items: stretch; flex-direction: column; }
  .admin-identity { display: none; }
  .stats, .form-grid { grid-template-columns: 1fr; }
  .schedule-head, .schedule-grid { grid-template-columns: minmax(110px, 1fr) 96px 96px; }
  .sidebar nav { width: 100%; }
  .sidebar nav button { text-align: center; }
}
