/* Swell "Signal" (brand kit option C, chosen by Vikto 26 Oct 2026): red grain field, tight white caps, ink lines.
   Only four colours: red, bone, grey, ink (dark mode swaps bone and ink). Each order is a work ticket moving down the floor:
   nota, potong, sablon, jahit, packing, serah. */
:root {
  --red: #C1001F; --bone: #F2F2F2; --grey: #C8C8C8; --ink: #1B1B1B;
  --ink-70: rgba(27,27,27,.7); --ink-50: rgba(27,27,27,.5); --ink-12: rgba(27,27,27,.12);
  --paper: #F2F2F2; /* stays light in both themes: text and rings on red */
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='10'%3E%3Cpath d='M1 1l6 7 6-7' fill='none' stroke='%231B1B1B' stroke-width='2.4'/%3E%3C/svg%3E");
  --bone-70: rgba(242,242,242,.75); --bone-40: rgba(242,242,242,.4);
  /* Old token names kept so views and inline styles keep working. */
  --bg: var(--bone); --surface: var(--bone); --muted: var(--ink-70); --line: var(--ink-12);
  --f-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='.33 .33 .33 0 0 .33 .33 .33 0 0 .33 .33 .33 0 0 0 0 0 0 1'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='2.2' intercept='-.6'/%3E%3CfeFuncG type='linear' slope='2.2' intercept='-.6'/%3E%3CfeFuncB type='linear' slope='2.2' intercept='-.6'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color-scheme: light;
}
/* Dark mode: ink and bone swap; red and the header stay. Follows the phone unless the theme button picked one. */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bone: #1B1B1B; --ink: #F2F2F2; --grey: #4D4D4D;
  --ink-70: rgba(242,242,242,.72); --ink-50: rgba(242,242,242,.5); --ink-12: rgba(242,242,242,.16);
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='10'%3E%3Cpath d='M1 1l6 7 6-7' fill='none' stroke='%23F2F2F2' stroke-width='2.4'/%3E%3C/svg%3E");
  color-scheme: dark; } }
:root[data-theme="dark"] {
  --bone: #1B1B1B; --ink: #F2F2F2; --grey: #4D4D4D;
  --ink-70: rgba(242,242,242,.72); --ink-50: rgba(242,242,242,.5); --ink-12: rgba(242,242,242,.16);
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='10'%3E%3Cpath d='M1 1l6 7 6-7' fill='none' stroke='%23F2F2F2' stroke-width='2.4'/%3E%3C/svg%3E");
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bone); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--red); color: var(--paper); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.wrap { max-width: 1040px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* Film grain on red fields. */
.grain { position: relative; isolation: isolate; }
.grain::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(130% 95% at 50% 35%, rgba(27,27,27,0) 45%, rgba(27,27,27,.28) 100%); }
.grain::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background-image: var(--noise); background-size: 220px 220px; mix-blend-mode: overlay; opacity: .6; }

