/* =====================================================================
   Leave & Duty Register — control-panel visual identity
   Display: Barlow Condensed | Body: IBM Plex Sans | Data: IBM Plex Mono
   ===================================================================== */

:root {
  --ink:      #101720;
  --ink-2:    #1A2430;
  --ink-3:    #26333F;
  --canvas:   #EBEEF2;
  --panel:    #FFFFFF;
  --rule:     #D2D9E1;
  --muted:    #66727F;
  --text:     #1B242E;

  --signal:   #E09112;   /* amber  — pending / accent */
  --run:      #1B8F63;   /* green  — sanctioned */
  --trip:     #C6402E;   /* red    — rejected */
  --info:     #2F6FB0;

  --r:        4px;
  --shadow:   0 1px 2px rgba(16,23,32,.06), 0 8px 24px -16px rgba(16,23,32,.35);
}

* { box-sizing: border-box; }

/* A class such as .grid-2 sets display:grid, which beats the browser's own
   [hidden] rule. Without this, hiding a block by setting `hidden` has no
   visible effect. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: "IBM Plex Sans", -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

h1, h2, h3, .eyebrow, .brand__name, .stat__value, .btn, th {
  font-family: "Barlow Condensed", "IBM Plex Sans", sans-serif;
}

h1 { font-size: 30px; font-weight: 600; letter-spacing: .01em; margin: 0 0 4px; }
h2 { font-size: 21px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 17px; font-weight: 600; margin: 0 0 8px; }

a { color: var(--info); }

code, .mono, .tag {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: .86em;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

/* ---------- app frame -------------------------------------------- */
.app { display: flex; min-height: 100vh; }

.rail {
  width: 232px;
  flex: 0 0 232px;
  background: var(--ink);
  color: #B9C4D0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--ink-3);
}
.brand__mark {
  display: flex; gap: 4px; margin-bottom: 10px;
}
.brand__mark i {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--ink-3);
}
.brand__mark i:first-child { background: var(--signal); box-shadow: 0 0 8px rgba(224,145,18,.7); }
.brand__mark i:nth-child(2) { background: var(--run); }

.brand__name {
  color: #fff; font-size: 20px; font-weight: 600;
  letter-spacing: .02em; line-height: 1.15; display: block;
}
.brand__org {
  font-size: 11px; text-transform: uppercase; letter-spacing: .14em;
  color: #6E7C8B; margin-top: 4px; display: block;
}

.nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.nav__label {
  font-family: "Barlow Condensed", sans-serif;
  text-transform: uppercase; letter-spacing: .16em; font-size: 11px;
  color: #5C6976; padding: 14px 8px 6px;
}
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; margin-bottom: 2px;
  color: #B9C4D0; text-decoration: none;
  border-radius: var(--r); font-size: 14px;
  border-left: 2px solid transparent;
}
.nav a:hover { background: var(--ink-2); color: #fff; }
.nav a.is-active {
  background: var(--ink-2); color: #fff;
  border-left-color: var(--signal);
}
.nav a .count {
  margin-left: auto; background: var(--signal); color: #241800;
  font-family: "IBM Plex Mono", monospace; font-size: 11px; font-weight: 600;
  padding: 1px 6px; border-radius: 10px;
}

.rail__foot {
  border-top: 1px solid var(--ink-3);
  padding: 14px 18px; font-size: 13px;
}
.rail__foot .who { color: #fff; font-weight: 500; }
.rail__foot .role { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: #6E7C8B; }
.rail__foot a { color: #93A1B0; font-size: 13px; text-decoration: none; }
.rail__foot a:hover { color: var(--signal); }

.main { flex: 1; min-width: 0; }

.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
  padding: 18px 28px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
}
.topbar .clock {
  font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--muted);
  text-align: right;
}

.content { padding: 24px 28px 60px; max-width: 1180px; }

/* ---------- panels ----------------------------------------------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.panel__head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
}
.panel__head h2, .panel__head h3 { margin: 0; }
.panel__body { padding: 18px; }
.panel__body--flush { padding: 0; }

/* ---------- stats ------------------------------------------------- */
.stats {
  display: grid; gap: 14px; margin-bottom: 22px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.stat {
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r);
  padding: 14px 16px; border-top: 3px solid var(--ink-3);
  text-decoration: none; color: inherit; display: block;
}
.stat--amber { border-top-color: var(--signal); }
.stat--green { border-top-color: var(--run); }
.stat--red   { border-top-color: var(--trip); }
.stat--blue  { border-top-color: var(--info); }
.stat__value { display: block; font-size: 34px; font-weight: 600; line-height: 1; }
.stat__label {
  display: block; margin-top: 6px; font-size: 11px; text-transform: uppercase;
  letter-spacing: .14em; color: var(--muted);
}
a.stat:hover { border-color: var(--ink-3); box-shadow: var(--shadow); }

/* ---------- SIGNATURE: annunciator board -------------------------- */
.annunciator {
  display: grid; gap: 10px; padding: 16px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  background:
    linear-gradient(var(--ink) 0 0) padding-box;
  border-radius: var(--r);
}
.tile {
  background: var(--ink-2);
  border: 1px solid var(--ink-3);
  border-left: 3px solid var(--signal);
  border-radius: 3px;
  padding: 12px 14px;
  color: #DCE3EA;
}
.tile--clear { border-left-color: var(--run); }
.tile__top {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.tile__name {
  font-family: "Barlow Condensed", sans-serif; font-size: 18px;
  font-weight: 600; color: #fff; letter-spacing: .01em;
}
.tile__meta {
  font-family: "IBM Plex Mono", monospace; font-size: 11px; color: #8794A2;
  margin-bottom: 8px;
}
.tile__relay {
  border-top: 1px dashed var(--ink-3); padding-top: 8px; margin-top: 8px;
  font-size: 13px;
}
.tile__relay .arrow { color: var(--signal); font-family: "IBM Plex Mono", monospace; }
.tile__relay strong { color: #fff; font-weight: 500; }
.tile__relay em { color: #8794A2; font-style: normal; font-size: 12px; }
.tile__none { color: #C6402E; font-size: 13px; }

.lamp {
  width: 9px; height: 9px; border-radius: 50%; display: inline-block;
  background: var(--signal); flex: 0 0 9px;
  box-shadow: 0 0 7px currentColor;
}
.tile .lamp { animation: breathe 2.4s ease-in-out infinite; }

@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) {
  .tile .lamp { animation: none; }
  * { scroll-behavior: auto !important; }
}

.board-empty {
  padding: 26px 16px; text-align: center; color: #8794A2;
  background: var(--ink); border-radius: var(--r);
}
.board-empty strong { color: var(--run); display: block; font-size: 18px;
  font-family: "Barlow Condensed", sans-serif; letter-spacing: .02em; }

/* ---------- tables ------------------------------------------------ */
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th {
  text-align: left; font-weight: 600; font-size: 13px;
  text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
  padding: 10px 14px; border-bottom: 1px solid var(--rule);
  background: #F6F8FA; white-space: nowrap;
}
table.grid td {
  padding: 11px 14px; border-bottom: 1px solid var(--rule); vertical-align: top;
}
table.grid tr:last-child td { border-bottom: 0; }
table.grid tbody tr:hover { background: #F9FBFC; }
table.grid .num { font-family: "IBM Plex Mono", monospace; }
.empty-row td { color: var(--muted); text-align: center; padding: 28px 14px; }

/* ---------- pills ------------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: "Barlow Condensed", sans-serif; font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  padding: 2px 9px 2px 7px; border-radius: 11px; border: 1px solid;
  white-space: nowrap;
}
.pill--amber { color: #8A5600; border-color: #F0D5A0; background: #FDF4E3; }
.pill--green { color: #10633F; border-color: #A9DCC5; background: #EAF7F1; }
.pill--red   { color: #8E2A1C; border-color: #EFBCB3; background: #FCEEEB; }
.pill--grey  { color: #4C5966; border-color: var(--rule);  background: #F2F5F8; }
.pill--amber .lamp { color: var(--signal); background: var(--signal); }
.pill--green .lamp { color: var(--run);    background: var(--run); }
.pill--red   .lamp { color: var(--trip);   background: var(--trip); }
.pill--grey  .lamp { color: #94A1AE;       background: #94A1AE; box-shadow: none; }

.tag {
  display: inline-block; padding: 1px 6px; border-radius: 3px;
  background: #EEF2F6; border: 1px solid var(--rule); color: #45525F;
}

/* ---------- forms -------------------------------------------------- */
.field { margin-bottom: 15px; }
.field > label, .field-label {
  display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .12em;
  font-weight: 600; color: var(--muted); margin-bottom: 5px;
}
input[type=text], input[type=password], input[type=date], input[type=tel],
input[type=email], input[type=number], input[type=month], select, textarea {
  width: 100%; padding: 9px 11px; font: inherit; font-size: 14px;
  border: 1px solid var(--rule); border-radius: var(--r);
  background: #fff; color: var(--text);
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--info); outline-offset: 1px; border-color: var(--info);
}
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.grid-2 { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid-3 { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.form-actions {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding-top: 6px;
}

/* ---------- buttons ------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 15px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase;
  padding: 8px 16px; border-radius: var(--r);
  border: 1px solid var(--ink); background: var(--ink); color: #fff;
  cursor: pointer; text-decoration: none; line-height: 1.4;
}
.btn:hover { background: var(--ink-2); }
.btn--ghost { background: #fff; color: var(--text); border-color: var(--rule); }
.btn--ghost:hover { background: #F3F6F9; border-color: var(--ink-3); }
.btn--go   { background: var(--run);    border-color: var(--run); }
.btn--go:hover { filter: brightness(1.08); }
.btn--stop { background: var(--trip);   border-color: var(--trip); }
.btn--stop:hover { filter: brightness(1.08); }
.btn--sm { font-size: 13px; padding: 5px 11px; }
.btn--block { width: 100%; justify-content: center; }
.btn:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }

/* ---------- alerts -------------------------------------------------- */
.alert {
  border: 1px solid var(--rule); border-left: 3px solid var(--muted);
  background: var(--panel); border-radius: var(--r);
  padding: 11px 14px; margin-bottom: 14px; font-size: 14px;
}
.alert--ok   { border-left-color: var(--run);    background: #EFF9F4; }
.alert--warn { border-left-color: var(--signal); background: #FDF6E9; }
.alert--err  { border-left-color: var(--trip);   background: #FCEFEC; }

/* ---------- auth screens -------------------------------------------- */
.auth {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr;
  background: var(--canvas);
}
.auth__side {
  background: var(--ink); color: #B9C4D0;
  padding: 48px 46px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth__side h1 { color: #fff; font-size: 46px; line-height: 1.02; max-width: 12ch; }
.auth__side p { max-width: 42ch; color: #93A1B0; }
.auth__board { margin-top: 28px; }
.auth__form-wrap {
  display: flex; align-items: center; justify-content: center; padding: 40px 24px;
}
.auth__card { width: 100%; max-width: 400px; }
.auth__card .panel { margin-bottom: 14px; }
.switch-line { font-size: 14px; color: var(--muted); text-align: center; }

@media (max-width: 880px) {
  .auth { grid-template-columns: 1fr; }
  .auth__side { padding: 32px 24px; }
  .auth__side h1 { font-size: 34px; }
  .auth__board { display: none; }
}

/* ---------- responsive frame ---------------------------------------- */
@media (max-width: 860px) {
  .app { flex-direction: column; }
  .rail {
    width: 100%; flex: none; height: auto; position: static;
    flex-direction: column;
  }
  .nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; }
  .nav a { flex: 1 1 auto; }
  .nav__label { display: none; }
  .content { padding: 18px 16px 48px; }
  .topbar { padding: 14px 16px; }
}

/* ---------- print (report preview) ---------------------------------- */
@media print {
  .rail, .topbar, .no-print { display: none !important; }
  body { background: #fff; }
  .panel { box-shadow: none; border-color: #999; }
  .content { padding: 0; max-width: none; }
}

/* =====================================================================
   Shift duty board
   ===================================================================== */
:root {
  --sh-m: #E09112;   /* morning  */
  --sh-e: #2F6FB0;   /* evening  */
  --sh-n: #5B4B9E;   /* night    */
  --sh-g: #1B8F63;   /* general  */
}

.shift-cols {
  display: grid; gap: 12px; padding: 16px;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  background: var(--ink);
}

.shift-col {
  background: var(--ink-2);
  border: 1px solid var(--ink-3);
  border-top: 3px solid var(--muted);
  border-radius: 3px;
  display: flex; flex-direction: column;
}
.shift-col--m { border-top-color: var(--sh-m); }
.shift-col--e { border-top-color: var(--sh-e); }
.shift-col--n { border-top-color: var(--sh-n); }
.shift-col--g { border-top-color: var(--sh-g); }

.shift-col__head {
  padding: 10px 12px 9px;
  border-bottom: 1px solid var(--ink-3);
  display: grid; grid-template-columns: auto 1fr auto; gap: 2px 8px; align-items: center;
}
.shift-col__head > .shift-col__code  { grid-area: 1 / 1; }
.shift-col__head > .shift-col__name  { grid-area: 1 / 2; }
.shift-col__head > .shift-col__count { grid-area: 1 / 3; justify-self: end; }
.shift-col__head > .shift-col__time  { grid-area: 2 / 2 / auto / -1; }
.shift-col__code {
  font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-size: 15px;
  width: 22px; height: 22px; border-radius: 3px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #10151C; background: var(--muted);
}
.shift-col--m .shift-col__code { background: var(--sh-m); }
.shift-col--e .shift-col__code { background: var(--sh-e); color: #fff; }
.shift-col--n .shift-col__code { background: var(--sh-n); color: #fff; }
.shift-col--g .shift-col__code { background: var(--sh-g); color: #fff; }

.shift-col__name {
  font-family: "Barlow Condensed", sans-serif; font-size: 16px; font-weight: 600;
  color: #fff; letter-spacing: .02em;
}
.shift-col__count {
  font-family: "IBM Plex Mono", monospace; font-size: 12px; color: #8794A2;
  border: 1px solid var(--ink-3); border-radius: 10px; padding: 0 7px;
}
.shift-col__time {
  font-family: "IBM Plex Mono", monospace; font-size: 11px; color: #8794A2;
}

.crew { list-style: none; margin: 0; padding: 6px; flex: 1; }
.crew__member {
  padding: 7px 8px; border-radius: 3px; margin-bottom: 3px;
  background: rgba(255,255,255,.03);
}
.crew__name { display: block; color: #EAF0F6; font-size: 14px; font-weight: 500; }
.crew__meta {
  display: block; font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px; color: #8794A2; margin-top: 1px;
}
.crew__note { display: block; font-size: 12px; color: #B9C4D0; margin-top: 3px; }
.crew__none { padding: 14px 8px; text-align: center; color: #67747F; font-size: 13px; }

.board-strip { padding: 0 16px 16px; background: var(--ink); }
.board-strip__label {
  font-family: "Barlow Condensed", sans-serif; text-transform: uppercase;
  letter-spacing: .14em; font-size: 12px; font-weight: 600;
  color: #8794A2; padding: 12px 0 8px;
  border-top: 1px solid var(--ink-3);
}
.board-strip__label--warn { color: var(--sh-m); }
.board-strip .annunciator { padding: 0; }
.board-strip .btn { margin-top: 10px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  background: var(--ink-2); border: 1px solid var(--ink-3); border-radius: 3px;
  padding: 5px 9px; color: #C6D0DA; font-size: 13px;
}
.chip em {
  font-style: normal; font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px; color: #7C8996; margin-left: 5px;
}

/* shift pill used in tables and on the employee dashboard */
.shift-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-size: 14px;
  text-transform: uppercase; letter-spacing: .06em;
  padding: 2px 10px; border-radius: 11px; border: 1px solid; white-space: nowrap;
}
.shift-pill--m { color: #8A5600; border-color: #F0D5A0; background: #FDF4E3; }
.shift-pill--e { color: #1D4E80; border-color: #B4CFE8; background: #EDF4FB; }
.shift-pill--n { color: #3E3372; border-color: #C6BEE8; background: #F1EEFB; }
.shift-pill--g { color: #10633F; border-color: #A9DCC5; background: #EAF7F1; }
.shift-pill--none { color: #4C5966; border-color: var(--rule); background: #F2F5F8; }

.staff-pick {
  display: grid; gap: 4px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  border: 1px solid var(--rule); border-radius: var(--r);
  padding: 10px; max-height: 260px; overflow-y: auto; background: #FBFCFD;
}
.staff-pick label {
  display: flex; gap: 8px; align-items: baseline; font-size: 14px;
  padding: 5px 7px; border-radius: 3px; cursor: pointer;
}
.staff-pick label:hover { background: #EEF2F6; }
.staff-pick input { width: auto; flex: 0 0 auto; }
.staff-pick .who-code {
  font-family: "IBM Plex Mono", monospace; font-size: 11px; color: var(--muted);
}

/* rest day column / pill */
.shift-col--o { border-top-color: #67747F; opacity: .92; }
.shift-col--o .shift-col__code { background: #67747F; color: #fff; }
.shift-pill--o { color: #4C5966; border-color: var(--rule); background: #F2F5F8; }

/* =====================================================================
   PWA: install button, offline / update banners, standalone tweaks
   ===================================================================== */
.rail__hint {
  margin-top: 8px; font-size: 12px; line-height: 1.45; color: #7C8996;
}
.rail__hint strong { color: #B9C4D0; font-weight: 500; }

.pwa-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  padding: 11px 16px calc(11px + env(safe-area-inset-bottom));
  font-size: 14px; line-height: 1.45;
  display: flex; gap: 12px; align-items: center; justify-content: center;
  flex-wrap: wrap; text-align: center;
  box-shadow: 0 -2px 14px rgba(16,23,32,.22);
}
.pwa-bar[hidden] { display: none; }
.pwa-bar--warn { background: var(--signal); color: #241800; }
.pwa-bar--info { background: var(--ink); color: #DCE3EA; }

.pwa-bar__btn {
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 4px 12px; border-radius: var(--r);
  border: 1px solid currentColor; background: transparent; color: inherit;
}
.pwa-bar__btn:hover { background: rgba(255,255,255,.14); }

/* standalone: keep content clear of the notch and the home indicator */
@media (display-mode: standalone) {
  .topbar { padding-top: calc(18px + env(safe-area-inset-top)); }
  .rail    { padding-top: env(safe-area-inset-top); }
  .content { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
}
