/* Cycle Republic Operations - one stylesheet, no build step.
   Dark workshop by default, light switch for bright shop floors. Brand green sampled from the CR logo. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root, :root[data-theme="dark"] {
  --bg: #0a0c0b; --side: #0e110f; --panel: #131715; --raise: #1a1f1c; --field: #0f1210;
  --line: #272d29; --line2: #1d2320; --hover: #171c19;
  --ink: #f2f5f2; --muted: #adb7af; --faint: #7f8a82;
  --accent: #92c73b; --accent-hover: #a6d84e; --accent-ink: #0b1204; --accent-text: #92c73b; --accent-soft: rgba(146,199,59,.13); --accent-ring: rgba(146,199,59,.45);
  --ok: #2dd4bf; --ok-soft: rgba(45,212,191,.13); --warn: #f5a524; --warn-soft: rgba(245,165,36,.13);
  --bad: #ff6b6b; --bad-soft: rgba(255,107,107,.13); --info: #66b2ff; --info-soft: rgba(102,178,255,.13);
  --plate: #ffffff; --shadow: 0 10px 30px rgba(0,0,0,.45); color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f3f5f2; --side: #ffffff; --panel: #ffffff; --raise: #f6f8f5; --field: #ffffff;
  --line: #dde2dc; --line2: #eceee9; --hover: #f6f8f4;
  --ink: #111512; --muted: #4f5a52; --faint: #77837a;
  --accent: #92c73b; --accent-hover: #86ba30; --accent-ink: #0b1204; --accent-text: #3f6a0c; --accent-soft: rgba(146,199,59,.18); --accent-ring: rgba(98,150,22,.5);
  --ok: #0f766e; --ok-soft: rgba(15,118,110,.1); --warn: #a15c00; --warn-soft: rgba(245,165,36,.16);
  --bad: #c62828; --bad-soft: rgba(198,40,40,.09); --info: #1d5fb4; --info-soft: rgba(29,95,180,.09);
  --plate: #ffffff; --shadow: 0 10px 30px rgba(17,21,18,.12); color-scheme: light;
}
:root {
  --r: 12px; --r-sm: 8px; --side-w: 244px; --top: 56px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 var(--font); font-feature-settings: "cv11", "ss03"; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; margin: 0 0 4px; }
h2 { font-size: 17px; font-weight: 650; letter-spacing: -.01em; margin: 26px 0 10px; }
h3 { font-size: 15px; font-weight: 650; margin: 18px 0 6px; }
p { margin: 6px 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 12.5px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- shell: sidebar (admin) + top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 6px; height: var(--top); padding: 0 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .logo { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; letter-spacing: -.01em; text-decoration: none; }
.topbar .logo img { border-radius: 6px; }
.topbar .logo span { white-space: nowrap; }
.store-chip { padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: 13px; font-weight: 600; margin-right: 6px; white-space: nowrap; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--raise); color: var(--ink); text-decoration: none; }
.ic { width: 20px; height: 20px; flex: none; }

.side { position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: var(--side-w); display: flex; flex-direction: column; background: var(--side); border-right: 1px solid var(--line); transform: translateX(-100%); transition: transform .2s ease; }
body.nav-open .side { transform: none; }
.scrim { position: fixed; inset: 0; z-index: 35; background: rgba(0,0,0,.55); opacity: 0; pointer-events: none; transition: opacity .2s; }
body.nav-open .scrim { opacity: 1; pointer-events: auto; }
.side-brand { display: flex; flex-direction: column; gap: 4px; padding: 20px 20px 14px; text-decoration: none !important; }
.side-brand img { height: 34px; width: auto; align-self: flex-start; }
.side-sub { color: var(--faint); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.side nav { flex: 1; overflow-y: auto; padding: 4px 12px 12px; }
.side-find { padding: 0 12px 8px; }
.side-find input { width: 100%; min-height: 36px; padding: 6px 12px; font-size: 14px; background: var(--raise); border-color: transparent; }
.side-find input:focus { border-color: var(--accent-ring); }
.grp { margin-bottom: 2px; }
.grp > summary { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 10px; border-radius: 10px; color: var(--muted); font-weight: 500; cursor: pointer; list-style: none; user-select: none; }
.grp > summary::-webkit-details-marker { display: none; }
.grp > summary:hover { background: var(--raise); color: var(--ink); }
.grp > summary span { flex: 1; }
.grp > summary .chev { width: 16px; height: 16px; flex: none; color: var(--faint); transition: transform .15s; }
.grp[open] > summary { color: var(--ink); }
.grp[open] > summary .chev { transform: rotate(90deg); }
.grp-items { padding: 2px 0 8px; }
.side nav .grp-items a { height: 36px; padding-left: 44px; font-size: 14px; }
.side nav a[hidden], .grp[hidden] { display: none; }
.side nav a { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 10px; margin-bottom: 2px; border-radius: 10px; color: var(--muted); font-weight: 500; text-decoration: none; }
.side nav a:hover { background: var(--raise); color: var(--ink); }
.side nav a.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.side-foot { display: flex; align-items: center; gap: 2px; padding: 12px; border-top: 1px solid var(--line); }
.side-foot .who { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 6px; border-radius: 10px; color: var(--ink); text-decoration: none; }
.side-foot .who:hover { background: var(--raise); }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; flex: none; }
.who-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.who-t strong { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-t small { color: var(--faint); font-size: 12px; }

.container { max-width: 1240px; margin: 0 auto; padding: 22px 16px 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.loading { padding: 60px; text-align: center; color: var(--muted); }
.container.back-row { padding-bottom: 0 !important; }
.container.after-back { padding-top: 10px !important; }
.back-link { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 4px 10px 4px 4px; margin-left: -4px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 14px; }
.back-link:hover { background: var(--raise); color: var(--ink); text-decoration: none; }
.back-link .ic { width: 18px; height: 18px; }

@media (min-width: 981px) {
  body.has-side .side { transform: none; }
  body.has-side .topbar { display: none; }
  body.has-side .container { margin-left: var(--side-w); max-width: none; padding: 30px 36px 80px; }
  body.has-side .container > * { max-width: 1280px; }
  body.has-side { --top: 0px; }
  .scrim { display: none; }
  .nav-toggle { display: none; }
}

/* ---------- panels & grid ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 16px; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.stat .v { font-size: 30px; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 13px; margin-top: 4px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 6px 0; }
.spacer { flex: 1; }

/* ---------- forms ---------- */
label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 12px; }
label > input, label > select, label > textarea { display: block; margin-top: 6px; width: 100%; }
input, select, textarea { font: inherit; color: var(--ink); min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--field); min-width: 0; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--line) 50%, var(--muted)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; padding: 0; vertical-align: middle; accent-color: var(--accent); }
.inline label { display: inline-flex; align-items: center; gap: 8px; margin: 0 14px 0 0; color: var(--ink); font-size: 14px; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238f9a92' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; font: inherit; font-weight: 600; padding: 8px 16px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--raise); color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: color-mix(in srgb, var(--raise) 70%, var(--ink) 8%); border-color: color-mix(in srgb, var(--line) 50%, var(--muted)); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--bad); background: transparent; border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ok { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.sm { min-height: 32px; padding: 4px 12px; font-size: 13px; border-radius: 7px; }
.btn.lg { min-height: 48px; font-size: 16px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-text); cursor: pointer; }

/* ---------- tables ---------- */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); max-height: 72vh; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 11px 14px; border-bottom: 1px solid var(--line2); text-align: left; vertical-align: middle; }
th { position: sticky; top: 0; background: var(--raise); font-size: 13px; color: var(--muted); font-weight: 600; z-index: 1; white-space: nowrap; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--hover); }
tr.sel { background: var(--accent-soft) !important; }
td.edit { cursor: text; }
td.edit:hover { outline: 1px dashed var(--faint); outline-offset: -3px; }
td input.cell { width: 100%; min-height: 32px; padding: 3px 8px; }

