:root {
  color-scheme: light;
  --ink: #193331;
  --muted: #71817c;
  --paper: #f3f6f2;
  --surface: #ffffff;
  --line: #dfe7e1;
  --deep: #173f3d;
  --teal: #147b70;
  --teal-soft: #e2f2ed;
  --coral: #cb5f48;
  --gold: #ddaa53;
  --shadow: 0 12px 34px rgba(28, 59, 54, .07);
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 18px 20px; color: #eef7f2; background: var(--deep); }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; padding: 0 8px 34px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; letter-spacing: .2px; }
.brand small { margin-top: 3px; color: #adc7bd; font-size: 9px; letter-spacing: 1.1px; }
.brand-mark { display: grid; place-items: center; width: 42px; aspect-ratio: 1; flex: 0 0 auto; border-radius: 13px; background: var(--gold); color: #263d35; font-weight: 800; font-size: 14px; }
.navigation { display: grid; gap: 7px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 12px; border: 0; border-radius: 8px; color: #c5d9d1; background: transparent; text-align: right; }
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,.12); }
.nav-icon { color: #89b5a5; font-size: 10px; font-weight: 800; }
.sidebar-foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 9px; border-top: 1px solid rgba(255,255,255,.15); color: #b5cbc2; font-size: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #72c9a3; }
.text-button { margin-right: auto; border: 0; color: #fff; background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.main-content { width: min(100%, 1320px); padding: 30px clamp(18px, 4vw, 54px) 60px; margin-inline: auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 27px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(24px, 3vw, 32px); line-height: 1.25; }
h2 { margin-bottom: 0; font-size: 19px; }
.eyebrow { margin-bottom: 7px; color: var(--teal); font-size: 10px; font-weight: 800; letter-spacing: 1.2px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.month-picker { display: grid; gap: 4px; color: var(--muted); font-size: 11px; }
input, select { min-width: 0; height: 42px; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; outline: none; color: var(--ink); background: #fff; }
input:focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(20,123,112,.12); }
.button { min-height: 42px; padding: 0 15px; border: 1px solid transparent; border-radius: 7px; font-weight: 700; white-space: nowrap; }
.button.primary { color: white; background: var(--teal); }
.button.primary:hover { background: #0d665c; }
.button.secondary { color: white; background: var(--coral); }
.button.secondary:hover { background: #b6503b; }
.button.quiet { color: var(--teal); border-color: var(--line); background: white; }
.view { display: none; }
.view.active { display: block; }
.metrics-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.metric { min-height: 132px; padding: 19px 20px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); box-shadow: var(--shadow); }
.metric span, .metric small { display: block; color: var(--muted); font-size: 12px; }
.metric strong { display: block; margin: 9px 0 3px; color: var(--deep); font-size: 30px; line-height: 1; }
.metric-accent { border-top: 3px solid var(--gold); }
.panel { margin-bottom: 16px; padding: 22px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); box-shadow: var(--shadow); }
.break-panel { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(280px, 1.1fr) minmax(220px, 1fr); align-items: center; gap: 20px; background: #edf5f0; }
.break-panel h2 { margin-bottom: 5px; }
.muted { color: var(--muted); font-size: 13px; }
.break-panel .muted { margin-bottom: 0; }
.inline-form { display: flex; gap: 8px; }
.inline-form select { flex: 1; }
.active-breaks { display: grid; gap: 7px; }
.break-chip { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid #e8d4aa; border-radius: 7px; background: #fff9ed; font-size: 12px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 16px; }
.section-heading .eyebrow { margin-bottom: 5px; }
.event-list { display: grid; }
.event-row { display: grid; grid-template-columns: minmax(100px, .7fr) minmax(140px, 1fr) minmax(125px, .8fr) minmax(95px, .6fr) auto; align-items: center; gap: 12px; padding: 13px 2px; border-top: 1px solid #edf0ed; }
.event-row:first-child { border-top: 0; }
.tazman-row { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(160px, .8fr) auto; align-items: center; gap: 12px; padding: 13px 2px; border-top: 1px solid #edf0ed; }
.tazman-row:first-child { border-top: 0; }
.tazman-row strong { display: block; font-size: 13px; }
.tazman-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.instructor-picker { position: relative; min-width: 0; }
.tazman-search { width: 100%; }
.selected-instructors { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 5px; }
.instructor-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 7px; border-radius: 5px; color: #17695c; background: var(--teal-soft); font-size: 12px; }
.remove-instructor { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; color: inherit; background: transparent; font-size: 17px; line-height: 1; }
.instructor-suggestions { position: absolute; z-index: 5; top: calc(100% + 3px); right: 0; left: 0; max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 7px; background: white; box-shadow: var(--shadow); }
.instructor-suggestions[hidden] { display: none; }
.instructor-option { display: block; width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid #edf0ed; color: var(--ink); background: white; text-align: right; }
.instructor-option:hover, .instructor-option.active { background: var(--teal-soft); }
.suggestion-empty { padding: 10px 12px; color: var(--muted); font-size: 12px; }
.tazman-actions { display: flex; gap: 7px; }
.event-row strong { font-size: 13px; }
.event-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.event-kind { display: inline-flex; width: fit-content; padding: 5px 8px; border-radius: 5px; color: #17695c; background: var(--teal-soft); font-size: 11px; }
.event-kind.training { color: #984d3b; background: #f9e9e3; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 14px; }
.form-grid label, .form-stack label { display: grid; gap: 6px; color: #50635e; font-size: 12px; font-weight: 700; }
.form-grid .wide-field { grid-column: span 2; }
.form-grid .button { width: fit-content; }
.worker-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.worker-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; }
.worker-row strong { display: block; font-size: 13px; }
.worker-row small { color: var(--muted); }
.button.danger { min-height: 34px; color: #a44333; border-color: #f0d1c9; background: #fff8f6; }
.empty-state { padding: 24px 10px; color: var(--muted); text-align: center; font-size: 13px; }
.toast { position: fixed; inset-inline-start: 22px; bottom: 22px; z-index: 4; max-width: calc(100vw - 44px); padding: 12px 16px; border-radius: 7px; color: white; background: var(--deep); opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.login-page { display: grid; place-items: center; padding: 20px; background: radial-gradient(ellipse at 80% 15%, #dbece2 0, transparent 38%), var(--paper); }
.login-shell { width: min(100%, 410px); padding: 34px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }
.login-shell .brand-mark { margin-bottom: 24px; }
.login-shell h1 { margin-bottom: 7px; font-size: 25px; }
.login-shell > .muted { margin-bottom: 24px; }
.form-stack { display: grid; gap: 14px; margin-top: 24px; }
.form-error { min-height: 18px; margin: 0; color: #a44333; font-size: 12px; }
.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: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; z-index: 3; top: 0; height: auto; padding: 10px 14px; }
  .brand { padding: 0 5px 10px; }
  .brand-mark { width: 34px; border-radius: 10px; }
  .navigation { grid-template-columns: repeat(3, 1fr); gap: 5px; }
  .nav-item { justify-content: center; padding: 10px 5px; font-size: 12px; }
  .nav-icon { display: none; }
  .sidebar-foot { position: absolute; top: 10px; left: 13px; width: auto; padding: 3px; border: 0; font-size: 0; }
  .sidebar-foot .text-button { font-size: 11px; }
  .main-content { padding-top: 20px; }
  .break-panel { grid-template-columns: 1fr 1.3fr; }
  .active-breaks { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .topbar-actions { width: 100%; }
  .month-picker { flex: 1; }
  .topbar-actions .button { flex: 1; }
  .metrics-row { gap: 7px; }
  .metric { min-height: 110px; padding: 13px 11px; }
  .metric span, .metric small { font-size: 10px; }
  .metric strong { font-size: 25px; }
  .panel { padding: 16px; }
  .break-panel { grid-template-columns: 1fr; gap: 15px; }
  .active-breaks { grid-column: auto; grid-template-columns: 1fr; }
  .inline-form { flex-wrap: wrap; }
  .inline-form select { flex-basis: 100%; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .form-grid .wide-field { grid-column: span 2; }
  .form-grid .button { width: 100%; grid-column: span 2; }
  .section-heading { align-items: flex-start; }
  .section-heading > .muted { display: none; }
  .event-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 13px 0; }
  .event-row > :nth-child(2) { grid-column: 1; }
  .event-row > :nth-child(3) { grid-column: 1; }
  .event-row > :nth-child(4) { grid-column: 2; grid-row: 1; }
  .event-row > :nth-child(5) { grid-column: 2; grid-row: 2 / span 2; }
  .tazman-row { grid-template-columns: 1fr; }
  .tazman-search { min-height: 46px; }
  .tazman-actions .button { flex: 1; }
  .worker-list { grid-template-columns: 1fr; }
  .login-shell { padding: 27px 22px; }
}
