/* ============================================================
   Bullfrog Staff + Manager — styles
   Mobile-first, iOS-inspired: frosted bars, soft squircle cards,
   spring press states, hairline separators.
   ============================================================ */

* { box-sizing: border-box; }

:root {
  /* Default theme — Midnight (brand monochrome) */
  --bg: #0a0a0a;
  --bg-2: #1a1a1a;
  --pin-grad-1: #1c1c1e;
  --pin-grad-2: #0a0a0a;
  --topbar-bg: #0a0a0a;
  --topbar-glass: rgba(10, 10, 10, 0.82);
  --topbar-ink: #faf7f2;
  --pill-bg: #faf7f2;
  --pill-ink: #0a0a0a;
  --body-bg: #f2f2f7;            /* iOS system grouped background */
  --card: #ffffff;
  --ink: #111113;
  --ink-2: #48484a;
  --muted: #8e8e93;              /* iOS secondary label */
  --cream: #faf7f2;
  --green: #248e19;
  --green-dk: #1a6a13;
  --red: #c41e2a;
  --amber: #f59e0b;
  --blue: #2563eb;
  --line: rgba(0, 0, 0, 0.08);   /* hairline */
  --chip-bg: #f2f2f7;
  --action: var(--green);
  --action-dk: var(--green-dk);
  --primary-grad-1: #2c2c2e;
  --primary-grad-2: #0a0a0a;
  --primary-ink: var(--cream);
  --jamie-bg: #fdecee;
  --jamie-border: rgba(196, 30, 42, 0.18);
  --jamie-accent: var(--red);
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.05);
  --shadow-raised: 0 2px 6px rgba(0,0,0,0.06), 0 16px 40px rgba(0,0,0,0.10);
  --spring: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* THEME: Brewery Green */
[data-theme="green"] {
  --bg: #082408;
  --bg-2: #133a0f;
  --pin-grad-1: #165210;
  --pin-grad-2: #082408;
  --topbar-bg: #0e3b0c;
  --topbar-glass: rgba(14, 59, 12, 0.85);
  --topbar-ink: #faf7f2;
  --pill-bg: #faf7f2;
  --pill-ink: #0e3b0c;
  --body-bg: #f3f6ee;
  --chip-bg: #eef3e6;
  --primary-grad-1: #2aa01e;
  --primary-grad-2: #1a6a13;
  --primary-ink: var(--cream);
  --jamie-bg: #e8f3dd;
  --jamie-border: rgba(26, 106, 19, 0.25);
  --jamie-accent: #1a6a13;
  --action: #248e19;
  --action-dk: #1a6a13;
}

/* THEME: Brewery Red */
[data-theme="red"] {
  --bg: #2a0508;
  --bg-2: #4a0a10;
  --pin-grad-1: #6b0c15;
  --pin-grad-2: #2a0508;
  --topbar-bg: #4a0a10;
  --topbar-glass: rgba(74, 10, 16, 0.85);
  --topbar-ink: #faf7f2;
  --pill-bg: #faf7f2;
  --pill-ink: #4a0a10;
  --body-bg: #faf4f4;
  --chip-bg: #f6ebeb;
  --primary-grad-1: #d5303c;
  --primary-grad-2: #7a0e18;
  --primary-ink: var(--cream);
  --jamie-bg: #f1ecdf;
  --jamie-border: rgba(122, 14, 24, 0.22);
  --jamie-accent: #7a0e18;
  --action: #c41e2a;
  --action-dk: #7a0e18;
}

