@font-face { font-family: "Archivo"; src: url("../fonts/Archivo-100_900.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("../fonts/IBMPlexMono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("../fonts/IBMPlexMono-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root { --ink: #14212d; --ink-soft: #5b6a77; --bg: #eef0f2; --line: #d3d9de; --hi: #ffd23f; --ok: #1d7f55; --bad: #c8203a; --mono: "Plex Mono", ui-monospace, monospace; --sans: "Archivo", system-ui, sans-serif; --ease: cubic-bezier(.2,.7,.2,1); }
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-family: var(--sans); font-size: 13px; background: #fff3c4; padding: 1px 5px; border-radius: 3px; }

/* login */
.login-body { min-height: 100vh; display: grid; place-items: center; background: var(--ink); padding: 20px; }
.login { width: min(380px, 100%); background: #fff; border-radius: 16px; padding: 30px 28px; box-shadow: 0 24px 60px rgba(0,0,0,.35); display: grid; gap: 14px; }
.login h1 { margin: 0; font-weight: 850; font-stretch: 118%; font-size: 30px; }
.login-brand { margin: 0; font-weight: 850; font-stretch: 118%; font-size: 18px; }
.login-brand span { font-weight: 500; font-stretch: 100%; font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-soft); margin-left: 6px; }
.login label { display: grid; gap: 4px; font-weight: 700; font-size: 14px; }
.login input { border: 2px solid var(--line); border-radius: 4px; padding: 10px 12px; }
.login input:focus { border-color: var(--ink); outline: none; box-shadow: 0 3px 0 var(--hi); }
.login button { border: 0; background: #e2482c; color: #fff; font-weight: 800; font-size: 16px; padding: 12px; border-radius: 4px; cursor: pointer; }
.login button:hover { background: #c23a20; }
.demo-creds { margin: 0; font-family: var(--sans); font-size: 13px; background: #fff7d1; border: 1.5px dashed #d6ad00; padding: 8px 10px; border-radius: 4px; }
.back { font-size: 14px; color: var(--ink-soft); }

/* shell */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #c9d3dc; padding: 24px 16px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.side-brand { color: #fff; text-decoration: none; font-weight: 850; font-stretch: 118%; font-size: 22px; display: flex; flex-direction: column; line-height: 1; padding: 0 8px; }
.side-brand span { font-weight: 500; font-stretch: 100%; font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: #8f9aa3; margin-top: 5px; }
.side nav { display: grid; gap: 2px; }
.side nav a { text-decoration: none; padding: 9px 10px; border-radius: 4px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; transition: background .2s; }
.side nav a:hover { background: rgba(255,255,255,.07); }
.side nav a[aria-current] { background: #fff; color: var(--ink); }
.badge { font-family: var(--sans); font-size: 12px; background: #fff; color: var(--ink); border-radius: 999px; padding: 0 7px; }
.side-foot { margin-top: auto; display: grid; gap: 10px; font-size: 14px; padding: 0 8px; }
.open-shop { color: #fff; font-weight: 700; text-decoration: none; }
.link-btn { background: none; border: 1px dashed #5b6a77; color: #c9d3dc; border-radius: 4px; padding: 6px 10px; cursor: pointer; width: 100%; text-align: left; }
.link-btn:hover { border-color: var(--hi); color: #fff; }
.logout { color: #8fa1b1; }

.main { padding: 28px clamp(16px, 3vw, 40px) 60px; min-width: 0; }
.main-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.main-head h1 { margin: 0; font-weight: 850; font-stretch: 118%; font-size: 32px; letter-spacing: -.02em; }
.kpis { margin: 0; display: flex; gap: 18px; font-size: 14px; color: var(--ink-soft); }
.kpis b { font-family: var(--sans); color: var(--ink); font-size: 16px; }
.intro { color: #3d4c59; max-width: 80ch; margin: 0 0 16px; }
.flash { margin: 0 0 16px; padding: 10px 14px; border-radius: 4px; font-weight: 600; animation: in .35s var(--ease); }
.flash.ok { background: #e3f4ec; color: var(--ok); border-left: 4px solid var(--ok); }
.flash.bad { background: #fde8ec; color: var(--bad); border-left: 4px solid var(--bad); }
@keyframes in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* cards + forms */
.rows { display: grid; gap: 14px; }
.row-card { background: #fff; border: 1px solid #d6dce1; border-radius: 12px; padding: 18px 20px; box-shadow: 0 1px 2px rgba(0,0,0,.04); transition: box-shadow .25s var(--ease); scroll-margin-top: 20px; }
.row-card.is-off { border-style: dashed; box-shadow: none; opacity: .75; }
.row-card.is-new { border-style: dashed; box-shadow: none; background: #fbfcfc; }
.row-card.dirty { border-color: #e2482c; box-shadow: 0 0 0 3px rgba(226,72,44,.12); }
.row-card:target { animation: flashrow 1.4s var(--ease); }
@keyframes flashrow { 0% { background: #fff6c8; } 100% { background: #fff; } }
.row-card h2 { margin: 6px 0 6px; font-size: 18px; font-weight: 800; }
.row-card h2:first-of-type { margin-top: 0; }
.new-t { margin: 0 0 10px; font-weight: 800; }
.g { display: grid; gap: 12px 14px; margin-bottom: 8px; }
.g-mat, .g-fin { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }
.span-full { display: grid; gap: 4px; font-size: 13px; font-weight: 700; color: var(--ink-soft); margin: 6px 0 10px; }
.row-card label { display: grid; gap: 4px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.row-card input:not([type=checkbox]), .row-card select { width: 100%; border: 1.5px solid var(--line); border-radius: 4px; padding: 8px 10px; background: #fff; color: var(--ink); font-weight: 500; font-size: 15px; }
.row-card input.big { font-weight: 700; font-size: 18px; }
.row-card input:focus, .row-card select:focus { border-color: var(--ink); outline: none; box-shadow: 0 2px 0 var(--hi); }
.row-card label.check { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--ink); font-weight: 600; align-self: end; padding-bottom: 8px; }
.row-card label.check input { width: 17px; height: 17px; accent-color: var(--ink); }
.edges { border: 1.5px dashed var(--line); border-radius: 4px; padding: 8px 12px 4px; display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; }
.edges legend { font-size: 13px; font-weight: 700; color: var(--ink-soft); padding: 0 4px; }
.edges label.check { padding-bottom: 4px; }
.pair { display: grid; grid-template-columns: 60px 1fr; gap: 6px; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.save { border: 0; background: var(--ink); color: #fff; font-weight: 800; padding: 9px 18px; border-radius: 4px; cursor: pointer; transition: background .2s, color .2s; }
.save:hover { background: #e2482c; }
.del { border: 1.5px solid var(--line); background: #fff; color: var(--bad); font-weight: 700; padding: 8px 12px; border-radius: 4px; cursor: pointer; }
.del:hover { border-color: var(--bad); }
.two { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; margin-top: 16px; }
form.inline { display: flex; align-items: flex-end; gap: 8px; padding: 8px 0; border-top: 1px dashed var(--line); }
form.inline.wrap { flex-wrap: wrap; }
form.inline label { flex: 1; min-width: 80px; }
form.inline label.grow { flex: 2; min-width: 140px; }
form.inline label.check { flex: 0; }
.narrow { max-width: 560px; display: grid; gap: 12px; margin-bottom: 16px; }

/* orders */
.orders { display: grid; gap: 8px; }
.order { background: #fff; border: 1px solid #d6dce1; border-radius: 12px; }
.order summary { list-style: none; display: grid; grid-template-columns: 140px 1fr 170px 110px 100px; gap: 12px; align-items: center; padding: 12px 16px; cursor: pointer; }
.order summary::-webkit-details-marker { display: none; }
.order[open] summary { border-bottom: 1px dashed var(--line); }
.o-ref { font-family: var(--sans); font-weight: 600; font-size: 13px; }
.o-who, .o-size { display: flex; flex-direction: column; min-width: 0; }
.o-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o-who small, .o-size small { color: var(--ink-soft); font-size: 12.5px; }
.o-size { font-family: var(--sans); font-size: 14px; }
.o-size small { font-family: var(--sans); }
.o-total { font-family: var(--sans); font-weight: 600; text-align: right; }
.o-status { justify-self: end; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 3px 9px; border-radius: 999px; background: var(--bg); }
.st-new .o-status { background: var(--hi); }
.st-printing .o-status { background: #d7ebff; }
.st-dispatched .o-status { background: #e3f4ec; color: var(--ok); }
.st-cancelled { opacity: .6; }
.o-body { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; padding: 16px; }
.o-body h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft); margin: 0 0 6px; }
.o-body h3 small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.o-body p { margin: 0 0 12px; }
table.mini { width: 100%; border-collapse: collapse; font-size: 14px; }
table.mini td { padding: 5px 0; border-bottom: 1px dashed var(--line); vertical-align: top; }
table.mini td small { display: block; color: var(--ink-soft); font-size: 12px; }
table.mini td:last-child { text-align: right; font-family: var(--sans); white-space: nowrap; }
table.mini tr.tot td { font-weight: 800; border-bottom: 0; border-top: 2px solid var(--ink); font-size: 16px; }
blockquote { margin: 0 0 12px; padding: 8px 12px; background: var(--bg); border-left: 3px solid var(--ink); font-size: 14px; }
.file-link { font-weight: 700; }
.status-form { display: flex; gap: 8px; }
.status-form select { border: 1.5px solid var(--line); border-radius: 4px; padding: 7px 10px; }
.status-form button { border: 0; background: var(--ink); color: #fff; font-weight: 700; padding: 8px 14px; border-radius: 4px; cursor: pointer; }
.empty { background: #fff; border: 2px dashed var(--line); border-radius: 4px; padding: 40px; text-align: center; color: var(--ink-soft); }

@media (max-width: 1100px) {
  .g-mat, .g-fin, .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span3 { grid-column: span 2; }
  .two { grid-template-columns: 1fr; }
  .order summary { grid-template-columns: 1fr auto; }
  .o-ref, .o-size { display: none; }
  .o-body { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; padding: 14px; gap: 10px; }
  .side nav { display: flex; overflow-x: auto; gap: 4px; }
  .side nav a { white-space: nowrap; }
  .side-foot { display: flex; flex-wrap: wrap; gap: 12px; }
  .link-btn { width: auto; }
  .g-mat, .g-fin, .g-4 { grid-template-columns: 1fr; }
  .span2, .span3 { grid-column: auto; }
}
