/* =========================================================
   Bakery OS — design system (dot-matrix identity)
   ========================================================= */
:root {
  --f-ar: 'IBM Plex Sans Arabic', system-ui, 'Segoe UI', Tahoma, sans-serif;
  --f-dot: 'Doto', 'JetBrains Mono', ui-monospace, monospace;
  --f-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', monospace;
  --r: 22px;
  --r-sm: 14px;
  --side-w: 264px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a0a;
  --bg2: #0f0f0f;
  --card: #141414;
  --card2: #1a1a1a;
  --card3: #202020;
  --line: #222;
  --line2: #2e2e2e;
  --fg: #eeeeec;
  --fg2: #bdbcb8;
  --muted: #7a7976;
  --dot-dim: #262626;
  --dot-mid: #6b6b6b;
  --input: #0e0e0e;
  --accent: #ff4d1f;
  --accent-2: #ff7a4f;
  --accent-soft: rgba(255, 77, 31, .13);
  --ok: #3fdc85;
  --ok-soft: rgba(63, 220, 133, .12);
  --warn: #ffb52e;
  --warn-soft: rgba(255, 181, 46, .12);
  --bad: #ff5c5c;
  --bad-soft: rgba(255, 92, 92, .12);
  --shadow: inset 0 1px 0 rgba(255, 255, 255, .035), 0 24px 48px -28px rgba(0, 0, 0, .9);
  --glow: radial-gradient(900px 520px at 85% -10%, rgba(255, 110, 50, .07), transparent 60%),
          radial-gradient(700px 500px at 0% 110%, rgba(255, 255, 255, .025), transparent 60%);
  --overlay: rgba(0, 0, 0, .62);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #e7e4de;
  --bg2: #edeae5;
  --card: #f9f8f5;
  --card2: #f1efea;
  --card3: #e9e6e0;
  --line: #dcd8d0;
  --line2: #cfcac0;
  --fg: #151515;
  --fg2: #383735;
  --muted: #76726b;
  --dot-dim: #d9d4cb;
  --dot-mid: #9b968e;
  --input: #ffffff;
  --accent: #ec4214;
  --accent-2: #f2643a;
  --accent-soft: rgba(236, 66, 20, .1);
  --ok: #138a4a;
  --ok-soft: rgba(19, 138, 74, .1);
  --warn: #b26a00;
  --warn-soft: rgba(178, 106, 0, .1);
  --bad: #c62828;
  --bad-soft: rgba(198, 40, 40, .09);
  --shadow: inset 0 1px 0 #fff, 0 18px 40px -26px rgba(70, 45, 20, .35);
  --glow: radial-gradient(900px 520px at 85% -10%, rgba(255, 140, 80, .16), transparent 60%),
          radial-gradient(700px 500px at 0% 110%, rgba(120, 90, 60, .08), transparent 60%);
  --overlay: rgba(30, 25, 20, .35);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--f-ar);
  background: var(--bg);
  background-image: var(--glow);
  background-attachment: fixed;
  color: var(--fg);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: #fff; }
.num, .mono { font-family: var(--f-mono); font-feature-settings: "tnum"; direction: ltr; unicode-bidi: isolate; }
.dot-font { font-family: var(--f-dot); font-weight: 800; }
.muted { color: var(--muted); }
.acc { color: var(--accent); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }

/* scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 8px; }

/* =========================== shell ===================== */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 22px 14px 16px;
  border-inline-end: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg2) 88%, transparent);
  backdrop-filter: blur(10px);
  display: flex; flex-direction: column; gap: 18px;
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 10px; }
.brand .logo { width: 54px; flex: none; }
.brand .bn { font-family: var(--f-dot); font-weight: 900; font-size: 22px; letter-spacing: .04em; line-height: 1; direction: ltr; }
.brand .bs { font-size: 12px; color: var(--muted); margin-top: 4px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav .grp { font-family: var(--f-mono); font-size: 10.5px; color: var(--muted); letter-spacing: .12em; padding: 12px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 12px;
  color: var(--fg2); font-size: 14px;
  transition: background .15s, color .15s;
  position: relative;
}
.nav a:hover { background: var(--card2); color: var(--fg); }
.nav a .ix { font-family: var(--f-mono); font-size: 10.5px; color: var(--muted); width: 18px; }
.nav a svg { opacity: .75; flex: none; }
.nav a .cnt {
  margin-inline-start: auto; font-family: var(--f-mono); font-size: 11px;
  min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.nav a.on { background: var(--card); color: var(--fg); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 8px 11px; }
.nav a.on .ix { color: var(--accent); }
.nav a.on svg { opacity: 1; }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.me {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--card);
}
.me .nm { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.me .rl { font-size: 11.5px; color: var(--muted); }
.me .btn { margin-inline-start: auto; }

.avatar {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  font-family: var(--f-dot); font-weight: 900; font-size: 15px;
  background: var(--card2); border: 1px dashed var(--line2);
}
.avatar.lg { width: 52px; height: 52px; font-size: 20px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 16px 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.top h1 { margin: 0; font-size: 20px; font-weight: 600; display: flex; align-items: baseline; gap: 12px; }
.top h1 .ix { font-family: var(--f-mono); font-size: 12px; color: var(--accent); }
.top .sub { font-size: 12.5px; color: var(--muted); }
.top .spacer { flex: 1; }
.clock { font-family: var(--f-dot); font-weight: 800; font-size: 20px; letter-spacing: .06em; direction: ltr; }
.clock-d { font-size: 11.5px; color: var(--muted); text-align: end; line-height: 1.2; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  border: 1px solid var(--line2); background: var(--card); cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.icon-btn:hover { border-color: var(--fg2); }
.icon-btn .dotn {
  position: absolute; top: -3px; inset-inline-end: -3px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: 10.5px; font-family: var(--f-mono);
  display: grid; place-items: center; border: 2px solid var(--bg);
}
.menu-btn { display: none; }
.content { padding: 24px 28px 60px; }

/* =========================== grid & cards ===================== */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.s2 { grid-column: span 2; } .s3 { grid-column: span 3; } .s4 { grid-column: span 4; }
.s5 { grid-column: span 5; } .s6 { grid-column: span 6; } .s7 { grid-column: span 7; }
.s8 { grid-column: span 8; } .s9 { grid-column: span 9; } .s12 { grid-column: span 12; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.gap-s { gap: 6px; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 16px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  min-width: 0;
  position: relative;
  display: flex; flex-direction: column;
}
.anim .card { animation: rise .5s var(--ease) both; }
.card.flat { box-shadow: none; }
.card.tight { padding: 16px; }
.card.click { cursor: pointer; transition: border-color .15s, transform .2s var(--ease); }
.card.click:hover { border-color: var(--line2); transform: translateY(-2px); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; min-height: 26px; }
.card-t { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--fg2); letter-spacing: .01em; }
.card-t .ix { font-family: var(--f-mono); font-size: 11.5px; color: var(--muted); letter-spacing: .08em; }
.card-t b { font-weight: 500; }
.card-x { display: flex; align-items: center; gap: 8px; }
.card-b { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.card-f { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 14px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.anim .grid > .card:nth-child(2) { animation-delay: .03s; } .anim .grid > .card:nth-child(3) { animation-delay: .06s; }
.anim .grid > .card:nth-child(4) { animation-delay: .09s; } .anim .grid > .card:nth-child(5) { animation-delay: .12s; }
.anim .grid > .card:nth-child(6) { animation-delay: .15s; } .anim .grid > .card:nth-child(n+7) { animation-delay: .18s; }

.big { font-family: var(--f-dot); font-weight: 800; font-size: 50px; line-height: .95; letter-spacing: .02em; direction: ltr; unicode-bidi: isolate; display: inline-block; }
.big.md { font-size: 38px; }
.big.sm { font-size: 28px; }
.big small { font-family: var(--f-ar); font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-inline-start: 6px; }
.big-label { font-size: 12px; color: var(--muted); margin-top: 6px; letter-spacing: .02em; }
.status-word { font-family: var(--f-dot); font-weight: 900; font-size: 34px; letter-spacing: .05em; line-height: 1; direction: ltr; }

.kvs { display: flex; gap: 0; }
.kvs .kv { flex: 1; padding-inline: 12px; border-inline-start: 1px solid var(--line2); }
.kvs .kv:first-child { border-inline-start: 0; padding-inline-start: 0; }
.kv .k { font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }
.kv .v { font-family: var(--f-dot); font-weight: 800; font-size: 25px; line-height: 1.15; direction: ltr; unicode-bidi: isolate; display: inline-block; }
.kv .v small { font-family: var(--f-ar); font-size: 11px; color: var(--muted); font-weight: 400; margin-inline-start: 3px; }

.legend { display: flex; flex-direction: column; gap: 10px; }
.legend .li { display: flex; flex-direction: column; }
.legend .li span { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); }
.legend .li span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--fg)); }
.legend .li b { font-family: var(--f-dot); font-size: 21px; font-weight: 800; padding-inline-start: 14px; direction: ltr; text-align: end; unicode-bidi: isolate; display: inline-block; }

.money { display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.money small { font-size: .78em; color: var(--muted); }

/* =========================== dots ===================== */
.dots { display: block; width: 100%; height: auto; overflow: visible; }
.dots .d-on { fill: var(--fg); }
.dots .d-on2 { fill: var(--fg); opacity: .5; }
.dots .d-off { fill: var(--dot-dim); }
.dots .d-mid { fill: var(--dot-mid); }
.dots .d-acc { fill: var(--accent); }
.dots .d-ok { fill: var(--ok); }
.dots .d-warn { fill: var(--warn); }
.dots .d-ring { fill: none; stroke: var(--accent); stroke-width: 1.4; }
.dots .d-ring.pulse { animation: pulse 1.6s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pulse { 0% { opacity: 1; transform: scale(.6); } 100% { opacity: 0; transform: scale(1.8); } }
.ring { position: relative; aspect-ratio: 1; margin-inline: auto; }
.ring .dots { width: 100%; height: 100%; }
.ring-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-c .big { font-size: 40px; }
.ring-c .lbl { font-size: 11px; color: var(--muted); letter-spacing: .1em; font-family: var(--f-mono); }
.icon-dots { width: 100%; max-width: 260px; max-height: 130px; margin-inline: auto; }
.wave g { animation: wv 1.8s ease-in-out infinite; }
@keyframes wv { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.meter { max-width: 100%; }
.meter-row { display: grid; grid-template-columns: minmax(90px, 1.1fr) minmax(0, 2fr) auto; align-items: center; gap: 12px; padding: 7px 0; }
.meter-row .nm { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter-row .vl { font-family: var(--f-mono); font-size: 12.5px; min-width: 54px; text-align: end; }

/* steps (timeline) */
.steps { display: flex; align-items: flex-start; justify-content: space-between; position: relative; padding-top: 2px; }
.steps .st { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; position: relative; text-align: center; min-width: 0; }
.steps .st::before {
  content: ""; position: absolute; top: 13px; inset-inline-start: 50%; width: 100%; height: 0;
  border-top: 2px dotted var(--line2); z-index: 0;
}
.steps .st:last-child::before { display: none; }
.steps .st.done::before { border-top-color: var(--accent); border-top-style: solid; opacity: .6; }
.steps .c {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--line2); background: var(--card); position: relative; z-index: 1; color: #fff;
}
.steps .st.done .c { background: var(--accent); border-color: var(--accent); }
.steps .st.cur .c { border-color: var(--accent); }
.steps .st.cur .c::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: blink 1.2s ease-in-out infinite; }
.steps .st small { font-size: 11px; color: var(--muted); line-height: 1.3; }
.steps .st.done small, .steps .st.cur small { color: var(--fg2); }
.steps.mini .c { width: 18px; height: 18px; border-width: 1.5px; }
.steps.mini .st::before { top: 8px; }
.steps.mini .st.cur .c::after { width: 6px; height: 6px; }
.steps.mini small { font-size: 10px; }
@keyframes blink { 50% { opacity: .3; } }

/* =========================== controls ===================== */
.btn {
  height: 38px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line2); background: var(--card2); color: var(--fg);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; white-space: nowrap; font-size: 13.5px; font-weight: 500;
  transition: background .15s, border-color .15s, transform .1s, opacity .15s;
}
.btn:hover { border-color: var(--fg2); }
.btn:active { transform: scale(.97); }
.btn.pri { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.pri:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.dark { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: var(--bad-soft); }
.btn.okb { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: var(--ok-soft); }
.btn.sm { height: 31px; padding: 0 12px; font-size: 12.5px; gap: 6px; }
.btn.xs { height: 26px; padding: 0 10px; font-size: 12px; gap: 5px; }
.btn.icon { width: 34px; padding: 0; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn.block { width: 100%; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 25px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--line2); font-size: 12px; white-space: nowrap; color: var(--fg2);
  background: transparent;
}
.pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.pill.t-acc { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-soft); }
.pill.t-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: var(--ok-soft); }
.pill.t-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: var(--warn-soft); }
.pill.t-bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); background: var(--bad-soft); }
.pill.t-info { color: var(--fg); }
.pill.t-mut { color: var(--muted); }
.pill.t-acc2 { color: var(--fg); border-color: var(--accent); }
.pill.t-acc2 i { background: var(--accent); }
.pill.live i { animation: blink 1s infinite; }
.chg { font-family: var(--f-mono); font-size: 12px; border-radius: 999px; padding: 3px 10px; border: 1px solid var(--line2); direction: ltr; }
.chg.up { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.chg.down { color: var(--muted); }

.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); flex-wrap: wrap; }
.tabs button {
  height: 32px; padding: 0 14px; border-radius: 999px; border: 0; background: transparent;
  color: var(--muted); cursor: pointer; font-size: 13px; display: inline-flex; align-items: center; gap: 7px;
}
.tabs button:hover { color: var(--fg); }
.tabs button.on { background: var(--fg); color: var(--bg); }
.tabs button .c { font-family: var(--f-mono); font-size: 11px; opacity: .7; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .grow { flex: 1; }
.search { position: relative; display: block; flex: 1 1 240px; max-width: 420px; }
.search svg { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .in { padding-inline-start: 38px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 12px; color: var(--muted); }
.field small { font-size: 11.5px; color: var(--muted); }
.field.full { grid-column: 1 / -1; }
.in {
  width: 100%; height: 40px; border-radius: 12px;
  border: 1px solid var(--line2); background: var(--input); color: var(--fg);
  padding: 0 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.in:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.in { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; }
select.in { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: 14px 52%, 19px 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-inline-end: 12px; padding-inline-start: 32px; }
.in.sm { height: 32px; border-radius: 10px; font-size: 13px; }
.in.num { text-align: center; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.chk { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line2); cursor: pointer; font-size: 13px; }
.chk input { accent-color: var(--accent); }
.chk:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 22px; background: var(--line2); transition: .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { inset-inline-start: 21px; }

/* =========================== tables ===================== */
.tw { overflow-x: auto; margin-inline: -4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .08em; color: var(--muted); font-weight: 500;
  text-align: start; padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 11px 10px; border-bottom: 1px dashed var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover { background: var(--card2); }
.tbl tbody tr.sel { background: var(--accent-soft); }
.tbl td.e, .tbl th.e { text-align: end; }
.tbl td.c, .tbl th.c { text-align: center; }
.tbl .id { font-family: var(--f-mono); font-size: 12.5px; color: var(--fg2); direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
.tbl tfoot td { border-top: 1px solid var(--line2); border-bottom: 0; font-weight: 600; }
.tbl .sub { font-size: 11.5px; color: var(--muted); }
.more-row { text-align: center; padding-top: 12px; }

.empty { padding: 34px 10px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty .icon-dots { max-width: 120px; opacity: .8; }

.list { display: flex; flex-direction: column; }
.list .it { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.list .it:last-child { border-bottom: 0; }
.list .it .t { font-size: 13.5px; }
.list .it .s { font-size: 11.5px; color: var(--muted); }
.list .it.click { cursor: pointer; }
.list .it.click:hover .t { color: var(--accent); }

.feed .it { align-items: flex-start; }
.feed .dt { width: 7px; height: 7px; border-radius: 50%; background: var(--dot-mid); margin-top: 8px; flex: none; }
.feed .it:first-child .dt { background: var(--accent); }

/* =========================== modal / toast ===================== */
.overlay {
  position: fixed; inset: 0; background: var(--overlay); backdrop-filter: blur(6px);
  z-index: 100; display: grid; place-items: center; padding: 20px; animation: fade .2s both;
}
.modal {
  width: min(720px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line2); border-radius: 24px;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .7); animation: pop .28s var(--ease) both;
}
.modal.lg { width: min(980px, 100%); }
.modal.sm { width: min(460px, 100%); }
.modal-h { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-h h3 { margin: 0; font-size: 17px; font-weight: 600; }
.modal-h .x { margin-inline-start: auto; }
.modal-b { padding: 20px 22px; overflow-y: auto; }
.modal-f { display: flex; gap: 10px; justify-content: flex-start; flex-wrap: wrap; padding: 14px 22px; border-top: 1px solid var(--line); }
.modal-f .sp { flex: 1; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }

#toast-root { position: fixed; bottom: 22px; left: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 420px;
  padding: 12px 16px; border-radius: 16px; background: var(--fg); color: var(--bg);
  font-size: 13.5px; box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .6); animation: pop .25s var(--ease) both;
}
.toast i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.toast.ok i { background: var(--ok); }
.toast.out { opacity: 0; transform: translateY(8px); transition: .3s; }

.dropdown {
  position: absolute; top: calc(100% + 10px); inset-inline-end: 0; width: 380px; max-height: 480px; overflow: auto;
  background: var(--card); border: 1px solid var(--line2); border-radius: 18px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6);
  z-index: 50; animation: pop .2s both; text-align: start;
}
.dropdown .dh { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); }
.note { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px dashed var(--line); cursor: pointer; }
.note:hover { background: var(--card2); }
.note .dt { width: 7px; height: 7px; border-radius: 50%; margin-top: 8px; background: transparent; flex: none; }
.note.unread .dt { background: var(--accent); }
.note .t { font-size: 13px; }
.note .s { font-size: 11px; color: var(--muted); }

/* =========================== specific blocks ===================== */
.flow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; align-items: end; }
.flow .fs { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 0 4px; position: relative; cursor: pointer; }
.flow .fs .n { font-family: var(--f-dot); font-weight: 900; font-size: 34px; line-height: 1; }
.flow .fs .l { font-size: 11.5px; color: var(--muted); }
.flow .fs.hot .n { color: var(--accent); }
.flow .fs .bar { width: 100%; }

.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.pcard { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s; box-shadow: var(--shadow); }
.pcard.in { border-color: var(--accent); }
.pcard .pi { height: 70px; display: grid; place-items: center; }
.pcard .pi .icon-dots { max-width: 120px; }
.pcard .pn { font-weight: 600; font-size: 14.5px; line-height: 1.35; }
.pcard .pu { font-size: 12px; color: var(--muted); }
.pcard .pp { font-family: var(--f-dot); font-weight: 800; font-size: 24px; direction: ltr; text-align: end; }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line2); background: var(--card2); cursor: pointer; display: grid; place-items: center; }
.qty button:hover { border-color: var(--accent); color: var(--accent); }
.qty input { width: 56px; height: 34px; text-align: center; border-radius: 10px; border: 1px solid var(--line2); background: var(--input); font-family: var(--f-mono); }
.qty.sm button { width: 28px; height: 28px; }
.qty.sm input { width: 48px; height: 28px; }