/* The four signal bars: red, bone, grey, ink. */
.signal-bars { display: flex; height: 6px; }
.signal-bars i { flex: 1; }
.signal-bars i:nth-child(1) { background: var(--red); }
.signal-bars i:nth-child(2) { background: var(--paper); }
.signal-bars i:nth-child(3) { background: #C8C8C8; }
.signal-bars i:nth-child(4) { background: #1B1B1B; }

header.site { background: var(--red); color: var(--paper); position: sticky; top: 0; z-index: 5; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; padding-block: 14px 12px; flex-wrap: wrap; }
.logo { font-family: var(--f-display); font-weight: 900; font-stretch: 78%; font-size: 36px; letter-spacing: -.065em; line-height: .8; text-decoration: none; display: inline-flex; align-items: baseline; white-space: nowrap; }
.logo .dot { display: inline-block; width: .19em; height: .19em; border-radius: 50%; background: var(--red); margin-left: .06em; box-shadow: 0 0 0 .045em var(--paper); }
.sub { font-family: var(--f-mono); font-size: 10.5px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--bone-70); margin-top: 6px; }
.sub.tag { text-transform: none; letter-spacing: .06em; }
.who-am-i { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--bone-70); }
.who-am-i .link { color: var(--paper); }
.profile-link { text-decoration: none; border-bottom: 1px dotted var(--bone-40); color: var(--paper); }
.profile-link:hover { border-bottom-color: var(--paper); }
.view-as-pick { width: auto; max-width: 180px; height: 34px; padding: 0 28px 0 8px; font-size: 13px; background-color: var(--bone); border-color: var(--bone); color: var(--ink); }
nav.tabs { display: flex; gap: 0; padding-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs a { flex: 1 0 auto; text-align: center; white-space: nowrap; border: 1.5px solid var(--bone-40); margin-left: -1.5px; padding: 9px 12px; font-family: var(--f-mono); font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; text-decoration: none; }
nav.tabs a:first-child { margin-left: 0; }
nav.tabs a:hover { background: rgba(27,27,27,.18); }
nav.tabs a[aria-current="page"] { background: var(--paper); color: var(--red); border-color: var(--paper); position: relative; }

main { padding-block: 22px 64px; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 900; font-stretch: 80%; text-transform: uppercase; letter-spacing: -.03em; line-height: .9; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(36px, 8vw, 56px); }
h2 { font-size: 26px; letter-spacing: -.02em; }
h3 { font-size: 20px; letter-spacing: -.01em; line-height: 1; }
.lede { color: var(--ink-70); margin: 8px 0 0; max-width: 60ch; }
.aside { font-family: var(--f-display); font-weight: 800; font-stretch: 92%; text-transform: uppercase; font-size: 13px; letter-spacing: .01em; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; }
.stack { display: grid; gap: 16px; }
.muted { color: var(--ink-70); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }

/* Red manifesto block that opens the client pages. */
.signal { background: var(--red); color: var(--paper); padding: 26px 20px 22px; display: grid; gap: 12px; overflow: hidden; }
.signal h1 { font-size: clamp(46px, 13vw, 84px); line-height: .84; letter-spacing: -.045em; word-spacing: .08em; }
.signal .lede { color: var(--bone-70); margin: 0; }
.signal .aside { color: var(--paper); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; border: 2px solid var(--ink); background: var(--ink); color: var(--bone); padding: 8px 18px; border-radius: 0; font-family: var(--f-display); font-weight: 800; font-stretch: 88%; font-size: 14px; letter-spacing: .02em; text-transform: uppercase; text-decoration: none; line-height: 1.1; text-align: center; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { background: var(--red); border-color: var(--red); color: var(--paper); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--bone), 0 0 0 6px var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--bone); border-color: var(--ink); }
.btn.red { background: var(--red); border-color: var(--red); color: var(--paper); }
.btn.red:hover { background: var(--ink); border-color: var(--ink); }
.btn[disabled] { background: var(--grey); border-color: var(--grey); color: var(--ink-50); cursor: not-allowed; }
.btn.big { width: 100%; min-height: 54px; font-size: 16px; }
.btn.small-btn { min-height: 34px; padding: 4px 10px; font-size: 12px; }
.link { border: 0; background: none; padding: 0; color: var(--ink-70); text-decoration: underline; text-underline-offset: 2px; font-size: 13px; }
.inline { display: inline; }

.flash { padding: 12px 14px; font-weight: 600; border-left: 6px solid var(--red); }
.flash.ok { background: var(--ink); color: var(--bone); }
.flash.ok .btn.ghost { color: var(--bone); border-color: var(--bone); }
.flash.ok .btn.ghost:hover { background: var(--bone); color: var(--ink); }
.flash.err { background: var(--red); color: var(--paper); border-left-color: var(--ink); }
.flash.demo { background: var(--grey); color: var(--ink); font-weight: 500; font-size: 14px; border-left-color: var(--ink); }
.viewas { background: var(--ink); color: var(--bone); font-size: 14px; font-weight: 600; padding-block: 10px; }
.viewas .btn { background: var(--bone); color: var(--ink); border-color: var(--bone); }
.link.exit-view { color: var(--paper); font-weight: 700; }

.pipe-scroll { overflow-x: auto; }
.pipe { display: grid; grid-template-columns: repeat(7, minmax(96px, 1fr)); border: 2px solid var(--ink); min-width: 680px; }
.pipe a { border-right: 1.5px solid var(--ink); padding: 10px 12px; display: grid; gap: 4px; text-decoration: none; }
.pipe a:last-child { border-right: 0; }
.pipe a:hover { background: var(--ink-12); }
.pipe a[aria-current="true"] { background: var(--red); color: var(--paper); }
.pipe b { font-family: var(--f-display); font-stretch: 80%; font-size: 32px; font-weight: 900; line-height: .9; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pipe small { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; opacity: .8; }

.ticket { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 14px 16px 12px; border: 2px solid var(--ink); text-decoration: none; transition: box-shadow .15s, transform .15s; }
.ticket:hover { box-shadow: 5px 5px 0 var(--red); transform: translate(-2px, -2px); }
.code { font-family: var(--f-mono); font-size: 11.5px; font-weight: 600; letter-spacing: .06em; color: var(--ink-70); }
.cust { font-family: var(--f-display); font-weight: 800; font-stretch: 90%; font-size: 18px; line-height: 1.15; min-width: 0; }
.items { color: var(--ink-70); font-size: 13px; grid-column: 1 / -1; }

/* Status chips use the palette only: done = ink, running = red dot, late = red, waiting for money = grey. */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border: 1.5px solid var(--ink); font-family: var(--f-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; align-self: start; justify-self: end; }
.chip.ok { background: var(--ink); color: var(--bone); }
.chip.ok::before { content: ""; width: 8px; height: 5px; border-left: 2px solid var(--bone); border-bottom: 2px solid var(--bone); transform: rotate(-45deg) translateY(-1px); }
.chip.run::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--red); animation: blink 1.2s steps(2) infinite; }
.chip.late { background: var(--red); border-color: var(--red); color: var(--paper); }
.chip.late::before { content: "!"; font-weight: 700; }
.chip.warn { background: var(--grey); border-color: var(--grey); color: var(--ink); }
@keyframes blink { 50% { opacity: .2; } }