/* THEME: Classic Cream */
[data-theme="cream"] {
  --bg: #faf7f2;
  --bg-2: #f1ebde;
  --pin-grad-1: #f4eee1;
  --pin-grad-2: #faf7f2;
  --topbar-bg: #faf7f2;
  --topbar-glass: rgba(250, 247, 242, 0.85);
  --topbar-ink: #0a0a0a;
  --pill-bg: #0a0a0a;
  --pill-ink: #faf7f2;
  --body-bg: #fdfaf3;
  --line: rgba(90, 74, 40, 0.12);
  --chip-bg: #f4eee1;
  --primary-grad-1: #2c2c2e;
  --primary-grad-2: #0a0a0a;
  --primary-ink: var(--cream);
  --jamie-bg: #ffffff;
  --jamie-border: rgba(160, 130, 60, 0.3);
  --jamie-accent: #c41e2a;
  --action: #248e19;
  --action-dk: #1a6a13;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  background: var(--body-bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.hidden { display: none !important; }

/* ----------------- PIN GATE ----------------- */
.pin-gate {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 30%, var(--pin-grad-1) 0%, var(--pin-grad-2) 78%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.pin-card {
  padding: 12px 8px;
  width: 100%;
  max-width: 340px;
  text-align: center;
}
.pin-logo-img {
  width: 210px;
  max-width: 78%;
  height: auto;
  display: block;
  margin: 0 auto 18px;
  object-fit: contain;
}
.pin-card .muted {
  margin: 0 0 18px;
  color: var(--topbar-ink);
  opacity: 0.55;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 600;
}
.error { color: #ff8585; margin: 8px 0 0; font-size: 14px; }

/* ----- Individual sign-in (Schedule-app accounts) ----- */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 auto 6px;
  max-width: 300px;
}
.login-form input {
  font-size: 16px;
  padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--topbar-ink);
  font-family: inherit;
  outline: none;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.login-form input::placeholder { color: var(--topbar-ink); opacity: 0.4; }
.login-form input:focus {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.12);
}
.login-btn {
  background: var(--pill-bg);
  color: var(--pill-ink);
  border: none;
  margin-top: 2px;
}
.login-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--topbar-ink);
  opacity: 0.45;
}
.setpass-title {
  margin: 0 0 2px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--topbar-ink);
}
.gate-toggle {
  background: none;
  border: none;
  color: var(--topbar-ink);
  opacity: 0.6;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-top: 20px;
  padding: 8px 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.gate-toggle:active { opacity: 1; }

/* ----- iOS-style PIN pad ----- */
.pin-pad { user-select: none; }
.pin-dots {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 4px 0 26px;
  min-height: 14px;
}
.pin-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1.5px solid var(--topbar-ink);
  opacity: 0.45;
  transition: all 0.15s var(--spring);
}
.pin-dot.filled {
  background: var(--topbar-ink);
  opacity: 1;
  transform: scale(1.08);
}
.pin-keys {
  display: grid;
  grid-template-columns: repeat(3, 76px);
  gap: 14px 22px;
  justify-content: center;
}
.pin-key {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.10);
  color: var(--topbar-ink);
  font-size: 30px;
  font-weight: 400;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.15s var(--spring);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.pin-key:active {
  background: rgba(255, 255, 255, 0.32);
  transform: scale(0.94);
  transition-duration: 0s;
}
.pin-key-del { font-size: 24px; }
.pin-key-spacer { display: block; }

/* Light variant — manager gate sits on a white card */
.pin-pad-light .pin-dot { border-color: var(--ink); }
.pin-pad-light .pin-dot.filled { background: var(--ink); }
.pin-pad-light .pin-key {
  background: var(--chip-bg);
  color: var(--ink);
}
.pin-pad-light .pin-key:active { background: rgba(0, 0, 0, 0.14); }

@keyframes pin-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(9px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}
.pin-dots.shake { animation: pin-shake 0.35s ease; }

/* ----------------- APP SHELL ----------------- */
.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 0 88px;
  min-height: 100vh;
  background: var(--body-bg);
}

.topbar {
  position: sticky;
  top: 0;
  background: var(--topbar-glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  color: var(--topbar-ink);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 0.5px solid rgba(120, 120, 128, 0.25);
  z-index: 10;
  padding-top: max(12px, env(safe-area-inset-top));
}
.topbar h1 {
  margin: 0;
  font-size: 17px;
  text-align: center;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--topbar-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Sub-pages: title only, no logo — keeps it on one clean line */
.topbar:not(.is-home) .topbar-logo { display: none; }
.topbar-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
}
.topbar-logo {
  height: 28px;
  width: auto;
  object-fit: contain;
}
.topbar.is-home .topbar-logo { height: 40px; }
.topbar.is-home #pageTitle { display: none; }
.back-btn {
  background: none;
  border: none;
  color: var(--topbar-ink);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 10px;
  transition: opacity 0.15s ease;
}
.back-btn:active { opacity: 0.5; }
.topbar-status {
  text-align: right;
  line-height: 1.2;
  padding-left: 8px;
}
.topbar-status-date {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--topbar-ink);
}
.topbar-status-next {
  font-size: 11px;
  color: var(--topbar-ink);
  opacity: 0.65;
  margin-top: 2px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

main { padding: 16px; }

/* Views slide in gently on navigation */
@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.view { animation: view-in 0.3s var(--spring); }

.welcome {
  font-size: 18px;
  margin: 4px 0 16px;
  color: var(--ink-2);
}
.view-intro {
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-2);
  margin: 2px 4px 16px;
}

