/* Papa Joe's Operations — portal styles
   Brand: cream paper, forest green, oxblood for the one dominant action, gold as a quiet accent.
   Serif for the things that carry the name (titles, departments); sans for the work. */

:root {
  --cream: #f5efe4;
  --cream-2: #ebe1d1;
  --white: #fffdf8;
  --forest: #0d2b23;
  --forest-2: #153b31;
  --forest-3: #1d4a3d;
  --oxblood: #68242d;
  --oxblood-2: #7d2f39;
  --gold: #c9aa70;
  --gold-2: #f1e6cf;
  --ink: #191b18;
  --ink-2: #4a4d47;
  --muted: #686b63;
  --line: rgba(25, 27, 24, .14);
  --line-2: rgba(25, 27, 24, .08);
  --ok: #2f6b4f; --ok-2: #e2ede6;
  --warn: #8d6a1e; --warn-2: #f3e8cf;
  --stop: #8e2f2a; --stop-2: #f3dfdc;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Baskerville, Georgia, serif;
  --sans: "Segoe UI Variable Text", "Segoe UI", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --rail: 240px;
  --r: 4px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sans); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--cream); -webkit-font-smoothing: antialiased; }
a { color: var(--oxblood); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
h1 { font: 400 30px/1.1 var(--serif); letter-spacing: -.01em; }
h2 { font: 600 19px/1.2 var(--serif); }
h3 { font: 650 14px/1.3 var(--sans); }
p { margin: 0 0 .75em; max-width: 68ch; }
:focus-visible { outline: 3px solid #d9a42c; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
[hidden] { display: none !important; }

/* ---------- Sign-in ---------- */
.gate { min-height: 100dvh; display: grid; grid-template-columns: 1.1fr 1fr; }
.gate-visual { position: relative; background: var(--forest) url("/images/deli-hero-v2.webp") center/cover no-repeat; color: var(--cream); display: flex; flex-direction: column; justify-content: space-between; padding: 40px; }
.gate-visual::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(13,43,35,.55), rgba(13,43,35,.25) 45%, rgba(13,43,35,.85)); }
.gate-visual > * { position: relative; }
.gate-visual .logo { width: 220px; filter: invert(1) brightness(1.2) sepia(.25); }
.gate-visual .tag { font: 400 34px/1.15 var(--serif); max-width: 14ch; color: var(--cream); }
.gate-visual .tag small { display: block; font: 400 14px/1.5 var(--sans); color: rgba(245,239,228,.8); margin-top: 12px; max-width: 34ch; }
.gate-form { display: grid; place-items: center; padding: 40px 24px; }
.gate-card { width: 100%; max-width: 380px; }
.gate-card .logo-small { width: 170px; margin-bottom: 26px; display: none; }
.gate-card h1 { margin-bottom: 4px; }
.gate-card .sub { color: var(--muted); margin-bottom: 22px; }