.bar { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; grid-column: 1 / -1; margin-top: 4px; }
.bar i { height: 7px; background: var(--grey); }
.bar i.done { background: var(--ink); }
.bar i.now { background: var(--red); }
.meta { display: flex; gap: 6px 16px; flex-wrap: wrap; grid-column: 1 / -1; font-size: 12px; color: var(--ink-70); font-variant-numeric: tabular-nums; }
.empty { border: 2px dashed var(--grey); padding: 24px 16px; color: var(--ink-70); text-align: center; }

.panel { border: 2px solid var(--ink); padding: 16px; display: grid; gap: 14px; min-width: 0; }
.cols { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.cols > * { min-width: 0; }
@media (max-width: 680px) { .cols { grid-template-columns: 1fr; } }
.label { font-family: var(--f-mono); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-70); margin: 0 0 8px; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; }
.steps li { display: grid; grid-template-columns: 18px 1fr; gap: 12px; padding-bottom: 14px; position: relative; }
.steps li::before { content: ""; width: 14px; height: 14px; border: 2px solid var(--grey); margin-top: 3px; background: var(--bone); position: relative; z-index: 1; }
.steps li::after { content: ""; position: absolute; left: 6px; top: 17px; bottom: 0; width: 2px; background: var(--grey); }
.steps li:last-child::after { display: none; }
.steps li.done::before { background: var(--ink); border-color: var(--ink); }
.steps li.done::after { background: var(--ink); }
.steps li.now::before { border-color: var(--red); background: var(--red); border-radius: 50%; animation: blink 1.2s steps(2) infinite; }
.steps li.now > div > div:first-child { color: var(--red); font-weight: 700; }
.steps li.gate::before { border-color: var(--ink); border-style: dashed; }
.steps .who { font-size: 12px; color: var(--ink-70); }
.steps form { margin-top: 8px; }

.paybar { height: 12px; background: var(--grey); position: relative; overflow: hidden; }
.paybar i { position: absolute; inset: 0 auto 0 0; background: var(--ink); }
.paybar::after { content: ""; position: absolute; left: 60%; top: 0; bottom: 0; width: 3px; background: var(--red); }
table.list { width: 100%; border-collapse: collapse; font-size: 13px; }
table.list td, table.list th { padding: 7px 4px; border-bottom: 1px solid var(--ink-12); text-align: left; vertical-align: top; }
table.list th { font-family: var(--f-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-70); border-bottom: 2px solid var(--ink); }
.table-scroll { overflow-x: auto; }

