/* Alaka Stok — follows DESIGN.md: ink / paper / orange only, Inter Tight, square, flat, no greys. */
:root {
  --ink: #111111;
  --paper: #ffffff;
  --orange: #ff5b14;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.4 'Inter Tight', Arial, sans-serif;
}
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 480px; margin: 64px auto; }
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
code { font: 500 14px/1.4 ui-monospace, Menlo, Consolas, monospace; }
ul.checks { list-style: none; padding: 0; margin: 0 0 24px; }
ul.checks li { padding: 4px 0; border-bottom: 1px solid var(--ink); }

h1 { font-size: 32px; line-height: 1.05; font-weight: 800; letter-spacing: -0.02em; margin: 8px 0 24px; }
h2 { font-size: 20px; line-height: 1.2; font-weight: 800; margin: 48px 0 16px; }
p { margin: 0 0 16px; max-width: 70ch; }
.meta { font-size: 14px; font-weight: 500; }
.eyebrow {
  display: flex; align-items: center; gap: 12px; margin: 48px 0 0;
  font-size: 13px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase;
}
.eyebrow::before { content: ''; width: 16px; height: 16px; border-radius: 50%; background: var(--orange); flex: none; }

/* header */
.top { border-bottom: 4px solid var(--ink); background: var(--paper); }
.top-in { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; padding-top: 12px; padding-bottom: 12px; }
.logo img { display: block; width: 120px; height: auto; }
/* phone: slim top bar + fixed bottom tab bar */
.top-in { flex-wrap: nowrap; justify-content: space-between; align-items: center; gap: 24px; padding-top: 20px; padding-bottom: 20px; }
.logo { display: block; padding: 4px 0; }
.logo img { width: auto; height: auto; max-width: 150px; max-height: 56px; }
.acct { position: relative; flex: none; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 2px solid var(--ink); border-radius: 50%; color: var(--ink); text-decoration: none; }
.acct:hover, .acct:focus-visible { background: var(--ink); color: var(--paper); }
.acct.on { background: var(--orange); border-color: var(--ink); color: var(--ink); }
.acct .nm { position: absolute; right: calc(100% + 8px); top: 50%; transform: translateY(-50%); padding: 6px 10px; background: var(--ink); color: var(--paper); font-size: 14px; font-weight: 700; white-space: nowrap; max-width: 60vw; overflow: hidden; text-overflow: ellipsis; opacity: 0; pointer-events: none; }
.acct:hover .nm, .acct:focus-visible .nm { opacity: 1; }
.logo-prev { margin: 16px 0; padding: 24px; border: 1px solid var(--ink); display: inline-block; }
.logo-prev img { display: block; max-width: 240px; max-height: 80px; }
nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--paper); padding-bottom: env(safe-area-inset-bottom); }
nav a { display: flex; align-items: center; justify-content: center; min-height: 56px; padding: 0 4px; font-size: 14px; font-weight: 700; text-decoration: none; text-align: center; border-top: 4px solid var(--ink); }
nav a.on { border-top-color: var(--orange); }
nav a.x { display: none; }
button.link { background: none; border: 0; padding: 12px 8px; min-height: 44px; font: 700 14px 'Inter Tight', Arial, sans-serif; color: var(--ink); text-decoration: underline; cursor: pointer; }
.back { display: inline-block; margin-top: 24px; padding: 8px 0; font-weight: 700; text-decoration: none; }
.back:hover { text-decoration: underline; }
.back + .eyebrow { margin-top: 8px; }
.actions.dash .btn:first-child { flex: 1 1 100%; }
.actions.dash .btn { flex: 1 1 calc(50% - 6px); }
input[type=file] { height: auto; padding: 12px; font: 400 16px 'Inter Tight', Arial, sans-serif; }
input[type=file]::file-selector-button { margin-right: 12px; padding: 10px 16px; border: 2px solid var(--ink); border-radius: 0; background: var(--paper); font: 700 14px 'Inter Tight', Arial, sans-serif; cursor: pointer; }
.foot a { color: var(--ink); }
main { padding-bottom: 120px; min-height: 60vh; }
.foot { padding-top: 32px; padding-bottom: 32px; border-top: 1px solid var(--ink); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px;
  border: 2px solid var(--orange); background: var(--orange); color: var(--ink);
  font: 700 16px 'Inter Tight', Arial, sans-serif; text-decoration: none; cursor: pointer; border-radius: 0;
  transition: transform 150ms var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn.sec { background: var(--paper); border-color: var(--ink); }
.btn:hover { text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; align-items: center; }
.actions form { margin: 0; }
form.inline { display: inline; margin-left: 16px; }

/* forms */
label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 16px; }
label > input, label > select { margin-top: 4px; font-weight: 400; }
input, select, textarea {
  display: block; width: 100%; min-height: 48px; padding: 0 12px; border: 1px solid var(--ink); border-radius: 0;
  background: var(--paper); color: var(--ink); font: 400 16px 'Inter Tight', Arial, sans-serif;
}
input:focus, select:focus { border: 2px solid var(--orange); padding: 0 11px; outline: 3px solid var(--ink); outline-offset: 2px; }
.chk { display: flex; gap: 12px; align-items: center; font-weight: 400; font-size: 16px; }
.chk input { width: 24px; min-height: 24px; height: 24px; flex: none; accent-color: var(--ink); }
.two { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
.stack { display: block; }
.form { max-width: 640px; }
.card { border-top: 4px solid var(--ink); padding-top: 16px; margin-top: 32px; }
input.qty { width: 112px; text-align: right; margin-left: auto; }
.bar { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.bar input { flex: 1; min-width: 200px; }

/* messages */
.flash { margin: 24px 0; padding: 12px 16px; border: 1px solid var(--ink); font-weight: 500; }
.flash.err { border: 0; border-left: 8px solid var(--orange); background: var(--paper); box-shadow: none; outline: 1px solid var(--ink); font-weight: 700; }

/* stats */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 16px; margin: 24px 0; }
.stat { border-top: 4px solid var(--ink); padding-top: 16px; }
.stat.hot { border-top-color: var(--orange); }
.stat b { display: block; white-space: nowrap; font-size: 28px; line-height: 1; font-weight: 800; letter-spacing: -0.03em; }
.stat span { display: block; margin-top: 8px; font-size: 14px; font-weight: 500; }

/* tables */
.scroll { overflow-x: auto; margin: 16px 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th { background: var(--ink); color: var(--paper); text-align: left; font-weight: 700; padding: 12px; white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--ink); vertical-align: middle; }
th.n, td.n { text-align: right; }
tr.grp td { font-weight: 800; border-bottom: 4px solid var(--ink); padding-top: 24px; background: var(--paper); }
tfoot td { font-weight: 800; border-top: 2px solid var(--ink); }
tr.hide { display: none; }

/* recipe form */
fieldset { border: 0; border-top: 4px solid var(--ink); padding: 16px 0 0; margin: 24px 0; min-width: 0; }
legend { font-weight: 800; font-size: 20px; padding-right: 12px; }
.irow { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--ink); }
.irow select { grid-column: 1 / -1; }
.qtywrap { display: flex; align-items: center; gap: 8px; }
.qtywrap input { min-width: 0; }
.u { min-width: 28px; font-size: 14px; font-weight: 700; }
.rc { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.irow .btn { min-height: 48px; padding: 0 16px; }

/* cost analysis */
ul.finds { list-style: none; padding: 0; margin: 0; border-top: 4px solid var(--ink); }
ul.finds li { padding: 16px 0; border-bottom: 1px solid var(--ink); max-width: 80ch; }
ul.finds .pill { margin-right: 8px; }
.meter { height: 8px; margin-top: 4px; border: 1px solid var(--ink); min-width: 80px; }
.meter i { display: block; height: 100%; background: var(--ink); }
.meter .w0 { width: 0%; }
.meter .w2 { width: 2%; }
.meter .w5 { width: 5%; }
.meter .w10 { width: 10%; }
.meter .w15 { width: 15%; }
.meter .w20 { width: 20%; }
.meter .w25 { width: 25%; }
.meter .w30 { width: 30%; }
.meter .w35 { width: 35%; }
.meter .w40 { width: 40%; }
.meter .w45 { width: 45%; }
.meter .w50 { width: 50%; }
.meter .w55 { width: 55%; }
.meter .w60 { width: 60%; }
.meter .w65 { width: 65%; }
.meter .w70 { width: 70%; }
.meter .w75 { width: 75%; }
.meter .w80 { width: 80%; }
.meter .w85 { width: 85%; }
.meter .w90 { width: 90%; }
.meter .w95 { width: 95%; }
.meter .w100 { width: 100%; }

/* pills + rows */
.pill { display: inline-block; padding: 2px 12px; border: 2px solid var(--ink); border-radius: 999px; font-size: 13px; font-weight: 700; vertical-align: middle; }
.pill.hot { background: var(--orange); border-color: var(--orange); }
.pill.done { background: var(--paper); }
.rows { margin: 24px 0; border-top: 4px solid var(--ink); }
.row { display: grid; gap: 4px; padding: 24px 0; border-bottom: 1px solid var(--ink); text-decoration: none; }
.row b { font-size: 20px; font-weight: 800; }
.row:hover b { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--orange); }