/* ---------- Frame ---------- */
.frame { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100dvh; }
.rail { background: var(--forest); color: #d9d4c7; padding: 22px 14px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; }
.rail .logo { width: 150px; margin: 0 10px 22px; filter: invert(1) brightness(1.2) sepia(.25); }
.rail nav { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }
.rail .group { margin: 12px 10px 4px; font-size: 11px; letter-spacing: .06em; color: var(--gold); }
.rail nav button { background: none; border: 0; text-align: left; color: #cfc9bb; padding: 8px 10px; border-radius: var(--r); cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rail nav button:hover { background: var(--forest-2); color: #fff; }
.rail nav button[aria-current="page"] { background: var(--cream); color: var(--forest); font-weight: 600; }
.rail nav button .soon { font-size: 11px; color: #8c9a93; }
.rail .who { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255,255,255,.12); font-size: 13px; color: #a9b3ac; }
.rail .who strong { color: #fff; display: block; }
.rail .who button { background: none; border: 0; padding: 6px 0 0; color: var(--gold); cursor: pointer; }

.main { padding: 30px 36px 100px; min-width: 0; }
.topline { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.topline .sub { color: var(--muted); margin-top: 4px; }
.topline .site { display: flex; gap: 8px; align-items: center; color: var(--ink-2); }
.topline .site select { width: auto; }

/* ---------- Components ---------- */
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; }
.stack > * + * { margin-top: 14px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.serif { font-family: var(--serif); }
.btn { border: 1px solid var(--line); background: var(--white); border-radius: var(--r); padding: 8px 14px; cursor: pointer; font-weight: 600; }
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--oxblood); border-color: var(--oxblood); color: #fff; }
.btn.primary:hover { background: var(--oxblood-2); }
.btn.forest { background: var(--forest); border-color: var(--forest); color: #fff; }
.btn.danger { background: var(--stop); border-color: var(--stop); color: #fff; }
.btn.quiet { border-color: transparent; background: transparent; color: var(--oxblood); padding-left: 6px; padding-right: 6px; }
.btn:disabled { opacity: .5; cursor: default; }
label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 4px; }
.field { margin-bottom: 12px; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="datetime-local"], input[type="number"], input[type="url"], select, textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
textarea { min-height: 96px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; }
.inline-form { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); align-items: end; }
.inline-form .full { grid-column: 1 / -1; }
details.panel > summary { cursor: pointer; font-weight: 600; list-style: none; }
details.panel > summary::before { content: "+ "; color: var(--oxblood); }
details.panel[open] > summary::before { content: "– "; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; cursor: pointer; color: var(--ink-2); margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--oxblood); border-color: var(--oxblood); font-weight: 600; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 12px 0; border-top: 1px solid var(--line-2); }
.list li:first-child { border-top: 0; padding-top: 0; }
.list .title { font-weight: 600; }
.list .meta { color: var(--muted); font-size: 13px; margin-top: 2px; }

.tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--ok-2); color: var(--ok); font-weight: 600; white-space: nowrap; }
.tag.warn { background: var(--warn-2); color: var(--warn); }
.tag.stop { background: var(--stop-2); color: var(--stop); }
.tag.plain { background: var(--cream-2); color: var(--ink-2); }
.tag.gold { background: var(--gold-2); color: #7a5a14; }
.notice { border-left: 3px solid var(--gold); background: var(--gold-2); padding: 10px 14px; border-radius: 0 var(--r) var(--r) 0; }
.notice.stop { border-color: var(--stop); background: var(--stop-2); }
.notice.ok { border-color: var(--ok); background: var(--ok-2); }
.error { color: var(--stop); font-size: 13px; margin-top: 6px; }
.empty { color: var(--muted); padding: 16px 0; }

/* Today board */
.ledger { border-top: 2px solid var(--forest); }
.ledger-row { display: grid; grid-template-columns: 170px 1fr; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line-2); }
.ledger-row h3 { color: var(--forest); font-family: var(--serif); font-weight: 600; font-size: 17px; }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--muted); vertical-align: middle; }
.status-dot.up { background: var(--ok); } .status-dot.degraded { background: var(--warn); } .status-dot.down { background: var(--stop); }

/* Departments */
.dept-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.dept-tile { position: relative; display: block; min-height: 150px; border-radius: var(--r); overflow: hidden; background: var(--forest-2); color: var(--cream); text-decoration: none; border: 0; text-align: left; cursor: pointer; padding: 0; }
.dept-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dept-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(13,43,35,.1), rgba(13,43,35,.85)); }
.dept-tile .t { position: absolute; left: 14px; right: 14px; bottom: 12px; z-index: 1; font: 500 20px/1.15 var(--serif); }
.dept-tile .t small { display: block; font: 400 12px/1.3 var(--sans); color: rgba(245,239,228,.8); margin-top: 3px; }
.dept-tile.mine { outline: 2px solid var(--gold); outline-offset: -2px; }
.dept-hero { position: relative; min-height: 190px; border-radius: var(--r); overflow: hidden; background: var(--forest); color: var(--cream); margin-bottom: 20px; display: flex; align-items: flex-end; padding: 22px 26px; }
.dept-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dept-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(13,43,35,.92), rgba(13,43,35,.55) 55%, rgba(13,43,35,.25)); }
.dept-hero > div { position: relative; z-index: 1; }
.dept-hero h1 { color: var(--cream); font-size: 36px; }
.dept-hero p { color: rgba(245,239,228,.85); margin: 6px 0 0; }

