/* 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], input[type=number], 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: 30px; }
.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 10px; 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 { min-width: 180px; max-width: 260px; }
td.name b { 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: 90px; }
.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; }
.stamp { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; cursor: default; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tags .pill { font-size: 11px; padding: 1px 7px; }
.pill.tag-pay { background: var(--warn-soft); color: var(--warn); }
.pill.tag-unnamed { background: #ece4f3; color: #5d3f7a; }
.form-section { font-size: 15px; margin: 18px 0 10px; color: var(--muted); font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
tr.editing td { background: #fbf9f5; padding: 16px; }
.import-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.import-card { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: #fff; }
.import-card h3 { font-size: 16px; margin-bottom: 4px; }
.import-card p { margin: 0 0 10px; }
table.preview td { vertical-align: top; }
table.preview .cell-input { min-width: 150px; }
.edit-box { border-bottom: 1px solid var(--line); background: #fbf9f5; }
.edit-title { font-size: 18px; margin-bottom: 12px; }
tr.is-editing td { background: #eef3ee !important; }
td.email { max-width: 190px; overflow-wrap: break-word; }
.pill.tag-close { background: #e4ecf6; color: #2d5384; }
.closeout ol.steps { padding-left: 20px; margin: 14px 0 0; }
.closeout ol.steps li { margin-bottom: 18px; }
label.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; }

/* Shipping labels: sheets drawn at real size (inches); printed with no page margins. */
.label-sheets { display: flex; flex-direction: column; align-items: center; gap: 24px; margin-top: 10px; }
.label-sheet { position: relative; width: 8.5in; height: 11in; background: #fff; box-shadow: var(--shadow); border: 1px solid var(--line); overflow: hidden; }
.label { position: absolute; box-sizing: border-box; padding: 0.12in 0.18in; display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden; outline: 1px dashed #e3dccf; border-radius: 0.1in; font-family: Arial, Helvetica, sans-serif; color: #000; }
.label.empty { background: repeating-linear-gradient(45deg, #faf8f4, #faf8f4 6px, #f2eee6 6px, #f2eee6 12px); }
.label-addr div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.label-note { color: #444; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sheet-sm .label { padding: 0.06in 0.12in; } .sheet-sm .label-addr { font-size: 8pt; line-height: 1.15; } .sheet-sm .label-note { font-size: 6pt; -webkit-line-clamp: 1; }
.sheet-md .label-addr { font-size: 11pt; line-height: 1.25; } .sheet-md .label-note { font-size: 7.5pt; }
.sheet-lg .label-addr { font-size: 13pt; line-height: 1.3; } .sheet-lg .label-note { font-size: 8.5pt; }
.sheet-sm .label.tight .label-addr { font-size: 7pt; } .sheet-md .label.tight .label-addr { font-size: 9pt; } .sheet-lg .label.tight .label-addr { font-size: 11pt; }
@media print {
  @page { size: letter; margin: 0; }
  body.labels-mode { background: #fff; margin: 0; }
  body.labels-mode .topbar, body.labels-mode .no-print, body.labels-mode .toast { display: none !important; }
  body.labels-mode .page { padding: 0; margin: 0; max-width: none; }
  body.labels-mode .label-sheets { display: block; margin: 0; gap: 0; }
  body.labels-mode .label-sheet { box-shadow: none; border: none; page-break-after: always; break-after: page; margin: 0; }
  body.labels-mode .label-sheet:last-child { page-break-after: auto; break-after: auto; }
  body.labels-mode .label { outline: none; }
  body.labels-mode .label.empty { background: none; }
}
.label-controls { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-end; }
.label-controls select { width: auto; max-width: 100%; }
.from-head { font-size: 0.7em; text-transform: uppercase; letter-spacing: 0.08em; color: #555; margin-bottom: 0.05in; }
.label.return { justify-content: center; }
.label-from { font-size: 7pt; line-height: 1.2; color: #222; margin-bottom: 0.06in; }
.label-from div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.label.has-from .label-addr { padding-left: 0.5in; }
.sheet-sm .label-from { font-size: 5pt; margin-bottom: 0.02in; } .sheet-sm .label.has-from .label-addr { padding-left: 0.2in; }
.sheet-sm .label.has-from .label-note { display: none; }
.sheet-lg .label-from { font-size: 8.5pt; }
/* Plain paper: dashed cut lines that also print. */
.label-sheets.plain .label { outline: none; border: 1.5px dashed #9a9086; border-radius: 0; padding: 0.25in 0.3in; }
.label-sheets.plain .label.empty { border-color: #e3dccf; }
.label-sheets.plain .label-addr { font-size: 14pt; line-height: 1.3; }
.label-sheets.plain .label.return .label-addr { font-size: 12pt; }
.label-sheets.plain .label-note { font-size: 9pt; }
@media print { body.labels-mode .label-sheets.plain .label { border: 1.5px dashed #777; } body.labels-mode .label-sheets.plain .label.empty { border: none; } }