.cart { position: sticky; top: 92px; }
.cart-line { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.total-line { display: flex; justify-content: space-between; align-items: baseline; padding-top: 12px; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; font-size: 13px; border: 1px solid var(--line2); background: var(--card2); }
.alert.warn { border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: var(--warn-soft); color: var(--fg); }
.alert.acc { border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); }
.alert.ok { border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: var(--ok-soft); }

.stop { border: 1px solid var(--line); border-radius: 18px; padding: 16px; background: var(--card2); display: flex; flex-direction: column; gap: 10px; }
.stop .h { display: flex; align-items: center; gap: 10px; }
.stop .no { font-family: var(--f-dot); font-weight: 900; font-size: 26px; color: var(--accent); width: 34px; }

.section-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; font-size: 13px; color: var(--muted); }
.section-title::after { content: ""; flex: 1; border-top: 1px dotted var(--line2); }

.perm { display: grid; grid-template-columns: 1.4fr repeat(6, 1fr); font-size: 12.5px; }
.perm > div { padding: 9px 8px; border-bottom: 1px dashed var(--line); text-align: center; }
.perm > div.h { font-family: var(--f-mono); font-size: 10.5px; color: var(--muted); }
.perm > div.l { text-align: start; }
.perm .y { color: var(--accent); font-weight: 700; }
.perm .n { color: var(--dot-mid); }

