/* Indigo dye, undyed wool, marigold and madder red. One stylesheet for every screen. */
:root {
  --bg: #eef0f5; --card: #fff; --ink: #1b2545; --mute: #69728a; --line: #dfe3ec;
  --gold: #e3a008; --late: #c2362b; --photo: #fff;
  --num: "Anek Devanagari", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1528; --card: #182040; --ink: #edf0f8; --mute: #9aa3bd; --line: #2a3358;
          --gold: #f0b429; --late: #ff6b5e; }
}
* { box-sizing: border-box; }
body { font-family: "Mukta", system-ui, sans-serif; margin: 0 auto; padding: 22px 16px 48px;
       max-width: 1040px; background: var(--bg); color: var(--ink); font-size: 17px; line-height: 1.35; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* Big condensed figures are the voice of the app */
.num { font-family: var(--num); font-stretch: 75%; font-weight: 700; line-height: .95; letter-spacing: -.01em; }
.unit { font-size: 15px; color: var(--mute); font-weight: 400; }
.mute { color: var(--mute); }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 13px; color: var(--mute); letter-spacing: .02em; }

.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 18px; }
.top h1 { font-family: var(--num); font-stretch: 85%; font-weight: 600; font-size: 28px; margin: 0; }
.top .num { font-size: 30px; }
.back { display: inline-block; text-decoration: none; color: var(--mute); padding: 4px 0 10px; }
h2 { font-family: var(--num); font-stretch: 85%; font-weight: 600; font-size: 20px; margin: 34px 0 12px;
     display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
h2 small { font-family: "Mukta", sans-serif; font-size: 15px; font-weight: 400; color: var(--mute); }

.card { background: var(--card); border-radius: 18px; padding: 16px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* A rug photo always sits on its own white sheet, like a sample card */
.rug { background: var(--photo); border-radius: 8px; object-fit: contain; padding: 3px; flex: none;
       box-shadow: 0 1px 3px rgb(27 37 69 / .18); }

/* A weave tile, the same on the factory screen and the production panel: name and a fan of its
   rugs, then its two figures, then any warnings */
.grid.tiles { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.tile { display: block; padding: 0; overflow: hidden; text-decoration: none; transition: box-shadow .15s; }
.tile:hover, .summary a:hover { box-shadow: inset 0 0 0 2px var(--gold); }
.tile:active { transform: scale(.99); }
.tile-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px 12px 16px;
  min-height: 108px; }
.tile .name { font-family: var(--num); font-stretch: 85%; font-weight: 600; font-size: 22px; line-height: 1.15; }
.tile .meta { margin-top: 4px; font-size: 14px; color: var(--mute); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 14px; }
.chip { font-size: 13px; font-weight: 600; color: var(--late); padding: 4px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--late) 12%, transparent); }
.idle { margin-top: 18px; font-size: 14px; }
.late-tag { display: inline-block; margin-top: 6px; color: var(--late); font-weight: 600; font-size: 15px; }
.fan { display: flex; flex: none; padding-left: 18px; }
.fan .rug { width: 54px; height: 74px; margin-left: -18px; }
.fan .rug:nth-child(1) { transform: rotate(-7deg); }
.fan .rug:nth-child(3) { transform: rotate(7deg); }

/* Lost sales: the one loud thing on the factory screens */
.loss-banner { background: var(--late); color: #fff; margin-bottom: 16px; display: flex; justify-content: space-between;
  align-items: center; gap: 16px; padding: 16px 20px; font-weight: 600; }
.loss-banner .num { font-size: 40px; white-space: nowrap; }
.row-loss { grid-column: 1 / -1; color: var(--late); font-weight: 600; font-size: 14px; }

/* Factory detail: one design, numbered in the order to make it */
.no-photo { display: flex; align-items: center; justify-content: center; text-align: center;
            font-size: 14px; color: var(--mute); padding: 8px; background: var(--line); box-shadow: none; }
.tag { font-family: var(--num); font-weight: 700; font-size: 17px; background: var(--ink); color: var(--card);
       border-radius: 999px; min-width: 30px; height: 30px; padding: 0 9px; display: inline-flex;
       align-items: center; justify-content: center; }
