@font-face { font-family: "Lato"; font-weight: 700; font-display: swap; src: url("fonts/lato-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 900; font-display: swap; src: url("fonts/lato-latin-900-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-display: swap; src: url("fonts/source-sans-3-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 600; font-display: swap; src: url("fonts/source-sans-3-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 700; font-display: swap; src: url("fonts/source-sans-3-latin-700-normal.woff2") format("woff2"); }

/* Lewis JCC brand palette (Brand Guidelines 2026) */
:root {
  --navy: #012855;
  --azure: #3a5a75;
  --cyan: #06baff;
  --pastel: #a5c9f1;

  --bg: #f4f7fb;
  --surface: #ffffff;
  --text: #0f1f33;
  --muted: #4f6478;
  --border: #d9e3ee;
  --accent: #012855;
  --accent-text: #ffffff;
  --accent-soft: #e8f1fb;
  --link: #0a5aa8;
  --header-bg: #012855;
  --header-text: #ffffff;
  --danger: #b42318;
  --ok: #18794e;
  --warn: #a15c07;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(1, 40, 85, 0.06), 0 2px 6px rgba(1, 40, 85, 0.06);
  --font-body: "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Lato", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-family: var(--font-body);
  font-size: 17px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #021428;
    --surface: #072340;
    --text: #e8f1fb;
    --muted: #a5c9f1;
    --border: #1c3a5c;
    --accent: #06baff;
    --accent-text: #012855;
    --accent-soft: #0b2f55;
    --link: #6fd3ff;
    --header-bg: #011b3a;
    --danger: #ff8a80;
    --ok: #5fd39b;
    --warn: #f0b45a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--link); }
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; color: var(--accent); line-height: 1.2; margin: 0 0 0.5rem; }
h1 { font-weight: 900; }
@media (prefers-color-scheme: dark) { h1, h2, h3 { color: var(--text); } }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
[hidden] { display: none !important; }

.test-banner { background: #fff4d6; font-weight: 600; color: #6b4700; text-align: center; font-size: 0.85rem; padding: 4px 16px; }
@media (prefers-color-scheme: dark) { .test-banner { background: #3a2c08; color: #f5d78a; } }

.topbar {
  display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 64px;
  background: var(--header-bg); color: var(--header-text); border-bottom: 4px solid var(--cyan);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--header-text); white-space: nowrap; }
.brand img { height: 36px; width: auto; display: block; }
.brand span { font-family: var(--font-head); font-weight: 700; font-size: 1rem; padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, 0.35); }
nav { display: flex; gap: 2px; flex: 1; }
nav a { text-decoration: none; color: rgba(255, 255, 255, 0.82); padding: 6px 10px; border-radius: 6px; white-space: nowrap; font-weight: 600; }
nav a:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
nav a.active { background: rgba(6, 186, 255, 0.22); color: #fff; box-shadow: inset 0 -2px 0 var(--cyan); }
.user { display: flex; align-items: center; gap: 12px; color: rgba(255, 255, 255, 0.82); font-size: 0.9rem; }
.user button.link { color: var(--pastel); }
.user form { margin: 0; }
.menu-toggle { display: none; }

main#view { max-width: 1120px; margin: 0 auto; padding: 24px; outline: none; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); padding: 8px 14px; border-radius: 8px; font: inherit; cursor: pointer; text-decoration: none;
}
.btn { font-weight: 600; }
.btn:hover { border-color: var(--azure); }
.btn.primary:hover { background: var(--azure); border-color: var(--azure); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: 0.6; cursor: default; }
button.link { background: none; border: none; color: var(--link); cursor: pointer; font: inherit; padding: 0; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.stat { font-family: var(--font-head); font-size: 2rem; font-weight: 900; color: var(--accent); }
.announcement { border-left: 4px solid var(--cyan); }
.announcement .body p:last-child { margin-bottom: 0; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.tabs { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.tabs button { border: none; background: var(--surface); padding: 7px 14px; font: inherit; color: var(--muted); cursor: pointer; }
.tabs button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.toolbar input[type="search"] { width: 260px; }
.toolbar select { width: auto; }

table.list { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table.list th, table.list td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.list th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); background: var(--bg); }
table.list tbody tr { cursor: pointer; }
table.list tbody tr:hover { background: var(--accent-soft); }
table.list th { font-family: var(--font-head); }
table.list tbody tr:last-child td { border-bottom: none; }
.overdue { color: var(--danger); font-weight: 600; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.badge.s-new { background: #e8f1fb; color: #3a5a75; }
.badge.s-progress { background: #d6f2ff; color: #012855; }
.badge.s-approval { background: #fff1d6; color: #8a4b00; }
.badge.s-done { background: #e3f5ea; color: #18794e; }
.badge.s-hold { background: #f2f4f7; color: #667085; }
.badge.s-canceled { background: #fde8e7; color: #b42318; }
@media (prefers-color-scheme: dark) {
  .badge.s-new, .badge.s-hold { background: #2a303b; color: #c4cbd6; }
  .badge.s-progress { background: #1d2a40; color: #8fbaff; }
  .badge.s-approval { background: #3a2c08; color: #f5c56b; }
  .badge.s-done { background: #12301f; color: #6fdca6; }
  .badge.s-canceled { background: #3a1513; color: #ff9b91; }
}

.empty { text-align: center; padding: 40px 16px; color: var(--muted); }

.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35); }
.drawer-panel {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(560px, 100%); background: var(--surface);
  padding: 24px; overflow-y: auto; box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
}
.drawer-close { position: absolute; right: 12px; top: 8px; border: none; background: none; font-size: 1.6rem; cursor: pointer; color: var(--muted); }
dl.meta { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 16px 0; }
dl.meta dt { color: var(--muted); }
dl.meta dd { margin: 0; }
.notes { white-space: pre-wrap; word-break: break-word; background: var(--bg); border-radius: 8px; padding: 12px; }
.comment { border-top: 1px solid var(--border); padding: 10px 0; }
.comment .who { font-weight: 600; }
.comment .text { white-space: pre-wrap; word-break: break-word; }

form.stack label { display: block; font-weight: 600; margin-bottom: 4px; }
fieldset.field { border: none; padding: 0; margin: 0; min-width: 0; }
.field .q, legend.q { display: block; font-weight: 600; margin-bottom: 4px; padding: 0; }
.req { color: var(--danger); }
.hint.pre { white-space: pre-line; font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; }
.field .hint { font-size: 0.85rem; color: var(--muted); margin: 6px 0 4px; }
.choices { display: flex; flex-direction: column; gap: 6px; }
.choices label { font-weight: 400; display: flex; gap: 8px; align-items: center; margin: 0; cursor: pointer; }
.choices input[type="radio"], .choices input[type="checkbox"] { width: auto; margin: 0; accent-color: var(--navy); }
.choices .other-text { width: auto; flex: 1; max-width: 320px; padding: 4px 8px; }
#loc-pick { flex-direction: row; gap: 20px; }
.section-title { padding-top: 12px; border-top: 1px solid var(--border); }
form.stack .hint { font-weight: 400; color: var(--muted); font-size: 0.85rem; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { font-weight: 400; display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; background: var(--surface); cursor: pointer; }
.checks input { width: auto; }
.errors { color: var(--danger); }
.errors ul { margin: 0; padding-left: 20px; }

.resource-group h2 { margin-top: 8px; }
.resource { display: flex; flex-direction: column; gap: 6px; }
.resource .kind { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.resource ul { margin: 4px 0 0; padding-left: 18px; font-size: 0.9rem; }

.cal-month h2 { position: sticky; top: 68px; background: var(--bg); padding: 8px 0; margin: 0; }
.cal-item { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.cal-item .when { color: var(--muted); font-size: 0.9rem; }
.cal-item.past { opacity: 0.55; }

.prose h2 { margin-top: 24px; }
.prose p, .prose ul { margin: 8px 0; }

.admin-section { margin-bottom: 32px; }
.edit-table { width: 100%; border-collapse: collapse; }
.edit-table td, .edit-table th { padding: 4px; text-align: left; vertical-align: top; }
.edit-table th { font-size: 0.8rem; color: var(--muted); font-weight: 600; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; z-index: 100; }

body.login { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
body.login { background: var(--navy); }
.login-card { background: var(--surface); border-radius: 14px; overflow: hidden; max-width: 420px; width: 100%; text-align: center; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3); }
.login-head { background: var(--navy); border-bottom: 4px solid var(--cyan); padding: 28px 32px 24px; }
.login-head img { width: 220px; max-width: 100%; height: auto; }
.login-body { padding: 28px 32px 32px; }
.login-card .btn { margin: 16px 0 8px; }

@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 8px; }
  .menu-toggle { display: block; margin-left: auto; border: 1px solid rgba(255,255,255,0.4); background: transparent; border-radius: 6px; padding: 4px 10px; font-size: 1.1rem; color: #fff; }
  .brand span { display: none; }
  .brand img { height: 34px; }
  nav { display: none; flex-basis: 100%; flex-direction: column; }
  nav.open { display: flex; }
  .user { flex-basis: 100%; justify-content: space-between; }
  main#view { padding: 16px; }
  .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .toolbar input[type="search"] { width: 100%; }
  table.list thead { display: none; }
  table.list, table.list tbody, table.list tr, table.list td { display: block; width: 100%; }
  table.list tr { border-bottom: 1px solid var(--border); padding: 8px 0; }
  table.list td { border: none; padding: 2px 12px; }
  dl.meta { grid-template-columns: 1fr; }
  .cal-item { grid-template-columns: 1fr; gap: 2px; }
}
