/* RUH SHELL — Layer 1 look for every server app (Ankit 30 Nov 2026 10:25: minimal, luxurious, premium).
   One file for all apps: change it here once and every app changes. Apps add no colours or fonts of their own.
   Warm ivory, lots of white space, maroon only for the main action, soft gold for small accents,
   no heavy borders or boxes inside boxes. Plain text (common point 30 Nov 2026 12:20): ONE font, Inter (+ Noto Sans
   Devanagari / Bengali), sentence case, no capitals-only, no wide spacing between letters, no decorative fonts.
   Premium = spacing and calm colours, not fancy fonts (scripts/check.mjs checks this). */
:root {
  --ivory: #FAF6F0;
  --card: #FFFFFF;
  --maroon: #6B1E2E;
  --maroon-2: #84283B;
  --gold: #B08D57;
  --gold-soft: #F3EADB;
  --ink: #221B18;
  --mute: #8A7F76;
  --sand: #EDE6DC;           /* hairlines only */
  --line: rgba(34, 27, 24, .07);
  --red: #A8322A;
  --amber: #A8741A;
  --green: #2F6B3A;
  --sans: 'Inter', 'Noto Sans Devanagari', 'Noto Sans Bengali', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --fs: 15px;
  --h: 48px;                 /* every touch area at least 48 px */
  --r: 16px;
  --shadow: 0 1px 2px rgba(60, 30, 20, .04), 0 10px 30px rgba(60, 30, 20, .06);
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--ivory); color: var(--ink); font: var(--fs)/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, .ttl { font-family: var(--sans); font-weight: 600; margin: 0; }
h1 { font-size: 26px; } h2 { font-size: 21px; } h3 { font-size: 18px; }
b, strong { font-weight: 600; }
.num, .tot, .big-num, .kpi b { font-variant-numeric: tabular-nums; }
.label { font-size: 13px; color: var(--mute); font-weight: 500; }
.muted, small.muted { color: var(--mute); }
.red { color: var(--red); } .amber { color: var(--amber); } .green { color: var(--green); }

/* surfaces: one level only — a card on ivory; inside a card things are separated by space and hairlines, not boxes */
.card { background: var(--card); border: 0; border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); min-width: 0; max-width: 100%; }
.card .card, .card .cblk { box-shadow: none; background: transparent; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 14px 0 0; }
.rh-enter { animation: rh-in .18s var(--ease); } /* only when a new screen opens, never on a redraw */
@keyframes rh-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* buttons: quiet by default (text button), maroon only for the one main action */
button, .btn { min-height: var(--h); height: auto; padding: 0 18px; border-radius: 999px; border: 0; background: transparent; color: var(--maroon);
  font: 500 15px var(--sans); cursor: pointer; transition: background .15s var(--ease), color .15s var(--ease), transform .1s var(--ease); }
