/* Colorado Plastic Products brand (Brand & Style Guidelines v3.0, Sept 2026).
   Ink and rust lead, yellow punctuates: yellow marks calls to action and key flags and always
   carries ink text. Neutrals do the quiet work. Green and red appear only as success/error states.
   Type: Big Shoulders for headings, labels and eyebrows; Inter for everything else. Sized small
   on purpose: this is a working board that has to show a lot of rows. */
:root {
  --ink: #28262C; --rust: #AD401F; --yellow: #FFC800;
  --bg: #EEF0F5; --panel: #FFFFFF; --soft: #F6F7FA; --text: #14181F; --muted: #5A6272; --line: #D9DCE4;
  --accent: var(--rust);            /* links, key numbers, active states on light */
  --tint: #FFF4CC;                  /* a wash of yellow for notices */
  --danger: #B42318; --ok: #157F3D; --up: #B42318; --down: #157F3D;
  --shadow: 0 1px 2px rgba(20, 24, 31, .08);
  --display: "Big Shoulders Display", "Arial Narrow", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181F; --panel: #28262C; --soft: #201E24; --text: #F4F5F8; --muted: #A9AFBC; --line: #403D46;
    --accent: var(--yellow);        /* rust on ink fails contrast; yellow on ink is approved */
    --tint: #3A3320; --danger: #FF8A7A; --ok: #5FD08A; --up: #FF8A7A; --down: #5FD08A;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 13px/1.45 Inter, Arial, sans-serif; display: flex; flex-direction: column; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.ghost { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; text-decoration: none; color: var(--text); }
.ghost:hover { background: var(--soft); border-color: var(--muted); }
/* Yellow buttons always carry ink text. */
.primary { background: var(--yellow); color: var(--ink); border: 0; border-radius: 6px; padding: 6px 14px; font-weight: 700; }
.primary:hover { filter: brightness(.95); }
.help { color: var(--muted); font-size: 12.5px; margin: 0; }
.chip { display: inline-block; background: var(--yellow); color: var(--ink); border-radius: 4px; padding: 0 6px; font-size: 11px; font-weight: 700; white-space: nowrap; }

.top { display: flex; align-items: center; gap: 14px; padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand h1 { font: 700 24px/1 var(--display); margin: 0; letter-spacing: .01em; position: relative; padding-bottom: 5px; }
.brand h1::after { content: ""; position: absolute; left: 0; bottom: 0; width: 28px; height: 3px; background: var(--yellow); }
.sync { color: var(--muted); font-size: 12px; }
.sync.stale { color: var(--danger); }
#search { flex: 1; min-width: 200px; max-width: 460px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--muted); }
.banner { background: var(--tint); color: var(--text); border-left: 4px solid var(--yellow); padding: 6px 16px; font-weight: 600; font-size: 12.5px; }

.tabs { display: flex; gap: 2px; padding: 4px 16px 0; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 6px 12px 7px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--rust); }
.tab .count { margin-left: 6px; background: var(--bg); border-radius: 999px; padding: 0 7px; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tab[aria-selected="true"] .count { background: var(--ink); color: #fff; }
.tab.push { margin-left: auto; }

main { flex: 1; min-height: 0; overflow: auto; padding: 10px 16px 70px; }
main.login { flex: 0 0 auto; overflow: visible; padding: 26px; }
.toolbar { display: flex; align-items: center; gap: 16px; justify-content: space-between; margin-bottom: 8px; flex-wrap: wrap; }
.toolbar .help { flex: 1; min-width: 260px; }
.tools { display: flex; align-items: center; gap: 12px; }
.inline { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
select, input[type="text"], input[type="number"], input[type="date"] { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
/* Bulk bar floats at the bottom so it stays put over a long list. */
.bulk { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 5; display: flex; align-items: center; gap: 12px;
  background: var(--ink); color: #fff; border-radius: 10px; padding: 8px 10px 8px 16px; box-shadow: 0 6px 24px rgba(0, 0, 0, .3); max-width: calc(100vw - 24px); }
.bulk .ghost { background: transparent; color: #fff; border-color: #5A6272; }
.bulk .ghost:hover { background: #3a373f; }
.bulk .bar { display: inline-block; vertical-align: middle; width: 160px; height: 6px; background: #4a4750; border-radius: 3px; margin-left: 10px; overflow: hidden; }
.bulk .bar i { display: block; height: 100%; background: var(--yellow); transition: width .4s; }

.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; }
/* Table headers are eyebrows: small spaced caps. */
#table th { position: sticky; top: 0; z-index: 1; background: var(--panel); text-align: left; font: 600 12px/1.2 var(--display); text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted); padding: 7px 8px; border-bottom: 2px solid var(--ink); white-space: nowrap; }
#table th:first-child { border-top-left-radius: 8px; } #table th:last-child { border-top-right-radius: 8px; }
#table th.num { text-align: right; }
#table td { padding: 4px 8px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 12.5px; line-height: 1.35; }
#table tbody tr { cursor: pointer; }
#table tbody tr:nth-child(even) { background: var(--soft); }
#table tbody tr:hover { background: var(--tint); }
#table tbody tr:last-child td { border-bottom: 0; }
#table td.prod { max-width: 380px; }
.pname { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.psub { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.newval { color: var(--accent); font-weight: 700; }
#table td.know { min-width: 190px; max-width: 320px; }
.sig { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill.old { display: inline-block; background: var(--tint); color: var(--text); border-radius: 4px; padding: 0 6px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.empty { padding: 30px 20px; text-align: center; color: var(--muted); margin: 0; }
#more { padding: 8px 10px; display: flex; align-items: center; gap: 10px; }
@media (max-width: 1100px) { .table-wrap { overflow-x: auto; } #table th { position: static; } }

.scrim { position: fixed; inset: 0; background: rgba(20, 24, 31, .4); z-index: 9; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(580px, 100vw); background: var(--panel); border-left: 1px solid var(--line); box-shadow: -8px 0 30px rgba(0, 0, 0, .2); z-index: 10; display: flex; flex-direction: column; }
.drawer-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 12px 16px; background: var(--ink); color: #fff; }
.drawer-head h2 { margin: 0 0 2px; font: 700 20px/1.15 var(--display); letter-spacing: .01em; }
.drawer-head p { margin: 0; color: #c9ccd4; overflow-wrap: anywhere; }
.drawer-head .ghost { background: transparent; color: #fff; border-color: #5A6272; }
.drawer-head .ghost:hover { background: #3a373f; }
.drawer-body { overflow: auto; padding: 14px 16px 40px; display: flex; flex-direction: column; gap: 16px; }
.sec h3 { margin: 0 0 6px; font: 600 12px/1.2 var(--display); text-transform: uppercase; letter-spacing: .14em; color: var(--rust); }
@media (prefers-color-scheme: dark) { .sec h3 { color: var(--yellow); } }
.now { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.now div { background: var(--bg); border-radius: 6px; padding: 6px 8px; }
.now span { display: block; font-size: 11px; color: var(--muted); }
.now b { font-variant-numeric: tabular-nums; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.form label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.form label.wide { grid-column: 1 / -1; }
.form input, .form select { width: 100%; color: var(--text); }
.cost-row { display: flex; align-items: center; gap: 6px; color: var(--text); }
.cost-row input { font-size: 17px; font-weight: 700; border-color: var(--ink); }
.note { background: var(--tint); color: var(--text); border-left: 4px solid var(--yellow); border-radius: 4px; padding: 6px 10px; font-size: 12.5px; margin: 8px 0 0; }
.note.info { background: var(--bg); border-left-color: var(--line); color: var(--muted); }
.prices { width: 100%; margin-top: 8px; }
.prices th { text-align: right; font: 600 11.5px/1.2 var(--display); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 4px 8px; }
.prices th:first-child, .prices td:first-child { text-align: left; }
.prices td { padding: 5px 8px; border-top: 1px solid var(--line); }
.prices .new { font-weight: 700; font-size: 14px; }
.up { color: var(--up); } .down { color: var(--down); }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li { display: grid; grid-template-columns: 84px 1fr auto; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); align-items: start; }
.hist li:first-child { border-top: 0; }
.hist .when { color: var(--muted); font-size: 12px; }
.hist .what b { font-variant-numeric: tabular-nums; }
.hist .sub { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.hist button { font-size: 12px; padding: 2px 8px; }
/* History tags stay inside the palette: ink, slate, yellow, rust, mist. */
.tag { font: 600 11px/1.5 var(--display); text-transform: uppercase; letter-spacing: .1em; border-radius: 3px; padding: 1px 6px; margin-right: 6px; }
.tag.cost { background: var(--ink); color: #fff; } .tag.feed { background: #5A6272; color: #fff; }
.tag.quote { background: var(--yellow); color: var(--ink); } .tag.applied { background: var(--rust); color: #fff; }
.tag.zoey { background: #EEF0F5; color: #5A6272; }
@media (prefers-color-scheme: dark) { .tag.cost { background: #fff; color: var(--ink); } }
.spark { width: 100%; height: 66px; display: block; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 2; }
.spark circle { fill: var(--accent); }
.spark text { fill: var(--muted); font-size: 11px; }

.margins-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px; max-width: 720px; box-shadow: var(--shadow); }
.margins-card h2 { margin: 0 0 6px; font: 700 22px/1.1 var(--display); }
#margins-table { margin: 14px 0; }
#margins-table th { font: 600 12px/1.2 var(--display); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
#margins-table th, #margins-table td { padding: 6px 10px; text-align: right; border-bottom: 1px solid var(--line); }
#margins-table th:first-child, #margins-table td:first-child { text-align: left; }
#margins-table input { width: 70px; text-align: right; }

dialog { border: 1px solid var(--line); border-top: 4px solid var(--yellow); border-radius: 8px; padding: 18px; width: min(680px, 94vw); background: var(--panel); color: var(--text); }
dialog::backdrop { background: rgba(20, 24, 31, .5); }
dialog h3 { margin: 0 0 8px; font: 700 20px/1.15 var(--display); }
dialog .actions { justify-content: flex-end; margin-top: 14px; }
.toast { position: fixed; bottom: 70px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; border-left: 4px solid var(--yellow); padding: 9px 16px; border-radius: 6px; z-index: 30; box-shadow: 0 6px 24px rgba(0, 0, 0, .3); max-width: 90vw; }
.toast.err { background: var(--danger); border-left-color: #fff; color: #fff; }
@media (prefers-color-scheme: dark) { .toast.err { color: #14181F; } }

.login-page { align-items: center; justify-content: center; background: var(--ink); }
.login { background: var(--panel); border-top: 4px solid var(--yellow); border-radius: 8px; padding: 26px; width: min(360px, 92vw); display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 40px rgba(0, 0, 0, .35); }
.login .login-logo { display: block; width: 100%; max-width: 260px; height: auto; margin: 0 auto 6px; }
.login h1 { margin: 0; text-align: center; font: 700 30px/1 var(--display); letter-spacing: .04em; text-transform: uppercase; }
.login .sub { margin: -6px 0 6px; font: 500 12px/1.2 var(--display); text-transform: uppercase; letter-spacing: .22em; color: var(--rust); }
@media (prefers-color-scheme: dark) { .login .sub { color: var(--yellow); } }
.login form { display: flex; flex-direction: column; gap: 12px; }
.login .sso-list { display: flex; flex-direction: column; gap: 8px; }
.login .sso { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--muted); border-radius: 6px;
  background: var(--panel); color: var(--text); font-weight: 600; font-size: 14px; text-decoration: none; }
.login .sso:hover { background: var(--bg); }
.login .fine, .login .or { margin: 0; text-align: center; color: var(--muted); font-size: 12px; }
.login label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.login input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font-size: 14px; }
.login button { background: var(--yellow); color: var(--ink); border: 0; border-radius: 6px; padding: 9px; font-weight: 700; }
.login .err { color: var(--danger); margin: 0; }

@media (max-width: 640px) {
  main { padding: 10px 10px 70px; } .top, .tabs { padding-left: 10px; padding-right: 10px; }
  .now { grid-template-columns: repeat(3, 1fr); } .form { grid-template-columns: 1fr; }
}
