/* Lithomatic — additions for the Laravel app: form errors, the enquiry
   page, and the staff dashboard. Everything else comes from site.css. */

/* --- Form errors ------------------------------------------------------ */
.field__error {
  margin-top: 7px; font-family: var(--mono); font-size: 10px; letter-spacing: .08em;
  color: var(--red);
}
.field__error + .field__error { margin-top: 3px; }
.field:has(> .field__error) .input,
.field:has(> .field__error) .select,
.field:has(> .field__error) .textarea { border-color: var(--red); }
.reveal[hidden] { display: none; }
.stamp-lines + .field__error { margin-top: 10px; }
.alert--ok { background: var(--navy); border-left-color: var(--navy-d); }

/* --- Contact page: sent state ----------------------------------------- */
.sent-note {
  border: 1px solid var(--line-2); background: var(--white); border-left: 4px solid var(--red);
  padding: 22px 24px; margin-top: 32px;
}
.sent-note__t { font-size: 17px; font-weight: 600; letter-spacing: -.015em; }
.sent-note p { margin-top: 8px; font-size: 14px; line-height: 1.6; color: var(--body); }
.sent-note b { font-family: var(--mono); font-weight: 500; color: var(--red); }

/* --- Staff dashboard -------------------------------------------------- */
.admin { padding-top: 30px; padding-bottom: 72px; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.admin-head h1 { margin-top: 12px; font-size: 32px; font-weight: 600; letter-spacing: -.03em; line-height: 1.05; }
.admin-head .lede { margin-top: 10px; font-size: 14.5px; max-width: 60ch; }

.flash {
  margin-top: 22px; padding: 12px 16px; border: 1px solid var(--line-2); background: var(--white);
  border-left: 4px solid var(--navy); font-size: 13.5px; font-weight: 500;
}

.stats { margin-top: 28px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { background: var(--white); border: 1px solid var(--line-2); padding: 20px 22px; display: block; color: inherit; }
.stat:hover { border-color: var(--navy); }
.stat__k { font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.stat__v { margin-top: 10px; font-size: 34px; font-weight: 600; letter-spacing: -.03em; line-height: 1; }
.stat__v--alert { color: var(--red); }
.stat__d { margin-top: 8px; font-size: 12.5px; color: var(--faint); }

.filter-tabs { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-tabs a {
  border: 1px solid var(--line-3); padding: 9px 14px; font-size: 13px; font-weight: 600;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--body); white-space: nowrap;
}
.filter-tabs a:hover { border-color: var(--navy); color: var(--navy); }
.filter-tabs a.is-on { background: var(--navy); border-color: var(--navy); color: var(--cream); }
.filter-tabs a b { font-weight: 400; opacity: .7; margin-left: 6px; }
.filter-form { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filter-form .field { flex: 1; min-width: 200px; }
.filter-form .input, .filter-form .select { margin-top: 0; padding: 10px 12px; font-size: 13.5px; }
.filter-form .btn { padding: 11px 16px; }

.dtable .ref { font-family: var(--mono); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.dtable .ref a { color: var(--ink); border-bottom: 1px solid var(--line-3); }
.dtable .who { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.dtable .who small { display: block; margin-top: 3px; font-size: 12.5px; font-weight: 400; color: var(--body); }
.dtable tr.is-unread td { background: rgba(220, 62, 55, .035); }
.dtable tr.is-unread .ref::before {
  content: ""; display: inline-block; width: 7px; height: 7px; background: var(--red); margin-right: 8px; vertical-align: middle;
}
.dtable .muted { color: var(--faint); font-size: 12.5px; }
.pager { margin-top: 18px; display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: 13px; color: var(--muted); }
.pager nav { display: flex; gap: 6px; }
.pager a, .pager span.cur {
  display: inline-block; min-width: 34px; text-align: center; padding: 7px 10px; border: 1px solid var(--line-3);
  font-family: var(--mono); font-size: 11px;
}
.pager span.cur { background: var(--navy); border-color: var(--navy); color: var(--cream); }
.pager a:hover { border-color: var(--navy); }

.timeline { display: flex; flex-direction: column; }
.tl { display: grid; grid-template-columns: 22px 1fr; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.tl:last-child { border-bottom: 0; }
.tl__dot { width: 9px; height: 9px; margin-top: 5px; background: var(--line-4); justify-self: center; }
.tl--reply .tl__dot { background: var(--navy); }
.tl--status .tl__dot { background: var(--red); }
.tl__meta { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.tl__body { margin-top: 6px; font-size: 14px; line-height: 1.6; white-space: pre-line; }
.tl--status .tl__body { font-size: 13px; color: var(--body); }

.spec-table { width: 100%; border-collapse: collapse; }
.spec-table th {
  text-align: left; width: 34%; padding: 11px 0; padding-right: 16px; vertical-align: top;
  font-family: var(--mono); font-size: 10px; font-weight: 400; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.spec-table td { padding: 11px 0; font-size: 14px; line-height: 1.55; border-bottom: 1px solid var(--line); white-space: pre-line; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: 0; }

.attach { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.attach:last-child { border-bottom: 0; }
.attach a { font-weight: 600; border-bottom: 1px solid var(--line-3); }
.attach span { font-family: var(--mono); font-size: 10.5px; color: var(--faint); white-space: nowrap; }

.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; font-size: 13.5px; }
.bar__track { grid-column: 1 / -1; height: 6px; background: var(--line); }
.bar__fill { height: 100%; background: var(--navy); }
.bar__n { font-family: var(--mono); font-size: 12px; }

.admin-form .field + .field { margin-top: 16px; }
.admin-form .btn { margin-top: 16px; }
.login-error { margin-top: 12px; }

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  .tl { grid-template-columns: 16px 1fr; }
}

/* The invoice on an order's page: a line-item table with live totals */
.inv-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 18px 24px; background: var(--cream); border-bottom: 1px solid var(--line); }
.inv-actions form { margin: 0; }
.inv-lines { width: 100%; border-collapse: collapse; margin-top: 4px; }
/* Side-by-side fields inside the invoice form sit on one line */
.admin-form .field-row .field + .field { margin-top: 0; }
.inv-lines th { text-align: left; padding: 0 8px 8px 0; font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.inv-lines td { padding: 0 8px 10px 0; vertical-align: top; }
.inv-lines td:last-child, .inv-lines th:last-child { padding-right: 0; width: 28px; }
.inv-lines .input { margin-top: 0; }
.inv-lines__n { width: 96px; }
.inv-lines__num { text-align: right; }
.inv-lines__amt { padding-top: 13px !important; text-align: right; white-space: nowrap; font-family: var(--mono); font-size: 13px; color: var(--ink); width: 110px; }
.inv-lines__x { width: 28px; height: 28px; margin-top: 8px; border: 1px solid var(--line-3); border-radius: 50%; background: transparent; color: var(--faint); font-size: 16px; line-height: 1; cursor: pointer; }
.inv-lines__x:hover { border-color: var(--red); color: var(--red); }
.inv-totals { margin-top: 20px; margin-left: auto; max-width: 320px; }
.inv-totals div { display: flex; justify-content: space-between; gap: 18px; padding: 7px 0; font-size: 13.5px; color: var(--body); border-bottom: 1px solid var(--line); }
.inv-totals b { font-family: var(--mono); font-size: 13px; color: var(--ink); }
.inv-totals__grand { border-bottom: 0 !important; border-top: 2px solid var(--navy); margin-top: 4px; padding-top: 10px !important; font-weight: 600; color: var(--ink) !important; }
.inv-totals__grand b { font-size: 16px; }
.tl--invoice .tl__dot { background: var(--red); }
@media (max-width: 760px) { .inv-lines__n { width: 70px; } .inv-lines__amt { display: none; } }