/* ---------- tags & notices ---------- */
.tag { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--raise); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.tag.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.tag.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.tag.sale { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.flag { display: block; font-size: 13px; margin-top: 3px; }
.flag.high { color: var(--bad); } .flag.medium { color: var(--warn); } .flag.low, .flag.info { color: var(--muted); }
.notice { padding: 12px 14px; border-radius: var(--r-sm); margin: 10px 0; border: 1px solid; }
.notice.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, transparent); color: var(--ink); }
.notice.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 40%, transparent); color: var(--ink); }
.notice.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 40%, transparent); color: var(--ink); }
.notice.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 40%, transparent); color: var(--ink); }
.toast { position: fixed; right: 16px; bottom: 16px; max-width: 420px; padding: 12px 16px; border-radius: 10px; background: var(--ink); color: var(--bg); font-weight: 500; box-shadow: var(--shadow); z-index: 100; }
.toast.err { background: var(--bad); color: #fff; }
.drop { border: 2px dashed var(--line); border-radius: var(--r); padding: 36px 20px; text-align: center; background: var(--panel); cursor: pointer; color: var(--muted); }
.drop:hover { border-color: var(--faint); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.err { color: var(--bad); }
.ok { color: var(--ok); }

/* ---------- sign in ---------- */
body.auth { display: grid; place-items: center; min-height: 100vh; padding: 16px; background: radial-gradient(900px 500px at 50% -10%, rgba(146,199,59,.14), transparent 60%), var(--bg); }
.auth-card { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 32px 28px; box-shadow: var(--shadow); }
.auth-logo { display: block; width: 190px; height: auto; margin: 0 0 22px; }
/* v3.8.0: Cycle Republic and Tool Mart side by side on the sign-in page (stacked on a narrow phone) */
.auth-logos { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 18px; margin: 0 0 22px; }
.auth-logos img { display: block; height: 40px; width: auto; max-width: 100%; }
.auth-logos img + img { padding-left: 18px; border-left: 1px solid var(--line); }
@media (max-width: 440px) { .auth-logos { gap: 12px; } .auth-logos img { height: 30px; } .auth-logos img + img { padding-left: 12px; } }
.topbar .unit-logo img { height: 26px; width: auto; border-radius: 3px; }
@media (max-width: 640px) { .topbar .unit-logo img { height: 18px; } }
@media (max-width: 430px) { .topbar:has(.unit-logo) #theme { display: none; } } /* room for both screens next to the logo; the theme switch stays in the computer sidebar */
.auth-card h1 { font-size: 24px; margin: 0; }
.auth-card .muted { margin: 4px 0 20px; }
.auth-card .btn { width: 100%; margin-top: 8px; }

/* ---------- store price page ---------- */
.brand-tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); margin-bottom: 18px; }
.brand-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; text-align: center; font-weight: 600; font-size: 14px; line-height: 1.2; transition: border-color .12s, transform .12s; user-select: none; }
.brand-tile:hover { border-color: var(--faint); }
.brand-tile.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.brand-tile .plate { position: relative; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 12px; background: var(--plate); overflow: hidden; }
.brand-tile .plate img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--plate); }
.brand-tile .plate.all { background: var(--raise); color: var(--accent-text); border: 1px solid var(--line); }
.brand-tile .plate .ini { font-weight: 800; font-size: 20px; color: #3a423c; }
.brand-tile .sub { font-weight: 500; font-size: 12px; color: var(--muted); }
.brand-tile.on .nm { color: var(--accent-text); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters input[type=search] { flex: 1 1 280px; min-height: 48px; font-size: 16px; padding: 10px 14px 10px 42px; border-radius: 12px;
  background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238f9a92' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 14px center; }
.filters select { min-height: 48px; border-radius: 12px; }
.filters select { flex: 0 1 auto; }
.fsel { display: contents; }
.filter-btn { display: none; }
.filter-btn.on { border-color: var(--accent); color: var(--accent-text); }
.toggle { display: inline-flex; align-items: center; gap: 10px; margin: 0; min-height: 48px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); color: var(--ink); font-size: 14px; cursor: pointer; white-space: nowrap; }
.toggle:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.result-count { color: var(--muted); font-size: 13px; margin: 0 2px 8px; }

.price-table { font-size: 15px; }
.price-table th { padding: 12px 16px; }
.price-table td { padding: 14px 16px; vertical-align: middle; }
.price-table .model { font-weight: 600; font-size: 16px; }
.price-table .attrs { color: var(--muted); font-size: 13px; margin-top: 2px; }
.price-table td.num { font-size: 16px; }
.price-table td.cr { font-weight: 800; font-size: 20px; color: var(--accent-text); letter-spacing: -.01em; }
.price-table td.mrpc.cut { color: var(--faint); text-decoration: line-through; text-decoration-thickness: 1px; }

.plate.sm { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: var(--plate); overflow: hidden; flex: none; }
.plate.sm img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.plate.sm .ini { font-size: 12px; font-weight: 800; color: #3a423c; }

/* mobile price cards */
.pcards { display: grid; gap: 10px; }
.pcard { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; align-items: end; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.pcard:active { background: var(--hover); }
.pcard .model { font-weight: 650; font-size: 16px; line-height: 1.3; }
.pcard .attrs { grid-column: 1; color: var(--muted); font-size: 13px; }
.pcard .price { grid-column: 2; grid-row: 1 / span 2; text-align: right; }
.pcard .cr { font-size: 26px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.pcard .mrp { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pcard .mrp s { color: var(--faint); }
.pcard .meta { grid-column: 1 / -1; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; padding-top: 8px; margin-top: 6px; border-top: 1px solid var(--line2); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pcard .awaiting { font-size: 13px; color: var(--warn); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); cursor: pointer; font-size: 13px; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }

/* ---------- review ---------- */
.toolbar { position: sticky; top: var(--top); z-index: 5; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 0; background: var(--bg); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.tabs button { border: 0; background: transparent; color: var(--muted); padding: 7px 14px; border-radius: 8px; cursor: pointer; font: inherit; font-size: 14px; font-weight: 500; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; box-shadow: inset 0 0 0 1px var(--accent-ring); }
/* Review: tiles in one row, filters on one line, actions in their own bar so they never look like filters */
.grid.stats-row { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid.stats-row .stat { padding: 14px 16px; }
.grid.stats-row .stat .v { font-size: 26px; }
.review-filters { flex-wrap: nowrap; }
.filter-tabs { flex-wrap: wrap; gap: 2px; min-width: 0; flex: 1 1 auto; }
.filter-tabs button { white-space: nowrap; font-size: 13px; padding: 6px 9px; }
.filter-tabs .cnt { display: inline-block; min-width: 18px; margin-left: 3px; padding: 0 5px; border-radius: 999px; background: var(--raise); color: var(--muted); font-size: 12px; font-weight: 600; text-align: center; }
.filter-tabs button.on .cnt { background: var(--accent); color: var(--accent-ink); }
.review-filters { align-items: flex-start; }
.review-filters input[type=search], .action-bar input[type=search] { flex: 0 0 180px; width: 180px; }
.action-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 14px; margin-bottom: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.action-bar > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.action-bar .ab-sel { gap: 12px; }
.action-bar .ab-main { margin-left: auto; }
.action-bar .ab-main .btn { min-height: 44px; }
.action-bar .link:disabled { color: var(--faint); cursor: not-allowed; text-decoration: none; }
.action-bar #ap-sel:not(:disabled) { border-color: var(--accent-ring); color: var(--accent-text); }
.change.up { color: var(--bad); } .change.down { color: var(--ok); }
.old { color: var(--faint); font-size: 12px; text-decoration: line-through; display: block; }

dialog { color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 0; width: min(580px, calc(100vw - 24px)); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(2px); }
dialog .dlg-body { padding: 22px; max-height: 75vh; overflow: auto; }
dialog .dlg-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--raise); }
/* v2.1.0: with many buttons the row wraps (it used to push the first one, Cancel invoice, out of the window); a red first button sits on the left */
dialog .dlg-foot .btn.danger:first-child { margin-right: auto; }

/* ---------- attendance: admin ---------- */
.nowrap { white-space: nowrap; }
.faint { color: var(--faint) !important; }
.tags { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.link-stat { display: block; color: var(--ink); text-decoration: none !important; transition: border-color .12s; }
.link-stat:hover { border-color: var(--faint); }
.stat.good .v { color: var(--accent-text); }
.stat.warn .v { color: var(--warn); }
.stat.bad .v { color: var(--bad); }
.att-cards { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.panel.flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; }
.panel > .panel-head { margin: -18px -18px 14px; }
.panel.flush > .panel-head { margin: 0; }
.filters.tight { margin: 0; }
.filters.tight input[type=search] { min-height: 40px; font-size: 15px; flex: 1 1 220px; }
.filters input[type=date], .filters input[type=month] { min-height: 48px; border-radius: 12px; }
.filters.tight input[type=month] { min-height: 40px; border-radius: var(--r-sm); }
.filters .fl { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 13px; }
.filters .fl input { margin: 0; }
.page-head .actions select, .page-head .actions input { min-height: 40px; }
.table-wrap.bare { border: 0; border-radius: 0; max-height: none; }
tr.click { cursor: pointer; }
td.empty { text-align: center; padding: 28px; color: var(--muted); }
.seg { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 500; padding: 0 12px; min-height: 40px; border-radius: 9px; cursor: pointer; }
.seg button:hover { color: var(--ink); background: var(--raise); }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.kv { padding: 10px 12px; border: 1px solid var(--line2); border-radius: var(--r-sm); background: var(--raise); }
.kv span { display: block; font-size: 12px; color: var(--muted); }
.kv strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.kv.warn strong { color: var(--warn); }
dialog h3.first { margin-top: 0; }
.changes { padding-left: 18px; margin: 6px 0; font-size: 14px; }
.changes li { margin-bottom: 8px; }
.daypick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip-check { margin: 0; cursor: pointer; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); font-size: 14px; background: var(--field); }
.chip-check input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.chip-check input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.hol-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.hol-add input[name=name] { flex: 1 1 220px; }
.hol-add .inline { margin: 0; color: var(--ink); font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }

/* detail drawer */
.drawer { position: fixed; z-index: 60; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--line); box-shadow: var(--shadow); transform: translateX(105%); transition: transform .2s ease; }
body.drawer-open .drawer { transform: none; }
.drawer-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .2s; }
body.drawer-open .drawer-scrim { opacity: 1; pointer-events: auto; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0 0 2px; font-size: 19px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 14px 20px 30px; }
.drawer-body h3 { margin-top: 20px; }
.punches { display: grid; gap: 8px; margin-bottom: 8px; }
.punch { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line2); border-radius: var(--r-sm); background: var(--raise); }
.punch.void { opacity: .75; background: transparent; border-style: dashed; }
.punch.void .ptime { text-decoration: line-through; }
.punch-t { min-width: 0; }
.ptime { font-variant-numeric: tabular-nums; font-weight: 600; }
.was { font-size: 12px; color: var(--faint); text-decoration: line-through; }
.punch-a { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.thumb { width: 56px; height: 56px; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--field); cursor: zoom-in; display: grid; place-items: center; color: var(--faint); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.thumb.none { cursor: default; font-size: 13px; }
.photo-big { display: block; width: 100%; max-width: 480px; margin: 0 auto; border-radius: 12px; transform: scaleX(-1); }

/* ---------- attendance: store kiosk ---------- */
body.kiosk-mode { background: var(--bg); }
body.kiosk-mode .container { max-width: 560px; padding: 14px 16px 40px; }
.kiosk, #k-body { display: flex; flex-direction: column; gap: 14px; }
.k-emp-meta > span:first-child { white-space: nowrap; }
.k-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.k-head h1 { font-size: 30px; margin: 0; }
.k-clock { text-align: right; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; line-height: 1.1; }
.k-clock small { display: block; font-size: 13px; font-weight: 500; color: var(--muted); }
.k-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px 18px; }
.k-label { font-size: 17px; font-weight: 600; color: var(--ink); margin: 0 0 10px; }
.k-input { width: 100%; min-height: 68px; font-size: 32px; font-weight: 700; letter-spacing: .08em; text-align: center; text-transform: uppercase; border-radius: 14px; font-variant-numeric: tabular-nums; }
.k-input::placeholder { font-size: 20px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.k-big { width: 100%; min-height: 60px; font-size: 18px; border-radius: 14px; }
.k-big svg { width: 24px; height: 24px; }
.k-card .k-big { margin-top: 14px; }
.btn.ghost { background: transparent; }
.k-msg { margin-top: 12px; padding: 12px 14px; border-radius: 12px; font-size: 15px; line-height: 1.45; }
.k-msg.bad { background: var(--bad-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent); }
.k-msg.warn { background: var(--warn-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); }
.k-emp { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; }
.k-emp-name { font-size: 22px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.k-emp-meta { grid-column: 1; color: var(--muted); font-size: 14px; display: flex; gap: 4px 14px; flex-wrap: wrap; }
.k-emp-meta strong { color: var(--ink); font-weight: 600; }
.k-action { grid-column: 2; grid-row: 1 / span 2; padding: 10px 14px; border-radius: 12px; font-weight: 800; font-size: 16px; letter-spacing: .04em; text-align: center; white-space: nowrap; }
.k-action.in { background: var(--accent); color: var(--accent-ink); }
.k-action.out { background: var(--warn); color: #1b1200; }
.k-since { grid-column: 1 / -1; font-size: 13px; color: var(--muted); margin-top: 4px; }
.k-cam { position: relative; aspect-ratio: 1 / 1; width: 100%; border-radius: 22px; overflow: hidden; background: #000; border: 1px solid var(--line); }
.k-cam video, .k-shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.k-frame { position: absolute; inset: 11% 20% 9%; border: 3px solid rgba(255,255,255,.85); border-radius: 50% / 45%; box-shadow: 0 0 0 999px rgba(0,0,0,.28); pointer-events: none; }
.k-cam-wait { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 16px; background: #000; }
.k-hint { text-align: center; font-size: 17px; margin: 0; }
.k-btns { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.k-cancel-link { justify-self: center; align-self: center; color: var(--muted); font-size: 15px; padding: 8px 16px; }
.k-problem h2 { margin: 0 0 8px; font-size: 20px; }
.k-problem ol { padding-left: 20px; margin: 8px 0; line-height: 1.7; }
.k-done { text-align: center; padding: 30px 20px 22px; border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.k-tick { width: 84px; height: 84px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
.k-tick svg { width: 48px; height: 48px; }
.k-done h2 { margin: 0 0 16px; font-size: 22px; }
.k-done-name { font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.k-done-meta { color: var(--muted); font-size: 16px; margin-top: 2px; }
.k-done-act { display: inline-flex; gap: 10px; align-items: baseline; margin: 16px 0 8px; padding: 10px 18px; border-radius: 12px; background: var(--raise); font-size: 18px; font-weight: 600; }
.k-done-act span { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.k-done-act.in span { color: var(--accent-text); }
.k-done-act.out span { color: var(--warn); }
@media (min-width: 700px) and (orientation: landscape) {
  body.kiosk-mode .container { max-width: 900px; }
  .kiosk #k-body:has(.k-cam) { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
  .kiosk #k-body:has(.k-cam) .k-cam { grid-row: span 4; }
}
@media (max-width: 980px) {
  .filters .fl { flex: 1 1 calc(50% - 8px); }
  .filters .fl input { flex: 1; }
  .seg { flex: 1 1 100%; }
  .seg button { flex: 1; }
  .punch { grid-template-columns: 48px 1fr; }
  .punch-a { grid-column: 1 / -1; justify-content: flex-start; }
  .thumb { width: 48px; height: 48px; }
}
@media (max-height: 700px) { .k-cam { max-height: 46vh; aspect-ratio: auto; height: 46vh; } }

/* ---------- phones ---------- */
@media (max-width: 980px) {
  .container { padding: 16px 14px 80px; }
  h1 { font-size: 24px; }
  .hide-sm { display: none !important; }
  .brand-tiles { display: flex; overflow-x: auto; gap: 8px; padding: 2px 2px 8px; margin: 0 -14px 14px; padding-inline: 14px; scroll-snap-type: x proximity; scrollbar-width: none; }
  .brand-tiles::-webkit-scrollbar { display: none; }
  .brand-tile { flex: 0 0 auto; width: 92px; scroll-snap-align: start; }
  .brand-tile .plate { width: 54px; height: 54px; }
  .filters select { flex: 1 1 calc(50% - 8px); }
  .toggle, .filter-btn { flex: 1 1 40%; min-height: 48px; border-radius: 12px; }
  .filter-btn { display: inline-flex; order: 2; }
  .toggle { order: 3; }
  .fsel { display: none; order: 4; width: 100%; gap: 8px; flex-wrap: wrap; }
  .fsel.open { display: flex; }
  .page-prices .page-head { margin-bottom: 12px; }
  .page-prices .page-head h1 { font-size: 22px; }
  th, td { padding: 9px 10px; }
}
@media (max-width: 1280px) { .grid.stats-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 980px) {
  .review-filters { flex-wrap: wrap; }
  .review-filters input[type=search], .action-bar input[type=search] { flex: 1 1 100%; width: 100%; }
  .action-bar .ab-sel { width: 100%; }
  .action-bar .ab-main { margin-left: 0; width: 100%; }
  .action-bar .ab-main .btn { flex: 1; }
}
@media (max-width: 520px) {
  .grid.stats-row { grid-template-columns: 1fr 1fr; }
  body:not(.has-side) .topbar .logo span, body.store-side .topbar .logo span { display: none; }
  .store-chip { max-width: 55vw; }
  .grid { grid-template-columns: 1fr 1fr; }
  .stat .v { font-size: 26px; }
  .page-head .actions .btn { flex: 1; }
}
@media print {
  :root, :root[data-theme] { --bg: #fff; --panel: #fff; --raise: #f4f4f4; --ink: #000; --muted: #333; --faint: #555; --line: #bbb; --line2: #ddd; --accent-text: #2d5000; --field: #fff; }
  .topbar, .side, .filters, .brand-tiles, .toolbar, .scrim, .actions { display: none !important; }
  body.has-side .container { margin: 0; padding: 0; }
  .table-wrap { max-height: none; border: 0; }
  .pcards { display: none; }
}

/* ---------- logins with several kinds of access (v1.2.1) ---------- */
.perm-set { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 14px 6px; margin: 12px 0 8px; }
.perm-set legend { padding: 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
label.inline { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; }
label.inline > input[type=checkbox], label.inline > input[type=radio] { display: inline-block; width: auto; margin: 0; flex: none; }
.perm-set label.inline { margin: 6px 0; }
.top-tabs { display: flex; gap: 4px; margin-left: 12px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.top-tabs a { padding: 5px 12px; border-radius: 7px; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; }
.top-tabs a:hover { color: var(--ink); text-decoration: none; }
.top-tabs a.active { background: var(--accent-soft); color: var(--accent-text); }
@media (max-width: 520px) { .top-tabs { margin-left: 4px; } .top-tabs a { padding: 5px 9px; font-size: 13px; } }

/* v1.3.0: time picker (hour / minute / AM-PM) */
fieldset.tfield { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
fieldset.tfield legend { padding: 0; margin-bottom: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.tsel { display: flex; align-items: center; gap: 6px; }
.tsel select { flex: 1 1 0; min-width: 0; margin: 0; }
.tsel span { color: var(--muted); font-weight: 700; }

/* v1.3.0: attendance calendar. Weekly off green, holiday orange, working days plain (white in the light theme). */
.mnav { display: inline-flex; align-items: center; gap: 8px; }
.mnav strong { min-width: 150px; text-align: center; font-size: 16px; }
.mnav .btn { min-height: 48px; min-width: 44px; font-size: 20px; padding: 0 12px; }
.legend { display: inline-flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-left: auto; }
.lgd::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; border: 1px solid var(--line); background: var(--panel); }
.lgd.weekly_off::before { background: var(--cal-off); border-color: var(--cal-off-line); }
.lgd.holiday::before { background: var(--cal-hol); border-color: var(--cal-hol-line); }
:root, :root[data-theme="dark"] { --cal-off: rgba(146,199,59,.16); --cal-off-line: rgba(146,199,59,.55); --cal-hol: rgba(245,165,36,.18); --cal-hol-line: rgba(245,165,36,.6); }
:root[data-theme="light"] { --cal-off: #e6f4d2; --cal-off-line: #9cc95a; --cal-hol: #ffe9c7; --cal-hol-line: #f0a830; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cwd { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 2px 6px; }
.cday { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 108px; padding: 8px; text-align: left; font: inherit; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; overflow: hidden; }
.cday:hover { border-color: var(--faint); }
.cday.weekly_off { background: var(--cal-off); border-color: var(--cal-off-line); }
.cday.holiday { background: var(--cal-hol); border-color: var(--cal-hol-line); }
.cday.today { box-shadow: 0 0 0 2px var(--accent); }
.cday.sel { box-shadow: 0 0 0 2px var(--info); }
.cday.future .cn { color: var(--faint); }
.cn { font-weight: 700; font-size: 15px; }
.chol { font-size: 12px; font-weight: 600; color: var(--muted); line-height: 1.2; }
.cbody { display: flex; flex-wrap: wrap; gap: 4px; }
.ctime { font-size: 12px; width: 100%; }
.cchip { font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 6px; background: var(--raise); color: var(--muted); white-space: nowrap; }
.cchip.ok { background: var(--ok-soft); color: var(--ok); } .cchip.bad { background: var(--bad-soft); color: var(--bad); }
.cchip.warn { background: var(--warn-soft); color: var(--warn); } .cchip.info { background: var(--info-soft); color: var(--info); }
.daytype.weekly_off { color: var(--accent-text); font-weight: 600; } .daytype.holiday { color: var(--warn); font-weight: 600; }
.dperson { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line2); }
.dp-main { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.dp-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.plist { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.plist span { padding: 2px 8px; border-radius: 6px; background: var(--raise); }
.plist .in { color: var(--ok); } .plist .out { color: var(--muted); }
.cpad { min-height: 0; }
@media (max-width: 760px) {
  .calendar { gap: 3px; }
  .cday { min-height: 64px; padding: 5px; border-radius: 8px; }
  .chol, .ctime { display: none; }
  .cchip { font-size: 9px; padding: 1px 3px; }
  .legend { margin-left: 0; }
  .mnav { flex: 1 1 100%; justify-content: space-between; }
}
.type-seg { margin-bottom: 14px; }
.type-seg label { display: inline-flex; align-items: center; margin: 0; padding: 0 16px; min-height: 40px; border-radius: 9px; cursor: pointer; color: var(--muted); font-size: 14px; }
.type-seg label input { position: absolute; opacity: 0; pointer-events: none; }
.type-seg label.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.type-seg label:has(input:focus-visible) { outline: 2px solid var(--accent-ring); }

/* v1.3.0: brand tiles on one line (scroll sideways), price filters on one line */
.tiles-wrap { position: relative; margin-bottom: 18px; }
.tiles-wrap .brand-tiles { display: flex; overflow-x: auto; gap: 10px; margin: 0; padding: 2px 2px 6px; scroll-snap-type: x proximity; scrollbar-width: thin; scroll-behavior: auto; }
.tiles-wrap .brand-tile { flex: 0 0 112px; scroll-snap-align: start; }
.tiles-arrow { position: absolute; z-index: 2; top: 50%; transform: translateY(-60%); width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; box-shadow: var(--shadow); }
.tiles-arrow:hover { border-color: var(--accent); color: var(--accent-text); }
.tiles-arrow.prev { left: -12px; } .tiles-arrow.next { right: -12px; }
@media (min-width: 981px) {
  .filters.one-line { flex-wrap: nowrap; }
  .filters.one-line input[type=search] { flex: 1 1 220px; min-width: 180px; }
  .filters.one-line .fsel { display: flex; gap: 8px; flex: 0 1 auto; min-width: 0; }
  .filters.one-line .fsel select { flex: 0 1 150px; min-width: 110px; }
  .filters.one-line .toggle { flex: 0 0 auto; padding: 0 12px; }
}
@media (max-width: 980px) {
  .tiles-arrow { display: none; }
  .tiles-wrap { margin: 0 -14px 14px; }
  .tiles-wrap .brand-tiles { padding-inline: 14px; scrollbar-width: none; }
  .tiles-wrap .brand-tile { flex: 0 0 92px; }
}

/* v1.3.0: payroll */
.pay-cards { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.calchips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 14px; }
.calchip { font-size: 13px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--muted); }
.calchip strong { color: var(--ink); margin-right: 4px; }
.pay-table tfoot td { border-top: 2px solid var(--line); font-weight: 600; }
table.explain td:first-child { width: 34px; color: var(--accent-text); font-weight: 700; }
.seg button.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
@media (max-width: 980px) { .pay-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- service job cards (v1.3.0) ---------- */
.svc-table tbody tr { cursor: pointer; }
.svc-table tbody tr:hover { background: var(--raise); }
.empty { padding: 32px 18px; text-align: center; color: var(--muted); }
.job-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.job-side .sticky { position: sticky; top: 16px; }
.job-main textarea { width: 100%; resize: vertical; }
.job-main label { margin-bottom: 10px; }
.job-main h3 { margin: 14px 0 8px; font-size: 15px; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) 140px 40px; gap: 8px; align-items: center; margin-bottom: 8px; }
.line.sp, .sp-head { grid-template-columns: minmax(0, 1fr) 100px 108px 92px 40px; }
.sp-head { display: grid; gap: 8px; margin: 10px 0 4px; }
.line .amt, .line .qty { text-align: right; }
.line .num { font-variant-numeric: tabular-nums; }
#quick { margin-bottom: 10px; }
.chip:disabled { cursor: default; opacity: .7; }
.trow { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line2, var(--line)); font-size: 14px; }
.trow span { color: var(--muted); }
.trow strong { font-variant-numeric: tabular-nums; }
.trow.sub strong { color: var(--ink); }
.trow.grand { border-bottom: 0; font-size: 20px; padding-top: 12px; }
.trow.grand span { color: var(--ink); font-weight: 600; }
.trow.grand strong { color: var(--accent-text); }
.warn-text { color: var(--warn); }
.btn.block { width: 100%; margin-top: 12px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.thumbs figure { position: relative; margin: 0; width: 110px; height: 110px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs figure .icon-btn { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; min-height: 0; background: rgba(0,0,0,.6); color: #fff; }
.thumb-add { display: flex; align-items: center; justify-content: center; width: 110px; height: 110px; border: 1px dashed var(--line); border-radius: var(--r-sm); color: var(--accent-text); font-weight: 600; cursor: pointer; margin: 0; }
.st-chips { margin-bottom: 8px; }
.timeline { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.timeline li { padding: 8px 0 8px 14px; border-left: 2px solid var(--line); margin-left: 4px; }
.rate-table input { width: 68px; padding: 6px 8px; text-align: right; }
.rate-table td, .rate-table th { padding-left: 6px; padding-right: 6px; }
.rate-table th[rowspan] { vertical-align: top; text-align: left; }
@media (max-width: 980px) {
  .job-grid { grid-template-columns: 1fr; }
  .job-side .sticky { position: static; }
}
@media (max-width: 560px) {
  .line.sp, .sp-head { grid-template-columns: minmax(0, 1fr) 76px 100px 36px; }
  .line.sp .num, .sp-head span:nth-child(4) { display: none; }
  .line { grid-template-columns: minmax(0, 1fr) 100px 36px; }
  .svc-table:not(.rt) th:nth-child(4), .svc-table:not(.rt) td:nth-child(4), .svc-table:not(.rt) th:nth-child(7), .svc-table:not(.rt) td:nth-child(7) { display: none; }
}
@media print {
  .page-service-job .notice, .page-service-job #status, .page-service-job .icon-btn, .page-service-job .thumb-add, .page-service-job #addl, .page-service-job #adds, .page-service-job #save, .page-service-job #quick, .page-service-job a.small { display: none !important; }
  .page-service-job .job-grid { grid-template-columns: 1fr; }
  .page-service-job .panel { break-inside: avoid; padding: 10px; margin-bottom: 8px; }
}

/* WhatsApp */
.wa-tabs { margin-bottom: 14px; overflow-x: auto; flex-wrap: nowrap; }
.wa-tabs a { color: var(--muted); padding: 7px 14px; border-radius: 8px; font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.wa-tabs a:hover { color: var(--ink); }
.wa-tabs a.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; box-shadow: inset 0 0 0 1px var(--accent-ring); }
.grid.stats-row.wa-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 14px; }
.wa-fs { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 12px 10px; margin: 10px 0; }
.wa-fs legend { padding: 0 6px; font-size: 13px; color: var(--muted); }
.wa-fs label.inline { margin: 4px 0; }
.wa-fs .chips label.inline { margin: 2px 12px 2px 0; }
.wa-param { display: grid; grid-template-columns: 56px 1fr 1fr; gap: 8px; align-items: center; margin: 6px 0; }
.wa-param input[hidden] { display: none; }
.wa-text { max-width: 460px; white-space: pre-line; font-size: 13.5px; }
.wa-copy { user-select: all; word-break: break-all; padding: 8px 10px; background: var(--raise); border-radius: var(--r-sm); }
.wa-msgs td { vertical-align: top; }
tr.muted td { color: var(--muted); }
@media (max-width: 520px) { .grid.stats-row.wa-stats { gap: 8px; } .wa-stats .stat { padding: 10px 12px; } .wa-stats .stat .v { font-size: 22px; } .wa-stats .stat .l { font-size: 12px; } .wa-param { grid-template-columns: 1fr; } }
.wa-hook > div { margin: 8px 0; }

/* Production */
tr.click:hover td, tr.click:hover th { background: var(--raise); }
.pp-results { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 8px; max-height: 260px; overflow: auto; }
.pp-hit { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); color: var(--ink); font: inherit; cursor: pointer; }
.pp-hit:hover, .pp-hit:focus { border-color: var(--accent); outline: none; }
.pp-picked { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 10px 12px; margin: 6px 0 10px; border: 1px solid var(--accent-ring); background: var(--accent-soft); border-radius: var(--r-sm); }
.pp-picked .small { grid-column: 1; }
.pp-picked .btn { grid-row: 1 / span 2; grid-column: 2; }
.pp-amount { font-size: 15px; margin: 10px 0 0; }
.grid.stats-row.pp-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 6px; }
.grid.stats-row.pp-stats4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; }
.pp-plan tr.need th { color: var(--warn); }
.pp-detail > td { background: var(--raise); padding: 10px 14px; }
.pp-items { width: 100%; font-size: 13.5px; }
.pp-issue { white-space: pre-line; }
.pp-brands { margin-bottom: 14px; }
.pp-brands summary { cursor: pointer; }
.pp-rates input.n { min-width: 220px; width: 100%; }
.pp-rates input.amt { width: 90px; text-align: right; }
@media (max-width: 720px) { .grid.stats-row.pp-stats, .grid.stats-row.pp-stats4 { grid-template-columns: 1fr 1fr; gap: 8px; } }

/* ---------- dashboard (v1.4.0) ---------- */
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.dash-grid .panel { margin: 0; }
.dash-panel > .panel-head { margin: 0 0 12px; padding: 0; border: 0; }
.dash-panel .panel-head h2 { margin: 0; }
.grid.stats-row.dash-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.grid.stats-row.dash-stats.one { grid-template-columns: minmax(0, 1fr); max-width: 260px; }
.dash-stats .stat { padding: 12px 14px; background: var(--raise); border-color: transparent; }
.dash-stats .stat .v { font-size: 24px; }
.dash-stats .stat .v small { font-size: 15px; color: var(--muted); font-weight: 600; }
.dash-stats .stat .l { font-size: 12.5px; }
a.stat.link { color: inherit; text-decoration: none; }
a.stat.link:hover { border-color: var(--accent-ring); }
.todo { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.todo li { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-top: 1px solid var(--line2); }
.todo li:first-child { border-top: 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--muted); }
.dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); } .dot.ok { background: var(--ok); } .dot.info { background: var(--info); }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .grid.stats-row.dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media print { .back-row, .side-find { display: none !important; } }
/* payroll: step-by-step pay (v1.4.0) */
.pay-how { padding: 12px 18px; }
.pay-how summary { cursor: pointer; }
.pay-how ol { margin: 10px 0 2px; padding-left: 20px; display: grid; gap: 6px; color: var(--muted); }
.pay-how ol strong { color: var(--ink); }
.pay-steps { list-style: none; margin: 8px 0 12px; padding: 0; counter-reset: st; }
.pay-steps li { display: flex; gap: 14px; justify-content: space-between; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line2); counter-increment: st; }
.pay-steps li > div { position: relative; padding-left: 30px; }
.pay-steps li > div::before { content: counter(st); position: absolute; left: 0; top: 1px; width: 21px; height: 21px; border-radius: 50%; background: var(--raise); color: var(--muted); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.pay-steps .v { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pay-steps li.total { border-top: 2px solid var(--line); }
.pay-steps li.total .v { color: var(--accent-text); font-size: 18px; }
.sheet-cols summary { cursor: pointer; color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.pay-table td:first-child, .pay-table th:first-child { min-width: 170px; }

/* v1.5 service, invoices, fittings, pricing */
.part-list { display: grid; gap: 6px; margin: 8px 0 12px; max-height: 340px; overflow-y: auto; }
.part { display: flex; justify-content: space-between; gap: 12px; align-items: center; text-align: left; width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--field); color: inherit; font: inherit; cursor: pointer; }
.part:hover, .part:focus-visible { border-color: var(--accent); }
.part > span:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.part > span:first-child strong { overflow-wrap: anywhere; }
#partq { width: 100%; margin-top: 4px; }
.nowrap { white-space: nowrap; }

/* v1.5 WhatsApp */
.grid.stats-row.wa-stats.wa-stats4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.wa-param { grid-template-columns: minmax(70px, 150px) 1fr 1fr; }
.wa-slot { font-size: 12.5px; overflow-wrap: anywhere; }
.wa-body { white-space: pre-line; }
.wa-vars { margin: 8px 0 2px; font-size: 13.5px; }
.wa-vars summary { cursor: pointer; color: var(--accent-text); }
.wa-vars ul { columns: 2; column-gap: 18px; margin: 8px 0; padding-left: 18px; color: var(--muted); }
.wa-why { max-width: 360px; overflow-wrap: anywhere; }
@media (max-width: 720px) { .grid.stats-row.wa-stats.wa-stats4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .wa-param { grid-template-columns: 1fr; } .wa-vars ul { columns: 1; } }
/* v1.5 attendance + HR */
/* Payroll row: a payslip */
dialog:has(.payslip) { width: min(760px, calc(100vw - 24px)); }
.payslip { display: grid; gap: 14px; }
.ps-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ps-name { font-size: 18px; font-weight: 700; }
.ps-total { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px 20px; padding: 16px 18px; border-radius: var(--r); background: var(--accent-soft); border: 1px solid var(--accent-ring); }
.ps-total span { display: block; font-size: 13px; color: var(--muted); }
.ps-total > div:first-child strong { font-size: 28px; line-height: 1.15; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.ps-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.ps-meta span { display: inline; font-size: 13px; }
.ps-meta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.ps-sec { border: 1px solid var(--line); border-radius: var(--r); padding: 4px 14px 6px; background: var(--raise); }
.ps-sec h3 { margin: 10px 0 4px; font-size: 14px; font-weight: 700; color: var(--accent-text); }
.ps-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line2); }
.ps-sec h3 + .ps-row { border-top: 0; }
.ps-row span { display: block; font-weight: 500; }
.ps-row small { display: block; color: var(--muted); font-size: 12px; }
.ps-row strong { white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.ps-sum { border-top: 2px solid var(--line); }
.ps-sum strong { color: var(--accent-text); font-size: 17px; }
.ps-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ps-more summary { cursor: pointer; color: var(--muted); font-size: 14px; padding: 4px 0; }
.payslip .notice { margin: 0; }
@media (max-width: 640px) { .ps-cols { grid-template-columns: 1fr; } .ps-total > div:first-child strong { font-size: 24px; } }
/* Records summary */
.att-sum summary { cursor: pointer; }
.att-sum .table-wrap { margin-top: 10px; }
.att-cl { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
/* HR portal: casual leave, team leave */
.hr-stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.hr-stats .v small { font-size: 13px; color: var(--muted); font-weight: 500; }
.hr-cl { display: flex; gap: 16px; align-items: center; padding: 14px 16px; margin-bottom: 14px; border-radius: var(--r); background: var(--accent-soft); border: 1px solid var(--accent-ring); }
.hr-cl .v { font-size: 30px; font-weight: 800; line-height: 1; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.hr-cl .l { font-size: 12px; color: var(--muted); white-space: nowrap; }
.hr-tabs .cnt { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; }
.hr-req-act { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
#lcheck .notice { margin: 4px 0 8px; }

/* ---------- v1.6.0 Sales and Customers ---------- */
.ipick { position: relative; }
.ipick-list { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); max-height: 320px; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.35); padding: 4px; }
.ipick-item { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 10px; text-align: left; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 14px; padding: 9px 10px; border-radius: 8px; cursor: pointer; min-height: 40px; }
.ipick-item:hover, .ipick-item.on { background: var(--accent-soft); }
.ipick-item .num { white-space: nowrap; }
.ipick-msg { margin: 0; padding: 10px; color: var(--muted); font-size: 14px; }
.sl-head, .sl-row { display: grid; grid-template-columns: minmax(0, 1fr) 108px 116px 108px 110px 36px; gap: 8px; align-items: center; }
.sl-head { padding: 0 2px 4px; border-bottom: 1px solid var(--line2); }
.sl-row { padding: 8px 2px; border-bottom: 1px solid var(--line2); }
.sl-row.lab { grid-template-columns: minmax(0, 1fr) 130px 36px; }
.sl-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sl-name .sl-link { margin-top: 4px; }
.pay-row { display: grid; grid-template-columns: 200px minmax(0, 1fr) 130px 36px; gap: 8px; align-items: center; margin-bottom: 8px; }
.type-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.type-tile { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--raise); color: var(--ink); text-decoration: none; min-height: 72px; }
.type-tile:hover { border-color: var(--accent); background: var(--accent-soft); }
.type-tile.ghost { background: transparent; border-style: dashed; }
.tt-ic, .kind-ic { display: inline-grid; place-items: center; color: var(--accent-text); }
.tt-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); flex: none; }
.tt-ic .ic { width: 24px; height: 24px; }
.kind-ic .ic { width: 26px; height: 26px; vertical-align: -4px; }
.tt-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
details.more { margin: 8px 0; }
details.more > summary { cursor: pointer; color: var(--accent-text); font-size: 14px; font-weight: 500; padding: 6px 0; }
.done-card { max-width: 520px; margin: 40px auto; text-align: center; }
.actions.center { justify-content: center; flex-wrap: wrap; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 12px 0; }
.seg.wrap { display: flex; flex-wrap: wrap; margin-bottom: 12px; }
.tag.vip { background: #d4a72c; color: #1a1300; border-color: transparent; }
/* v1.7.0: a discount on each invoice line (% or ₹), the customer card */
.disc-in { display: flex; min-width: 0; }
.disc-in input { min-width: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.disc-t { flex: 0 0 34px; border: 1px solid var(--line); border-left: 0; border-radius: 0 8px 8px 0; background: var(--raise); color: var(--accent-text); font-weight: 700; cursor: pointer; }
.sl-amt { line-height: 1.25; }
#quick .chips { margin: 10px 0 4px; }
.chip.on .muted { color: inherit; opacity: .75; }
.crm-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 10px; background: var(--raise); display: flex; flex-direction: column; gap: 6px; }
.crm-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crm-stats { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted); }
.crm-stats b { color: var(--ink); }
.crm-notes { font-size: 14px; }
.crm-notes textarea { width: 100%; }
.qp-list { margin-top: 10px; max-height: 320px; overflow: auto; }
.qp-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line2); }
.container.set-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding-bottom: 0 !important; }
.set-name { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: none; }
.set-tabs .seg a { display: inline-flex; align-items: center; color: var(--muted); font-size: 14px; font-weight: 500; padding: 0 12px; min-height: 36px; border-radius: 9px; text-decoration: none; }
.set-tabs .seg a:hover { color: var(--ink); background: var(--raise); }
.set-tabs .seg a.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.container.after-tabs { padding-top: 12px !important; }
.att-rec-h { font-size: 16px; margin: 18px 0 8px; }
.link-btn { background: none; border: 0; padding: 0 4px; color: var(--accent-text); cursor: pointer; text-decoration: underline; }
@media (max-width: 700px) {
  .sl-head { display: none; }
  .sl-row { grid-template-columns: 108px minmax(0, 1fr) 104px 36px; }
  .sl-row .sl-name { grid-column: 1 / -1; }
  .sl-row .sl-amt { grid-column: 1 / -2; grid-row: 3; }
  .sl-row.lab { grid-template-columns: minmax(0, 1fr) 110px 36px; }
  .pay-row { grid-template-columns: minmax(0, 1fr) 110px 36px; }
  .pay-row > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- v1.8.0: customer tile beside the bill, bottom bar on phones, one-line stats ---------- */
.job-side { display: flex; flex-direction: column; }
.cust-tile label { margin-bottom: 10px; }
.cust-tile input, .cust-tile select { width: 100%; }
.cust-tile .crm-card { margin-top: 4px; }
.cust-tile .more { margin-top: 6px; }
.cust-tile .more summary { cursor: pointer; color: var(--accent-text); font-size: 14px; margin-bottom: 8px; }
.fld > label { margin-bottom: 4px; }
.with-btn { display: flex; gap: 8px; align-items: center; }
.with-btn select { flex: 1 1 auto; min-width: 0; }
.with-btn .btn { flex: none; }
.free-chk { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; font-size: 13px; color: var(--accent-text); font-weight: 600; }
.mbar { display: none; }
@media (max-width: 980px) {
  .job-side { display: contents; }
  .cust-tile { order: -1; }
  .job-main { order: 0; }
  .bill-tile { order: 1; }
  #status { order: 2; }
  .job-grid { gap: 0; }
  .mbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0,0,0,.18); }
  .mbar > div { display: flex; flex-direction: column; line-height: 1.15; }
  .mbar strong { font-size: 22px; font-variant-numeric: tabular-nums; color: var(--accent-text); }
  .mbar .btn { min-height: 48px; padding: 8px 22px; font-size: 16px; }
  .cust-tile input, .cust-tile select, .job-main input, .job-main select, .job-main textarea { font-size: 16px; min-height: 46px; }
}
/* underlined tabs with counts (v1.8.0) */
.utabs { display: flex; gap: 22px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 14px 0 12px; scrollbar-width: none; }
.utabs::-webkit-scrollbar { display: none; }
.utabs button, .utabs a { flex: none; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 10px 2px; font: inherit; font-size: 15px; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap; text-decoration: none; }
.utabs button:hover, .utabs a:hover { color: var(--ink); }
.utabs .on { color: var(--accent-text); border-bottom-color: var(--accent); font-weight: 600; }
.utabs .n { margin-left: 4px; color: var(--faint); font-weight: 500; }
.utabs .on .n { color: var(--ink); }
/* one-line stat tiles: scroll sideways on a phone instead of wrapping */
.grid.stats-row.stat-strip { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(132px, 1fr); overflow-x: auto; scrollbar-width: none; gap: 10px; }
.stat-strip .stat { padding: 12px 14px; }
.stat-strip .stat .v { font-size: 24px; }
.stat-strip .stat .l { font-size: 12px; }
.kv-grid.kv-strip { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(104px, 1fr); overflow-x: auto; scrollbar-width: none; }
.kv-strip .kv { white-space: nowrap; }
/* ---------- v1.8.0: back to everybody, attendance on a phone ---------- */
.emp-back { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 14px; }
.emp-back .btn { gap: 4px; }
@media (max-width: 700px) {
  .att-table th:nth-child(2), .att-table td:nth-child(2), .att-table th:nth-child(3), .att-table td:nth-child(3), .att-table th:nth-child(8), .att-table td:nth-child(8),
  .att-table th:nth-child(9), .att-table td:nth-child(9), .att-table th:nth-child(11), .att-table td:nth-child(11) { display: none; }
  .att-table { font-size: 13px; }
  .att-table th, .att-table td { padding: 9px 7px; }
  .att-sum td:first-child, .att-sum th:first-child { position: sticky; left: 0; background: var(--panel); z-index: 2; min-width: 120px; }
  [data-page=att-records] .filters .fl { flex: 1 1 calc(50% - 8px); }
  [data-page=att-records] .page-head .actions { width: 100%; }
  [data-page=att-records] .page-head .actions .btn { flex: 1 1 auto; }
}
.job-main input[type=search] { width: 100%; }
.job-main .fld { grid-column: span 2; margin-bottom: 10px; }
.with-btn select { flex: 1 1 160px; min-width: 160px; }
#labour { margin-top: 4px; }
@media (max-width: 560px) { .job-main .fld { grid-column: 1 / -1; } }
/* tables that turn into cards on a phone (class "rt") */
@media (max-width: 700px) {
  .rt, .rt tbody { display: block; width: 100%; }
  .rt thead { display: none; }
  .rt tr { display: block; padding: 11px 14px; border-bottom: 1px solid var(--line); }
  .rt tbody tr:hover { background: transparent; }
  .rt td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 2px 0; border: 0; text-align: right; }
  .rt td::before { content: attr(data-label); flex: none; color: var(--muted); font-size: 12px; text-align: left; }
  .rt td:first-child { display: block; text-align: left; font-size: 15px; padding-bottom: 4px; }
  .rt td:first-child::before, .rt td[data-label=""]::before { content: none; }
  .rt td:empty { display: none; }
  .rt td:last-child[data-label=""] { justify-content: flex-start; gap: 8px; padding-top: 8px; }
  .table-wrap:has(.rt) { max-height: none; overflow: visible; }
}

@media (max-width: 980px) {
  .page-prices .filters .toggle, .page-prices .filters .filter-btn { flex: 1 1 28%; min-height: 44px; padding: 0 8px; font-size: 13px; gap: 6px; justify-content: center; }
  .page-prices .page-head .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
  .page-prices .page-head .actions .btn { min-height: 44px; padding: 6px 8px; font-size: 14px; }
  .page-prices .page-head .actions .btn.primary { grid-column: 1 / -1; }
  [data-page=att-dashboard] .att-table td:first-child, [data-page=att-dashboard] .att-table th:first-child { position: sticky; left: 0; background: var(--panel); z-index: 2; }
}

/* ---------- v1.9.0: the Settings area (side menu of its own), unit pages with a readiness checklist ---------- */
.set-shell { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 24px; align-items: start; }
body.has-side .container.set-shell > * { max-width: none; }
.set-body { min-width: 0; max-width: 1080px; }
.set-main { min-width: 0; }
.set-nav { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 2px; padding: 4px 0; }
.set-nav-h { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 4px 12px 8px; }
.set-nav a { display: block; padding: 8px 12px; border-radius: var(--r-sm); color: var(--muted); font-size: 14px; font-weight: 500; text-decoration: none; }
.set-nav a:hover { background: var(--raise); color: var(--ink); text-decoration: none; }
.set-nav a.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.set-body > .set-tabs { padding: 0; margin: 0; }
.set-body > .set-tabs .utabs { margin-top: 0; }
@media (max-width: 980px) {
  .set-shell { display: block; }
  .set-nav { position: static; flex-direction: row; overflow-x: auto; gap: 6px; padding: 0 0 10px; margin: 0 0 14px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .set-nav::-webkit-scrollbar { display: none; }
  .set-nav-h { display: none; }
  .set-nav a { flex: none; white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; }
  .set-nav a.on { border-color: var(--accent); }
}
/* how far a unit is set up */
.ready { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.ready-bar { position: relative; flex: none; width: 72px; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.ready-bar > span { position: absolute; inset: 0 auto 0 0; background: var(--warn); border-radius: 99px; }
.ready.full .ready-bar > span { background: var(--accent); }
.ready-t { font-size: 13px; color: var(--muted); white-space: nowrap; }
.ready.full .ready-t { color: var(--accent-text); font-weight: 600; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line2); font-size: 14px; }
.checklist li:last-child { border-bottom: 0; }
.checklist .ck { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--warn); color: transparent; font-size: 13px; font-weight: 700; }
.checklist li.done .ck { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.checklist li.done { color: var(--muted); }
.checklist li a { margin-left: auto; font-size: 13px; font-weight: 600; }
.unit-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 10px; }
.unit-card, .set-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--raise); color: var(--ink); text-decoration: none !important; transition: border-color .12s; }
.unit-card:hover, .set-card:hover { border-color: var(--faint); }
.set-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.set-card { background: var(--panel); }
.set-card strong { font-size: 15px; }
.unit-over { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .unit-over { grid-template-columns: 1fr; } }
.set-sec .sec-help { margin: -4px 0 12px; }
.sec-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line2); }
.form-grid .span2 { grid-column: 1 / -1; }
.warn-dot { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--warn-soft); color: var(--warn) !important; font-size: 11px; font-weight: 700; }
.ok-text { color: var(--accent-text); }
.warn-text { color: var(--warn); }
tr.link-row { cursor: pointer; }
[data-page=users] .tags .tag { white-space: normal; }
[data-page=users] td { vertical-align: middle; }
.hol-add { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.hol-add input[type=date] { flex: 0 1 180px; }
.hol-add input[name=name] { flex: 1 1 220px; }
/* tables no longer clip inside a 72vh box: the page scrolls instead (1.9.0) */
.table-wrap { max-height: none; }
/* job card board (1.9.0): one column per open status */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(172px, 1fr); gap: 10px; overflow-x: auto; padding: 14px; align-items: start; }
.board-col { background: var(--raise); border: 1px solid var(--line2); border-radius: var(--r); padding: 10px; min-height: 120px; transition: border-color .12s; }
.board-col.over { border-color: var(--accent); background: var(--accent-soft); }
.board-col > header { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 10px; }
.board-col > header .n { color: var(--faint); font-size: 13px; font-weight: 600; }
.board-cards { display: flex; flex-direction: column; gap: 8px; }
.board-empty { text-align: center; padding: 10px 0; }
.jc-card { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; cursor: pointer; }
.jc-card:hover { border-color: var(--faint); }
.jc-card.late { border-left-color: var(--bad); }
.jc-card.dragging { opacity: .5; }
.jc-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--ink); text-decoration: none !important; }
.jc-name { font-weight: 600; margin-top: 4px; }
.jc-foot { display: flex; justify-content: space-between; align-items: baseline; margin-top: 6px; }
.jc-move { width: 100%; margin: 8px 0 0; min-height: 36px; font-size: 13px; }
@media (max-width: 700px) { .board { grid-auto-columns: 82vw; padding: 10px; scroll-snap-type: x mandatory; } .board-col { scroll-snap-align: start; } }
/* attendance month grid (muster roll, 1.9.0) */
.seg .seg-a { display: inline-flex; align-items: center; color: var(--muted); font-size: 14px; font-weight: 500; padding: 0 12px; min-height: 40px; border-radius: 9px; text-decoration: none; }
.seg .seg-a:hover { color: var(--ink); background: var(--raise); }
.table-wrap.grid-wrap { overflow-x: auto; }
.mgrid { border-collapse: separate; border-spacing: 0; font-size: 13px; }
.mgrid th, .mgrid td { padding: 0; border-bottom: 1px solid var(--line2); }
.mgrid thead th { padding: 8px 2px; font-size: 12px; text-align: center; position: sticky; top: 0; background: var(--raise); z-index: 1; }
.mgrid .g-d span { display: block; font-size: 10px; color: var(--faint); font-weight: 500; }
.mgrid .g-d.we { color: var(--faint); }
.mgrid .g-emp { position: sticky; left: 0; z-index: 2; background: var(--panel); text-align: left; padding: 8px 12px; min-width: 140px; max-width: 190px; border-right: 1px solid var(--line); }
.mgrid thead .g-emp { background: var(--raise); z-index: 3; }
.mgrid .g-emp strong, .mgrid .g-emp span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mgrid td.num, .mgrid thead th.num { padding: 8px 8px; font-weight: 600; text-align: right; }
.g-c { min-width: 26px; height: 36px; text-align: center; font-weight: 600; font-size: 12px; cursor: pointer; color: var(--muted); }
td.g-c:hover { outline: 2px solid var(--accent-ring); outline-offset: -2px; }
.g-c.ok { color: var(--accent-text); }
.g-c.late { background: var(--warn-soft); }
.g-c.bad { color: var(--bad); background: var(--bad-soft); }
.g-c.info { color: var(--info); background: var(--info-soft); }
.g-c.warn { color: var(--warn); background: var(--warn-soft); }
.g-c.off { color: var(--faint); background: var(--cal-off); }
.g-c.edited { box-shadow: inset 0 -2px 0 var(--info); }
.g-c.none { cursor: default; background: transparent; }
.g-key { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 10px; }
.g-key b { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 4px; border-radius: 5px; margin-right: 4px; cursor: default; }
/* payroll as steps (1.9.0) */
.psteps { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; counter-reset: none; }
.pstep { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.pstep-n { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line); font-size: 13px; font-weight: 700; color: var(--muted); }
.pstep.todo { border-color: var(--warn); }
.pstep.todo .pstep-n { border-color: var(--warn); color: var(--warn); }
.pstep.done .pstep-n { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pstep.wait { opacity: .7; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-text); cursor: pointer; font-weight: 600; }
.linkish:hover { text-decoration: underline; }
@media (max-width: 980px) { .psteps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .psteps { grid-template-columns: 1fr; } }
/* stock item tabs (1.9.0) */
.kv-list { display: grid; gap: 10px; margin-bottom: 10px; }
.kv-list > div > div { margin-top: 2px; }
ul.plain { list-style: none; margin: 0 0 10px; padding: 0; }
ul.plain li { padding: 5px 0; border-bottom: 1px solid var(--line2); }
.bad-text { color: var(--bad); }

/* v2.0.0 sales dashboard */
.bar { height: 10px; border-radius: 6px; background: var(--line2); overflow: hidden; } .bar i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }

/* v2.0.0: Settings has no second sidebar; its pages are in the main menu */
.set-shell { display: block; }
.side-h { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 14px 12px 6px; }
.side .back-app { opacity: .85; border-bottom: 1px solid var(--line2); margin-bottom: 4px; }

/* v2.1.0: UPI QR, anonymous customer, "How did you hear about us?" */
.qr-box { display: flex; justify-content: center; }
.qr-box svg { width: min(300px, 70vw); height: auto; background: #fff; padding: 8px; border-radius: 12px; }
.qr-amt { font-size: 1.6rem; }
.center { text-align: center; }
.anon-chk { margin-bottom: 6px; }
.heard-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin: 6px 0 12px; }
.heard-opt { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; margin: 0; }
.heard-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.heard-opt input { margin: 0; }

/* v2.1.0: the job card number is the page heading */
h1.jc-no { font-family: var(--mono); font-size: 2rem; font-weight: 800; letter-spacing: .01em; }

/* v2.2.0 Cash expenses: the "Add expense" type buttons */
.exp-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.exp-type { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; min-height: 56px; white-space: normal; }

/* v2.3.0 */
dialog.wide { width: min(860px, calc(100vw - 24px)); }
.inv-no-big { font: 700 1.6rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; margin: .1rem 0 .6rem; word-break: break-all; }
.info { cursor: help; color: var(--muted); font-size: .9em; }
.grid.cols-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.bar.ok i { background: #1a7f4b; }
.mcol { width: 100%; height: auto; max-width: 720px; }

/* v2.3.0 phones: the top menu scrolls inside itself, so the page is no wider than the phone (it used to open zoomed out) */
@media (max-width: 760px) {
  .topbar { min-width: 0; overflow: hidden; padding: 0 8px; }
  .topbar .logo, .topbar .icon-btn, .topbar .store-chip { flex: none; }
  .topbar .spacer { display: none; }
  .top-tabs { flex: 1 1 0; min-width: 0; overflow-x: auto; white-space: nowrap; scrollbar-width: none; margin-left: 2px; }
  .top-tabs::-webkit-scrollbar { display: none; }
  .top-tabs a { flex: none; }
  .store-chip { display: none; }
  .chip, .btn { min-height: 40px; }
}
:root[data-theme="light"] { --faint: #5d6a61; }

@media (max-width: 760px) { .rt td.nil { display: none; } }
.menu-more { position: relative; display: inline-block; }
.menu-more > summary { list-style: none; }
.menu-more > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 260px; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.menu-pop a { padding: 9px 10px; border-radius: 7px; color: var(--ink); text-decoration: none; font-size: 14px; }
.menu-pop a:hover { background: var(--raise); }
.menu-more > summary.btn.sm { min-height: 34px; padding: 4px 12px; font-weight: 500; color: var(--muted); background: transparent; }
.menu-pop button { text-align: left; background: none; border: 0; padding: 9px 10px; border-radius: 7px; color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.menu-pop button:hover { background: var(--raise); }
.menu-pop hr { border: 0; border-top: 1px solid var(--line2); margin: 4px 0; }
/* v2.3.0: the menu styles above are shared (Download menus, Filters) */
.set-group { font-size: 15px; margin: 18px 0 8px; color: var(--muted); font-weight: 600; }
.side-h.sub { font-size: 11px; opacity: .75; margin-top: 10px; }

/* ---------- v3.1 (Feedback -8) ---------- */
.h-strong { font-weight: 800; letter-spacing: -.01em; }
.sales-head { align-items: center; }
.sales-head .actions select { min-width: 200px; }
.types-panel { padding: 12px; }
.type-tiles.eq { grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); }
.type-tiles.eq .type-tile { justify-content: flex-start; min-height: 84px; height: 100%; }
@media (max-width: 760px) { .type-tiles.eq { grid-template-columns: 1fr 1fr; } .sales-head .actions { width: 100%; } .sales-head .actions select { flex: 1; min-width: 0; } }
.inv-list .inv-no { font-size: 15.5px; }
.back-link { font-size: 16px; min-height: 42px; padding: 6px 12px 6px 6px; }
.back-link .ic { width: 22px; height: 22px; }
.inv-head { align-items: flex-start; }
.inv-title { font-size: 30px; font-weight: 800; letter-spacing: .01em; margin: 0; line-height: 1.15; word-break: break-all; }
.inv-sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.edit-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 96px; min-height: 44px; padding: 8px 14px; border: 2px solid var(--warn); border-radius: 10px; color: var(--warn); background: var(--warn-soft); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: 13px; }
.done-no { font-size: 34px; font-weight: 800; margin: 14px 0 2px; word-break: break-all; }
.done-card h1.done-what { font-size: 18px; font-weight: 600; margin: 0 0 4px; }
.admin-box { border-color: rgba(229, 72, 77, .35); }
@media (max-width: 640px) { .inv-title { font-size: 24px; } .done-no { font-size: 26px; } .edit-badge { min-height: 36px; min-width: 0; } }
.vch-t input, .vch-t select { min-width: 0; width: 100%; } .vch-t td.nowrap input { width: auto; max-width: 150px; } .vch-t td { vertical-align: top; }
.vch-t td.nowrap select { width: auto; } .vch-t td.nowrap { white-space: nowrap; }
/* ---------- v3.1 settings: find a setting, unit pickers, one unit's settings elsewhere ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.set-find { padding: 16px; }
.set-find-box { display: block; margin: 0; }
.set-find-box input { width: 100%; min-height: 48px; font-size: 16px; padding: 10px 16px 10px 42px; border-radius: var(--r);
  background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237f8a82' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 14px center / 18px; }
.set-find p.small { margin: 10px 2px 0; }
.set-hits { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.set-hits li { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--raise); overflow: hidden; }
.set-hit { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; color: var(--ink); text-decoration: none !important; }
a.set-hit:hover, a.set-hit:focus-visible { background: var(--hover); }
.set-hit strong { font-weight: 600; font-size: 14.5px; }
.set-hit .tag { vertical-align: 1px; margin-left: 4px; }
.set-units { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.set-units a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--ink); background: var(--field); text-decoration: none; }
.set-units a:hover { border-color: var(--accent); color: var(--accent-text); }
.set-none { margin: 10px 2px 0; }
/* the sidebar search shows setting results under the box */
.side-set { margin-top: 8px; max-height: 55vh; overflow: auto; }
.side-set .set-hits { margin: 0; gap: 4px; }
.side-set .set-hit { padding: 8px 10px; }
.side-set .set-hit strong { font-size: 13.5px; }
.side-set .set-hit .small { font-size: 12px; }
.side-set .set-units { padding: 0 10px 8px; gap: 4px; }
.side-set .set-units a { min-height: 28px; padding: 0 10px; font-size: 12px; }
.side-set .set-none { font-size: 12.5px; margin: 0 2px; }
/* a section opened from a search or link is marked for a moment */
@keyframes set-flash { 0%, 40% { box-shadow: 0 0 0 2px var(--accent-ring); } 100% { box-shadow: 0 0 0 0 transparent; } }
.set-flash { animation: set-flash 2.4s ease-out; scroll-margin-top: calc(var(--top) + 12px); }
.set-sec { scroll-margin-top: calc(var(--top) + 12px); }
tr.row-pick > td { background: var(--accent-soft); }
.unit-pick { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.unit-pick select { min-width: 200px; min-height: 36px; }
.w-s { max-width: 130px; }
.set-save { margin: -4px 0 16px; justify-content: flex-end; }
.link-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
/* unit page: this unit's values on other settings pages */
.else-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 6px 22px; }
.else-g h3 { margin: 6px 0 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.else-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "l go" "v go"; align-items: center; gap: 0 10px; padding: 9px 0; border-top: 1px solid var(--line2); color: var(--ink); text-decoration: none !important; }
.else-row:hover .else-go { text-decoration: underline; }
.else-l { grid-area: l; font-size: 13px; color: var(--muted); }
.else-v { grid-area: v; font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.else-go { grid-area: go; font-size: 13px; color: var(--accent-text); font-weight: 600; }
.tally-units input, .tally-units select { min-width: 150px; }
@media (max-width: 700px) {
  .panel-head .unit-pick { width: 100%; }
  .unit-pick select { flex: 1; min-width: 0; }
  .w-s, .tally-units input, .tally-units select { max-width: none; min-width: 0; width: 100%; }
}
.unit-over > #elsewhere { grid-column: 1 / -1; }
/* v3.3.0: invoice types, one line per unit with its Tally set-up */
.uline { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line2); }
.uline:first-child { border-top: 0; padding-top: 0; }
.uline > div { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 700px) { .uline { flex-direction: column; align-items: stretch; } .rt td.ulines { display: block; text-align: left; padding: 6px 0; } }
/* v3.3.0: supplier payments and suppliers */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 0 0 14px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 2px; }
.kpi span { color: var(--muted); font-size: 13px; }
.kpi strong { font-size: 22px; font-variant-numeric: tabular-nums; }
tr.row-bad > td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.check-list { display: grid; gap: 6px; margin: 4px 0 12px; }
.check-list label.inline { align-items: flex-start; overflow-wrap: anywhere; }
.sup-head h3 { margin: 4px 0; }
.sup-head p { margin: 4px 0; }
.pay-bills input.w-s { width: 110px; }
.pay-bills label.inline { display: inline-flex; gap: 6px; margin: 0; }
.pay-bills td .small.muted { display: block; }
.cd-rows { display: grid; gap: 8px; }
.cd-row { display: grid; grid-template-columns: 110px 140px 160px auto; gap: 8px; align-items: end; }
.chg { background: var(--warn-soft); border-radius: 6px; padding: 0 4px; }
@media (max-width: 700px) {
  .pay-bills input.w-s { width: 100%; }
  .cd-row { grid-template-columns: 1fr 1fr; }
}
/* v3.3.0 supplier page: details and money side by side, one under the other on a phone */
.sup-cols { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; margin-bottom: 16px; }
.sup-cols > .panel { min-width: 0; margin: 0; }
@media (max-width: 700px) { .sup-cols { grid-template-columns: 1fr; } }

/* v3.4.0 (Feedback -9): store logins get the sidebar on a computer; on a phone they keep the menu bar at the top */
@media (max-width: 980px) {
  body.store-side .side { display: none; }
  body.store-side .nav-toggle { display: none; }
}
/* v3.4.0: Modules and features (System admin) */
.feat-list { display: flex; flex-direction: column; }
.feat-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line2); }
.feat-row:first-child { border-top: 0; }
.feat-row > div:first-child { display: flex; flex-direction: column; min-width: 0; }
.feat-row.child { padding-left: 24px; }
.feat-row.child strong { font-weight: 500; }
.feat-row .seg button { min-height: 34px; font-size: 13px; }
@media (max-width: 760px) { .feat-row { flex-direction: column; align-items: stretch; } .feat-row.child { padding-left: 12px; } }