/* Catering board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.board .col { background: var(--cream-2); border-radius: var(--r); padding: 10px; min-height: 120px; }
.board .col h3 { font-size: 13px; color: var(--ink-2); margin-bottom: 8px; display: flex; justify-content: space-between; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; margin-bottom: 8px; }
.card .meta { color: var(--muted); font-size: 12px; }

/* Project center */
.bar { height: 6px; background: var(--cream-2); border-radius: 3px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--forest); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-weight: 600; color: var(--ink-2); padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.data td { padding: 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.data td input, table.data td select { padding: 5px 7px; }

/* Website content */
.web-item { display: grid; grid-template-columns: 110px 1fr auto; gap: 14px; align-items: start; }
.web-item img, .web-item .noimg { width: 110px; height: 76px; object-fit: cover; border-radius: var(--r); background: var(--cream-2); }

/* Mobile */
@media (max-width: 900px) {
  .gate { grid-template-columns: 1fr; }
  .gate-visual { display: none; }
  .gate-card .logo-small { display: block; }
  .frame { grid-template-columns: 1fr; }
  .rail { position: fixed; bottom: 0; left: 0; right: 0; top: auto; height: auto; padding: 6px 4px; flex-direction: row; z-index: 5; }
  .rail .logo, .rail .who, .rail .group { display: none; }
  .rail nav { flex-direction: row; overflow-x: auto; width: 100%; }
  .rail nav button { flex: 0 0 auto; padding: 8px 10px; font-size: 13px; }
  .rail nav button .soon { display: none; }
  .main { padding: 18px 16px 90px; }
  .ledger-row { grid-template-columns: 1fr; gap: 6px; }
  .web-item { grid-template-columns: 1fr; }
}
.password-control{display:flex;align-items:stretch;border:1px solid #cbd7cf;border-radius:9px;background:white;overflow:hidden}.password-control:focus-within{outline:2px solid #bf9a50;outline-offset:2px}.password-control input{min-width:0;flex:1;border:0!important;border-radius:0!important;box-shadow:none!important;outline:none!important;margin:0!important}.password-control button{flex-shrink:0;border:0;border-left:1px solid #e4ebe6;padding:0 14px;background:#f3f6f2;color:#174c3e;font:inherit;font-size:13px;cursor:pointer;min-width:66px}.password-control button:hover{background:#e6efe7}.password-control button:focus-visible{outline:2px solid #276858;outline-offset:-3px}.password-check{font-size:13px;line-height:1.5;color:#687970;margin:7px 0 18px}.password-check span{display:inline-flex;justify-content:center;width:19px;font-weight:700}.password-check.met{color:#226e46}.password-check.mismatch{color:#99452e}

/* Shared multi-location assignment controls */
.location-picker{min-width:250px;max-width:720px;margin:12px 0}.location-picker-options{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:8px;padding:12px 0}.location-picker>small{display:block}.location-picker .scope-check{margin:0;align-items:center}.location-picker input{width:auto}.person-record [data-person-locations]{margin:20px 0 28px}
[data-invitation-screen] .inline-form{display:grid;grid-template-columns:1fr;align-items:start;max-width:720px;gap:12px}[data-invitation-screen] .inline-form>.location-picker{width:100%;max-width:none;margin:0}[data-invitation-screen] [data-send]{justify-self:start;width:auto}
