/* Fibtec QR — stylesheet */

:root {
  --accent: #b3172b;
  --accent-2: #8c1121;
  --accent-bg: #fdf0f1;
  --ink: #1d1517;
  --ink-2: #44383b;
  --ink-3: #7a6a6e;
  --line: #ece5e6;
  --line-2: #e0d6d8;
  --line-soft: #f3eeef;
  --bg: #f8f4f4;
  --subtle: #fbf7f7;
  --panel: #ffffff;
  --top: #22070b;
  --top-grad: linear-gradient(90deg, #22070b 0%, #3a0a12 22%, #6e1220 50%, #4a0d16 78%, #22070b 100%);
  --hero: radial-gradient(90% 140% at 100% 0%, rgba(255, 110, 125, .38) 0, rgba(255, 110, 125, 0) 55%),
          radial-gradient(60% 120% at 0% 100%, rgba(251, 146, 60, .16) 0, rgba(251, 146, 60, 0) 60%),
          linear-gradient(135deg, #2a080d 0%, #6b1120 55%, #a31a2c 100%);
  --side: #22070b;
  --ok: #047857;     --ok-bg: #dcfce7;
  --warn: #b45309;   --warn-bg: #fef3c7;
  --bad: #b91c1c;    --bad-bg: #fee2e2;
  --info: #1d4ed8;   --info-bg: #eaf0ff;
  --muted: #6b5b5f;  --muted-bg: #f3eeef;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 64, .04), 0 0 0 1px var(--line);
  --shadow-h: 0 8px 24px -12px rgba(16, 24, 64, .18), 0 0 0 1px #dfe3ee;
  --top-h: 64px;
  --rail-w: 84px;
  --panel-w: 240px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 15.5px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
p { margin: 0 0 .75em; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.icon { width: 18px; height: 18px; flex: none; vertical-align: middle; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }
::selection { background: rgba(179, 23, 43, .18); }
* { scrollbar-color: #dccfd2 transparent; }

/* ----------------------------------------------------------- Layout
   Dark top bar · rounded light "sheet" · left rail (sections) · panel
   (pages of the section + menu search) · content · dark footer strip. */

body.admin { background: var(--top); min-height: 100vh; display: flex; flex-direction: column; }
.masthead {
  position: sticky; top: 0; z-index: 30;
  height: var(--top-h); flex: none;
  display: flex; align-items: center; gap: 16px;
  padding: 0 18px 0 20px;
  background: var(--top) var(--top-grad) no-repeat;
  color: #fff;
}
/* Rounded lip under the bar: the sheet's top corners stay visible while content scrolls. */
.masthead::after {
  content: ''; position: absolute; left: 8px; right: 8px; top: 100%; height: 18px;
  border-radius: 18px 18px 0 0; box-shadow: 0 -18px 0 18px var(--top);
  clip-path: inset(0 -40px -40px -40px); pointer-events: none;
}
.brand { display: flex; gap: 12px; align-items: center; color: #fff; flex: none; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff;
  background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.brand-mark .icon { width: 20px; height: 20px; color: #ffb3ba; }
.brand strong { display: block; font-size: 15px; letter-spacing: -.01em; line-height: 1.2; }
.brand small { display: block; font-size: 11.5px; color: rgba(255, 226, 229, .62); }
.global-search { flex: 1; max-width: 560px; margin: 0 auto; position: relative; }
.global-search .icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: rgba(255, 226, 229, .6); width: 16px; }
.masthead .global-search input {
  width: 100%; height: 40px; min-height: 0; padding: 0 16px 0 40px; border-radius: 999px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .10); color: #fff;
}
.masthead .global-search input::placeholder { color: rgba(255, 226, 229, .55); }
.masthead .global-search input:focus { background: rgba(255, 255, 255, .12); border-color: rgba(169, 184, 255, .6); box-shadow: 0 0 0 3px rgba(255, 110, 125, .25); }
.mh-right { display: flex; align-items: center; gap: 8px; flex: none; }
.mh-btn {
  position: relative; width: 38px; height: 38px; border-radius: 999px; display: inline-grid; place-items: center;
  color: #fff; background: transparent; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
}
.mh-btn:hover { background: rgba(255, 255, 255, .08); text-decoration: none; }
.mh-btn .icon { width: 18px; height: 18px; }
.mh-dot {
  position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #ef4444; color: #fff; font-size: 10.5px; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--top);
}
.mh-new {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 999px;
  background: #fff; color: #6b1120; font-weight: 650; font-size: 13px; white-space: nowrap;
}
.mh-new:hover { text-decoration: none; background: #fdeef0; }
.mh-new .icon { width: 16px; height: 16px; }
.mh-user { display: flex; align-items: center; gap: 10px; padding: 3px 12px 3px 3px; border-radius: 999px; color: #fff; }
.mh-user:hover { background: rgba(255, 255, 255, .08); text-decoration: none; }
.mh-user strong { display: block; font-size: 13px; line-height: 1.2; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh-user small { display: block; font-size: 11px; color: rgba(255, 226, 229, .62); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #e2525f, #b3172b); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none;
}
.menu-btn { display: none; }

.shell {
  flex: 1; display: flex; align-items: stretch;
  margin: 0 8px; background: var(--bg); border-radius: 18px; overflow: clip;
  min-height: calc(100vh - var(--top-h));
}
.sidebar {
  flex: 0 0 calc(var(--rail-w) + var(--panel-w)); width: calc(var(--rail-w) + var(--panel-w));
  position: sticky; top: var(--top-h); align-self: flex-start; height: calc(100vh - var(--top-h));
  display: flex; border-radius: 18px 0 0 0; overflow: hidden;
}
html.nav-collapsed .sidebar { flex-basis: var(--rail-w); width: var(--rail-w); }
html.nav-collapsed .side-panel { display: none; }

.rail {
  flex: 0 0 var(--rail-w); background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 2px; padding: 12px 6px; overflow-y: auto;
}
.rail-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px 7px; border-radius: 12px;
  color: var(--ink-3); font: 500 11.5px/1.2 var(--font); text-align: center; background: none; border: 0; cursor: pointer;
}
.rail-item:hover { color: var(--ink); text-decoration: none; }
.rail-ico { position: relative; width: 40px; height: 34px; display: grid; place-items: center; border-radius: 10px; transition: background-color .12s; }
.rail-ico .icon { width: 20px; height: 20px; stroke-width: 1.8; }
.rail-item:hover .rail-ico { background: #f6f0f1; }
.rail-item.active { color: var(--ink); font-weight: 650; }
.rail-item.active .rail-ico { background: var(--accent-bg); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(179, 23, 43, .14); }
.rail-dot { position: absolute; top: 5px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 2px #fff; }
.rail-collapse { margin-top: auto; }
html.nav-collapsed .rail-collapse .rail-ico { transform: scaleX(-1); }

.side-panel { flex: 1; min-width: 0; background: var(--subtle); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; padding: 18px 12px 12px; }
.ws-label { font-size: 12.5px; font-weight: 650; padding: 0 4px 6px; }
.ws-box { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.ws-dot { flex: 0 0 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--top); color: #fff; font-size: 12px; font-weight: 700; }
.ws-meta { min-width: 0; display: flex; flex-direction: column; }
.ws-meta strong { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-meta small { font-size: 11px; color: var(--ink-3); }
.nav-search {
  display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 12px; margin: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; color: var(--ink-3); cursor: text; font-weight: 400;
}
.nav-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(179, 23, 43, .12); }
.nav-search .icon { width: 16px; height: 16px; }
.side-panel .nav-search input { flex: 1; min-width: 0; min-height: 0; height: auto; padding: 0; border: 0; background: transparent; font-size: 13.5px; }
.side-panel .nav-search input:focus { box-shadow: none; }
.nav-list { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.nav-group { display: none; }
.nav-group.is-current { display: block; }
.nav-group-title { display: none; }
.nav-list.is-searching .nav-group { display: none; }
.nav-list.is-searching .nav-group.has-hits { display: block; margin-bottom: 8px; }
.nav-list.is-searching .nav-group-title { display: block; padding: 6px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #ad9da1; }
.nav-empty { padding: 14px 10px; font-size: 13px; color: var(--ink-3); }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 2px 0; border-radius: 11px; color: var(--ink-2); font-size: 14px; font-weight: 500; }
.nav-link[hidden] { display: none; }
.nav-link > span { flex: 1; min-width: 0; }
.nav-link .icon { width: 19px; height: 19px; color: #8e7d81; }
.nav-link:hover { background: #f3eced; color: var(--ink); text-decoration: none; }
.nav-link.active { background: #fff; color: var(--ink); font-weight: 650; box-shadow: 0 1px 2px rgba(16, 24, 64, .06), 0 0 0 1px var(--line); }
.nav-link.active .icon { color: var(--accent); }
.nav-link .chev { width: 15px; height: 15px; color: #c6b8bb; opacity: 0; transition: opacity .12s, transform .12s; }
.nav-link:hover .chev { opacity: 1; transform: translateX(2px); }
.count { background: var(--accent); color: #fff; font-size: 11px; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 6px; }

.content { flex: 1; min-width: 0; padding: 22px 32px 32px; max-width: 1440px; }
.scrim { display: none; }

.site-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  min-height: 64px; padding: 12px clamp(16px, 5vw, 60px); color: rgba(255, 226, 229, .62); font-size: 13px; font-weight: 500;
}
.site-foot-pill { display: inline-flex; align-items: center; gap: 9px; height: 32px; padding: 0 13px; border-radius: 999px; background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); color: #f1f4ff; font-weight: 600; }
.site-foot-pill i { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }

/* Breadcrumb + hero page header */
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13.5px; color: var(--ink-3); margin: 0 0 14px; }
.crumbs a { color: var(--ink-3); display: inline-flex; align-items: center; }
.crumbs a:hover { color: var(--ink); text-decoration: none; }
.crumbs .icon { width: 15px; height: 15px; }
.crumbs .sep { width: 13px; height: 13px; color: #c6b8bb; }
.crumbs .cur { color: var(--ink); font-weight: 600; }

.page-head {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin: 0 0 22px; padding: 26px 32px; border-radius: 20px; color: #fff; background: var(--hero);
}
.page-head::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(70% 90% at 100% 0%, #000 0, transparent 70%);
          mask-image: radial-gradient(70% 90% at 100% 0%, #000 0, transparent 70%);
}
.ph-text { min-width: 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 5px 13px 5px 11px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: rgba(255, 255, 255, .92);
  background: rgba(255, 255, 255, .10); border: 1px solid rgba(255, 255, 255, .16); border-radius: 999px;
}
.eyebrow .icon { width: 12px; height: 12px; }
.page-head h1 { font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1.12; overflow-wrap: anywhere; }
.page-head .sub { color: rgba(255, 255, 255, .78); margin: 8px 0 0; font-size: 13.5px; font-weight: 500; }
.page-head .sub a { color: #fff; text-decoration: underline; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.page-head .actions .btn {
  height: 44px; padding: 0 18px; border-radius: 12px; font-weight: 650;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .26); color: #fff;
}
.page-head .actions .btn:hover { background: #fff; color: #6b1120; border-color: #fff; filter: none; }
.page-head .actions .btn-accent { background: #fff; border-color: #fff; color: #6b1120; font-weight: 750; }
.page-head .actions .btn-accent:hover { background: #fbe2e5; border-color: #fbe2e5; }
.page-head .actions .btn .icon { width: 16px; height: 16px; stroke-width: 2.4; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-2-even { grid-template-columns: 1fr 1fr; }
.stack > * + * { margin-top: 20px; }

/* ------------------------------------------------------------ Cards */

.card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.card-head .muted { font-size: 12.5px; }
.card-body { padding: 20px; }
.card-body.tight { padding: 0; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line-soft); background: var(--subtle); border-radius: 0 0 var(--radius) var(--radius); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { padding: 18px 20px; display: flex; gap: 14px; align-items: center; color: inherit; transition: box-shadow .18s ease, transform .18s ease; }
a.stat:hover { text-decoration: none; box-shadow: var(--shadow-h); transform: translateY(-1px); }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--muted-bg); color: var(--ink-2); flex: none; }
.stat-icon.bad { background: var(--bad-bg); color: var(--bad); }
.stat-icon.warn { background: var(--warn-bg); color: var(--warn); }
.stat-icon.ok { background: var(--ok-bg); color: var(--ok); }
.stat-icon.accent { background: var(--accent-bg); color: var(--accent); }
.stat b { display: block; font-size: 26px; line-height: 1.1; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat > div { min-width: 0; }
.stat .stat-label { display: block; color: var(--ink-3); font-size: 12.5px; font-weight: 600; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat b em { font-style: normal; font-size: 14px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; }
.stat small { display: block; margin-top: 3px; color: var(--ink-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

dl.props { display: grid; grid-template-columns: 150px 1fr; gap: 9px 16px; margin: 0; }
dl.props dt { color: var(--ink-3); }
dl.props dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.specs div { background: #fff; padding: 11px 14px; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
.specs small { display: block; color: var(--ink-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
.specs span { font-weight: 550; overflow-wrap: anywhere; }

/* ---------------------------------------------------------- Buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff;
  color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; line-height: 1.3;
}
.btn:hover { background: var(--subtle); text-decoration: none; border-color: #d6c8cb; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #262e52; border-color: #262e52; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); border-color: #f0b8b4; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.icon-btn { border: 0; background: transparent; padding: 6px; border-radius: 8px; cursor: pointer; color: var(--ink-2); display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--muted-bg); }
.inline-form { display: inline; margin: 0; }

/* ------------------------------------------------------------ Forms */

label { display: block; font-weight: 550; margin-bottom: 6px; font-size: 13px; }
label .opt { font-weight: 400; color: var(--ink-3); }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date],
input[type=number], input[type=tel], input[type=url], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff;
  font: inherit; color: var(--ink); min-height: 40px; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(179, 23, 43, .14); }
input[type=color] { width: 48px; height: 38px; padding: 2px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.field-hint { color: var(--ink-3); font-size: 12.5px; margin-top: 5px; }
.field-error { color: var(--bad); font-size: 12.5px; margin-top: 5px; }
.check { display: flex; gap: 9px; align-items: flex-start; font-weight: 400; cursor: pointer; }
.check input { margin-top: 3px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 4px; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 650; margin: 0 0 12px; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line-soft); }
.filters input, .filters select { width: auto; min-width: 150px; }
.filters input[type=search] { min-width: 230px; flex: 1; max-width: 320px; }

/* Parts editor */
.parts-table td { padding: 6px 6px; vertical-align: top; }
.parts-table td:first-child { padding-left: 0; }
.parts-table input { min-height: 36px; }
.parts-table .qty { width: 80px; }
.parts-table .unit { width: 84px; }

/* ----------------------------------------------------------- Tables */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 650; padding: 11px 16px; background: var(--subtle); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color .12s ease; }
.table tbody tr:hover { background: #fff6f6; }
.table .primary { font-weight: 600; color: var(--ink); }
.table .sub { color: var(--ink-3); font-size: 12.5px; }
.table td.actions { white-space: nowrap; text-align: right; }

/* ----------------------------------------------------- Badges, tags */

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: var(--muted-bg); color: var(--muted); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 5px; font-size: 12px; font-weight: 600; background: var(--muted-bg); color: var(--ink-2); white-space: nowrap; }
.tag-preventive { background: #e7f3ee; color: #12704a; }
.tag-corrective { background: #fdeee4; color: #a8480f; font-weight: 700; }
.tag-emergency { background: var(--bad-bg); color: var(--bad); }
.tag-inspection { background: var(--info-bg); color: var(--info); }
.tag-calibration { background: #efeafd; color: #5b3cc4; }
.tag-installation { background: #e6f4f7; color: #0c6b7f; }
.tag-upgrade { background: #f2f0e4; color: #6d5d10; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 6px; background: var(--muted-bg); font-size: 12.5px; color: var(--ink-2); margin: 0 4px 4px 0; }

/* ----------------------------------------------------------- Alerts */

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin-bottom: 18px; border: 1px solid; }
.alert span { flex: 1; }
.alert-success { background: var(--ok-bg); border-color: #b9e2c9; color: #0f5e34; }
.alert-error { background: var(--bad-bg); border-color: #f3c1bd; color: #8f1f1a; }
.alert-warning { background: var(--warn-bg); border-color: #f5d29f; color: #7a4100; }
.alert-info { background: var(--info-bg); border-color: #cdd8fb; color: #23379a; }
.alert-x { background: none; border: 0; cursor: pointer; color: inherit; opacity: .6; padding: 0; }
.alert-x:hover { opacity: 1; }

/* -------------------------------------------------------- Timeline */

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline > li { position: relative; padding: 0 0 22px 30px; }
.timeline > li::before { content: ""; position: absolute; left: 8px; top: 20px; bottom: 0; width: 2px; background: var(--line); }
.timeline > li:last-child::before { display: none; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline .node { position: absolute; left: 0; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--line-2); }
.timeline .node.ok { border-color: var(--ok); }
.timeline .node.warn { border-color: var(--warn); }
.timeline .node.bad { border-color: var(--bad); }
.entry { border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.entry-head { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 14px 16px 10px; flex-wrap: wrap; }
.entry-head h3 { font-size: 15px; margin-bottom: 4px; }
.entry-meta { display: flex; gap: 6px 14px; flex-wrap: wrap; color: var(--ink-3); font-size: 12.5px; align-items: center; }
.entry-meta span { display: inline-flex; align-items: center; gap: 5px; }
.entry-meta .icon { width: 14px; height: 14px; }
.entry-body { padding: 0 16px 14px; }
.entry-body h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin: 12px 0 4px; font-weight: 650; }
.entry-body p { margin: 0; color: var(--ink-2); }
.parts-list { width: 100%; border: 1px solid var(--line); border-radius: 10px; border-collapse: separate; border-spacing: 0; overflow: hidden; margin-top: 4px; font-size: 13px; }
.parts-list th { background: var(--subtle); text-align: left; font-weight: 600; color: var(--ink-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.parts-list td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.parts-list tr:last-child td { border-bottom: 0; }
.parts-list .pn { font-family: var(--mono); font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.thumbs a { display: block; width: 84px; height: 84px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--bg); position: relative; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs .doc { display: grid; place-items: center; text-align: center; font-size: 11px; color: var(--ink-3); padding: 6px; height: 100%; overflow: hidden; }
.entry-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 16px; border-top: 1px solid var(--line-soft); background: var(--subtle); border-radius: 0 0 14px 14px; flex-wrap: wrap; }

/* ---------------------------------------------------------- QR card */

.qr-box { text-align: center; }
.qr-box .qr { width: 100%; max-width: 210px; margin: 0 auto 12px; display: block; }
.qr-box .qr svg { width: 100%; height: auto; display: block; }
.qr-url { display: flex; gap: 6px; align-items: center; background: var(--subtle); border: 1px solid var(--line); border-radius: 10px; padding: 6px 6px 6px 10px; margin-bottom: 12px; }
.qr-url code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; text-align: left; }
.qr-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

.empty { text-align: center; padding: 44px 20px; color: var(--ink-3); }
.empty .icon { width: 36px; height: 36px; color: var(--line-2); margin-bottom: 8px; }
.empty h3 { color: var(--ink); margin-bottom: 4px; font-size: 15px; }
.empty .btn { margin-top: 10px; }

.pager { display: flex; justify-content: center; gap: 16px; align-items: center; padding: 14px; border-top: 1px solid var(--line-soft); color: var(--ink-3); }

.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 12px 20px; border-bottom: 1px solid var(--line-soft); display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.list-plain li:last-child { border-bottom: 0; }
.list-plain .grow { flex: 1; min-width: 0; }
.list-plain .title { font-weight: 600; color: var(--ink); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* -------------------------------------------------------- Auth page */

.auth {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: 32px 20px 22px; background: linear-gradient(160deg, #eef3fb 0%, #f3eefe 45%, #ecf7ff 100%);
}
.auth-card {
  width: 100%; max-width: 420px; background: rgba(255, 255, 255, .94); border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 16px; padding: 32px 34px; box-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 24px 60px -24px rgba(30, 41, 99, .35);
}
.auth-card .brand { padding: 0 0 24px; color: var(--ink); }
.auth-card .brand-mark { background: var(--top) var(--top-grad); box-shadow: none; }
.auth-card .brand small { color: var(--ink-3); }
.auth-card h1 { font-size: 20px; margin-bottom: 4px; }
.auth-card .field { margin-bottom: 16px; }
.auth-card input { background: #f7f2f3; border-color: transparent; }
.auth-card input:hover { background: #f5eff0; }
.auth-card input:focus { background: #fff; }
.auth-card .btn-primary { height: 44px; border-radius: 10px; }
.auth-wide { max-width: 560px; }
.auth-foot { font-size: 12px; color: var(--ink-3); }

/* ===================================================== Public panel */

.public { background: var(--bg); }
.p-wrap { max-width: 760px; margin: 0 auto; padding: 0 16px 40px; }
.p-top { background: var(--hero); color: #fff; padding: 18px 0 64px; }
.p-top .p-wrap { padding-bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.p-top .brand { padding: 0; }
.p-top .brand small { color: #9fb0c3; }
.p-top a.call { color: #fff; display: inline-flex; gap: 6px; align-items: center; font-weight: 600; font-size: 13px; padding: 7px 12px; border: 1px solid rgba(255, 255, 255, .25); border-radius: 99px; }
.p-top a.call:hover { background: rgba(255, 255, 255, .08); text-decoration: none; }
.p-hero { margin-top: -48px; }
.p-card { background: #fff; border-radius: 16px; box-shadow: 0 1px 2px rgba(16, 24, 64, .04), 0 0 0 1px var(--line), 0 12px 32px -16px rgba(16, 24, 64, .18); margin-bottom: 16px; overflow: hidden; }
.p-card-body { padding: 20px; }
.p-hero h1 { font-size: 22px; }
.p-hero .owner { color: var(--ink-3); display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.p-hero .owner .icon { width: 15px; height: 15px; }
.p-status { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.p-status > div { padding: 14px 16px; border-right: 1px solid var(--line); min-width: 0; }
.p-status > div:last-child { border-right: 0; }
.p-status small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin-bottom: 4px; font-weight: 600; }
.p-status strong { display: block; font-size: 15px; }
.p-status .s-ok { color: var(--ok); } .p-status .s-warn { color: var(--warn); } .p-status .s-bad { color: var(--bad); }
.p-section-title { display: flex; align-items: center; justify-content: space-between; margin: 26px 2px 12px; }
.p-section-title h2 { font-size: 16px; }
.p-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.p-cta .btn { flex: 1; padding: 11px 14px; }
.p-machines a.p-machine { display: flex; gap: 14px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); color: inherit; }
.p-machines a.p-machine:last-child { border-bottom: 0; }
.p-machines a.p-machine:hover { background: #fff6f6; text-decoration: none; }
.p-machine .m-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-bg); color: var(--accent); display: grid; place-items: center; flex: none; }
.p-machine .grow { flex: 1; min-width: 0; }
.p-machine strong { display: block; }
.p-foot { text-align: center; color: var(--ink-3); font-size: 12.5px; padding: 20px 0; }
.p-foot a { color: var(--ink-3); text-decoration: underline; }
.summary-row { display: flex; gap: 8px; flex-wrap: wrap; }
.notice { padding: 40px 24px; text-align: center; }
.notice .icon { width: 40px; height: 40px; color: var(--ink-3); margin-bottom: 10px; }
dialog { border: 0; border-radius: 16px; padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgba(0, 0, 0, .3); }
dialog::backdrop { background: rgba(40, 8, 12, .55); }
dialog .card-head { border-bottom: 1px solid var(--line); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* =========================================================== Labels */

.label-sheet { display: grid; grid-template-columns: repeat(auto-fill, 90mm); gap: 6mm; }
.qr-label {
  width: 90mm; height: 50mm; border: 1px solid #dccfd2; border-radius: 3mm; background: #fff;
  display: grid; grid-template-columns: 40mm 1fr; overflow: hidden; break-inside: avoid; color: #1d1517;
}
.qr-label .l-qr { padding: 3mm; display: grid; place-items: center; border-right: 1px dashed #e3d9db; }
.qr-label .l-qr svg { width: 34mm; height: 34mm; display: block; }
.qr-label .l-info { padding: 3.5mm 3.5mm 3mm; display: flex; flex-direction: column; min-width: 0; }
.qr-label .l-brand { display: flex; align-items: center; gap: 1.6mm; font-weight: 700; font-size: 10pt; letter-spacing: .02em; }
.qr-label .l-brand i { width: 4.2mm; height: 4.2mm; border-radius: 1mm; background: var(--accent); display: inline-block; }
.qr-label .l-title { font-weight: 700; font-size: 10.5pt; line-height: 1.15; margin-top: 2.6mm; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.qr-label .l-sub { font-size: 7.5pt; color: #5e4f53; margin-top: 1mm; line-height: 1.3; overflow: hidden; }
.qr-label .l-scan { margin-top: auto; font-size: 7.5pt; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .03em; }
.qr-label .l-contact { font-size: 7pt; color: #5e4f53; margin-top: .6mm; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.label-sheet.tall { grid-template-columns: repeat(auto-fill, 60mm); }
.qr-label.tall { width: 60mm; height: 85mm; grid-template-columns: 1fr; grid-template-rows: 50mm 1fr; }
.qr-label.tall .l-qr { border-right: 0; border-bottom: 1px dashed #e3d9db; }
.qr-label.tall .l-qr svg { width: 44mm; height: 44mm; }
.qr-label.tall .l-info { padding: 3mm 4mm; text-align: center; align-items: center; }
.qr-label.tall .l-title { margin-top: 1.6mm; }
.label-pick { max-height: 360px; overflow-y: auto; }
.label-pick label { display: flex; gap: 10px; align-items: center; font-weight: 400; padding: 8px 20px; margin: 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.label-pick label:hover { background: #fff6f6; }

/* ======================================================= Responsive */

@media (max-width: 1080px) {
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 1500px) {
  :root { --rail-w: 78px; --panel-w: 220px; }
  .content { padding: 20px 24px 28px; }
}
@media (max-width: 1024px) {
  body.admin { background: var(--bg); }
  .masthead { padding: 0 10px; gap: 10px; }
  .masthead::after { display: none; }
  .menu-btn { display: inline-grid; flex: none; }
  .shell { margin: 0; border-radius: 0; display: block; }
  .sidebar, html.nav-collapsed .sidebar {
    position: fixed; left: 0; top: 0; z-index: 50; height: 100vh; height: 100dvh;
    width: min(92vw, calc(var(--rail-w) + var(--panel-w))); border-radius: 0 18px 18px 0;
    transform: translateX(-104%); transition: transform .22s cubic-bezier(.2, .8, .2, 1);
    box-shadow: 8px 0 32px -12px rgba(8, 14, 40, .35);
  }
  html.nav-collapsed .side-panel { display: flex; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(40, 8, 12, .45); z-index: 40; }
  .rail-collapse { display: none; }
  .content { padding: 16px 14px 24px; }
  .site-foot { background: var(--top) var(--top-grad); }
  .grid-2-even { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .masthead .brand { display: none; }
  .mh-user { padding: 3px; }
  .page-head { padding: 20px; border-radius: 18px; }
  .page-head h1 { font-size: 22px; }
  .page-head .actions .btn { height: 40px; padding: 0 14px; }
  .site-foot { justify-content: center; text-align: center; }
}
@media (max-width: 640px) {
  .hide-sm { display: none !important; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  dl.props { grid-template-columns: 1fr; gap: 2px; }
  dl.props dd { margin-bottom: 8px; }
  .page-head { align-items: flex-start; }
  .p-status { grid-template-columns: 1fr; }
  .p-status > div { border-right: 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
  .p-status > div:last-child { border-bottom: 0; }
  .p-status small { margin: 0; }
  .filters input[type=search] { max-width: none; }
  .filters input, .filters select { min-width: 0; flex: 1 1 140px; }
  .parts-table, .parts-table tbody, .parts-table tr, .parts-table td { display: block; width: 100% !important; }
  .parts-table thead { display: none; }
  .parts-table tr { border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-bottom: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .parts-table td { padding: 0 !important; }
  .parts-table td.wide { grid-column: 1 / -1; }
}

/* ============================================================ Print */

@media print {
  @page { margin: 12mm; }
  body { background: #fff; font-size: 11pt; }
  .sidebar, .masthead, .crumbs, .site-foot, .no-print, .entry-foot, .alert, .scrim { display: none !important; }
  body.admin, .admin { display: block; background: #fff; }
  .shell { display: block; margin: 0; background: #fff; }
  .content { padding: 0; max-width: none; }
  .page-head { background: none; color: #000; padding: 0 0 10px; border-bottom: 2px solid #000; border-radius: 0; }
  .page-head .actions, .page-head .eyebrow { display: none; }
  .page-head .sub { color: #333; }
  .card, .entry, .p-card { box-shadow: none; break-inside: avoid; }
  .timeline > li { break-inside: avoid; }
  a { color: inherit; }
  .label-sheet { gap: 4mm; }
  .qr-label { border-color: #999; }
  .public .p-top { background: #fff; color: #000; padding: 0 0 8px; border-bottom: 2px solid #000; }
  .public .p-hero { margin-top: 12px; }
}

/* Small company sign-in link at the bottom of the QR page */
.p-login { margin-top: 14px; }
.p-login a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-3); font-size: 12px; font-weight: 600; text-decoration: none; }
.p-login a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.p-login .icon { width: 14px; height: 14px; }

/* Client portal: staff look without the side menu */
.portal .content { margin: 0 auto; width: 100%; max-width: 1180px; }
.portal-nav { display: flex; gap: 4px; margin-right: auto; }
.portal-nav a { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px; color: rgba(255, 226, 229, .8); font-weight: 600; font-size: 13.5px; }
.portal-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.portal-nav .icon { width: 17px; height: 17px; }
.portal .global-search { display: none; }
.m-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.m-card { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; color: inherit; }
.m-card:hover { text-decoration: none; box-shadow: var(--shadow-h); }
.m-card-top { display: flex; gap: 12px; align-items: flex-start; }
.m-card-top .m-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-bg); color: var(--accent); display: grid; place-items: center; flex: none; }
.m-card h3 { font-size: 15.5px; margin-bottom: 2px; }
.m-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 0; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.m-card dt { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; }
.m-card dd { margin: 0; font-weight: 600; font-size: 13.5px; }
@media (max-width: 1024px) {
  .portal .masthead .brand { display: flex; }
  .portal .menu-btn { display: none; }
}
@media (max-width: 760px) {
  .portal .masthead .brand { display: flex; }
  .portal .masthead .brand > span:last-child { display: none; }
  .portal-nav span { display: none; }
}
@media (max-width: 640px) {
  .p-card .specs { grid-template-columns: 1fr 1fr; }
}

/* Segmented filter (QR page timeline) */
.seg { display: inline-flex; gap: 2px; padding: 3px; margin: 0 0 14px; background: #fff; border-radius: 12px; box-shadow: var(--shadow); }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 9px; font: 600 13px/1.2 var(--font); color: var(--ink-3); cursor: pointer; }
.seg button.on { background: var(--accent-bg); color: var(--accent); }
.timeline > li[hidden] { display: none; }

/* ===================================================== Friendlier forms */

.step { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 8px; border-radius: 50%; background: var(--accent-bg); color: var(--accent); font-size: 12.5px; font-weight: 800; vertical-align: 1px; }
.card-head h2 .opt { font-weight: 500; color: var(--ink-3); font-size: 13px; }
.record-form { max-width: 980px; }

/* One-tap fault titles */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip-btn { border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); border-radius: 999px; padding: 6px 12px; font: 500 12.5px/1.2 var(--font); cursor: pointer; transition: all .12s; }
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }
.chip-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Big tappable radio choices */
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; margin: 0; font-weight: 600; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: 12px; border: 1.5px solid var(--line-2); background: #fff; color: var(--ink-2); font-size: 14px; transition: all .12s; }
.choice span::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); flex: none; }
.choice:hover span { border-color: #b9c1d6; }
.choice input:focus-visible + span { box-shadow: 0 0 0 3px rgba(179, 23, 43, .2); }
.choice input:checked + span { color: var(--ink); }
.choice-ok input:checked + span { border-color: var(--ok); background: var(--ok-bg); }
.choice-ok span::before { background: var(--ok); }
.choice-warn input:checked + span { border-color: var(--warn); background: var(--warn-bg); }
.choice-warn span::before { background: #f59e0b; }
.choice-bad input:checked + span { border-color: var(--bad); background: var(--bad-bg); }
.choice-bad span::before { background: #ef4444; }
.choice-info input:checked + span { border-color: var(--accent); background: var(--accent-bg); }
.choice-info span::before { background: var(--accent); }
.choice-muted input:checked + span { border-color: var(--ink-3); background: var(--muted-bg); }
.choice-stack { flex-direction: column; }
.choice-stack .choice span { width: 100%; }

/* Upload area */
.upload { position: relative; display: flex; align-items: center; gap: 14px; margin: 0; padding: 18px; border: 2px dashed var(--line-2); border-radius: 14px; background: var(--subtle); cursor: pointer; font-weight: 400; transition: all .12s; }
.upload:hover, .upload.has-files { border-color: var(--accent); background: var(--accent-bg); }
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload > .icon { width: 30px; height: 30px; color: var(--accent); }
.upload strong { display: block; color: var(--ink); }
.upload small { display: block; color: var(--ink-3); font-size: 12px; }
.upload-sm { padding: 12px 14px; }
.upload-sm > .icon { width: 24px; height: 24px; }
.thumbs:empty { display: none; }
[data-upload-preview] { margin-top: 10px; }
.thumb-new, .thumb-keep { display: block; width: 84px; margin: 0; }
.thumb-new img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.thumb-new .doc { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 8px; border: 1px solid var(--line); background: var(--subtle); font-size: 11px; padding: 6px; text-align: center; overflow: hidden; }
.thumb-keep a { display: block; width: 84px; height: 84px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.thumb-keep img { width: 100%; height: 100%; object-fit: cover; }
.thumb-keep .check, .thumb-keep .muted { margin-top: 4px; display: block; }

/* Searchable select */
.select-filter { margin-bottom: 8px; }

/* Save bar that stays in view while scrolling a long form */
.sticky-actions {
  position: sticky; bottom: 0; z-index: 15; display: flex; justify-content: flex-end; gap: 10px;
  margin: 16px 0 0; padding: 12px 16px; border-radius: 14px;
  background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 -1px 0 var(--line), 0 -8px 24px -12px rgba(16, 24, 64, .18);
}
.sticky-actions .btn { min-height: 44px; padding: 0 20px; }

/* Alerts fade out */
.alert { transition: opacity .4s ease, transform .4s ease; }
.alert.fade-out { opacity: 0; transform: translateY(-6px); }

/* Segmented tabs as links too */
.seg a { padding: 7px 14px; border-radius: 9px; font: 600 13px/1.2 var(--font); color: var(--ink-3); text-decoration: none; }
.seg a.on { background: var(--accent-bg); color: var(--accent); }

/* ============================================ Fault requests inbox */
.req-list { display: grid; gap: 14px; }
.req { padding: 18px 20px; border-left: 4px solid var(--line-2); }
.req-down { border-left-color: #ef4444; }
.req-high { border-left-color: #f59e0b; }
.req-normal { border-left-color: var(--accent); }
.req.is-closed { opacity: .72; border-left-color: var(--line-2); }
.req-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.req-title strong { display: block; font-size: 16px; }
.req-title .muted { font-size: 13px; }
.req-badges { display: flex; gap: 6px; }
.req-desc { margin: 12px 0; white-space: pre-line; font-size: 15px; }
.req-contact { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--ink-3); font-size: 13px; }
.req-contact span, .req-contact a { display: inline-flex; align-items: center; gap: 5px; }
.req-contact .icon { width: 14px; height: 14px; }
.req-note { display: flex; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--warn-bg); color: #7a4100; font-size: 13px; }
.req-note .icon { width: 15px; height: 15px; margin-top: 2px; }
.req-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.req-more summary { list-style: none; }
.req-more summary::-webkit-details-marker { display: none; }
.req-more[open] { flex-basis: 100%; order: 10; }
.req-note-form { display: grid; gap: 8px; margin-top: 8px; max-width: 560px; }
.req-note-form .btn { justify-self: start; }
.req-del { margin-left: auto; }
.req-del .icon-btn { color: var(--bad); }

/* ============================================ Phones */
@media (max-width: 640px) {
  .public .p-cta-dock {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .96); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    box-shadow: 0 -1px 0 var(--line), 0 -10px 30px -12px rgba(16, 24, 64, .25); flex-wrap: nowrap;
  }
  .public .p-cta-dock .btn { flex: 1 1 0; min-height: 48px; padding: 0 10px; font-size: 14px; }
  .public .p-cta-dock .btn-accent { flex: 1.6 1 0; }
  .public main { padding-bottom: 90px; }
  .record-form .card-body { padding: 16px; }
  .sticky-actions { margin: 12px -14px -24px; border-radius: 16px 16px 0 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
  .sticky-actions .btn { flex: 1; }
  dialog { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 18px 18px 0 0; }
  .choice-row:not(.choice-stack) .choice { flex: 1 1 100%; }
  .choice span { width: 100%; }
  .req { padding: 16px; }
  .req-actions .btn { flex: 1 1 auto; justify-content: center; }
}

.page-head-sm { padding: 18px 28px; }
.page-head-sm .eyebrow { margin-bottom: 8px; }
.page-head-sm h1 { font-size: 23px; }
@media (max-width: 760px) {
  .page-head-sm { padding: 14px 18px; margin-bottom: 14px; }
  .page-head-sm .eyebrow { display: none; }
  .page-head-sm h1 { font-size: 19px; }
}

/* ===================================================== Professional polish */

/* Keyboard focus is always visible */
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.masthead a:focus-visible, .masthead button:focus-visible { outline-color: #ffb3ba; }

/* "/" shortcut hint in the top search */
.search-kbd {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none;
  min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px;
  font: 600 12px/1 var(--font); color: rgba(255, 226, 229, .7); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
}
.global-search input:focus + .search-kbd, .global-search input:not(:placeholder-shown) + .search-kbd { display: none; }

/* Toast messages, top right, out of the page flow */
.toasts { position: fixed; top: calc(var(--top-h) + 14px); right: 20px; z-index: 70; display: flex; flex-direction: column; gap: 10px; width: min(400px, calc(100vw - 24px)); pointer-events: none; }
.toast {
  pointer-events: auto; margin: 0; align-items: center; padding: 12px 12px 12px 14px; border: 0; border-radius: 14px;
  background: #fff; color: var(--ink); font-weight: 500;
  box-shadow: 0 0 0 1px var(--line), 0 16px 40px -12px rgba(16, 24, 64, .28);
  animation: toast-in .28s cubic-bezier(.2, .8, .2, 1);
}
.toast .toast-ico { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--muted-bg); color: var(--ink-2); }
.toast-ico .icon { width: 16px; height: 16px; }
.toast.alert-success .toast-ico { background: var(--ok-bg); color: var(--ok); }
.toast.alert-error .toast-ico { background: var(--bad-bg); color: var(--bad); }
.toast.alert-warning .toast-ico { background: var(--warn-bg); color: var(--warn); }
.toast.alert-info .toast-ico { background: var(--info-bg); color: var(--info); }
.toast.alert-error { box-shadow: 0 0 0 1px #f3c1bd, 0 16px 40px -12px rgba(16, 24, 64, .28); }
.toast .alert-x { color: var(--ink-3); padding: 4px; border-radius: 6px; }
.toast .alert-x:hover { background: var(--muted-bg); }
.toast .alert-x .icon { width: 16px; height: 16px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
.public .toasts { top: 14px; }

/* In-page confirm dialog */
.confirm-dlg { width: min(420px, calc(100vw - 32px)); }
.confirm-body { display: flex; gap: 14px; padding: 22px 22px 8px; }
.confirm-ico { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--bad-bg); color: var(--bad); }
.confirm-body h3 { font-size: 16px; margin: 2px 0 6px; }
.confirm-body p { margin: 0; color: var(--ink-2); }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 22px 20px; }
.confirm-actions .btn { min-height: 42px; padding: 0 18px; }
.btn-danger-solid { background: #dc2626; border-color: #dc2626; color: #fff; }
.btn-danger-solid:hover { background: #b91c1c; border-color: #b91c1c; }

/* Busy state on a submitted button */
.btn.is-busy { position: relative; pointer-events: none; opacity: .9; }
.btn.is-busy .icon { visibility: hidden; }
.btn.is-busy::before {
  content: ''; position: absolute; left: 14px; top: 50%; width: 14px; height: 14px; margin-top: -7px;
  border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
.btn.is-busy:not(:has(.icon)) { padding-left: 36px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Clickable table rows */
.table tr.row-link { cursor: pointer; }
.table tr.row-link:hover .primary { color: var(--accent); }

@media (max-width: 1280px) {
  .col-opt { display: none; }
}
@media (max-width: 640px) {
  .toasts { top: auto; bottom: 12px; right: 12px; }
  .public .toasts { bottom: 84px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .btn.is-busy::before { animation-duration: 1.4s !important; }
}

/* QR page: confirmation after a fault report, machine identity line */
.p-sent { display: flex; gap: 16px; padding: 20px; border-left: 4px solid var(--ok); }
.p-sent-ico { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok); }
.p-sent-ico .icon { width: 22px; height: 22px; stroke-width: 2.6; }
.p-sent h2 { font-size: 17px; margin: 2px 0 4px; }
.p-sent p { margin: 0 0 10px; }
.p-sent-no { font-size: 13.5px; color: var(--ink-2); }
.p-sent-no strong { font-family: var(--mono); font-size: 14px; color: var(--ink); }
.p-ident { margin-top: 4px; font-size: 13px; color: var(--ink-2); font-weight: 500; }

/* Stat cards: keep a row of five together on mid-size screens */
.stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
@media (max-width: 1400px) {
  .stat { flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; }
  .stat-icon { width: 36px; height: 36px; border-radius: 10px; }
  .stat-icon .icon { width: 17px; height: 17px; }
}
@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stats > .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 1024px) {
  .search-kbd { display: none; }
}
@media (max-width: 640px) {
  .stats .stat-icon { display: none; }
  .stat { padding: 14px; gap: 0; }
  .stat b { font-size: 24px; }
}

/* Phones: table rows become stacked cards instead of a squeezed grid */
@media (max-width: 640px) {
  .table-wrap { overflow: visible; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
  .table tr:last-child { border-bottom: 0; }
  .table td { padding: 2px 0; border: 0; text-align: left; }
  .table td:empty { display: none; }
  .table td.right { text-align: left; }
  .table td.actions { text-align: left; margin-top: 8px; }
  .table td.actions .btn-ghost { padding-left: 0; }
  .table td:first-child { font-size: 15px; }
  .col-opt { display: none !important; }
}
@media (max-width: 640px) {
  .table td + td { display: inline-block; width: auto; margin: 4px 12px 0 0; vertical-align: middle; }
  .table td + td.actions { display: block; width: 100%; margin-right: 0; }
}

/* Date range in list filters */
.date-range { display: inline-flex; align-items: center; gap: 6px; }
.date-range .dr-label { font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.date-range .dr-sep { color: var(--ink-3); }
.filters .date-range input { min-width: 0; width: 150px; }
@media (max-width: 640px) {
  .date-range { flex: 1 1 100%; }
  .filters .date-range input { flex: 1; width: auto; }
}

/* Single-column layouts must never grow wider than the screen (long QR links, tables) */
@media (max-width: 1080px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1024px) {
  .grid-2-even { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .filters .date-range { display: flex; width: 100%; min-width: 0; }
  .filters .date-range input { flex: 1 1 0; min-width: 0; width: 0; }
}
.entry-foot-note { justify-content: flex-start; align-items: center; gap: 8px; color: var(--ink-3); font-size: 12.5px; }
.entry-foot-note .icon { width: 15px; height: 15px; }
.upload.has-error { border-color: var(--bad); background: var(--bad-bg); }
.icon-btn.copied { color: var(--ok); background: var(--ok-bg); }
.p-status .s-muted { color: var(--muted); }

/* Service records as accordions: the heading shows, a click opens the details. */
summary.entry-head { cursor: pointer; list-style: none; padding-bottom: 14px; border-radius: 14px; user-select: none; -webkit-tap-highlight-color: transparent; }
summary.entry-head::-webkit-details-marker { display: none; }
summary.entry-head::marker { content: ""; }
summary.entry-head > div:first-child { flex: 1 1 220px; min-width: 0; }
summary.entry-head:hover h3 { color: var(--accent); }
summary.entry-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
details.entry[open] > summary.entry-head { padding-bottom: 10px; border-radius: 14px 14px 0 0; }
.entry-side { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.entry-chev { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; background: var(--subtle); color: var(--ink-3); transition: transform .18s ease, background .18s ease; }
.entry-chev .icon { width: 15px; height: 15px; }
details.entry[open] .entry-chev { transform: rotate(90deg); background: var(--line-soft); }
details.entry:not([open]) .entry-more { display: none; }
.timeline > li:target details.entry, .timeline > li.is-flash details.entry { box-shadow: 0 0 0 2px var(--accent); }
@media print { .entry-chev { display: none !important; } }
.timeline-toggle { display: flex; margin: 0 0 10px auto; }

/* Subscriptions and QR label stock */
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; min-width: 0; }
.list-tight li { padding-top: 8px; padding-bottom: 8px; }
.lead-code { font-size: 24px; font-weight: 700; letter-spacing: .03em; margin: 0 0 10px; }
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
select[size] { padding: 4px; }
select[size] option { padding: 7px 8px; border-radius: 6px; }
select[size] optgroup { font-weight: 700; color: var(--ink-3); }
.grid-side { grid-template-columns: minmax(0, 1fr) 350px; }
@media (max-width: 1000px) { .grid-side { grid-template-columns: minmax(0, 1fr); } }

/* ============================================================ FibexQR logo
   Light version (white letters) on the dark bars, the supplied logo on white surfaces. */
.brand-logo { display: block; width: auto; height: 26px; max-width: 100%; flex: none; }
.masthead .brand-logo, .p-top .brand-logo { height: 28px; }
.masthead .brand { padding: 4px 0; }
.p-top .brand { display: flex; align-items: center; gap: 12px; }
.brand-tag { padding-left: 12px; border-left: 1px solid rgba(255, 226, 229, .25); color: rgba(255, 226, 229, .7); font-size: 12px; font-weight: 600; white-space: nowrap; }
.af-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 24px; }
.af-top .brand-logo { height: 30px; }
.af-tenant {
  display: inline-flex; align-items: center; gap: 6px; max-width: 55%; height: 28px; padding: 0 11px; border-radius: 999px;
  background: #f6f4f5; border: 1px solid #ebe5e7; color: #1d1517; font-size: 11.5px; font-weight: 650; white-space: nowrap;
}
.af-tenant .icon { width: 12px; height: 12px; flex: none; }
.af-tenant span { overflow: hidden; text-overflow: ellipsis; }
.r-head .brand-logo { height: 30px; }
@media (max-width: 420px) {
  .af-top .brand-logo { height: 26px; }
  .brand-tag { display: none; }
}

/* ============================================================ Service costs */
.parts-table .price { width: 120px; text-align: right; }
.cost-row { display: grid; grid-template-columns: 150px 180px minmax(0, 1fr); gap: 14px 18px; align-items: start; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line-2); }
.label-like { display: block; font-weight: 600; margin-bottom: 6px; font-size: 13px; color: var(--ink-2); }
.cost-sum { min-height: 40px; display: flex; align-items: center; padding: 0 12px; border-radius: 12px; background: var(--subtle); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
#total_cost { text-align: right; font-variant-numeric: tabular-nums; }
.parts-list tfoot td { padding: 8px 10px; background: var(--subtle); font-weight: 700; border-top: 1px solid var(--line); }
.cost-total { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--accent-bg); color: var(--ink); }
.cost-total span { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); }
.cost-total .icon { width: 15px; height: 15px; color: var(--accent); }
.cost-total strong { font-size: 18px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--accent-2); }
@media (max-width: 640px) {
  .cost-row { grid-template-columns: 1fr 1fr; }
  .cost-row > div:last-child { grid-column: 1 / -1; }
  .parts-table .price { width: 100%; }
  .parts-list th, .parts-list td { padding-left: 7px; padding-right: 7px; }
}

.parts-list th.right { text-align: right; }

/* ============================================================ Public "Servis kaydını gir" */
dialog.dlg-wide { width: min(640px, calc(100vw - 32px)); }
dialog.dlg-wide form { max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
dialog.dlg-wide .card-body { overflow-y: auto; }
.sl-parts { display: grid; gap: 8px; margin-bottom: 6px; }
.sl-part { display: grid; grid-template-columns: minmax(0, 1fr) 90px; gap: 8px; }
.sl-part .qty { text-align: right; }
.sl-who { margin-top: 6px; padding-top: 14px; border-top: 1px dashed var(--line-2); }
.sl-who .label-like { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
@media (max-width: 640px) {
  dialog.dlg-wide { width: 100vw; }
  dialog.dlg-wide form { max-height: 92vh; }
  dialog.dlg-wide .form-grid { grid-template-columns: 1fr !important; }
}

/* ============================================================ Invoices in a service record */
.inv-block { margin-top: 12px; }
.inv-list { list-style: none; margin: 4px 0 10px; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.inv-list li { min-width: 0; }
.inv-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.inv-file { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; color: var(--ink); }
.inv-file:hover { text-decoration: none; }
.inv-file:hover strong { color: var(--accent); }
.inv-ico { flex: none; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--muted-bg); color: var(--ink-3); font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.inv-ico.is-pdf { background: #fde8e8; color: #b91c1c; }
.inv-ico .icon { width: 16px; height: 16px; }
.inv-main { min-width: 0; display: flex; flex-direction: column; }
.inv-main strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-main small { color: var(--ink-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-side { flex: none; display: inline-flex; align-items: center; gap: 6px; }
.inv-del { color: var(--bad); }
@media (max-width: 640px) { .inv-list li { flex-wrap: wrap; } .inv-file { flex: 1 1 100%; } .inv-side { margin-left: 44px; } }

/* ============================================================ Public QR page — design pass */
.public { background: #f6f2f3; }
.public .p-top { background: linear-gradient(135deg, #1f0609 0%, #3f0b14 50%, #6b1120 100%); padding: 22px 0 76px; }
.public .p-top .brand-logo { height: 30px; }
.public .p-top .brand .brand-tag { color: rgba(255, 226, 229, .82); }
.public .p-hero { margin-top: -54px; }
.public .p-card { border-radius: 18px; box-shadow: 0 1px 2px rgba(40, 8, 12, .05), 0 0 0 1px #ece3e5, 0 18px 40px -26px rgba(40, 8, 12, .35); }
.public .p-card-body { padding: 22px 24px; }
.public .p-hero h1 { font-size: 24px; letter-spacing: -.02em; }
.public .p-ident { color: var(--ink-2); }
.public .p-status > div { padding: 15px 18px; }
.public .p-status small { font-size: 10.5px; letter-spacing: .07em; color: #8d7d81; }
.public .p-status strong { font-size: 15.5px; }

/* status pill */
.s-pill { display: inline-flex !important; align-items: center; gap: 7px; padding: 4px 11px 4px 9px; border-radius: 999px; font-size: 13.5px !important; line-height: 1.2; }
.s-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.p-status .s-pill.s-ok { background: #e4f4ea; color: #13703f; }
.p-status .s-pill.s-warn { background: #fdf3dc; color: #b45309; }
.p-status .s-pill.s-bad { background: #fde8e8; color: #b91c1c; }
.p-status .s-pill.s-muted { background: #eef0f3; color: #5b6380; }

/* machine details: a clean three-column list, no boxed grid */
.public .p-card .specs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 24px; border: 0; border-radius: 0; overflow: visible; background: transparent; }
.public .p-card .specs div { padding: 11px 0; box-shadow: none; border-bottom: 1px solid #f1eaec; background: transparent; }
.public .p-card .specs small { font-size: 10.5px; letter-spacing: .07em; color: #8d7d81; font-weight: 600; margin-bottom: 2px; }
.public .p-card .specs span { font-weight: 600; color: var(--ink); overflow-wrap: normal; word-break: normal; }

/* section heading + history toolbar */
.public .p-section-title { margin: 28px 2px 12px; gap: 6px 16px; flex-wrap: wrap; align-items: baseline; }
.public .p-section-title h2 { font-size: 18px; letter-spacing: -.01em; }
.timeline-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.timeline-bar .seg { margin: 0; }
.timeline-bar .timeline-toggle { margin: 0; }
.public .seg { box-shadow: 0 0 0 1px #ece3e5; }
.public .seg button.on { background: #fbe2e5; color: #8c1121; }

/* timeline: each dot sits level with its service title */
.timeline .node { top: 15px; }
.timeline > li::before { top: 33px; bottom: -15px; }
.public .timeline > li { padding-bottom: 14px; }
.public .entry { border-color: #ece3e5; border-radius: 14px; }
.public details.entry:not([open]):hover { box-shadow: 0 6px 18px -12px rgba(40, 8, 12, .3); }

/* CTA + footer */
.public .p-cta .btn { min-height: 46px; border-radius: 12px; font-size: 15px; }
.public .p-foot { padding: 26px 0 10px; line-height: 1.6; }
.public .p-login { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.public .p-login a { padding: 8px 14px; font-size: 12.5px; background: #fff; }

@media (max-width: 640px) {
  .public .p-top { padding: 18px 0 70px; }
  .public .p-top .brand-logo { height: 26px; }
  .public .p-card-body { padding: 18px; }
  .public .p-hero h1 { font-size: 21px; }
  .public .p-section-title { flex-direction: column; align-items: flex-start; }
  /* details as label-left / value-right rows: codes never break mid-word */
  .public .p-card .specs { grid-template-columns: minmax(0, 1fr); }
  .public .p-card .specs div { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 10px 0; }
  .public .p-card .specs small { margin: 0; flex: none; }
  .public .p-card .specs span { text-align: right; min-width: 0; overflow-wrap: anywhere; }
  .public .p-card .specs div:last-child { border-bottom: 0; }
  .public .p-status > div { padding: 12px 18px; }
}
@media print {
  .public .p-top { background: #fff; }
  .s-pill { background: none !important; padding: 0; }
}