/* ----------------- GREETING (home header) ----------------- */
.greeting { margin: 6px 4px 16px; }
.greeting-word {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.1;
}
.greeting-sub {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 3px;
}

/* ----------------- GRID OF TILES ----------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.grid-small { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .grid-small { grid-template-columns: repeat(4, 1fr); }
}

.tile {
  background: var(--card);
  border-radius: 22px;
  padding: 18px 12px 16px;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  border: 0.5px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 112px;
  transition: transform 0.18s var(--spring), box-shadow 0.18s ease;
}
.tile:active { transform: scale(0.96); box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.tile-emoji {
  font-size: 26px;
  line-height: 1;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--chip-bg);
  border-radius: 16px;
}
.tile-label {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.tile-primary {
  background: linear-gradient(145deg, var(--primary-grad-1) 0%, var(--primary-grad-2) 100%);
  color: var(--primary-ink);
  border: none;
}
.tile-primary .tile-label { color: var(--primary-ink); }
.tile-primary .tile-emoji { background: rgba(255, 255, 255, 0.14); }
.tile-warn { background: #fffaf0; }
.tile-warn .tile-emoji { background: #fdf0d2; }
.tile-jamie { background: var(--jamie-bg); border-color: var(--jamie-border); }
.tile-jamie .tile-emoji { background: rgba(255, 255, 255, 0.6); }

/* ----------------- FORMS ----------------- */
.row-form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.row-form input {
  flex: 1;
  padding: 12px 14px;
  border: 0.5px solid var(--line);
  border-radius: 12px;
  font-size: 16px;
  background: var(--card);
  font-family: inherit;
  outline: none;
}
.row-form input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--action) 25%, transparent); }

.stack-form {
  background: var(--card);
  border-radius: 18px;
  padding: 16px;
  border: 0.5px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}
.stack-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink-2);
}
.stack-form input,
.stack-form select,
.stack-form textarea {
  font-size: 16px;
  padding: 11px 13px;
  border: 0.5px solid var(--line);
  border-radius: 12px;
  background: var(--body-bg);
  font-family: inherit;
  outline: none;
  color: var(--ink);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.stack-form select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238e8e93' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
}
.stack-form input:focus,
.stack-form select:focus,
.stack-form textarea:focus {
  border-color: var(--action);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--action) 22%, transparent);
  background: var(--card);
}
.stack-form textarea { resize: vertical; }

.btn {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 13px 18px;
  border-radius: 14px;
  border: 0.5px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s var(--spring), filter 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--action);
  color: white;
}
.btn-primary:active { background: var(--action-dk); }
.btn-ghost {
  background: transparent;
  border: 0.5px solid var(--line);
  color: var(--ink-2);
}
.btn-small { padding: 7px 13px; font-size: 13px; border-radius: 10px; }

