/* =====================================================================
   Secure Edge staff portal - design
   Navy and gold from the logo. Light, high contrast, phone-first.
   ===================================================================== */

:root {
  color-scheme: light;

  --navy-950: #1c2330;
  --navy-900: #232c3b;
  --navy:     #323e52;   /* matches the logo background */
  --navy-600: #46546b;
  --gold:     #d4b843;   /* matches the logo gold */
  --gold-600: #c3a52f;
  --gold-100: #fbf4d8;

  --bg:      #f2f4f8;
  --surface: #ffffff;
  --text:    #1b2230;
  --muted:   #566073;
  --line:    #dce1e9;

  --ok:        #1f7a3d;
  --ok-bg:     #e4f4ea;
  --danger:    #b3261e;
  --danger-bg: #fce9e7;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(28, 35, 48, .06), 0 8px 24px rgba(28, 35, 48, .07);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; margin: 0 0 .6rem; }
h1 { font-size: 1.65rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

p { margin: 0 0 .8rem; }
.muted { color: var(--muted); font-size: .9rem; }

.icon {
  width: 22px; height: 22px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--navy);
  color: #fff;
  border-bottom: 2px solid var(--gold);
  padding-top: env(safe-area-inset-top, 0px);
}
.topbar-inner {
  max-width: 1040px; margin: 0 auto; padding: .6rem 1rem;
  display: flex; align-items: center; gap: 1.25rem;
}
.brand {
  display: inline-flex; align-items: center; gap: .65rem;
  color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .01em;
}
.brand-logo { width: 38px; height: 38px; border-radius: 9px; display: block; }

.nav { display: flex; gap: .25rem; flex: 1; }
.nav a {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem .8rem; border-radius: 8px;
  color: rgba(255, 255, 255, .78); text-decoration: none; font-weight: 600; font-size: .95rem;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.nav a[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, .12); box-shadow: inset 0 -2px 0 var(--gold); }
.nav .icon { display: none; }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.logout-form { margin: 0; }

/* ---------- Layout ---------- */
.wrap { max-width: 1040px; margin: 0 auto; padding: 1.25rem 1rem 2rem; }
.wrap.narrow { max-width: 540px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.35rem;
  margin-bottom: 1rem;
}
.card-secret { border: 2px solid var(--gold); background: var(--gold-100); }

.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 1rem 1rem 2rem; }

/* ---------- Dashboard ---------- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-900) 100%);
  color: #fff;
  border-radius: 18px;
  padding: 1.6rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
  border-left: 5px solid var(--gold);
}
.hero .eyebrow { color: var(--gold); font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .35rem; }
.hero h1 { color: #fff; font-size: 1.8rem; margin-bottom: .5rem; }
.hero p { color: rgba(255, 255, 255, .8); margin-bottom: .35rem; }
.hero .chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.chip {
  display: inline-block; padding: .2rem .75rem; border-radius: 99px;
  font-size: .8rem; font-weight: 700;
  background: rgba(255, 255, 255, .12); color: #fff;
}
.chip-gold { background: var(--gold); color: var(--navy-950); }

.section-title { margin: 1.6rem 0 .75rem; font-size: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }

.tile {
  display: block; position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  color: var(--text); text-decoration: none;
}
.tile p { color: var(--muted); font-size: .92rem; margin-bottom: .75rem; }
.tile-icon {
  width: 46px; height: 46px; border-radius: 12px; margin-bottom: .8rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold-100); color: var(--navy);
}
.tile-link { box-shadow: var(--shadow); border-color: transparent; }
.tile-link:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(28,35,48,.08), 0 12px 28px rgba(28,35,48,.12); }
.tile-link h3::after { content: " \2192"; color: var(--gold-600); }
.tile-soon { background: transparent; border-style: dashed; }
.tile-soon .tile-icon { background: #e9edf3; color: var(--navy-600); }

/* ---------- Forms ---------- */
label { display: block; font-weight: 700; font-size: .92rem; margin: 1.1rem 0 .3rem; }