@media (min-width: 720px) {
  .wrap { padding: 0 32px; }
  .two { grid-template-columns: 1fr 1fr; }
  .irow { grid-template-columns: 1fr 180px 120px 96px; }
  .irow select { grid-column: auto; }
  .top-in { gap: 24px 48px; padding-top: 24px; padding-bottom: 24px; }
  .logo img { max-width: 180px; max-height: 64px; }
  nav { position: static; flex: 1; display: flex; gap: 4px; border: 0; padding: 0; background: none; }
  nav a { display: block; min-height: 0; padding: 12px 12px 8px; margin: 0; border-top: 0; border-bottom: 4px solid transparent; white-space: nowrap; }
  nav a:hover { border-bottom-color: var(--ink); }
  nav a.on { border-bottom-color: var(--orange); }
  nav a.x { display: block; }
  nav a.m { display: none; }
  .actions.dash .btn, .actions.dash .btn:first-child { flex: 0 0 auto; }
  main { padding-bottom: 96px; }
  .stats { grid-template-columns: repeat(4, 1fr); gap: 24px 32px; }
  h1 { font-size: 44px; }
  .stat b { font-size: 40px; }
  .row { grid-template-columns: 320px 1fr; align-items: baseline; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
@media print {
  .top, .foot, .actions, .bar { display: none; }
}

/* language switch: ID | EN */
form.lang { display: flex; align-items: center; gap: 4px; margin: 0; }
form.lang button.link { text-decoration: none; padding: 8px 6px; min-width: 32px; font-weight: 500; }
form.lang button.link.on { font-weight: 900; text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 3px; text-underline-offset: 6px; }
.langs { text-align: right; }
.top-in > form.lang { margin-left: auto; }
.who + form.lang { margin-left: 0; }
td.n { white-space: nowrap; }

/* schedule grid */
table.grid th, table.grid td { text-align: center; padding: 8px 4px; }
table.grid td:first-child, table.grid th:first-child { text-align: left; white-space: nowrap; padding-left: 0; }
table.grid select { min-width: 92px; padding: 0 4px; }
.weeknav { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; }
.weeknav a { padding: 8px 0; font-weight: 700; }

/* kiosk */
.kiosk { max-width: 560px; margin: 0 auto; }
.kiosk .names { display: grid; gap: 12px; margin-top: 24px; }
.kiosk .names .btn, .btn.big { width: 100%; min-height: 72px; font-size: 22px; }
.clock { font-size: 56px; font-weight: 900; letter-spacing: -0.03em; margin: 0; }
.pin { font-size: 36px; text-align: center; letter-spacing: 0.4em; height: 72px; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.pad .btn { min-height: 72px; font-size: 28px; padding: 0; }
.plain { list-style: none; padding: 0; margin: 8px 0; }
.plain li { padding: 8px 0; border-bottom: 1px solid var(--ink); }
details summary { list-style: none; cursor: pointer; text-align: center; }
details[open] summary { margin-bottom: 16px; }

/* payslip */
.payslip { max-width: 560px; }
.payslip table { margin: 16px 0; }
@media print {
  .top, nav, .foot, .no-print, .back { display: none !important; }
  main { padding: 0; }
}

/* multi-branch: schedule clash, extra branch fields */
table.grid td.clash { outline: 3px solid var(--orange); outline-offset: -3px; }
.clashtag { display: block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }
table.grid .other { display: block; font-size: 11px; line-height: 1.25; margin-top: 2px; }
fieldset.branches { border: 0; border-top: 3px solid var(--ink); padding: 12px 0 0; margin: 8px 0; }
fieldset.branches legend { font-weight: 800; padding: 0 8px 0 0; }
.xrow { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; align-items: center; margin: 8px 0; }
@media (max-width: 560px) { .xrow { grid-template-columns: 1fr; } }