/* ----------------- LISTS ----------------- */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.list li {
  background: var(--card);
  border: 0.5px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  box-shadow: var(--shadow);
}
.list li.done .item-text { text-decoration: line-through; color: var(--muted); }
.item-check {
  width: 24px; height: 24px;
  border: 1.5px solid rgba(0, 0, 0, 0.2);
  border-radius: 50%;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  font-size: 13px;
  transition: all 0.18s var(--spring);
}
.item-check.checked {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
.item-text { flex: 1; word-break: break-word; font-size: 15px; line-height: 1.4; }
.item-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.item-del {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 8px;
  transition: color 0.15s ease;
}
.item-del:active { color: var(--red); }

.status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.status-new { background: #dbeafe; color: #1d4ed8; }
.status-in-progress { background: #fef3c7; color: #92400e; }
.status-fixed { background: #dcfce7; color: #166534; }
.status-needs-owner-approval { background: #fee2e2; color: #991b1b; }

.section-h {
  margin: 26px 4px 10px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
}
.filter-row select {
  padding: 8px 12px;
  border: 0.5px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  background: var(--card);
  font-family: inherit;
  color: var(--ink);
}

/* ----------------- MANAGER DASHBOARD STATS ----------------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
@media (min-width: 600px) { .stat-row { grid-template-columns: repeat(4, 1fr); } }
.stat-card {
  background: var(--card);
  border: 0.5px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.18s var(--spring);
}
.stat-card:active { transform: scale(0.96); }
.stat-value {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 3px;
  letter-spacing: -0.01em;
}
.stat-warn .stat-value { color: #b45309; }
.stat-warn { background: #fffaf0; }
.stat-info .stat-value { color: var(--blue); }
.stat-alert .stat-value { color: var(--red); }
.stat-alert { background: #fef5f5; }

/* ----------------- FOOD GUIDE ----------------- */
.vendor-card {
  background: var(--card);
  border: 0.5px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.vendor-card h3 { margin: 0 0 6px; font-size: 17px; letter-spacing: -0.02em; }
.vendor-meta { color: var(--ink-2); font-size: 14px; margin-bottom: 10px; }
.vendor-card ul { margin: 0 0 10px; padding-left: 20px; font-size: 14px; }
.vendor-card .notes {
  background: #fef9c3;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
}

/* ----------------- UTIL ----------------- */
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--topbar-glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid rgba(120, 120, 128, 0.25);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 5;
}
.footer .btn-ghost { color: var(--topbar-ink); border-color: transparent; background: rgba(127,127,127,0.14); }
.footer .muted { color: var(--topbar-ink); opacity: 0.55; }

code {
  background: rgba(120, 120, 128, 0.14);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 13px;
}

.config-warning {
  background: #fee2e2;
  border: 0.5px solid #fca5a5;
  color: #991b1b;
  padding: 12px 14px;
  border-radius: 14px;
  margin: 12px 0;
  font-size: 14px;
}

/* ----------------- DATE PICKER ----------------- */
.date-picker {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
  margin-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.date-picker::-webkit-scrollbar { display: none; }
.date-pill {
  flex: 0 0 auto;
  background: var(--card);
  border: 0.5px solid var(--line);
  border-radius: 14px;
  padding: 9px 12px;
  min-width: 62px;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  transition: transform 0.18s var(--spring), background 0.18s ease;
  box-shadow: var(--shadow);
}
.date-pill:active { transform: scale(0.95); }
.date-pill-day { font-weight: 600; font-size: 12px; color: var(--muted); }
.date-pill-num {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 3px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.date-pill-today {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--action);
  letter-spacing: 0.5px;
  margin-top: 3px;
}
.date-pill.active {
  background: var(--bg);
  color: var(--cream);
  border-color: var(--bg);
}
.date-pill.active .date-pill-day { color: var(--cream); opacity: 0.7; }
.date-pill.active .date-pill-today { color: var(--cream); opacity: 0.7; }

/* ----------------- WIDGETS (staff home) ----------------- */
.widget {
  background: var(--card);
  border: 0.5px solid var(--line);
  border-radius: 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.widget-header {
  padding: 11px 15px;
  border-bottom: 0.5px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.widget-title {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.widget-meta { font-size: 11px; color: var(--muted); }
.widget-body { padding: 13px 15px; }
.widget-body-flush { padding: 4px 6px; }
.widget-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
@media (min-width: 600px) { .widget-row { grid-template-columns: 1fr 1fr; } }

.widget-notes {
  background: #fffbeb;
  border-color: rgba(217, 119, 6, 0.22);
}
.widget-notes .widget-header { border-bottom-color: rgba(217, 119, 6, 0.18); }
.widget-notes .widget-body {
  font-size: 15px;
  line-height: 1.5;
}
/* pre-wrap belongs on the content itself (.ann-body), never on flush
   containers — template-literal indentation would render as blank space */
.widget-body-flush { white-space: normal; }

/* Today's Tasks — staff-checkable checklist */
.task-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  text-align: left;
  padding: 11px 10px;
  cursor: pointer;
  border-radius: 12px;
  transition: background 0.15s ease;
}
.task-row + .task-row { border-top: 0.5px solid var(--line); }
.task-row:active { background: var(--chip-bg); }
.task-check {
  width: 24px;
  height: 24px;
  border: 1.5px solid rgba(0, 0, 0, 0.22);
  border-radius: 50%;
  flex-shrink: 0;
  transition: all 0.18s var(--spring);
}
.task-row.checking .task-check {
  background: var(--green);
  border-color: var(--green);
  box-shadow: inset 0 0 0 2px white;
}
.task-row.checking .task-text {
  text-decoration: line-through;
  color: var(--muted);
}
.task-text { flex: 1; line-height: 1.35; }

/* ----- My Shifts widget ----- */
.shift-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  font-size: 14px;
}
.shift-row + .shift-row { border-top: 0.5px solid var(--line); }
.shift-when {
  font-weight: 700;
  letter-spacing: -0.01em;
  min-width: 86px;
  color: var(--ink);
}
.shift-time { flex: 1; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.shift-role {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--ink-2);
}
.shift-today { background: color-mix(in srgb, var(--action) 8%, transparent); border-radius: 10px; }
.shift-today .shift-when { color: var(--action); }
.widget-meta a { color: var(--action); text-decoration: none; font-weight: 600; }

/* ----- Announcements ----- */
#announceWidget.widget-notes .widget-body-flush { padding: 4px 6px; }
.ann { padding: 11px 10px; }
.ann + .ann { border-top: 0.5px solid rgba(217, 119, 6, 0.18); }
.ann-body { font-size: 15px; line-height: 1.45; white-space: pre-wrap; }
.ann-unread .ann-body { font-weight: 600; }
.ann-unread { position: relative; padding-left: 18px; }
.ann-unread::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 18px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
}
.ann-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 7px;
  font-size: 12px;
  color: var(--muted);
}
.ann-acked { color: var(--green); font-weight: 700; }
.ann-need { font-style: italic; }
.linklike {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 12px;
  color: var(--blue);
  cursor: pointer;
}
.readers { margin-top: 6px; padding: 8px 10px; background: var(--chip-bg); border-radius: 10px; }

/* ----- Checklists ----- */
.cl-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 11px 12px;
  text-decoration: none;
  color: var(--ink);
}
.cl-summary + .cl-summary { border-top: 0.5px solid var(--line); }
.cl-name { font-weight: 600; font-size: 14px; }
.cl-count { font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.cl-count.cl-complete { color: var(--green); }
.cl-bar {
  grid-column: 1 / -1;
  height: 5px;
  border-radius: 3px;
  background: var(--chip-bg);
  overflow: hidden;
}
.cl-bar-fill {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--action);
  transition: width 0.3s var(--spring);
}
.task-check-on {
  background: var(--green);
  border-color: var(--green) !important;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.task-done .task-text { color: var(--muted); }
.task-by {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.cl-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.cl-controls select {
  padding: 7px 10px;
  border: 0.5px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  background: var(--card);
  font-family: inherit;
  color: var(--ink);
}
.dow-chips { display: flex; gap: 4px; }
.dow-chip {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0.5px solid var(--line);
  background: var(--card);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
}
.dow-chip.on {
  background: var(--action);
  border-color: var(--action);
  color: white;
}
.cl-items li { box-shadow: none; border-radius: 10px; padding: 9px 12px; }

/* ----- Photos ----- */
.photo-preview {
  position: relative;
  width: 96px;
}
.photo-preview img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 12px;
  border: 0.5px solid var(--line);
}
.photo-clear {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--ink);
  color: white;
  font-size: 12px;
  cursor: pointer;
}
.thumb {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 10px;
  border: 0.5px solid var(--line);
  flex-shrink: 0;
  cursor: zoom-in;
}

/* ----- Links: manager tier divider ----- */
.links-mgr-divider {
  grid-column: 1 / -1;
  margin: 14px 4px 2px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ----- On Tap ----- */
.tap-num {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--cream);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* ----- Install tip ----- */
.install-tip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--card);
  border-bottom: 0.5px solid var(--line);
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
}
.install-tip span { flex: 1; }
.install-close {
  background: rgba(120, 120, 128, 0.14);
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  flex-shrink: 0;
}

/* ----- Misc form bits ----- */
.check-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  font-weight: 500 !important;
}
.check-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--action);
}
.check-row.small { font-size: 12px; color: var(--muted); }
.search-input {
  flex: 1;
  padding: 10px 14px;
  border: 0.5px solid var(--line);
  border-radius: 12px;
  font-size: 15px;
  background: var(--card);
  font-family: inherit;
  outline: none;
}
.mgr-login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mgr-login-form input {
  font-size: 16px;
  padding: 12px 14px;
  border: 0.5px solid var(--line);
  border-radius: 12px;
  background: var(--body-bg);
  font-family: inherit;
  outline: none;
  color: var(--ink);
}
.mgr-login-form input:focus {
  border-color: var(--action);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--action) 22%, transparent);
  background: var(--card);
}