.design .head { grid-template-columns: 96px 1fr; }
.design .rug { width: 96px; height: 128px; }
.design .size-line { grid-template-columns: 40px 1fr auto; }
.pieces { text-align: right; } .pieces .num { display: block; font-size: 32px; }
.pieces > span { font-size: 13px; color: var(--mute); }
/* the size drawn to scale, so 3×5 and 9×12 look different at a glance */
.shape-box { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }
.shape { display: block; border: 2px solid var(--ink); border-radius: 2px; opacity: .75; }

/* Ageing: a thread that fills over the 90 days and turns madder red when late */
.age { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--mute); }
.age i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.age i b { display: block; height: 100%; background: var(--ink); border-radius: 4px; }
.age.late { color: var(--late); font-weight: 600; }
.age.late i b { background: var(--late); }

/* Owner screen */
.summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.summary a { display: flex; flex-direction: column; gap: 4px; text-decoration: none; padding: 16px; transition: box-shadow .15s; }
.summary span { font-size: 14px; color: var(--mute); }
.summary .num { font-size: 44px; }
.summary small { font-size: 13px; color: var(--mute); line-height: 1.3; }
.summary .alert .num { color: var(--late); }
.grid.pair { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.panel h3 { font-family: var(--num); font-stretch: 85%; font-weight: 600; font-size: 19px; margin: 0 0 12px; }
.panel p { margin: 12px 0 0; font-size: 14px; }
@media (max-width: 720px) { .summary { grid-template-columns: repeat(2, 1fr); } .summary .num { font-size: 36px; } }
.pick { display: flex; gap: 14px; align-items: center; }
.pick .rug { width: 66px; height: 88px; }
.pick .body { flex: 1; min-width: 0; }
.pick { align-items: flex-start; }
.pick .num { font-size: 30px; }
.pick .name { font-weight: 600; }
.pick input { width: 26px; height: 26px; flex: none; accent-color: var(--gold); margin: 2px 0 0; }
label.pick { cursor: pointer; }
label.pick:has(input:not(:checked)) { opacity: .45; }
.approve-bar { position: sticky; bottom: 12px; margin-top: 12px; display: flex; justify-content: space-between;
               align-items: center; gap: 12px; box-shadow: 0 6px 24px rgb(27 37 69 / .25); }
.approve-bar .num { font-size: 30px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 8px;
         padding-top: 10px; border-top: 1px solid var(--line); }
.stats .num { display: block; font-size: 28px; }
.stats span { font-size: 13px; color: var(--mute); }
.pick .age { margin-top: 8px; }
button { font: inherit; font-weight: 600; border: 0; border-radius: 999px; padding: 12px 20px;
         background: var(--gold); color: #1b2545; cursor: pointer; }
button.quiet { background: transparent; color: var(--mute); box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 400; }
.loom { display: grid; grid-template-columns: 110px 1fr auto; gap: 14px; align-items: center; text-decoration: none;
        padding: 12px 0; border-top: 1px solid var(--line); }
.loom:first-child { border-top: 0; padding-top: 0; } .loom:last-child { padding-bottom: 0; }
.loom i { height: 10px; border-radius: 10px; background: var(--line); overflow: hidden; }
.loom i b { display: block; height: 100%; background: var(--ink); border-radius: 10px; }
.loom .num { font-size: 26px; }
details { margin-top: 34px; } summary { cursor: pointer; color: var(--mute); }
.table-wrap { overflow-x: auto; margin-top: 12px; padding: 4px 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
td, th { padding: 9px 8px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--mute); font-weight: 400; } .risk { color: var(--late); font-weight: 600; }
.empty { color: var(--mute); }

.card details { margin-top: 12px; }

.login { max-width: 380px; margin: 12vh auto 0; display: grid; gap: 16px; }
.login label { display: grid; gap: 6px; color: var(--mute); }
.login input { font: inherit; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line);
  background: transparent; color: inherit; }
.login input:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* Approval: a weave's page. One card per carpet: photo and name, its two figures, then a row that
   opens the sizes. Figures are always a condensed number over a small label. */
.figures { display: flex; gap: 28px; }
.figures > div { display: flex; flex-direction: column; gap: 2px; }
.panel .figures { flex-wrap: wrap; gap: 14px 32px; }
.figures .num { font-size: 34px; }
.figures span, .ticked { font-size: 13px; color: var(--mute); letter-spacing: .02em; }
.weave-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin: 2px 0 20px; }
.weave-head h1 { font-family: var(--num); font-stretch: 85%; font-weight: 600; font-size: 34px; margin: 0 0 4px; }
.weave-head p { margin: 0; max-width: 46ch; font-size: 15px; }
.weave-head .tools { margin: 0; flex: none; }
.weave-head .figures { text-align: right; } .weave-head .figures > div { align-items: flex-end; }
.weave-head .num { font-size: 44px; }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.tools input { flex: 1; min-width: 220px; font: inherit; font-size: 16px; padding: 11px 16px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--card); color: inherit; }
.tools button, .tools .download { padding: 10px 16px; font-size: 14px; line-height: 1.35; }
.grid.carpets { grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; align-items: start; }
.carpet { padding: 0; overflow: hidden; transition: opacity .15s; }
.carpet.off { opacity: .45; }
.carpet .head { display: grid; grid-template-columns: 72px 1fr 26px; gap: 14px; align-items: start; padding: 16px 16px 14px; }
.carpet .rug { width: 72px; height: 96px; }
.carpet .no-photo { background: var(--line); font-size: 12px; }
.carpet .name { font-weight: 600; font-size: 17px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }
.carpet .code { margin-top: 5px; font-size: 12px; }
.carpet .meta { margin-top: 2px; font-size: 14px; color: var(--mute); }
.carpet .all, .size-line > input { width: 24px; height: 24px; margin: 0; accent-color: var(--gold); cursor: pointer; }
.carpet .figures, .tile .figures { padding: 12px 16px; border-top: 1px solid var(--line); gap: 0; }
.carpet .figures > *, .tile .figures > * { flex: 1; }
.carpet .figures > * + *, .tile .figures > * + * { padding-left: 16px; border-left: 1px solid var(--line); }
.carpet .figures > a { margin: 0; border-radius: 0; padding-top: 0; padding-bottom: 0; }
.carpet .figures .num, .tile .figures .num { font-size: 32px; }
.carpet .open { display: flex; justify-content: space-between; align-items: center; width: 100%; border-radius: 0;
  background: transparent; color: var(--ink); font-weight: 400; font-size: 15px; padding: 12px 16px;
  border-top: 1px solid var(--line); }
