/* Stanley Brown's Workbench */
:root {
  --paper: #f7f3ec;
  --card: #fffdf9;
  --ink: #2b2520;
  --muted: #6f655c;
  --line: #e4dccf;
  --brand: #3e5641;      /* workshop green */
  --brand-dark: #2c3e2e;
  --accent: #a0623a;     /* saddle brown, for Stanley */
  --accent-soft: #f3e6da;
  --ok: #2f7a4a;
  --ok-soft: #e3f1e7;
  --warn: #8a5a00;
  --warn-soft: #fbf0d9;
  --danger: #a23b2f;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(43, 37, 32, 0.06), 0 4px 14px rgba(43, 37, 32, 0.06);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 15px/1.5 var(--sans); }
a { color: var(--brand); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 0.5em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- buttons and inputs ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--brand); background: var(--brand); color: #fff;
  padding: 8px 14px; border-radius: 8px; font: 600 14px var(--sans); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--brand-dark); }
.btn.secondary { background: var(--card); color: var(--brand); }
.btn.secondary:hover { background: #eef1ec; }
.btn.danger { background: var(--card); color: var(--danger); border-color: #d9b3ad; }
.btn.danger:hover { background: #fbeeec; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.link { background: none; border: none; color: var(--brand); padding: 4px 6px; font-weight: 500; }
.btn.link:hover { text-decoration: underline; background: none; }
.btn:disabled { opacity: 0.5; cursor: default; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=tel], select, textarea {
  font: 14px var(--sans); color: var(--ink); background: #fff; border: 1px solid #cfc5b6; border-radius: 7px; padding: 7px 9px; width: 100%;
}
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid #8fa98f; outline-offset: 1px; }
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; vertical-align: middle; }

/* ---------- landing ---------- */
.landing { min-height: 100vh; display: flex; flex-direction: column; }
.landing main { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center;
  max-width: 1040px; margin: 0 auto; padding: 56px 28px; width: 100%; }
.landing .eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 14px; }
.landing h1 { font-size: 46px; margin-bottom: 18px; }
.landing .lede { font-size: 18px; color: var(--muted); max-width: 30em; margin: 0 0 28px; }
.landing .btn { padding: 11px 22px; font-size: 15px; }
.landing footer { text-align: center; padding: 24px; color: var(--muted); font-size: 13px; }
.photos { position: relative; aspect-ratio: 4 / 5; }
.photos figure { margin: 0; position: absolute; background: #fff; padding: 10px 10px 34px; box-shadow: var(--shadow); border-radius: 4px; }
.photos figure img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 2px; background: var(--accent-soft); }
.photos figcaption { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; font: italic 14px var(--serif); color: var(--muted); }
.photos .p1 { left: 0; top: 7%; width: 64%; height: 80%; transform: rotate(-2.5deg); z-index: 2; }
.photos .p3 { right: 0; top: 0; width: 42%; height: 43%; transform: rotate(5deg); z-index: 3; }
.photos .p2 { right: 3%; bottom: 0; width: 42%; height: 43%; transform: rotate(-3deg); z-index: 3; }
.photos.single .p1 { inset: 0; transform: rotate(-1.5deg); }
@media (max-width: 760px) {
  .landing main { grid-template-columns: 1fr; gap: 28px; padding: 32px 20px; }
  .landing h1 { font-size: 34px; }
  .photos { max-width: 420px; width: 100%; margin: 0 auto; order: -1; }
}

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 32px; width: 100%; max-width: 380px; }
.login-card .mark { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; text-decoration: none; color: var(--ink); }
.login-card .mark img { width: 34px; height: 34px; }
.login-card .mark span { font: 600 18px var(--serif); }
.login-card .field { margin-bottom: 14px; }
.login-card .btn { width: 100%; justify-content: center; padding: 10px; margin-top: 6px; }
.notice { border-radius: 8px; padding: 10px 12px; margin-bottom: 16px; font-size: 14px; }
.notice.error { background: #fbeeec; color: var(--danger); border: 1px solid #efcfca; }
.notice.info { background: var(--warn-soft); color: var(--warn); border: 1px solid #efdcb4; }

/* ---------- app shell ---------- */
.topbar { background: var(--brand-dark); color: #fff; }
.topbar .inner { max-width: 1240px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 18px; }
.topbar a { color: #fff; text-decoration: none; }
.topbar .home { display: flex; align-items: center; gap: 10px; font: 600 17px var(--serif); }
.topbar .home img { width: 28px; height: 28px; background: #fff; border-radius: 50%; padding: 3px; }
.topbar .crumb { opacity: 0.85; font-size: 14px; }
.topbar .crumb::before { content: "/"; margin-right: 14px; opacity: 0.5; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 14px; opacity: 0.9; }
.topbar .signout { font-size: 14px; border: 1px solid rgba(255,255,255,0.35); padding: 5px 11px; border-radius: 7px; }
.topbar .signout:hover { background: rgba(255,255,255,0.1); }
.page { max-width: 1240px; margin: 0 auto; padding: 28px 24px 60px; }

/* ---------- home tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; margin-top: 22px; }
.tile { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px; box-shadow: var(--shadow);
  text-decoration: none; color: var(--ink); transition: transform 0.12s, border-color 0.12s; }
a.tile:hover { transform: translateY(-2px); border-color: #b9c7b9; }
.tile .icon { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: #e7ede6; margin-bottom: 14px; }
.tile .icon svg { width: 24px; height: 24px; stroke: var(--brand); }
.tile h2 { font-size: 20px; margin-bottom: 6px; }
.tile p { margin: 0; color: var(--muted); font-size: 14px; }
.tile.soon { opacity: 0.6; box-shadow: none; border-style: dashed; }
.tile .tag { display: inline-block; margin-top: 12px; font-size: 12px; font-weight: 600; color: var(--muted); }

/* ---------- tracker ---------- */
.banner { background: var(--warn-soft); border: 1px solid #efdcb4; color: var(--warn); border-radius: 8px; padding: 9px 14px; font-size: 13.5px; margin-bottom: 22px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar h1 { margin: 0; font-size: 28px; }
.toolbar .spacer { flex: 1; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 22px; }
.panel > header { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel > header h2 { margin: 0; font-size: 19px; }
.panel > header .spacer { flex: 1; }
.panel .body { padding: 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; background: #faf7f2; white-space: nowrap; }
th.c, td.c { text-align: center; }
tbody tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #f6f3ed; }
tr.withdrawn td { color: #9a9086; }
tr.withdrawn td.name { text-decoration: line-through; }
td.name { white-space: nowrap; }
tr.done td { background: #f4f9f5; }
.empty { padding: 34px 18px; text-align: center; color: var(--muted); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #ece7df; color: var(--muted); white-space: nowrap; }
.pill.TNCC { background: #e4ecf6; color: #2d5384; }
.pill.ENPC { background: var(--accent-soft); color: #87502c; }
.pill.Open { background: var(--ok-soft); color: var(--ok); }
.pill.Full { background: var(--warn-soft); color: var(--warn); }
.pill.Completed { background: #e7ede6; color: var(--brand); }
.pill.Cancelled { background: #fbeeec; color: var(--danger); }
.progress { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.progress .bar { flex: 1; height: 7px; background: #ece7df; border-radius: 4px; overflow: hidden; }
.progress .bar span { display: block; height: 100%; background: var(--ok); }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.grid .wide { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; margin-top: 16px; align-items: center; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: none; padding: 8px 14px; font: 600 14px var(--sans); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }
.back { display: inline-block; margin-bottom: 10px; font-size: 14px; text-decoration: none; }
.back:hover { text-decoration: underline; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted); font-size: 14px; }
.facts b { color: var(--ink); font-weight: 600; }
.menu { position: relative; }
.menu .items { position: absolute; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); min-width: 220px; z-index: 20; padding: 6px; }
.menu .items a { display: block; padding: 8px 10px; border-radius: 6px; text-decoration: none; color: var(--ink); font-size: 14px; }
.menu .items a:hover { background: #f3efe8; }
.cell-input { border: 1px solid transparent !important; background: transparent !important; padding: 4px 6px !important; min-width: 120px; }
.cell-input:hover { border-color: #ddd3c5 !important; background: #fff !important; }
.cell-input:focus { border-color: #8fa98f !important; background: #fff !important; }
select.cell-input { min-width: 110px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; z-index: 50; box-shadow: var(--shadow); }
.toast.error { background: var(--danger); }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.filters { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.filters label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; margin: 0; }