/* v3.5.2: notifications */
.icon-btn.bell { position: relative; }
.bell-n { position: absolute; top: 4px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; line-height: 17px; text-align: center; }
.notif-panel { position: fixed; z-index: 120; max-height: min(70vh, 560px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.notif-list { overflow-y: auto; }
.notif { display: flex; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line2, var(--line)); color: var(--ink); text-decoration: none; }
a.notif[href]:hover { background: var(--raise); text-decoration: none; }
.notif.unread { background: color-mix(in srgb, var(--info-soft) 60%, transparent); }
.notif-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.notif-t small { font-size: 12px; color: var(--muted); }
.notif-i { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 12px; font-weight: 700; background: var(--raise); color: var(--muted); }
.notif-i.done { background: var(--ok-soft); color: var(--ok); }
.notif-i.failed { background: var(--bad-soft); color: var(--bad); }
.notif-i.download { background: var(--info-soft); color: var(--info); }
.notif-pop { position: fixed; right: 16px; bottom: 72px; z-index: 110; display: flex; align-items: center; gap: 10px; max-width: min(460px, calc(100vw - 32px)); padding: 10px 8px 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.notif-pop.bad { border-color: var(--bad); }
.notif-pop .icon-btn { width: 30px; height: 30px; }
/* v3.5.2: Error log */
.err-msg { overflow-wrap: anywhere; }
.err-detail { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; max-height: 320px; overflow: auto; margin: 6px 0 0; }
label.chip { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
label.chip input { margin: 0; width: auto; min-height: 0; }
/* v3.9.0: Contract wages day by day; warranty claim link */
.cw-filters label.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.cw-filters input[type=date] { width: auto; }
.cw-day > summary { cursor: pointer; list-style: none; }
.cw-day > summary::-webkit-details-marker { display: none; }
.cw-sum { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.cw-sum .cw-tot { margin-left: auto; color: var(--accent-text); }
.cw-day[open] > summary { margin-bottom: 10px; }
.cw-h { font-size: 14px; margin: 14px 0 6px; }
.rt tfoot td { font-weight: 600; border-top: 1px solid var(--line); }
.claim-share { display: grid; gap: 8px; }
.claim-share .link-row { display: flex; gap: 6px; }
.claim-share .link-row input { flex: 1; min-width: 0; }
.claim-share .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 560px) { .claim-share .row2 { grid-template-columns: 1fr; } }
/* v3.10.0: the terms and conditions page of cycle sale invoices (Settings → Company and printing) */
.terms-box { width: 100%; line-height: 1.5; resize: vertical; }
.terms-help { margin: 10px 0 0; padding-left: 18px; }
.terms-help li { margin: 3px 0; }
.terms-imgs { border: 0; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 6px; }
.terms-imgs legend { font-weight: 600; margin-bottom: 6px; }

/* v4.0.0 (Feedback -12): quantity with − and + buttons (job cards, tool job cards, invoices) */
.qstep { display: inline-flex; align-items: stretch; width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--field); }
.qstep input { border: 0 !important; border-radius: 0 !important; min-width: 0; width: 100%; text-align: center !important; padding-left: 2px; padding-right: 2px; background: transparent; }
.qstep .qs { flex: 0 0 30px; border: 0; background: var(--raise); color: var(--ink); font-size: 17px; line-height: 1; cursor: pointer; padding: 0; }
.qstep .qs:hover { background: var(--hover); color: var(--accent-text); }
.qstep .qs:active { background: var(--accent); color: var(--accent-ink); }
.qstep:focus-within { border-color: var(--accent); }
.qstep.off { border-color: transparent; background: none; }

/* v4.0.0 (Feedback -12): bills in tabs on Create invoice */
.inv-tabs { display: flex; gap: 6px; align-items: stretch; overflow-x: auto; margin: 0 0 14px; padding-bottom: 2px; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.inv-tabs .itab { display: flex; align-items: stretch; flex: 0 0 auto; max-width: 230px; border: 1px solid var(--line); border-bottom: 0; border-radius: var(--r-sm) var(--r-sm) 0 0; background: var(--raise); }
.inv-tabs .itab a { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 7px 4px 7px 12px; color: var(--muted); text-decoration: none; }
.inv-tabs .itab-l { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.inv-tabs .itab-s { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.inv-tabs .itab.on { background: var(--panel); border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
.inv-tabs .itab.on a { color: var(--ink); }
.inv-tabs .itab:not(.on):hover { background: var(--hover); }
.inv-tabs .itab-x { border: 0; background: none; color: var(--faint); font-size: 18px; padding: 0 10px; cursor: pointer; border-radius: 0 var(--r-sm) 0 0; }
.inv-tabs .itab-x:hover { color: var(--bad); background: var(--bad-soft); }
.inv-tabs .itab-new { flex: 0 0 auto; align-self: center; margin-left: 4px; border: 1px dashed var(--line); background: none; color: var(--accent-text); border-radius: var(--r-sm); padding: 7px 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.inv-tabs .itab-new:hover { border-color: var(--accent); background: var(--accent-soft); }
.phones-edit { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; margin-top: 12px; }
.phones-edit label { margin-top: 6px; }

/* v4.0.0 (Feedback -12): Task manager, Task progress, the Tasks tab and the task dialog */
.task-list { display: grid; gap: 8px; margin-bottom: 14px; }
.task-h { font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--muted); margin: 16px 0 8px; font-weight: 600; }
.task-h.bad-text, .bad-text { color: var(--bad); }
.task-card { display: grid; grid-template-columns: 26px minmax(0, 1fr) 16px; gap: 12px; align-items: center; width: 100%; text-align: left; font: inherit; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; cursor: pointer; transition: border-color .12s, background .12s; }
.task-card:hover { border-color: var(--faint); background: var(--hover); }
.task-card.over { border-left: 3px solid var(--bad); }
.task-card.done { opacity: .75; }
.task-tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; color: var(--accent-ink); }
.task-card.done .task-tick { background: var(--accent); border-color: var(--accent); }
.task-tick svg { width: 15px; height: 15px; }
.task-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.task-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 3px; }
.task-go { color: var(--faint); font-size: 22px; }
dialog.task-dlg { width: min(640px, calc(100vw - 16px)); }
.task-dlg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.task-details { background: var(--raise); border: 1px solid var(--line2); border-radius: var(--r-sm); padding: 12px 14px; margin: 12px 0; line-height: 1.55; white-space: normal; overflow-wrap: anywhere; }
.task-sec { margin-top: 14px; }
.task-sec h3 { font-size: 15px; margin: 0; display: flex; align-items: center; gap: 8px; }
.task-sec .panel-head { margin: 0 0 8px; padding: 0; border: 0; }
.task-files > p { grid-column: 1 / -1; margin: 0; }
.task-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.task-file { position: relative; margin: 0; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--raise); }
.task-file img, .task-file .task-pdf { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--field); }
.task-file .task-pdf span { font-weight: 700; letter-spacing: .06em; color: var(--bad); border: 2px solid currentColor; border-radius: 6px; padding: 4px 8px; font-size: 13px; }
.task-file figcaption { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; font-size: 12.5px; overflow-wrap: anywhere; }
.task-file .icon-btn { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.6); color: #fff; width: 28px; height: 28px; min-height: 0; }
.task-file.queued { opacity: .7; border-style: dashed; }
label.btn.busy { opacity: .6; pointer-events: none; }
.task-defs { display: grid; gap: 10px; }
.task-def { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.task-def h2 { margin: 0 0 4px; font-size: 17px; }
.task-def p { margin: 4px 0; }
.td-side { text-align: right; }
.td-counts { display: flex; gap: 14px; justify-content: flex-end; font-size: 13px; }
.td-counts a { color: var(--muted); text-decoration: none; }
.td-counts strong { font-size: 18px; color: var(--ink); margin-right: 2px; }
.td-counts a.bad-text strong { color: var(--bad); }
.td-side .actions { justify-content: flex-end; margin-top: 8px; }
.task-form fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.task-form legend { font-weight: 600; margin-bottom: 8px; }
.assign-mode { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; }
.emp-pick { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-sm); margin-top: 8px; }
.emp-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line2); margin: 0; cursor: pointer; font-weight: 400; }
.emp-row:last-child { border-bottom: 0; }
.emp-row:hover { background: var(--hover); }
.emp-pick > p { padding: 8px 12px; margin: 0; }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; justify-content: flex-end; z-index: 2; border-top: 1px solid var(--line); }
.task-table td { vertical-align: top; }
.stat.link-stat.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-ring); }
button.stat { font: inherit; text-align: left; cursor: pointer; }
.filters.wrap { flex-wrap: wrap; }
.dash-tasks .task-list { margin: 0; }
@media (max-width: 720px) {
  .task-def { grid-template-columns: 1fr; }
  .td-side { text-align: left; }
  .td-counts, .td-side .actions { justify-content: flex-start; }
  .task-files { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.dash-grid .span-all { grid-column: 1 / -1; }

.task-filters select, .task-filters input[type=date] { width: auto; max-width: 210px; min-height: 40px; }
@media (max-width: 640px) { .task-filters select, .task-filters .fl { flex: 1 1 100%; max-width: none; } .task-filters input[type=date] { flex: 1; max-width: none; } }