.carpet .open:hover { background: color-mix(in srgb, var(--line) 45%, transparent); }
.chevron { width: 9px; height: 9px; margin: 0 4px 4px 0; border-right: 2px solid var(--mute);
  border-bottom: 2px solid var(--mute); transform: rotate(45deg); transition: transform .15s; }
.open[aria-expanded="true"] .chevron { margin-bottom: -4px; transform: rotate(225deg); }
.sizes { background: color-mix(in srgb, var(--line) 35%, transparent); padding: 0 16px; }
.size-line { display: grid; grid-template-columns: 24px 1fr auto; gap: 12px; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--line); }
.size-line:has(> input:not(:checked)) { opacity: .45; }
.size-line b { font-size: 17px; font-weight: 600; }
.size-line .code { margin-top: 2px; font-size: 12px; }
.size-line .facts { margin-top: 3px; font-size: 13px; color: var(--mute); display: flex; flex-wrap: wrap; gap: 0 10px; }
.size-line .facts span { white-space: nowrap; }
.qty { display: flex; align-items: center; gap: 4px; }
.qty button { width: 34px; height: 34px; padding: 0; font-size: 18px; line-height: 1; background: var(--card); }
.qty input { width: 52px; font: inherit; font-family: var(--num); font-stretch: 75%; font-weight: 700; font-size: 22px;
  text-align: center; padding: 3px 2px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--card);
  color: inherit; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.approve-bar { padding: 14px 18px; }