input, select, textarea { background: var(--bone); border: 2px solid var(--ink); border-radius: 0; padding: 10px 12px; width: 100%; min-height: 46px; -webkit-appearance: none; appearance: none; transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: var(--ink-50); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: 4px 4px 0 var(--red); }
select { padding-right: 34px; background-image: var(--arrow); background-repeat: no-repeat; background-position: right 12px center; }
input[type="checkbox"], input[type="radio"] { -webkit-appearance: auto; appearance: auto; min-height: 0; width: 18px; height: 18px; accent-color: var(--red); box-shadow: none; }
input[readonly] { background: var(--ink-12); }
label.f { display: grid; gap: 6px; font-family: var(--f-mono); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-70); }
label.f input, label.f select, label.f textarea { font-family: var(--f-body); font-size: 16px; letter-spacing: 0; text-transform: none; color: var(--ink); font-weight: 400; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.item { border: 1.5px solid var(--ink); padding: 12px; display: grid; gap: 10px; }
.item-row { display: grid; grid-template-columns: 1.3fr 1fr 80px 46px; gap: 8px; align-items: end; }
.details { display: grid; gap: 6px; }
.details:empty { display: none; }
.detail-row { display: grid; grid-template-columns: minmax(90px, 0.6fr) 1.4fr 46px; gap: 6px; align-items: center; }
.detail-name { font-size: 13px; font-weight: 600; color: var(--ink-70); padding-left: 2px; }
.item [data-add-detail] { justify-self: start; }
.detail-list { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; }
.detail-list b { font-weight: 600; color: var(--ink-70); }
@media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } .item-row { grid-template-columns: 1fr 72px 46px; } .item-row label:first-child { grid-column: 1 / -1; } }
.x { border: 2px solid var(--ink); background: transparent; height: 46px; font-weight: 700; }
.x:hover { background: var(--red); border-color: var(--red); color: var(--paper); }
.checks { display: flex; gap: 8px 16px; flex-wrap: wrap; font-size: 13px; }
.checks label { display: flex; gap: 6px; align-items: center; }
.checks input { width: 18px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form > * { flex: 1; min-width: 120px; }
.inline-form .btn { flex: 0 0 auto; }

.job { border: 2px solid var(--ink); padding: 14px 16px; display: grid; gap: 10px; }
.track { max-width: 560px; display: grid; gap: 16px; }
.status-big { font-family: var(--f-display); font-stretch: 78%; font-weight: 900; text-transform: uppercase; letter-spacing: -.04em; font-size: clamp(44px, 12vw, 64px); line-height: .86; margin: 0; }
.status-big em { font-style: normal; color: var(--red); }
.login { max-width: 400px; margin: 36px auto 0; }
details.user { border-top: 1.5px solid var(--ink-12); padding-block: 12px; }
details.user summary { cursor: pointer; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
footer.site { color: var(--ink-70); font-size: 12px; padding-block: 24px; border-top: 2px solid var(--ink); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tile { border: 2px solid var(--ink); padding: 12px 14px; display: grid; gap: 6px; min-width: 0; }
.tile b { font-family: var(--f-display); font-stretch: 80%; font-size: 30px; font-weight: 900; letter-spacing: -.03em; line-height: 1; overflow-wrap: anywhere; }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 0.9fr) 1.4fr minmax(120px, auto); gap: 10px; align-items: center; font-size: 14px; }
.bar-track { height: 12px; background: var(--grey); overflow: hidden; }
.bar-track i { display: block; height: 100%; background: var(--ink); }
.bar-track i.slow { background: var(--red); }
@media (max-width: 560px) { .bar-row { grid-template-columns: 1fr auto; } .bar-row .bar-track { grid-column: 1 / -1; grid-row: 2; } }

.plan-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.plan-stages { list-style: none; margin: 0; padding: 0; counter-reset: stage; }
.plan-stages > li { display: grid; grid-template-columns: 42px 1fr; gap: 14px; padding-bottom: 22px; position: relative; }
.plan-stages > li::before { counter-increment: stage; content: counter(stage); font-family: var(--f-display); font-stretch: 80%; font-weight: 900; font-size: 22px; width: 42px; height: 42px; display: grid; place-items: center; background: var(--bone); border: 2px solid var(--ink); position: relative; z-index: 1; }
.plan-stages > li.done::before { background: var(--ink); color: var(--bone); }
.plan-stages > li.now::before { background: var(--red); border-color: var(--red); color: var(--paper); }
.plan-stages > li::after { content: ""; position: absolute; left: 20px; top: 42px; bottom: 0; width: 2px; background: var(--ink); }
.plan-stages > li:last-child::after { display: none; }
.plan-stages > li > div { min-width: 0; display: grid; gap: 8px; padding-top: 6px; }
.plan-stages h3 { margin: 0; font-size: 20px; }
.plan-stages .chip { vertical-align: 2px; margin-left: 4px; }

details.client { border: 2px solid var(--ink); padding: 12px 14px; }
details.client[open] { box-shadow: 5px 5px 0 var(--red); }
details.client summary { cursor: pointer; display: flex; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; list-style: none; }
details.client summary::-webkit-details-marker { display: none; }
.client-name { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-width: 0; }
textarea { font-family: var(--f-mono); font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  .chip.run::before, .steps li.now::before { animation: none; }
  .ticket, .btn { transition: none; }
  .ticket:hover { transform: none; }
}
.chip.hot { background: var(--red); border-color: var(--red); color: var(--paper); }
.theme-toggle { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 1.5px solid var(--bone-40); background: transparent; color: var(--paper); font-family: var(--f-mono); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.theme-toggle:hover { background: rgba(27,27,27,.18); }
.theme-toggle i { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--paper); background: linear-gradient(90deg, var(--paper) 50%, transparent 50%); }
.mix { display: grid; gap: 6px; }
.mix:empty { display: none; }
.mix-row { display: grid; grid-template-columns: minmax(90px, 0.6fr) 1fr 80px 46px; gap: 6px; align-items: center; }
@media (max-width: 600px) { .mix-row { grid-template-columns: 1fr 72px 46px; } .mix-row .detail-name { grid-column: 1 / -1; } }
/* On phones the header (logo, account, tabs) is too tall to stay pinned; let it scroll away. */
@media (max-width: 760px) { header.site { position: relative; } } /* relative, not static: keeps the grain layers inside the header */
