/* NUAMAH CLASSIC — the tailor's bench
   Indigo thread, tape-measure yellow, chalk, pin red, thread green, seam grey.
   One family (Archivo): expanded width for headings, names and measurements; normal width for reading. */

:root {
  --indigo: #1f2a44;
  --indigo-2: #2d3b5f;
  --indigo-soft: #e8ebf2;
  --tape: #f3c316;
  --tape-deep: #d9a900;
  --chalk: #f4f5f7;
  --paper: #ffffff;
  --pin: #b83227;
  --pin-soft: #f8e5e3;
  --thread: #2e7a4e;
  --thread-soft: #e2f1e8;
  --amber: #8a5a00;
  --amber-soft: #fbf0d4;
  --seam: #dadde3;
  --ink: #1f2a44;
  --muted: #5d6473;

  --wide: 125%;
  --r-sm: 6px;
  --r-md: 10px;

  font-family: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); line-height: 1.5; }
a { color: var(--indigo); text-underline-offset: 3px; }
h1, h2, h3 { font-stretch: var(--wide); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; font-weight: 750; }
h2 { font-size: 1.125rem; font-weight: 700; }
h3 { font-size: .9375rem; font-weight: 650; color: var(--muted); }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .8125rem; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--tape); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- top bar ---------- */
.bar { background: var(--indigo); color: #fff; }
.bar-inner { max-width: 1040px; margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; gap: 28px; }
.wordmark { color: #fff; text-decoration: none; font-stretch: var(--wide); font-weight: 800; font-size: 1.125rem; letter-spacing: .01em; white-space: nowrap; }
.wordmark span { font-weight: inherit; }
.tabs { display: flex; gap: 4px; flex: 1; }
.tabs a { color: #c9d0e0; text-decoration: none; font-weight: 600; padding: 18px 4px 16px; margin: 0 8px; border-bottom: 3px solid transparent; }
.tabs a:hover { color: #fff; }
.tabs a.active { color: #fff; border-bottom-color: var(--tape); }
.tabs svg { display: none; }
.signout { margin-left: auto; background: none; border: 0; color: #c9d0e0; font: inherit; font-weight: 600; cursor: pointer; padding: 6px 0; }
.signout:hover { color: #fff; text-decoration: underline; }

main { max-width: 1040px; margin: 0 auto; padding: 28px 20px 80px; }

/* ---------- page head & sections ---------- */
.back { display: inline-block; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .875rem; margin-bottom: 10px; }
.back:hover { color: var(--indigo); }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.head .sub { color: var(--muted); margin-top: 6px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.block { margin-bottom: 36px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.block-head .count { color: var(--muted); font-weight: 500; font-stretch: 100%; margin-left: 6px; }
.panel { background: var(--paper); border: 1px solid var(--seam); border-radius: var(--r-md); padding: 20px; }
.empty { color: var(--muted); padding: 18px 0; border-top: 1px solid var(--seam); }
.empty a { font-weight: 600; }

/* ---------- dashboard summary ---------- */
.summary { font-stretch: var(--wide); font-size: 1.5rem; font-weight: 650; line-height: 1.3; max-width: 30ch; margin: 4px 0 32px; }
.summary .bad { color: var(--pin); }
.summary .calm { color: var(--muted); font-weight: 500; }

/* ---------- order & customer rows ---------- */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--seam); }
.rows li { border-bottom: 1px solid var(--seam); }
.row { display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; align-items: center; padding: 12px 4px; color: inherit; text-decoration: none; }
.row:hover { background: var(--paper); }
.row.no-date { grid-template-columns: 1fr auto; }
.due { text-align: center; line-height: 1; border-right: 1px solid var(--seam); padding-right: 14px; }
.due .d { display: block; font-stretch: var(--wide); font-size: 1.5rem; font-weight: 750; }
.due .m { display: block; font-size: .75rem; color: var(--muted); margin-top: 3px; }
.due.late .d, .due.late .m { color: var(--pin); }
.due.none .d { color: var(--seam); }
.what { min-width: 0; }
.what .t, .what .s { display: block; }
.what .t { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.what .s { color: var(--muted); font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: .875rem; }
.initial { width: 40px; height: 40px; border-radius: 50%; background: var(--indigo-soft); color: var(--indigo); display: grid; place-items: center; font-weight: 750; font-stretch: var(--wide); }
.row.person { grid-template-columns: 40px 1fr auto; }

/* status: a coloured thread dot + word */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: .8125rem; font-weight: 600; white-space: nowrap; }
.status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.s-pending { color: var(--amber); }
.s-in_progress { color: var(--indigo-2); }
.s-ready { color: var(--thread); }
.s-delivered { color: var(--muted); }
.s-cancelled { color: var(--pin); }
.owed { color: var(--pin); font-weight: 650; }
.paid { color: var(--thread); font-weight: 650; }
.late-text { color: var(--pin); font-weight: 650; }

/* ---------- buttons ---------- */
.btn, button.btn {
  font: inherit; font-weight: 650; font-size: .9375rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--r-sm); border: 1.5px solid var(--indigo);
  background: var(--indigo); color: #fff; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--indigo-2); border-color: var(--indigo-2); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.quiet { background: transparent; color: var(--indigo); border-color: var(--seam); }
.btn.quiet:hover { border-color: var(--indigo); background: var(--paper); }
.btn.wa { background: #1c8a4a; border-color: #1c8a4a; }
.btn.wa:hover { background: #16743d; border-color: #16743d; }
.btn.small { padding: 7px 12px; font-size: .8125rem; }
.link-danger { background: none; border: 0; padding: 0; font: inherit; color: var(--pin); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.danger-zone { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--seam); }

/* ---------- segmented filter ---------- */
.seg { display: inline-flex; flex-wrap: wrap; gap: 0; border: 1.5px solid var(--seam); border-radius: var(--r-sm); overflow: hidden; margin-bottom: 20px; background: var(--paper); }
.seg a { padding: 8px 14px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .875rem; border-right: 1px solid var(--seam); }
.seg a:last-child { border-right: 0; }
.seg a.on { background: var(--indigo); color: #fff; }

/* ---------- forms ---------- */
.form { display: grid; gap: 28px; }
.form fieldset { border: 0; margin: 0; padding: 0; }
.form legend { font-stretch: var(--wide); font-weight: 700; font-size: 1.0625rem; margin-bottom: 12px; padding: 0; }
.fields { display: grid; gap: 14px 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.fields.tight { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.field.full { grid-column: 1 / -1; }
label { display: block; font-weight: 600; font-size: .875rem; margin-bottom: 6px; }
label .opt { color: var(--muted); font-weight: 400; }
input, select, textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  padding: 10px 12px; background: var(--paper); border: 1.5px solid var(--seam); border-radius: var(--r-sm);
}
input:hover, select:hover, textarea:hover { border-color: #b9bfca; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px var(--tape); }
textarea { resize: vertical; }
.unit { position: relative; }
.unit input { padding-right: 34px; }
.unit::after { content: 'in'; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .875rem; pointer-events: none; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.search { max-width: 460px; margin-bottom: 18px; }
.search input { padding: 12px 14px; font-size: 1.0625rem; }

/* ---------- facts (definition grids) ---------- */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px 24px; margin: 0; }
.facts dt { font-size: .8125rem; color: var(--muted); margin-bottom: 2px; }
.facts dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.facts dd.none { color: var(--muted); font-weight: 400; }

/* ---------- money ---------- */
.money { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 4px 40px; margin: 0 0 16px; }
.money dt { font-size: .8125rem; color: var(--muted); }
.money dd { margin: 0; font-stretch: var(--wide); font-size: 1.25rem; font-weight: 700; }
table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: .8125rem; padding: 8px 8px 8px 0; border-bottom: 1.5px solid var(--seam); }
td { padding: 10px 8px 10px 0; border-bottom: 1px solid var(--seam); vertical-align: middle; }
td.num, th.num { text-align: right; }
.pay-form { display: grid; grid-template-columns: 1.1fr 1fr 1fr 1.4fr auto; gap: 10px; align-items: end; margin-top: 16px; }

/* ---------- the tape measure ---------- */
.tape-wrap { margin-bottom: 8px; }
.tape-label { font-size: .8125rem; font-weight: 600; color: var(--muted); margin: 14px 0 6px; }
.tape {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  background-color: var(--tape);
  border-radius: 4px;
  box-shadow: inset 0 -2px 0 var(--tape-deep);
}
/* tick marks: small every 8px, tall every 40px, along the top edge of each cell */
.tape > div, .tape-ticks {
  background-image:
    repeating-linear-gradient(90deg, rgba(31,42,68,.55) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(90deg, rgba(31,42,68,.85) 0 1.5px, transparent 1.5px 40px);
  background-size: 100% 7px, 100% 13px;
  background-repeat: no-repeat;
}
.tape > div { padding: 20px 10px 10px; border-left: 1px solid rgba(31,42,68,.25); min-width: 0; }
.tape > div:first-child { border-left: 0; }
.tape .n { font-stretch: var(--wide); font-size: 1.625rem; font-weight: 800; line-height: 1; color: var(--indigo); }
.tape .n small { font-size: .875rem; font-weight: 600; margin-left: 1px; }
.tape .n.none { color: rgba(31,42,68,.35); font-weight: 500; }
.tape .k { font-size: .75rem; font-weight: 600; color: rgba(31,42,68,.8); margin-top: 6px; line-height: 1.2; }
.history { margin-top: 18px; }
.history summary { cursor: pointer; font-weight: 600; color: var(--indigo); }
.scroll-x { overflow-x: auto; }

/* ---------- photos ---------- */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.photo { position: relative; margin: 0; border-radius: var(--r-sm); overflow: hidden; background: var(--indigo-soft); aspect-ratio: 1; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.photo figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; font-size: .75rem; font-weight: 600; color: #fff; background: linear-gradient(transparent, rgba(20,26,42,.75)); display: flex; justify-content: space-between; align-items: center; }
.photo button { background: rgba(255,255,255,.92); color: var(--pin); border: 0; border-radius: 4px; font: inherit; font-size: .75rem; font-weight: 700; padding: 3px 7px; cursor: pointer; }
.upload { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.upload select { width: auto; }
.lightbox { position: fixed; inset: 0; background: rgba(15,20,33,.9); display: flex; align-items: center; justify-content: center; z-index: 100; cursor: zoom-out; }
.lightbox img { max-width: 94vw; max-height: 90vh; border-radius: 4px; }

/* ---------- toast ---------- */
#toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--indigo); color: #fff; padding: 12px 18px; border-radius: var(--r-sm); font-weight: 600; z-index: 200; max-width: calc(100vw - 32px); box-shadow: 0 8px 24px rgba(15,20,33,.25); border-left: 4px solid var(--tape); }
#toast.error { border-left-color: var(--pin); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--indigo); }
.login .band { margin: 0 0 28px; }
.login-box { width: 100%; max-width: 380px; }
.login-box .wordmark { display: block; font-size: 1.75rem; margin-bottom: 6px; }
.login-box form { background: var(--paper); border-radius: var(--r-md); padding: 24px; display: grid; gap: 14px; }
.login-box .btn { width: 100%; margin-top: 4px; }
.login-box .hint { color: #c9d0e0; margin: 0 0 16px; }
.error-text { color: var(--pin); font-size: .875rem; font-weight: 600; min-height: 1.3em; margin: 0; }

/* ---------- job card ---------- */
.jobcard { background: var(--paper); border: 1px solid var(--seam); border-radius: var(--r-md); padding: 28px; }
.jobcard-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; border-bottom: 2px solid var(--indigo); padding-bottom: 12px; margin-bottom: 18px; }
.jobcard-top .wordmark { color: var(--indigo); }
.jobcard .facts { margin-bottom: 20px; }
.jobcard .photos { grid-template-columns: repeat(3, 1fr); margin-top: 10px; }

/* ---------- phones ---------- */
@media (max-width: 720px) {
  main { padding: 20px 16px 104px; }
  .bar-inner { height: 54px; padding: 0 16px; }
  h1 { font-size: 1.5rem; }
  .summary { font-size: 1.25rem; }
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; gap: 0;
    background: var(--paper); border-top: 1px solid var(--seam);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabs a { flex: 1; margin: 0; padding: 8px 0 10px; color: var(--muted); border-bottom: 0; border-top: 3px solid transparent;
            display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .75rem; }
  .tabs a.active { color: var(--indigo); border-top-color: var(--tape); }
  .tabs svg { display: block; width: 22px; height: 22px; }
  .tape { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tape > div:nth-child(4) { border-left: 0; }
  .tape > div:nth-child(n+4) { border-top: 1px solid rgba(31,42,68,.25); }
  .pay-form { grid-template-columns: 1fr 1fr; }
  .pay-form .field-note { grid-column: 1 / -1; }
  .pay-form .btn { grid-column: 1 / -1; }
  .money { gap: 4px 24px; }
  .money dd { font-size: 1.0625rem; }
  .hide-sm { display: none; }
  #toast { bottom: 84px; }
  .head .actions { width: 100%; }
}

@media print {
  .bar, .tabs, .no-print, #toast { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .jobcard { border: 0; padding: 0; }
  .tape { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}


/* ---------- Adinkra stamped band (design B) ----------
   Adinkrahene (concentric circles: greatness) and Nkyimu (ruled cross: skill, precision),
   printed flat in gold like a stamped cloth strip. Header and sign-in only. */
.band { height: 34px; background: url('/adinkra-band.svg') repeat-x center; background-size: 360px 34px; }
.bar .band { max-width: 1040px; margin: 4px auto 10px; padding: 0 20px; background-origin: content-box; background-clip: content-box; }
.jobcard .band { background-image: url('/adinkra-band.svg'); filter: none; margin-bottom: 12px; }
.jobcard-band { background: var(--indigo); padding: 8px 10px; border-radius: 4px; margin-bottom: 16px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.jobcard-band .band { margin: 0; }
@media (max-width: 720px) {
  .bar .band { height: 26px; background-size: 275px 26px; padding: 0 16px; margin-bottom: 8px; }
}