button:hover { background: var(--gold-soft); }
button:active { transform: scale(.98); }
button:disabled { opacity: .5; cursor: default; }
.btn-main, button.btn-main { background: var(--maroon); color: #fff; font-weight: 600; box-shadow: 0 6px 16px rgba(107, 30, 46, .18); }
.btn-main:hover { background: var(--maroon-2); }
.big { min-height: 54px; font-size: 16px; }
.chip { min-height: 38px; padding: 0 14px; border-radius: 999px; background: var(--gold-soft); color: var(--ink); font-size: 14px; }
.chip.on, .tab.on { background: var(--maroon); color: #fff; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }

/* inputs: big, calm, gold ring on focus; numbers right-aligned */
input, select, textarea { min-height: var(--h); font: 16px var(--sans); padding: 0 14px; border: 1px solid var(--sand); border-radius: 12px; background: #fff;
  color: var(--ink); width: 100%; transition: border-color .15s, box-shadow .15s; }
textarea { padding: 12px 14px; min-height: 96px; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(176, 141, 87, .18); }
input[inputmode="decimal"], input[inputmode="numeric"], .num { text-align: right; font-variant-numeric: tabular-nums; }
input::placeholder { color: #B5AAA0; }

/* header (one for every app): logo + small plain app name, quiet tabs, Live dot, me */
.top, .rh { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 10px 20px; background: rgba(250, 246, 240, .92);
  backdrop-filter: saturate(1.2) blur(10px); -webkit-backdrop-filter: saturate(1.2) blur(10px); border-bottom: 1px solid var(--line); }
.top img, .rh-logo img { height: 30px; }
.top .ttl { font-size: 15px; font-weight: 500; }
.top button { margin-left: auto; }
.rh-logo { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0; min-height: 40px; }
.rh-logo span { font: 500 15px var(--sans); color: var(--ink); }
.rh-tabs { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.rh-tab, .tab { border-radius: 999px; min-height: 40px; padding: 0 14px; white-space: nowrap; color: var(--mute); }
.rh-tab.on { background: transparent; color: var(--maroon); box-shadow: inset 0 -2px 0 var(--maroon); border-radius: 0; }
.rh-when { display: grid; text-align: right; line-height: 1.15; font-size: 12px; color: var(--mute); }
.dot, .live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.dot.off { background: var(--amber); }
.rh-me { width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 50%; background: var(--gold-soft); color: var(--maroon); font-weight: 600; }
.rh-menu { position: fixed; right: 12px; top: 60px; z-index: 6; background: #fff; border-radius: var(--r); padding: 10px; display: grid; gap: 4px; min-width: 220px; box-shadow: var(--shadow); }
.rh-item { text-align: left; color: var(--ink); border-radius: 10px; }
.rh-item.on { background: var(--gold-soft); color: var(--maroon); }
.rh-who { display: grid; padding: 6px 10px; } .rh-who small { color: var(--gold); }
.rh-langs { display: flex; gap: 6px; flex-wrap: wrap; }
.rh-view { padding: 20px; max-width: 1080px; margin: 0 auto; display: grid; gap: 16px; }
main { max-width: 1080px; }

/* numbers that matter: big and calm */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: #fff; border-radius: var(--r); padding: 16px; display: grid; gap: 4px; text-align: left; height: auto; box-shadow: var(--shadow); color: var(--ink); }
.kpi b { font: 600 26px/1.15 var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; } .kpi.red b { color: var(--red); }
.kpi b small { font: 500 13px var(--sans); color: var(--mute); }
.card .kpi { box-shadow: none; background: transparent; padding: 0; }   /* no boxes inside boxes */
.card .kpis { gap: 18px 24px; }
.big-num { font: 600 28px/1.15 var(--sans); font-variant-numeric: tabular-nums; }
.tot { color: var(--gold); font-weight: 600; }

/* lists */
.picks, .list { display: grid; gap: 0; }
.pick { min-height: 60px; display: flex; align-items: center; gap: 14px; text-align: left; padding: 10px 6px; border-radius: 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.pick span { display: grid; flex: 1; } .pick small { color: var(--mute); }
.pick em { font-style: normal; font-weight: 600; } .pick.red em { color: var(--red); }
.pick-q { margin-bottom: 8px; }
.line { display: flex; justify-content: space-between; gap: 8px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.line.late { box-shadow: inset 3px 0 0 var(--red); padding-left: 10px; }
.cdot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--sand); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tilegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.ktile { height: auto; display: grid; gap: 2px; padding: 14px; text-align: left; position: relative; background: #fff; border-radius: var(--r); box-shadow: var(--shadow); color: var(--ink); }
.ktile .reddot { position: absolute; right: 10px; top: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); }

/* design photos: large, soft corners, nothing around them */
.photo, img.photo { border-radius: 14px; object-fit: cover; background: var(--gold-soft); display: block; }
.thumb { width: 56px; height: 70px; border-radius: 10px; object-fit: cover; background: var(--gold-soft); }

/* sign in */
.login { max-width: 400px; margin: 48px auto; display: grid; gap: 14px; text-align: center; justify-items: center; padding: 0 16px; }
.login.wide { max-width: 640px; }
.login > input, .login > .big, .login > .pw { width: 100%; }
.langs { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.keep { display: flex; gap: 10px; align-items: center; justify-self: start; }
.keep input { width: 22px; min-height: 22px; height: 22px; }
.msg { min-height: 20px; color: var(--red); }
.pw { position: relative; width: 100%; }
.pw input { padding-right: 56px; }
.pw .eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; padding: 0; font-size: 20px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; width: 100%; }
.tile { height: auto; padding: 18px 8px; display: grid; gap: 6px; justify-items: center; background: #fff; border-radius: var(--r); box-shadow: var(--shadow); color: var(--ink); }
.tile .face { width: 56px; height: 56px; border-radius: 50%; background: var(--gold-soft); display: grid; place-items: center; font: 600 22px var(--sans); color: var(--maroon); }
.tile small { color: var(--gold); }

/* messages, sheets, toast */
.testband { background: var(--gold-soft); color: #7A5A1A; border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 500; text-align: center; }
#rh-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(8px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px;
  opacity: 0; transition: opacity .2s var(--ease), transform .2s var(--ease); pointer-events: none; z-index: 9; }
#rh-toast.on { opacity: 1; transform: translateX(-50%); } #rh-toast.bad { background: var(--red); }
.rh-sheet { position: fixed; inset: 0; background: rgba(34, 27, 24, .32); display: grid; align-items: end; z-index: 8; animation: rh-in .18s var(--ease); }
.rh-sheet .card { margin: 12px; display: grid; gap: 12px; }
.scroll-x { overflow-x: auto; }

/* paper (slips, PO, PDF): one template for every app */
.slip, .paper { background: #fff; color: #222; border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); }
.slip table, .paper table { width: 100%; border-collapse: collapse; font-size: 14px; }
.slip th, .slip td { border-bottom: 1px solid #eee; padding: 8px 4px; text-align: left; }
.slip td.n, .slip th.n { text-align: right; }
.rh-paper { position: fixed; inset: 0; overflow: auto; background: var(--ivory); z-index: 7; padding: 16px; display: grid; gap: 12px; align-content: start; }
.paper { max-width: 820px; width: 100%; margin: 0 auto; }
.paper-head { display: flex; gap: 12px; align-items: center; border-bottom: 1px solid var(--sand); padding-bottom: 10px; margin-bottom: 10px; }
.paper-head img { height: 48px; } .paper-head div { display: grid; }
@media print {
  body { background: #fff !important; }
  header.top, .rh, .noprint, button { display: none !important; }
  main { padding: 0 !important; max-width: none !important; }
  .slip, .paper { box-shadow: none; padding: 0; }
  body.papering > *:not(.rh-paper) { display: none !important; } .rh-paper { position: static; padding: 0; }
}
@media (max-width: 760px) {
  :root { --fs: 15px; }
  .rh-when { display: none; } .rh-view { padding: 14px; } .top, .rh { padding: 8px 14px; }
  .card { padding: 16px; } h1 { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
/* PO line history (apps/po/line_screen.js) */
.hist { width: 100%; border-collapse: collapse; }
.hist th, .hist td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 14px; }
.hist th { font-size: 13px; color: var(--mute); font-weight: 500; }
.hist .n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hist .chip { min-height: 30px; padding: 2px 10px; }

/* ---------- dashboard (every app's home): grid of small cards, Expand-style layout in the Ruh look ---------- */
.ic { flex: none; }
.dash { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .dash { grid-template-columns: minmax(0, 1fr); gap: 12px; } .dash > * { grid-column: auto !important; } }
.dcard { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 18px; display: grid; gap: 12px; min-width: 0; }
.dcard.wide { grid-column: 1 / -1; }
.dcard .card, .dcard .kpis { box-shadow: none; }
.dcard .kpi { box-shadow: none; background: transparent; padding: 0; }
.dcard h4 { margin: 0; display: flex; align-items: center; gap: 8px; font: 600 15px var(--sans); color: var(--ink); }
.dcard h4 .ic { color: var(--gold); }
.dquick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dq { min-height: 76px; border-radius: 14px; background: var(--ivory); color: var(--ink); display: grid; place-items: center; gap: 4px; padding: 10px 4px; font-size: 13px; }
.dq .ic { color: var(--maroon); } .dq:hover { background: var(--gold-soft); }
.dq.main { background: var(--maroon); color: #fff; box-shadow: 0 6px 16px rgba(107, 30, 46, .18); } .dq.main .ic { color: #fff; }
.dtints { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dt { min-height: 74px; border-radius: 14px; display: grid; align-content: center; justify-items: start; gap: 2px; padding: 10px 14px; text-align: left; color: var(--ink); }
.dt b { font: 600 24px/1.1 var(--sans); font-variant-numeric: tabular-nums; } .dt span { font-size: 13px; color: var(--mute); }
.dt.rose { background: #F6E9EA; } .dt.rose b { color: var(--maroon); }
.dt.sand { background: #F5EEDF; } .dt.sand b { color: #8A6A2E; }
.dt.sage { background: #EBF0E7; } .dt.sage b { color: var(--green); }
.dt.mist { background: #ECEFF2; } .dt.mist b { color: #3F5566; }
.drows { display: grid; }
.dr { display: grid; grid-template-columns: 52px 1fr; align-items: baseline; gap: 10px; min-height: 46px; padding: 6px 2px; border-radius: 0; border-bottom: 1px solid var(--line); text-align: left; color: var(--ink); }
.dr:last-child { border-bottom: 0; }
.dr b { font: 600 20px/1.1 var(--sans); text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
.dr span { font-size: 14px; }
.dr.red b { color: var(--red); } .dr.amber b { color: var(--amber); } .dr.green b { color: var(--green); }
.dr.zero b { color: #C9BFB4; } .dr.zero span { color: var(--mute); }
.dtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.dtabs button { min-height: 36px; padding: 0 10px; border-radius: 0; color: var(--mute); font-size: 13px; white-space: nowrap; }
.dtabs button.on { color: var(--maroon); box-shadow: inset 0 -2px 0 var(--maroon); background: transparent; }

/* ---------- app navigation: slim icon sidebar on PC, bottom bar on phone (same tabs) ---------- */
.rh-nav { position: fixed; z-index: 6; display: flex; background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.rh-nav button { position: relative; color: var(--mute); border-radius: 12px; display: grid; place-items: center; gap: 2px; padding: 6px; min-height: 52px; }
.rh-nav button.on { color: var(--maroon); background: var(--gold-soft); }
.rh-nav button i { position: absolute; top: 4px; right: 6px; font-style: normal; font-size: 10px; min-width: 16px; height: 16px; line-height: 16px; border-radius: 8px; background: var(--maroon); color: #fff; padding: 0 4px; }
@media (min-width: 900px) {
  .rh-nav { left: 0; top: 0; bottom: 0; width: 76px; flex-direction: column; gap: 4px; padding: 74px 8px 12px; box-shadow: 1px 0 0 var(--line); }
  .rh-nav button span { position: absolute; left: 66px; top: 50%; transform: translateY(-50%); background: var(--ink); color: #fff; font-size: 12px; padding: 4px 10px; border-radius: 6px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s; }
  .rh-nav button:hover span { opacity: 1; }
  body:has(.rh-nav) header.top { z-index: 7; padding-left: 92px; }
  body:has(.rh-nav) main { padding-left: 96px !important; }
}
@media (max-width: 899px) {
  .rh-nav { left: 0; right: 0; bottom: 0; justify-content: space-around; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); box-shadow: 0 -1px 0 var(--line); overflow-x: auto; }
  .rh-nav button { flex: 1; min-width: 60px; font-size: 11px; }
  body:has(.rh-nav) main { padding-bottom: 92px !important; }
}