input, select, textarea {
  width: 100%; min-height: 50px; padding: .65rem .85rem;
  font: inherit; color: var(--text); background: #fff;
  border: 1.5px solid #bfc7d3; border-radius: 10px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--navy);
  box-shadow: 0 0 0 4px rgba(212, 184, 67, .4);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; padding: .5rem 1rem;
  font: inherit; font-size: .95rem; font-weight: 700; text-decoration: none; text-align: center;
  color: var(--navy-950); background: var(--gold);
  border: 0; border-radius: 10px; cursor: pointer;
}
.btn:hover { background: var(--gold-600); }
.btn:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.btn-secondary { background: #fff; color: var(--navy); border: 1.5px solid #bfc7d3; }
.btn-secondary:hover { background: #f2f4f8; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8f1e18; }
.btn-block { display: flex; width: 100%; margin-top: 1.5rem; }
.btn-small { min-height: 40px; padding: .3rem .75rem; font-size: .85rem; }

.topbar .btn-ghost {
  background: transparent; color: #fff; border: 1.5px solid rgba(255, 255, 255, .4);
  min-height: 40px; padding: .3rem .9rem; font-size: .9rem;
}
.topbar .btn-ghost:hover { background: rgba(255, 255, 255, .12); }

/* ---------- Messages ---------- */
.alert { padding: .85rem 1rem; border-radius: 10px; margin-bottom: 1rem; border-left: 5px solid; font-size: .95rem; }
.alert-error { background: var(--danger-bg); border-color: var(--danger); color: #5c120e; }
.alert-ok    { background: var(--ok-bg);     border-color: var(--ok);     color: #12451f; }
.alert-info  { background: var(--gold-100);  border-color: var(--gold);   color: #4a3d0a; }

.secret {
  display: inline-block; font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 1.35rem; letter-spacing: .08em; word-break: break-all;
  padding: .55rem .9rem; background: #fff;
  border: 2px dashed var(--gold-600); border-radius: 10px;
}

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: .12rem .65rem; border-radius: 99px; font-size: .78rem; font-weight: 700; }
.badge-green { background: var(--ok-bg); color: var(--ok); }
.badge-grey  { background: #e9edf3; color: #3d4757; }
.badge-gold  { background: var(--gold-100); color: #6b5a10; }
.badge-navy  { background: var(--navy); color: #fff; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th {
  text-align: left; padding: .55rem .6rem; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); border-bottom: 2px solid var(--line);
}
td { padding: .8rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: #f8f9fc; }
td.cell-name { font-weight: 700; }
.actions { white-space: nowrap; }
.inline-form { display: flex; gap: .4rem; flex-wrap: wrap; margin: 0; }

/* ---------- Sign-in screens ---------- */
body.auth { background: var(--navy); color: #fff; }
.auth-wrap {
  min-height: calc(100vh - 64px); min-height: calc(100dvh - 64px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 1.5rem 1rem 1rem;
}
.login-logo { display: block; width: 100%; max-width: 280px; height: auto; margin: 0 auto .5rem; }
.auth-card { width: 100%; max-width: 420px; color: var(--text); border: 0; border-top: 4px solid var(--gold); }
.auth-card h1 { font-size: 1.4rem; }
body.auth .footer { color: rgba(255, 255, 255, .6); }

/* ---------- Phone layout ---------- */
@media (max-width: 700px) {
  html { font-size: 16.5px; }
  .brand span { display: none; }

  body { padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
  body.auth { padding-bottom: 0; }

  /* the menu becomes a tab bar along the bottom, like a phone app */
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: #fff; border-top: 1px solid var(--line);
    padding: .3rem .5rem calc(.3rem + env(safe-area-inset-bottom, 0px));
    gap: 0; justify-content: space-around;
    box-shadow: 0 -4px 16px rgba(28, 35, 48, .08);
  }
  .nav a {
    flex: 1; flex-direction: column; gap: .15rem; padding: .4rem .25rem;
    font-size: .72rem; color: var(--muted); border-radius: 10px;
  }
  .nav a:hover { background: transparent; color: var(--navy); }
  .nav a[aria-current="page"] { color: var(--navy); background: var(--gold-100); box-shadow: none; }
  .nav .icon { display: block; }

  .hero { padding: 1.3rem 1.15rem; }
  .hero h1 { font-size: 1.5rem; }
  .card { padding: 1.1rem; }

  /* tables turn into stacked cards */
  .table-wrap { overflow: visible; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tr { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: .75rem; padding: .45rem .95rem; }
  tbody tr:hover { background: #fff; }
  td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .4rem 0; text-align: right; }
  td::before { content: attr(data-label); font-weight: 700; color: var(--muted); text-align: left; flex: 0 0 36%; }
  td.actions { white-space: normal; justify-content: flex-start; padding-top: .6rem; border-top: 1px solid var(--line); margin-top: .3rem; }
  td.actions::before { display: none; }
}

/* Keep content clear of notches when installed as an app */
body {
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* ---------- Forms and page headings (sites, clients) ---------- */
textarea { min-height: 170px; resize: vertical; line-height: 1.5; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.form-grid .full { grid-column: 1 / -1; }
.help { color: var(--muted); font-size: .85rem; margin: .3rem 0 0; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.5rem; }
.btn-row .btn { flex: 1 1 auto; }
.inline-note { display: inline-block; margin-left: .5rem; }
@media (max-width: 700px) {
  .form-grid { grid-template-columns: 1fr; }
}
.btn-row.flush { margin: 0; }
.sr-label { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Site colours ---------- */
.c-blue { --c: #1565e0; }
.c-teal { --c: #00838f; }
.c-green { --c: #1b9e3e; }
.c-olive { --c: #7a9a00; }
.c-amber { --c: #d99a00; }
.c-orange { --c: #e8590c; }
.c-red { --c: #d32f2f; }
.c-pink { --c: #e91e8c; }
.c-purple { --c: #8e24aa; }
.c-indigo { --c: #3f2fb5; }
.c-slate { --c: #455a64; }
.c-brown { --c: #795548; }

.dot { display: inline-block; width: .85em; height: .85em; border-radius: 50%; background: var(--c, #1d4ed8); margin-right: .35em; vertical-align: -.05em; }

.chips-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.25rem; }
.site-chip {
  display: inline-flex; align-items: center; min-height: 40px; padding: .4rem 1rem;
  border-radius: 99px; background: var(--c, #1d4ed8); color: #fff;
  font-weight: 700; font-size: .95rem; text-decoration: none;
}
.site-chip:hover { filter: brightness(1.12); }

.site-card { border-left: 6px solid var(--c, #1d4ed8); }
.site-card h2 { display: flex; align-items: center; }
.prose { white-space: pre-wrap; line-height: 1.6; }
.card-sub { color: var(--muted); font-size: .92rem; margin-bottom: .75rem; }

.label-text { display: block; font-weight: 700; font-size: .92rem; margin: 1.1rem 0 .5rem; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: .5rem; }
.swatch {
  position: relative; display: flex; align-items: center; gap: .55rem; margin: 0;
  padding: .5rem .65rem; background: #fff; border: 1.5px solid var(--line);
  border-radius: 10px; font-weight: 600; font-size: .9rem; cursor: pointer;
}
.swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatch-dot { width: 24px; height: 24px; border-radius: 50%; background: var(--c); flex: none; }
.swatch input:checked + .swatch-dot { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--navy); }
.swatch input:focus-visible + .swatch-dot { outline: 3px solid var(--gold); outline-offset: 4px; }
.swatch:hover { border-color: var(--navy-600); }

input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; min-height: 0; padding: 0; accent-color: var(--navy); }
.check-row {
  display: flex; align-items: center; gap: .8rem; margin: 0 0 .5rem; padding: .7rem .85rem;
  background: #fff; border: 1.5px solid var(--line); border-radius: 10px; font-weight: 600; cursor: pointer;
}
.check-row:hover { border-color: var(--navy-600); }
.check-row .grow { flex: 1; }

.link-box { font-family: "SFMono-Regular", Menlo, Consolas, monospace; font-size: .85rem; }

/* ---------- Scheduling ---------- */
.wrap.wide { max-width: 1320px; }
.badge-red { background: var(--danger-bg); color: var(--danger); }

.week-bar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.week-nav { display: flex; gap: .4rem; flex-wrap: wrap; }
.week-title { font-size: 1.15rem; font-weight: 700; }
.filter-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: 0; }
.filter-form select { width: auto; min-width: 170px; min-height: 44px; }

.summary { display: flex; gap: 1.25rem; flex-wrap: wrap; color: var(--muted); font-size: .92rem; margin-bottom: 1rem; }
.summary strong { color: var(--text); }
.week-actions { padding: .9rem 1.1rem; }

.week-grid { display: grid; grid-template-columns: 1fr; gap: .75rem; }
@media (min-width: 1000px) {
  .week-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; }
}
.day { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .65rem; min-height: 110px; }
.day.is-today { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(212, 184, 67, .45); }
.day-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-bottom: .5rem; }
.day-add { font-size: .85rem; font-weight: 700; text-decoration: none; }
.empty-day { color: var(--muted); font-size: .85rem; }

.shift {
  display: block; color: var(--text); text-decoration: none;
  background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--c, #1d4ed8);
  border-radius: 8px; padding: .45rem .55rem; margin-bottom: .45rem;
  font-size: .85rem; line-height: 1.35;
}
a.shift:hover { box-shadow: var(--shadow); }
.shift span { display: block; }
.shift-time { font-weight: 700; }
.shift-site { color: var(--muted); }
.shift-who { font-weight: 600; }
.shift .badge { display: inline-block; font-size: .7rem; margin-top: .25rem; }
.shift-draft { border-style: dashed; border-left-style: solid; background: #fafbfd; }
.shift-open { background: var(--gold-100); }

.weekdays { display: flex; flex-wrap: wrap; gap: .5rem; }
.check-row.compact { margin: 0; padding: .5rem .8rem; min-width: 84px; }

.shift-card-time { font-weight: 700; font-size: 1.05rem; margin-bottom: .2rem; }
.next-shift { display: block; color: var(--text); text-decoration: none; }
.next-shift:hover { box-shadow: 0 2px 4px rgba(28,35,48,.08), 0 12px 28px rgba(28,35,48,.12); }
.eyebrow-dark { color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .2rem; }

/* ---------- Chat ---------- */
.nav a { position: relative; }
.nav-badge {
  display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px;
  background: var(--gold); color: var(--navy-950);
  font-size: .72rem; font-weight: 800; line-height: 20px; text-align: center;
}
@media (max-width: 700px) {
  .nav-badge { position: absolute; top: 2px; left: calc(50% + 6px); }
}

.room-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.room-row {
  display: flex; align-items: center; gap: .85rem; padding: .8rem .25rem;
  border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none;
}
.room-row:hover { background: #f8f9fc; }
.room-avatar {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--c, #475569); color: #fff; font-weight: 700;
}
.room-avatar.person { background: var(--navy-600); }
.room-main { flex: 1; min-width: 0; }
.room-name { display: flex; justify-content: space-between; gap: .5rem; font-weight: 700; }
.room-time { font-size: .78rem; font-weight: 400; color: var(--muted); }
.room-preview { display: block; color: var(--muted); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread {
  flex: none; min-width: 22px; padding: 0 .5rem; border-radius: 99px;
  background: var(--gold); color: var(--navy-950); font-size: .78rem; font-weight: 800; text-align: center; line-height: 22px;
}
.new-chat { margin-top: .5rem; }

.chat-wrap { display: flex; flex-direction: column; height: calc(100vh - 330px); height: calc(100dvh - 330px); min-height: 320px; }
.chat-log {
  flex: 1; overflow-y: auto; padding: 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0;
}
.chat-readonly { max-height: 60vh; border-radius: var(--radius); }
.msg { max-width: 84%; margin-bottom: .8rem; }
.msg .meta { font-size: .74rem; color: var(--muted); margin-bottom: .15rem; }
.msg .bubble {
  display: inline-block; padding: .55rem .85rem; border-radius: 14px;
  background: #eef1f6; white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg.mine { margin-left: auto; text-align: right; }
.msg.mine .bubble { background: var(--navy); color: #fff; text-align: left; }
.chat-form {
  display: flex; gap: .5rem; align-items: flex-end; padding: .6rem;
  background: #fff; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius);
}
.chat-form textarea { flex: 1; min-height: 48px; max-height: 140px; margin: 0; resize: none; }
.chat-status { min-height: 1.3em; margin-top: .4rem; font-size: .85rem; color: var(--danger); }

/* ---------- Help ---------- */
.search-form { display: flex; gap: .5rem; margin-bottom: 1rem; }
.search-form input { flex: 1; margin: 0; }
.faq { border-bottom: 1px solid var(--line); }
.faq:last-child { border-bottom: 0; }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .95rem .25rem; cursor: pointer; font-weight: 700; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font-size: 1.5rem; line-height: 1; color: var(--gold-600); }
.faq[open] summary::after { content: "\2212"; }
.faq summary:hover { color: var(--navy-600); }
.faq .prose { padding: 0 .25rem 1.1rem; }

@media (max-width: 700px) {
  .topbar-inner { gap: .6rem; }
  .topbar-actions { gap: .4rem; }
  .topbar .btn-ghost { padding: .3rem .65rem; font-size: .85rem; }
}

/* ---------- Time clock ---------- */
[hidden] { display: none !important; }
.clock-card { text-align: center; }
.clock-card h2 { justify-content: center; }
.clock-btn { min-height: 56px; font-size: 1.1rem; margin-top: .75rem; }
.clock-btn:disabled { opacity: .55; cursor: not-allowed; }
.clock-on { border-top: 5px solid var(--ok); }
.clock-since { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.clock-btn.is-armed { box-shadow: 0 0 0 4px var(--gold); }
#clock-pending { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; }
.ts-week { margin-top: 1.5rem; }
.ts-week .section-title { margin: 0; }

/* Staff documents: preview picture */
.doc-preview { max-width: 100%; max-height: 28rem; border: 1px solid #c9d1dc; border-radius: 8px; }
.doc-full { width: 100%; height: auto; border: 1px solid #c9d1dc; border-radius: 8px; }
.doc-frame { width: 100%; height: 70vh; border: 1px solid #c9d1dc; border-radius: 8px; }

/* ---------- My calendar ---------- */
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.cal-title { margin: 0; font-size: 1.15rem; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-head div { text-align: center; font-size: .78rem; font-weight: 700; color: var(--muted); padding: .25rem 0; }
.cal-day {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  min-height: 62px; padding: .3rem .1rem; border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--text); text-decoration: none;
}
.cal-num { font-weight: 700; font-size: .95rem; }
.cal-out { background: transparent; color: var(--muted); border-style: dashed; }
.cal-past { opacity: .6; }
.cal-today { border-color: var(--gold); border-width: 2.5px; }
.cal-selected { background: var(--navy); color: #fff; border-color: var(--navy); opacity: 1; }
.cal-leave { background: var(--gold-100); }
.cal-selected.cal-leave { background: var(--navy); }
.cal-notfree:not(.cal-leave) { background: var(--danger-bg); }
.cal-selected.cal-notfree { background: var(--navy); }
.cal-tag-notfree { color: var(--danger); }
.card-notfree { border-left: 5px solid var(--danger); }
.notfree-box { margin-top: .75rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.notfree-box summary, .notfree-more summary { cursor: pointer; font-weight: 700; padding: .35rem 0; }
.nf-line { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin: .4rem 0; }
.notfree-more { margin: .6rem 0; }
.cal-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; margin-top: .25rem; min-height: 10px; }
.cal-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, #475569); border: 1.5px solid #fff; box-shadow: 0 0 0 1px #8b94a3; }
.cal-more { font-size: .7rem; font-weight: 700; }
.cal-tag { margin-top: .15rem; font-size: .68rem; font-weight: 700; color: #6b5a10; background: #fff; border-radius: 99px; padding: 0 .4rem; }
.cal-key { margin: .75rem 0 0; }

/* ---------- Round clock button on the home page ---------- */
.clock-round-wrap { text-align: center; margin: 1.25rem 0; }
.clock-round-wrap [hidden] { display: none !important; }
.clock-round-card { margin: 0 0 1rem; }
.clock-later { display: none; }
.clock-round {
  display: inline-flex; align-items: center; justify-content: center;
  width: 150px; height: 150px; padding: .5rem; border: 0; border-radius: 50%;
  font: inherit; font-size: 1.3rem; font-weight: 800; line-height: 1.2; text-align: center;
  cursor: pointer; box-shadow: 0 4px 14px rgba(50, 62, 82, .35);
}
.clock-round-in  { background: var(--gold); color: var(--navy-950); }
.clock-round-out { background: var(--danger); color: #fff; }
.clock-round:hover { filter: brightness(.95); }
.clock-round:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.clock-round.is-armed { box-shadow: 0 0 0 6px var(--gold); font-size: 1.05rem; }
.clock-round:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }
.clock-round-note { margin: .6rem 0 0; font-weight: 700; color: var(--text); }


/* Training lessons */
.lesson p { font-size: 1.1rem; line-height: 1.6; margin: 0 0 1rem; }
.lesson strong { font-weight: 800; color: var(--navy); }
.lesson-list { margin: 0 0 1rem; padding-left: 1.3rem; font-size: 1.1rem; line-height: 1.6; }
.lesson-list li { margin-bottom: .6rem; }
.key-box { background: var(--gold-100); border-left: 6px solid var(--gold); border-radius: 10px; padding: .9rem 1rem; margin: 1rem 0; font-size: 1.15rem; line-height: 1.5; color: #1f2430; }
.key-label { display: inline-block; background: var(--navy); color: #fff; border-radius: 99px; padding: .1rem .7rem; font-size: .8rem; font-weight: 700; margin-right: .4rem; }
.quick-check { border: 2px solid var(--navy); border-radius: 10px; padding: .2rem 1rem; margin: 1rem 0; background: #fff; }
.quick-check summary { cursor: pointer; font-weight: 700; color: var(--navy); min-height: 48px; display: flex; align-items: center; font-size: 1.05rem; }
.quick-check p { margin: .2rem 0 .8rem; }
.lesson-progress { width: 100%; height: 14px; accent-color: #d4b843; margin: .2rem 0 .8rem; }

/* Training quiz */
.quiz-q { border: 0; margin: 0 0 1rem; min-width: 0; }
.quiz-q legend { padding: 0; }
.quiz-option { display: flex; align-items: center; gap: .8rem; min-height: 52px; padding: .6rem .9rem; margin: .5rem 0; border: 2px solid #bfc7d3; border-radius: 10px; background: #fff; font-size: 1.05rem; cursor: pointer; }
.quiz-option input { width: 24px; height: 24px; flex: 0 0 auto; accent-color: #323e52; }
.quiz-option:has(input:checked) { border-color: var(--navy); background: var(--gold-100); font-weight: 700; }
.quiz-score { font-size: 1.3rem; margin: .4rem 0; }
.quiz-right { border-left: 6px solid #2e7d32; }
.quiz-wrong { border-left: 6px solid #b3261e; }

/* Uniform shop */
.shop-card h3 { margin: .6rem 0 .3rem; }
.shop-img { display: block; width: 100%; height: 190px; object-fit: contain; background: #fff; border: 1px solid #e1e6ee; border-radius: 10px; }
.shop-img-empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .9rem; background: #f3f5f9; }
.shop-history { margin: 0 0 .75rem; padding-left: 1.1rem; color: var(--muted); font-size: .9rem; }

/* Home search */
[hidden] { display: none !important; }
.home-search-card { padding: .9rem 1rem; }
.home-search-card input { margin-top: .3rem; }

/* ---- Home page: to do list and Find something box ---- */
.todo-card { border: 2px solid var(--gold); background: var(--gold-100); margin-bottom: 1rem; }
.todo-title { margin: 0 0 .6rem; font-size: 1.1rem; color: var(--navy-950); }
.todo-count { display: inline-block; min-width: 1.6rem; padding: .05rem .5rem; border-radius: 999px; background: var(--navy); color: #fff; font-size: .85rem; text-align: center; }
.todo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.todo-item { background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.todo-urgent { border-left: 5px solid var(--danger); }
.todo-link { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .7rem .9rem; text-decoration: none; color: var(--text); }
.todo-text { font-weight: 600; }
.todo-go { flex: none; font-weight: 700; color: var(--navy); border-bottom: 2px solid var(--gold); }
.todo-link:hover { background: #fffdf2; }
.todo-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin: 0 0 .6rem; }
.todo-head .todo-title { margin: 0; }
.todo-min { flex: none; }
.todo-card.is-min .todo-head { margin-bottom: 0; }

.home-find { position: sticky; top: var(--topbar-h, 60px); z-index: 15; margin: 0 -1rem 1rem; padding: .6rem 1rem .7rem; background: var(--bg); border-bottom: 2px solid var(--navy); }
.home-find-label { display: block; font-weight: 800; font-size: 1.15rem; margin-bottom: .3rem; color: var(--navy-950); }
.home-find input { width: 100%; box-sizing: border-box; font-size: 1.2rem; padding: .85rem 1rem; border: 3px solid var(--navy); border-radius: 12px; background: #fff; color: var(--navy-950); }
.home-find input:focus { outline: 3px solid var(--gold); outline-offset: 2px; }
.home-suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; list-style: none; margin: .25rem 0 0; padding: 0; background: #fff; border: 2px solid var(--navy); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }
.home-suggest[hidden] { display: none; }
.home-suggest li + li { border-top: 1px solid var(--line); }
.home-suggest a { display: block; padding: .65rem .9rem; text-decoration: none; color: var(--text); }
.home-suggest a:hover, .home-suggest a:focus { background: var(--gold-100); }
.home-suggest strong { display: block; color: var(--navy-950); }
.home-suggest span { font-size: .88rem; color: var(--muted); }
.todo-item { overflow: hidden; }
.todo-done { margin: 0; padding: 0 .9rem .7rem; }

/* Selfie photo */
.selfie-box { margin: .75rem 0 1rem; }
.selfie-img { display: block; width: 140px; height: 140px; border-radius: 50%; object-fit: cover; border: 3px solid var(--gold); background: #fff; }
.selfie-small { width: 72px; height: 72px; }
.selfie-empty { display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 700; color: #323e52; background: #f3e9bd; }
.selfie-small.selfie-empty { font-size: 1.6rem; }
.selfie-tiny { width: 44px; height: 44px; border-width: 2px; flex: none; }
.selfie-tiny.selfie-empty { font-size: 1.1rem; }
.staff-who { display: flex; align-items: center; gap: .6rem; }
.hero { position: relative; }
.hero-selfie { position: absolute; top: 1rem; right: 1rem; }
.hero .eyebrow, .hero h1 { padding-right: 5rem; }
.addr-suggestions { display: none; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin-top: .25rem; overflow: hidden; }
.addr-suggestions.open { display: block; }
.addr-option { display: block; width: 100%; text-align: left; padding: .75rem .9rem; background: #fff; color: #232c3b; border: 0; border-bottom: 1px solid var(--line); font: inherit; font-size: 1rem; cursor: pointer; }
.addr-option:last-child { border-bottom: 0; }
.addr-option:hover, .addr-option:focus { background: var(--gold-100); outline: 0; }

/* Schedule: who is not free (admins only) */
.not-free { margin-top: 8px; padding: 8px; border: 1px solid #b42318; border-radius: 8px; background: #fff4f2; color: #1a1a1a; font-size: 0.85rem; }
.not-free-title { font-weight: 700; color: #b42318; margin-bottom: 4px; }
.not-free-row { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }

/* Incident button on Home while clocked in */
.incident-bar { text-align: center; margin: 0 0 1.25rem; }
.incident-bar .btn-incident { display: block; width: 100%; max-width: 22rem; margin: 0 auto; background: #d4b843; color: #323e52; border: 2px solid #323e52; font-weight: 700; }

/* Shared shift card on the Schedule (several people, same site and times) */
.shift-shared { border-left-width: 4px; }
.shift-person { padding: .3rem 0; border-top: 1px solid var(--line, #e1e5ec); }
.shift-person a { font-weight: 600; text-decoration: underline; }
.shift-person .badge { display: inline-block; font-size: .7rem; margin-top: 0; }

/* Live alerts card: slim one-line strip */
#push-card { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; padding: .4rem .75rem; margin-bottom: .6rem; }
#push-card[hidden] { display: none; }
#push-card h2 { font-size: .95rem; margin: 0; flex: 1 1 auto; }
#push-card p { font-size: .8rem; margin: 0; flex: 1 1 100%; order: 3; }
#push-card p:empty { display: none; }
#push-card .btn { margin: 0; padding: .25rem .7rem; min-height: 0; font-size: .85rem; }

/* Actual clock times beside planned shift times (Schedule and My shifts) */
.clocked-late, .muted.clocked-late { color: var(--danger); font-weight: 700; }

/* ---------- Home page: fold-away sections ---------- */
.home-fold { margin: 0 0 1rem; }
.home-fold[hidden] { display: none; }
.home-fold-title { display: flex; justify-content: space-between; align-items: center; gap: 1rem; cursor: pointer; list-style: none; padding: 1rem 1.1rem; background: var(--gold-100); color: var(--navy-950); border: 2px solid var(--navy); border-radius: 12px; font-size: 1.2rem; font-weight: 800; }
.home-fold-title::-webkit-details-marker { display: none; }
.home-fold-title::after { content: "Show"; font-size: .95rem; font-weight: 700; background: var(--navy); color: #fff; padding: .25rem .7rem; border-radius: 999px; }
.home-fold[open] > .home-fold-title::after { content: "Hide"; }
.home-fold-count { margin-left: auto; font-size: .95rem; font-weight: 600; color: var(--navy-600); }
.home-fold[open] > .home-fold-title { margin-bottom: 1rem; }

/* My shifts: week / month switch and month grid (light, high contrast, works on phones) */
.view-switch { display: flex; gap: .4rem; }
.mo-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.mo-dow { font-weight: 700; text-align: center; padding: .3rem 0; color: #1c2430; font-size: .85rem; }
.mo-day { background: #fff; border: 1px solid var(--line, #cfd6e0); border-radius: 8px; padding: 3px; min-height: 76px; overflow: hidden; }
.mo-day.mo-out { background: #f1f3f7; }
.mo-day.mo-out .mo-num { color: #5b6677; }
.mo-day.is-today { border: 2px solid var(--gold, #d4b843); }
.mo-num { display: block; font-weight: 700; color: #1c2430; text-decoration: none; padding: 2px 3px; font-size: .9rem; }
.mo-chip { display: flex; align-items: center; gap: 3px; margin-top: 2px; padding: 2px 4px; border-radius: 5px; background: #eef2f9; border: 1px solid #cfd6e0; color: #1c2430; text-decoration: none; font-size: .75rem; line-height: 1.25; overflow: hidden; white-space: nowrap; }
.mo-chip .mo-time { font-weight: 700; }
.mo-chip .mo-text { overflow: hidden; text-overflow: ellipsis; }
.mo-chip.mo-open { background: var(--gold-100, #fff4cc); }
.mo-chip.mo-ph { background: #fff8e1; border: 1px dashed #b7791f; }
.mo-hint { margin-top: .6rem; }
@media (max-width: 700px) {
  .mo-day { min-height: 58px; }
  .mo-chip .mo-text { display: none; }
  .mo-chip.mo-ph .mo-text { display: inline; }
  .mo-chip { font-size: .7rem; padding: 2px 2px; }
}