.cal-item {
  padding: 9px 12px;
  border-left: 3px solid var(--action);
  background: var(--chip-bg);
  border-radius: 10px;
  margin-bottom: 8px;
}
.cal-item:last-child { margin-bottom: 0; }
.cal-item-time {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.cal-item-title {
  font-size: 14px;
  color: var(--ink);
  margin-top: 2px;
  letter-spacing: -0.01em;
}
.cal-item.res { border-left-color: #c41e2a; background: #fdf3f3; }

.grid-actions {
  margin-top: 8px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 600px) { .grid-actions { grid-template-columns: repeat(3, 1fr); } }

/* ----------------- MANAGER PIN GATE ----------------- */
.manager-gate {
  text-align: center;
  background: var(--card);
  border-radius: 24px;
  padding: 32px 24px 28px;
  margin: 24px auto;
  max-width: 380px;
  box-shadow: var(--shadow-raised);
  border: 0.5px solid var(--line);
}
.manager-gate-icon { font-size: 42px; margin-bottom: 8px; }
.manager-gate h2 {
  margin: 0 0 4px;
  font-size: 21px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.manager-gate .muted { margin: 0 0 20px; font-size: 14px; }
.lock-mgr-btn {
  display: block;
  margin: 30px auto 0;
}

/* ----------------- IMAGE FULLSCREEN VIEWER ----------------- */
.img-viewer {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}
.img-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
}
.img-viewer img {
  position: relative;
  max-width: 96vw;
  max-height: 96vh;
  object-fit: contain;
  border-radius: 6px;
}
.img-viewer-close {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: none;
  border-radius: 999px;
  width: 38px;
  height: 38px;
  font-size: 18px;
  cursor: pointer;
}

/* ----------------- THEME PICKER ----------------- */
.theme-sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.theme-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  animation: fade-in 0.2s ease-out;
}
.theme-sheet-panel {
  position: relative;
  background: var(--body-bg);
  width: 100%;
  max-width: 720px;
  border-radius: 24px 24px 0 0;
  padding: 14px 18px 28px;
  padding-bottom: max(28px, env(safe-area-inset-bottom));
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.25);
  animation: slide-up 0.32s var(--spring);
}
.theme-sheet-panel::before {
  content: "";
  display: block;
  width: 36px;
  height: 5px;
  border-radius: 3px;
  background: rgba(120, 120, 128, 0.3);
  margin: 0 auto 12px;
}
@keyframes fade-in { from { opacity: 0 } to { opacity: 1 } }
@keyframes slide-up { from { transform: translateY(40px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }

.theme-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.theme-sheet-header h3 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.theme-close {
  background: rgba(120, 120, 128, 0.14);
  border: none;
  font-size: 14px;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--ink-2);
}
.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 600px) { .theme-grid { grid-template-columns: repeat(4, 1fr); } }

.theme-card {
  border: 2px solid transparent;
  border-radius: 18px;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  background: var(--card);
  text-align: left;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform 0.18s var(--spring);
}
.theme-card:active { transform: scale(0.97); }
.theme-card.active { border-color: var(--action); }
.theme-card-swatch {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}
.theme-card-swatch img {
  max-width: 72%;
  max-height: 100%;
  object-fit: contain;
}
.theme-card-body {
  padding: 10px 12px;
  background: var(--card);
  border-top: 0.5px solid var(--line);
}
.theme-card-name {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.theme-card-current {
  font-size: 10px;
  color: var(--action);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.theme-card-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