/* =========================== login ===================== */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.login .hero { padding: 48px 56px; display: flex; flex-direction: column; gap: 28px; border-inline-end: 1px solid var(--line); position: relative; overflow: hidden; }
.login .hero h1 { font-family: var(--f-dot); font-weight: 900; font-size: clamp(54px, 7vw, 96px); line-height: .9; margin: 0; letter-spacing: .02em; direction: ltr; text-align: start; }
.login .hero h1 span { color: var(--accent); }
.login .hero p { margin: 0; color: var(--fg2); font-size: 17px; max-width: 520px; }
.login .pick { padding: 48px 48px; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; max-height: 100vh; }
.flowline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: end; }
.flowline .fl { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.flowline .fl .ix { font-family: var(--f-mono); font-size: 11px; color: var(--accent); }
.flowline .fl b { font-size: 14px; font-weight: 600; }
.flowline .fl small { color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.ucards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.ucard { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); cursor: pointer; text-align: start; transition: border-color .15s, transform .15s; }
.ucard:hover { border-color: var(--accent); transform: translateY(-2px); }
.ucard .nm { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.ucard .rl { font-size: 11.5px; color: var(--muted); }

/* =========================== print ===================== */
#print-root { display: none; }
@media print {
  body { background: #fff !important; color: #000; }
  body.printing #app, body.printing #modal-root, body.printing #toast-root { display: none !important; }
  body.printing #print-root { display: block; }
  @page { size: A4; margin: 14mm; }
}
.pr { font-family: var(--f-ar); color: #000; font-size: 13px; }
.pr header { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #000; padding-bottom: 12px; margin-bottom: 16px; }
.pr h1 { margin: 0; font-size: 22px; }
.pr h2 { margin: 0; font-size: 18px; font-family: var(--f-mono); }
.pr p { margin: 3px 0; }
.pr table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.pr th, .pr td { border: 1px solid #999; padding: 6px 8px; text-align: start; }
.pr th { background: #eee; }
.pr .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; margin-bottom: 10px; }
.pr .sig { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 50px; text-align: center; }
.pr .sig div { border-top: 1px solid #000; padding-top: 6px; }
.pr .tot { text-align: end; font-size: 15px; font-weight: 700; }

/* =========================== responsive ===================== */
@media (max-width: 1280px) {
  .s3 { grid-column: span 6; }
  .s4 { grid-column: span 6; }
  .s5, .s7 { grid-column: span 12; }
}
@media (max-width: 1080px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(300px, 86vw); background: var(--bg2); transform: translateX(105%); transition: transform .3s var(--ease); box-shadow: 0 0 60px rgba(0, 0, 0, .5); }
  .side.open { transform: none; }
  .menu-btn { display: grid; }
  .s6, .s8, .s9 { grid-column: span 12; }
  .login { grid-template-columns: 1fr; }
  .login .hero { border-inline-end: 0; border-bottom: 1px solid var(--line); padding: 32px 24px; }
  .login .pick { padding: 28px 24px; max-height: none; }
  .scrim { position: fixed; inset: 0; background: var(--overlay); z-index: 35; }
}
@media (max-width: 720px) {
  .content { padding: 16px 16px 60px; }
  .top { padding: 12px 16px; gap: 10px; }
  .top h1 { font-size: 17px; }
  .top .clock-wrap, .top .sub { display: none; }
  .s2, .s3, .s4 { grid-column: span 12; }
  .grid { gap: 12px; }
  .form-grid, .form-grid.c3 { grid-template-columns: 1fr; }
  .big { font-size: 42px; }
  .flow { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 18px; }
  .dropdown { position: fixed; top: 64px; inset-inline: 12px; width: auto; }
  .modal { border-radius: 20px; }
  .flowline { grid-template-columns: repeat(2, 1fr); row-gap: 20px; }
  .search { max-width: none; flex-basis: 100%; }
  .tbl { min-width: 780px; }
  .toolbar .in { min-width: 0 !important; flex: 1 1 140px; }
  .perm { font-size: 11px; }
}

/* =========================== server states ===================== */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 16px; text-align: center; }
.boot .icon-dots { width: 140px; animation: blink 1.4s ease-in-out infinite; }
body.busy, body.busy * { cursor: progress !important; }