.approve-bar .figures { align-items: flex-end; gap: 24px; }
.approve-bar .figures .num { font-size: 30px; }
.approve-bar .figures .ticked { display: block; padding-bottom: 3px; white-space: nowrap; }
@media (max-width: 560px) {
  .weave-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .weave-head .figures { text-align: left; } .weave-head .figures > div { align-items: flex-start; }
  .approve-bar .figures .ticked { display: none; }
  .approve-bar { padding: 12px 14px; } .approve-bar .figures { gap: 14px; }
  .approve-bar .figures .num { font-size: 24px; }
  .approve-bar button { padding: 11px 14px; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) { .carpet, .chevron { transition: none; } }
.news { margin: 10px 2px 0; }
.download { display: inline-block; text-decoration: none; padding: 8px 14px; border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px var(--line); color: inherit; font-size: 15px; }
.age { margin-top: 2px; }
/* a figure that opens its list */
.figures > a { display: flex; flex-direction: column; gap: 2px; text-decoration: none; border-radius: 10px;
  padding: 4px 8px; margin: -4px -8px; transition: background .15s; }
.figures > a:hover { background: color-mix(in srgb, var(--gold) 22%, transparent); }
.figures > a span { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.panel p .download, .more .download { margin: 0 6px 6px 0; font-size: 14px; }
.more { margin-top: 26px; }
table.list td { vertical-align: middle; } .thumb { width: 36px; height: 48px; display: block; }
table.list th { position: sticky; top: 0; background: var(--card); }
/* Production progress: what is made is always marigold */
.made { color: var(--gold); }
.progress { height: 6px; background: var(--line); }
.progress b { display: block; height: 100%; background: var(--gold); }
.size-line .progress { margin-top: 8px; border-radius: 6px; overflow: hidden; }
.carpet details { margin: 0; } .carpet summary { list-style: none; cursor: pointer; }
.carpet summary::-webkit-details-marker { display: none; }
.carpet details[open] .chevron { margin-bottom: -4px; transform: rotate(225deg); }
.carpet details .size-line { grid-template-columns: 1fr auto; }
.carpet.finished .head, .carpet.finished .figures { opacity: .6; }
.weave-head h1 .mute { font-weight: 400; }
.after-tiles { margin-top: 14px; }
/* Priority: make this first. A dark pill with a marigold star, the same on every screen */
.pri-chip { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; padding: 3px 10px 3px 8px;
  border-radius: 999px; background: var(--ink); color: var(--card); font-size: 12px; font-weight: 600; white-space: nowrap; }
.pri-chip::before, .pri span::before, .pri-button::before { content: "\2605"; color: var(--gold); }
.pri-chip[hidden] { display: none; }
.chips .pri-chip { margin-top: 0; font-size: 13px; }
.pri-all { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 0; font-size: 13px; color: var(--mute); }
.pri-all span { flex: 1; min-width: 150px; } .pri-all button { padding: 6px 12px; font-size: 13px; background: var(--card); }
.pri { display: inline-flex; margin-top: 6px; cursor: pointer; }
.pri input { position: absolute; opacity: 0; pointer-events: none; }
.pri span, .pri-button { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--mute); background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.pri span::before, .pri-button::before { color: var(--line); }
.pri input:checked + span, .pri-button.on { background: var(--ink); color: var(--card); box-shadow: none; }
.pri input:checked + span::before, .pri-button.on::before { color: var(--gold); }
.pri input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.pri-form { margin-top: 6px; } .pri-button { border: 0; cursor: pointer; }
.add-row { display: flex; align-items: center; gap: 8px; }
.add-row input[type=number] { width: 64px; font: inherit; padding: 7px 8px; border-radius: 8px; border: 1.5px solid var(--line);
  background: transparent; color: inherit; text-align: center; }
.add-row .pri { margin: 0; } .add-row button { padding: 8px 16px; font-size: 14px; }
.done { margin-bottom: 14px; box-shadow: inset 4px 0 0 var(--gold); }
/* Season: twelve small bars, one per month */
.months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; margin-top: 16px; height: 110px; }
.months div { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; height: 100%; }
.months i { display: block; width: 100%; max-width: 34px; background: var(--ink); border-radius: 4px 4px 0 0; opacity: .8; }
.months b { font-family: var(--num); font-stretch: 75%; font-size: 14px; order: -1; }
.months span { font-size: 12px; color: var(--mute); }
