@font-face {
  font-family: "IRANSansWeb";
  src: url("fonts/IRANSansWeb_Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #f7f9fb;
  --surface-warm: #fff7e8;
  --ink: #151c25;
  --muted: #65707d;
  --line: #dde4ec;
  --teal: #008574;
  --teal-strong: #00695f;
  --bronze: #b77a32;
  --gold: #d6a84e;
  --graphite: #202b38;
  --navy: #0d1724;
  --red: #c62828;
  --danger: #b42318;
  --success: #147a43;
  --warning: #a15c07;
  --shadow: 0 20px 52px rgba(18, 31, 47, 0.09);
  --shadow-soft: 0 8px 24px rgba(18, 31, 47, 0.06);
  --radius: 8px;
  --sidebar: 260px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.72), rgba(238,241,245,0.98) 42%),
    var(--bg);
  color: var(--ink);
  font-family: "IRANSansWeb", Vazirmatn, IRANSans, Tahoma, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: 0;
}

body[dir="ltr"],
[dir="ltr"] body {
  font-family: Inter, Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
  box-shadow: 0 1px 0 rgba(13, 23, 36, 0.02);
}

textarea {
  resize: vertical;
}

select[multiple] {
  min-height: 172px;
  padding: 8px;
}

select[multiple] option {
  padding: 8px;
  border-radius: 6px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.check-line {
  grid-auto-flow: column;
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.check-line input {
  width: 18px;
  min-height: 18px;
}

code {
  direction: ltr;
  display: inline-block;
  font-family: Consolas, monospace;
  font-size: 12px;
}

.hidden {
  display: none !important;
}

.btn {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  background: linear-gradient(135deg, var(--teal), var(--teal-strong));
  color: #fff;
  box-shadow: 0 12px 22px rgba(0, 121, 107, 0.22);
}

.btn.primary:hover {
  background: var(--teal-strong);
}

.btn.subtle {
  background: #fff;
  color: var(--graphite);
  border-color: var(--line);
  box-shadow: var(--shadow-soft);
}

.brand-mark {
  width: 104px;
  height: 42px;
  border: 1px solid rgba(214, 168, 78, 0.28);
  border-radius: var(--radius);
  background:
    #fff
    url("brand/otc-group-logo.webp")
    center / 82px auto
    no-repeat;
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  line-height: 1;
  box-shadow: var(--shadow-soft);
}

.install-page,
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.install-card,
.auth-panel,
.auth-intro {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.install-card {
  width: min(680px, 100%);
  padding: 28px;
}

.install-shell {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.install-form {
  display: grid;
  gap: 16px;
}

.install-submit {
  width: min(260px, 100%);
}

.auth-shell {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 18px;
}

.auth-intro,
.auth-panel {
  padding: 28px;
}

.auth-intro {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(244, 247, 248, 0.96)),
    url("brand/otc-car-tuning-2.webp")
    center bottom / cover
    no-repeat,
    var(--surface);
}

.auth-intro h1,
.hero-band h1 {
  margin: 14px 0 10px;
  font-size: 34px;
  line-height: 1.35;
}

.auth-intro p {
  max-width: 54ch;
  color: var(--muted);
}

.auth-demo {
  margin-top: 28px;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.auth-demo strong {
  color: var(--teal-strong);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--surface-soft);
  padding: 4px;
  border-radius: var(--radius);
  margin-bottom: 18px;
}

.segmented button {
  border: 0;
  background: transparent;
  border-radius: 6px;
  min-height: 40px;
  cursor: pointer;
  color: var(--muted);
}

.segmented button.active {
  background: var(--surface);
  color: var(--teal-strong);
  box-shadow: 0 6px 14px rgba(20, 32, 31, 0.07);
}

.stack {
  display: none;
  gap: 14px;
}

.stack.active {
  display: grid;
}

.alert {
  padding: 12px 14px;
  border-radius: var(--radius);
  margin-bottom: 14px;
}

.alert.danger {
  color: var(--danger);
  background: #fff1ef;
  border: 1px solid #ffd1cb;
}

.alert.success {
  color: var(--success);
  background: #eef8f1;
  border: 1px solid #ccebd6;
}

.alert.warning {
  color: var(--warning);
  background: #fff7e8;
  border: 1px solid #ffdca6;
}

.app-page {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  width: var(--sidebar);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 249, 250, 0.92)),
    var(--surface);
  border-inline-end: 1px solid var(--line);
  padding: 20px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
  backdrop-filter: blur(14px);
  min-height: 0;
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.side-nav {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding-inline-end: 4px;
  scrollbar-width: thin;
}

.side-nav a {
  min-height: 46px;
  padding: 12px 14px;
  border-radius: var(--radius);
  color: var(--muted);
  display: flex;
  align-items: center;
  border: 1px solid transparent;
}

.side-nav a:hover {
  color: var(--teal-strong);
  background: var(--surface-soft);
}

.side-nav a.active {
  color: var(--teal-strong);
  background: #fff;
  border-color: rgba(0, 121, 107, 0.18);
  box-shadow: inset 3px 0 0 var(--teal), var(--shadow-soft);
}

.logout-form {
  display: grid;
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,0.96) 22%);
  padding-top: 12px;
}

.workspace {
  margin-inline-start: var(--sidebar);
  padding: 22px 24px 56px;
  display: grid;
  gap: 18px;
}

body[data-role="customer"] .workspace {
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  align-items: start;
}

body[data-role="customer"] .topbar,
body[data-role="customer"] .hero-band,
body[data-role="customer"] #customer-services,
body[data-role="customer"] #customer-profile {
  grid-column: 1 / -1;
}

body[data-role="customer"] #customer-vehicle {
  grid-column: 1;
}

body[data-role="customer"] #customer-orders {
  grid-column: 2;
}

.topbar {
  min-height: 68px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 12px;
  z-index: 20;
  backdrop-filter: blur(14px);
}

.topbar strong,
.topbar span {
  display: block;
}

.topbar span {
  color: var(--muted);
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notif-pill,
.lang-link {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--graphite);
  font-size: 12px;
}

.hero-band,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-band {
  position: relative;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 280px);
  gap: 18px;
  align-items: center;
  overflow: hidden;
  min-height: 172px;
}

.hero-band::after {
  content: "";
  position: absolute;
  inset-block: 12px;
  inset-inline-end: 12px;
  width: min(34%, 320px);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(13, 23, 36, 0.12), rgba(13, 23, 36, 0)),
    url("brand/otc-car-tuning-1.webp")
    center / cover
    no-repeat;
  border: 1px solid rgba(214, 168, 78, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.24);
  opacity: 0.5;
  z-index: 0;
}

.hero-band > * {
  position: relative;
  z-index: 1;
}

.eyebrow {
  color: var(--bronze);
  font-weight: 800;
  font-size: 13px;
}

.hero-metrics,
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 10px;
}

.hero-metrics span,
.metric-grid span,
.presence-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-soft);
}

.hero-metrics strong,
.metric-grid strong {
  display: block;
  color: var(--teal-strong);
  font-size: 26px;
}

.panel {
  padding: 20px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 0 0 4px;
  font-size: 19px;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  max-width: 62ch;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}

.grid-form > *,
.workbench-panel > *,
.vehicle-services-form > * {
  min-width: 0;
}

.grid-form .wide {
  grid-column: span 2;
}

.inline-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.vehicle-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-top: 14px;
}

.vehicle-register-form {
  padding: 10px;
  border: 1px solid rgba(221, 228, 236, 0.72);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #fbfcfd);
}

.vehicle-register-form label {
  color: #4b5563;
  font-weight: 700;
}

.vehicle-strip a {
  min-width: 190px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-soft);
  box-shadow: var(--shadow-soft);
}

.vehicle-strip a.active {
  border-color: var(--teal);
  background: #eefaf7;
  box-shadow: inset 3px 0 0 var(--teal), var(--shadow-soft);
}

.vehicle-strip strong,
.vehicle-strip span {
  display: block;
}

.vehicle-strip span {
  color: var(--muted);
  font-size: 13px;
}

.catalog-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.category-chips,
.admin-option-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.category-chips button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.category-chips button.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.admin-option-filters label {
  min-width: min(260px, 100%);
}

.workbench-panel {
  display: grid;
  gap: 16px;
}

#admin-options.workbench-panel,
#admin-vehicles.workbench-panel {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 2px 0 0;
}

#admin-options.workbench-panel {
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  align-items: start;
  grid-auto-flow: dense;
}

#admin-vehicles.workbench-panel {
  grid-template-columns: minmax(340px, 460px) minmax(0, 1fr);
  align-items: start;
  grid-auto-flow: dense;
}

#admin-options .section-head,
#admin-vehicles .section-head {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  padding: 2px 4px 8px;
}

#admin-vehicles > .subsection:first-of-type {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

#admin-vehicles > .subsection:first-of-type h3 {
  grid-column: 1 / -1;
}

#admin-vehicles #vehicleForm {
  position: sticky;
  top: 166px;
  background: #fff;
  border-color: var(--line);
  box-shadow: var(--shadow-soft);
  grid-template-columns: 1fr;
  border-inline-start: 3px solid var(--teal);
}

#admin-vehicles .vehicle-history-table {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
  gap: 0;
  box-shadow: var(--shadow-soft);
}

#admin-vehicles .vehicle-history-table > div {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

#admin-vehicles .vehicle-history-table > div:last-child {
  border-bottom: 0;
}

#admin-options #importOptions,
#admin-options .vehicle-services-workbench {
  grid-column: 1 / -1;
}

#admin-options #optionForm {
  grid-column: 1;
  position: sticky;
  top: 166px;
  align-self: start;
  background: #fff;
  border-color: var(--line);
  box-shadow: var(--shadow-soft);
  grid-template-columns: 1fr;
  border-inline-start: 3px solid var(--teal);
}

#admin-options #optionForm .wide,
#admin-vehicles #vehicleForm .wide {
  grid-column: 1;
}

#admin-options .admin-option-filters,
#admin-options .option-list {
  grid-column: 2;
}

#admin-options .admin-option-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
  margin: 0;
  align-items: end;
}

#admin-options .option-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
  gap: 0;
  box-shadow: var(--shadow-soft);
}

#admin-options .option-list article {
  display: grid;
  grid-template-columns: minmax(190px, 1.35fr) minmax(120px, 0.85fr) minmax(110px, 0.75fr) minmax(120px, 0.75fr) auto;
  align-items: center;
  min-height: 58px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

#admin-options .option-list article:last-child {
  border-bottom: 0;
}

#admin-options .option-list article:hover,
#admin-options .option-list article.row-active,
#admin-vehicles .vehicle-history-table > div.row-active,
.compact-table > div.row-active,
.data-list .quick-row.row-active {
  background: #f6fbfa;
  box-shadow: inset 3px 0 0 var(--teal);
}

.vehicle-services-workbench {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1.8fr);
  gap: 16px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--gold);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.workbench-copy h3 {
  margin: 8px 0;
  font-size: 20px;
}

.workbench-copy p {
  margin: 0;
  color: var(--muted);
}

.vehicle-services-form {
  display: grid;
  gap: 12px;
  background: transparent;
}

.service-matrix-groups {
  max-height: 420px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  padding-inline-end: 4px;
}

.service-matrix-groups section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.service-matrix-groups h4 {
  margin: 0;
  padding: 10px 12px;
  background: var(--surface-soft);
  font-size: 14px;
}

.matrix-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  transition: 140ms ease;
}

.matrix-row:hover {
  background: #f7fbfa;
}

.matrix-row input {
  width: 18px;
  min-height: 18px;
}

.matrix-row span {
  display: grid;
  gap: 2px;
}

.matrix-row small {
  color: var(--muted);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.service-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  display: grid;
  grid-template-columns: 116px 1fr;
  min-height: 158px;
  box-shadow: var(--shadow-soft);
  transition: 160ms ease;
}

.service-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.service-thumb {
  background:
    linear-gradient(135deg, rgba(13,23,36,0.04), rgba(214,168,78,0.16)),
    #eef2f4;
  display: grid;
  place-items: center;
  color: var(--bronze);
  font-weight: 800;
}

.service-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.service-body {
  padding: 12px;
  display: grid;
  gap: 8px;
}

.service-body h3 {
  margin: 0;
  font-size: 17px;
}

.service-body p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  background: var(--surface-soft);
  color: var(--graphite);
}

.badge.ok {
  color: var(--success);
  background: #eef8f1;
}

.badge.warn {
  color: var(--warning);
  background: #fff7e8;
}

.badge.danger {
  color: var(--danger);
  background: #fff1ef;
}

.price-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  color: var(--teal-strong);
  font-weight: 800;
}

.cart-dock {
  position: sticky;
  bottom: 16px;
  z-index: 25;
  margin-top: 16px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  border: 1px solid rgba(0, 133, 116, 0.18);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  box-shadow: 0 18px 34px rgba(18, 31, 47, 0.12);
  backdrop-filter: blur(14px);
}

.cart-summary {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  min-width: 0;
  flex: 1;
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 8px;
  text-align: right;
  cursor: pointer;
}

.cart-summary span,
.cart-summary small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.cart-summary strong {
  color: var(--teal-strong);
  font-size: 15px;
}

.cart-actions {
  display: flex;
  gap: 8px;
}

.cart-actions .btn {
  min-height: 40px;
  padding-inline: 14px;
}

.cart-panel {
  position: absolute;
  inset-inline: 0;
  inset-block-end: calc(100% + 8px);
  display: none;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(18, 31, 47, 0.14);
}

.cart-dock.open .cart-panel {
  display: grid;
  gap: 10px;
}

.cart-panel-head,
.cart-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.cart-item {
  grid-template-columns: minmax(0, 1fr) auto 34px;
  min-height: 42px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.cart-item span {
  color: var(--ink);
  font-size: 13px;
}

.cart-item strong {
  color: var(--teal-strong);
  font-size: 12px;
}

.order-list,
.task-list,
.inventory-list,
.option-list {
  display: grid;
  gap: 10px;
}

.order-row,
.task-row,
.inventory-list article,
.option-list article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
}

.order-row span,
.task-row span,
.inventory-list span,
.option-list span,
.order-row small,
.task-row small {
  color: var(--muted);
  display: block;
}

.qr-box {
  width: 104px;
  display: grid;
  gap: 4px;
  justify-items: center;
}

.qr-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  width: 100%;
}

.qr-actions .btn {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 11px;
}

.qr-box img,
.mini-qr {
  width: 72px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 3px;
}

.mini-qr {
  width: 44px;
  height: 44px;
}

.qr-scanner {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(0, 133, 116, 0.22);
  border-radius: 8px;
  background: #f4fbfa;
}

.qr-scanner[hidden] {
  display: none;
}

.qr-scanner video {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: #101820;
}

.qr-scanner strong,
.qr-scanner span {
  display: block;
}

.qr-scanner span {
  color: var(--muted);
  margin-bottom: 10px;
}

.profile-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-line span {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.presence-card {
  display: grid;
  grid-template-columns: 170px 84px auto;
  gap: 8px;
}

.task-actions,
.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-page-switcher {
  display: none;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  position: sticky;
  top: 90px;
  z-index: 15;
  padding: 10px;
  margin-inline: -10px;
  background: rgba(238, 241, 245, 0.82);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
}

.admin-page-switcher .btn {
  min-height: 38px;
  padding-inline: 12px;
  box-shadow: none;
}

.form-actions {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
}

.grid-form .form-actions.wide {
  grid-column: 1 / -1;
}

.admin-edit-form {
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px;
  margin-inline: -10px;
  transition: 160ms ease;
  scroll-margin-top: 168px;
}

.admin-edit-form.editing {
  border-color: rgba(15, 118, 110, 0.28);
  background: #f7fbfa;
}

.admin-edit-form.saved-flash {
  border-color: rgba(20, 122, 67, 0.42);
  box-shadow: 0 0 0 3px rgba(20, 122, 67, 0.1);
}

.btn.danger {
  background: #fff1ef;
  color: var(--danger);
  border-color: #ffd0ca;
}

.lookup-result {
  margin-top: 12px;
}

.lookup-result .result-card {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: var(--radius);
  padding: 12px;
}

.compact-table,
.admin-table {
  display: grid;
  gap: 8px;
}

.compact-table > div,
.admin-table > div {
  display: grid;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
  box-shadow: var(--shadow-soft);
}

.compact-table > div {
  grid-template-columns: 70px minmax(180px, 1fr) repeat(4, auto);
}

.admin-table > div {
  grid-template-columns: 120px 1fr 1fr 1.2fr auto 180px;
}

.assign-table > div {
  grid-template-columns: 120px 1.2fr 140px 160px 260px;
}

.admin-table .table-head {
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 700;
}

.inventory-list {
  margin-top: 14px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.inventory-list article,
.option-list article {
  grid-template-columns: 1fr;
  gap: 6px;
  min-height: 132px;
}

.stock-low {
  border-color: #ffd6a7 !important;
  background: #fff9ef !important;
}

.option-list {
  margin-top: 14px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.option-list article small {
  color: var(--bronze);
  font-size: 12px;
}

.report-range {
  margin-bottom: 12px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.report-metrics {
  margin-bottom: 16px;
}

.report-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.report-columns h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.report-table > div {
  grid-template-columns: minmax(120px, 1fr) repeat(3, auto);
}

.vehicle-history-table > div {
  grid-template-columns: 72px minmax(150px, 1fr) minmax(130px, 1fr) repeat(3, auto);
}

.vehicle-history-table small {
  color: var(--muted);
}

.report-tabs {
  justify-content: flex-end;
}

.integration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.integration-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.integration-grid small {
  color: var(--muted);
}

.subsection {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.subsection h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--muted);
  background: var(--surface-soft);
  text-align: center;
}

.toast {
  position: fixed;
  inset-block-end: 20px;
  inset-inline-start: 50%;
  transform: translateX(-50%) translateY(20px);
  min-width: min(360px, calc(100vw - 32px));
  background: var(--graphite);
  color: #fff;
  border-radius: var(--radius);
  padding: 12px 14px;
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
  z-index: 60;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  background: var(--danger);
}

.mobile-nav {
  display: none;
}

/* Admin application shell: matched to the accepted premium workbench concept. */
body[data-role="admin"] {
  background: var(--bg);
}

body[data-role="admin"] .sidebar {
  background: #fff;
  border-inline-end: 1px solid var(--line);
  box-shadow: -10px 0 30px rgba(18, 31, 47, 0.04);
  padding: 18px 14px;
  gap: 18px;
}

.brand-copy {
  display: grid;
  gap: 2px;
  line-height: 1.35;
}

.brand-copy small {
  color: var(--bronze);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
}

body[data-role="admin"] .brand-line {
  justify-content: space-between;
  padding: 2px 2px 10px;
}

body[data-role="admin"] .brand-mark {
  width: 86px;
  height: 38px;
  background-size: 76px auto;
  border: 0;
  box-shadow: none;
}

.ui-icon {
  width: 21px;
  height: 21px;
  display: inline-block;
  vertical-align: middle;
  flex: 0 0 auto;
}

.nav-icon {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  color: #5c6875;
}

body[data-role="admin"] .side-nav {
  gap: 6px;
  padding: 4px 0 8px;
}

body[data-role="admin"] .side-nav a {
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 7px;
  color: #526071;
  direction: rtl;
  justify-content: flex-start;
  gap: 12px;
  font-size: 14px;
  text-align: right;
}

body[data-role="admin"] .side-nav .nav-icon {
  flex: 0 0 22px;
  display: inline-grid;
  place-items: center;
}

body[data-role="admin"] .side-nav .nav-label {
  flex: 1;
  min-width: 0;
  text-align: right;
}

body[data-role="admin"] .side-nav a:hover {
  background: #f4f8f8;
  color: var(--teal-strong);
}

body[data-role="admin"] .side-nav a.active {
  color: #fff;
  background: linear-gradient(180deg, #009982, #007767);
  border-color: transparent;
  box-shadow: 0 12px 22px rgba(0, 121, 107, 0.18);
}

body[data-role="admin"] .side-nav a.active .nav-icon {
  color: #fff;
}

body[data-role="admin"] .logout-form {
  background: linear-gradient(180deg, rgba(255,255,255,0), #fff 25%);
}

body[data-role="admin"] .logout-form .btn {
  width: 100%;
  justify-content: center;
  min-height: 50px;
}

body[data-role="admin"] .workspace {
  padding: 8px 10px 44px;
  gap: 8px;
}

body[data-role="admin"] .admin-topbar {
  direction: ltr;
  min-height: 90px;
  top: 8px;
  display: grid;
  grid-template-columns: minmax(210px, 250px) auto minmax(420px, 1fr) minmax(138px, 168px);
  align-items: stretch;
  gap: 8px;
  padding: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

body[data-role="admin"] .admin-topbar > * {
  direction: rtl;
}

.topbar-profile,
.topbar-tools,
.today-chip,
.admin-stat-strip {
  min-width: 0;
  border-inline-start: 1px solid var(--line);
}

.topbar-profile {
  direction: ltr !important;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-inline-start: 0;
}

.topbar-profile > span:not(.avatar):not(.chevron) {
  direction: rtl;
  text-align: right;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #17212d, #334155);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
}

.topbar-profile strong,
.topbar-profile small {
  display: block;
}

.topbar-profile small {
  color: var(--muted);
  font-size: 12px;
}

.chevron {
  color: var(--muted);
  display: grid;
  place-items: center;
}

.topbar-tools {
  direction: ltr !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
}

.icon-button {
  position: relative;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border: 1px solid transparent;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: #475569;
  background: #fff;
  text-decoration: none;
}

.icon-button .ui-icon,
body[data-role="admin"] .lang-link {
  flex: 0 0 auto;
}

.icon-button .ui-icon {
  width: 20px;
  height: 20px;
}

.icon-button:hover {
  border-color: var(--line);
  background: var(--surface-soft);
}

.icon-button b {
  position: absolute;
  inset-block-start: -4px;
  inset-inline-end: -3px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-size: 10px;
  line-height: 1;
}

.admin-stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(98px, 1fr));
  align-items: stretch;
}

.stat-chip {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 30px;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  gap: 0 8px;
  padding: 12px 14px;
  border-inline-end: 1px solid var(--line);
}

.stat-chip:first-child {
  border-inline-end: 0;
}

.stat-chip small {
  color: var(--muted);
  font-size: 12px;
}

.stat-chip strong {
  font-size: 23px;
  line-height: 1.2;
  color: var(--ink);
}

.stat-chip i {
  grid-row: 1 / span 2;
  grid-column: 2;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--teal);
}

.today-chip {
  display: grid;
  grid-template-columns: 1fr 30px;
  align-items: center;
  gap: 2px 8px;
  padding: 12px 14px;
  color: var(--muted);
}

.today-chip strong {
  color: var(--ink);
  font-size: 13px;
}

.today-chip .ui-icon {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--teal);
}

body[data-role="admin"] .lang-link {
  flex: 0 0 38px;
  min-width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  background: var(--surface-soft);
}

body[data-role="admin"] .panel,
.data-sheet,
.editor-sheet,
.action-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.admin-workbench {
  direction: ltr;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  align-items: start;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  gap: 10px;
}

.admin-workbench > * {
  direction: rtl;
}

.admin-workbench .section-head {
  grid-column: 1 / -1;
  min-height: 64px;
  align-items: center;
  padding: 12px 4px;
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.admin-workbench .section-head h2 {
  font-size: 18px;
}

.admin-workbench .section-head p {
  font-size: 13px;
}

.editor-sheet {
  position: sticky;
  top: 108px;
  grid-column: 1;
  padding: 16px !important;
  margin: 0 !important;
  grid-template-columns: 1fr !important;
  align-self: start;
  max-height: calc(100vh - 124px);
  overflow: auto;
}

#admin-options #optionForm,
#admin-inventory #inventoryForm,
#admin-vehicles #vehicleForm,
#admin-vehicles #vehicleModelForm,
#admin-technicians #technicianQuickForm,
#admin-users #userForm {
  display: none;
}

#admin-options #optionForm.editing,
#admin-options #optionForm.is-new,
#admin-inventory #inventoryForm.editing,
#admin-inventory #inventoryForm.is-new,
#admin-vehicles #vehicleForm.editing,
#admin-vehicles #vehicleForm.is-new,
#admin-vehicles #vehicleModelForm.editing,
#admin-vehicles #vehicleModelForm.is-new,
#admin-technicians #technicianQuickForm.editing,
#admin-technicians #technicianQuickForm.is-new,
#admin-users #userForm.editing,
#admin-users #userForm.is-new,
.editor-sheet.always-open {
  display: grid;
}

.editor-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 4px;
  padding-bottom: 12px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--line);
}

.editor-title h3 {
  margin: 0;
  font-size: 18px;
}

.editor-title p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.editor-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
  margin: -2px 0 6px;
}

.editor-tabs button {
  min-height: 42px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  border-bottom: 2px solid transparent;
  border-inline: 0;
  border-block-start: 0;
  background: transparent;
  cursor: pointer;
}

.editor-tabs button.active {
  color: var(--teal-strong);
  border-color: var(--teal);
  font-weight: 800;
}

.editor-pane {
  display: none;
  grid-template-columns: 1fr;
  gap: 12px;
}

.editor-pane.active {
  display: grid;
}

.requirement-editor {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.requirement-editor strong,
.requirement-editor span {
  display: block;
}

.requirement-editor span {
  color: var(--muted);
  font-size: 12px;
}

.requirement-rows {
  display: grid;
  gap: 8px;
}

.requirement-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px 38px;
  gap: 8px;
  align-items: center;
}

.editor-sheet .form-actions {
  position: sticky;
  bottom: -16px;
  margin: 6px -16px -16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.data-sheet {
  grid-column: 2;
  min-width: 0;
  padding: 14px;
}

.standalone-sheet {
  grid-column: 1 / -1;
}

.data-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.data-toolbar strong,
.data-toolbar span {
  display: block;
}

.data-toolbar span {
  color: var(--muted);
  font-size: 12px;
}

.data-list {
  display: grid;
  gap: 0;
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.data-list .table-head,
.data-list article,
.data-list .quick-row {
  display: grid;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.data-list .table-head {
  min-height: 48px;
  background: #fbfcfd;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.data-list article:last-child,
.data-list .quick-row:last-child {
  border-bottom: 0;
}

.data-list article:hover,
.data-list .quick-row:hover {
  background: #f7fbfa;
}

.data-list .quick-row.saved-flash {
  background: #effbf5;
  box-shadow: inset 3px 0 0 #11945f;
}

#admin-inventory #inventoryForm {
  grid-column: 1;
}

#admin-inventory .inventory-sheet {
  grid-column: 2;
}

.inventory-list.data-list {
  grid-template-columns: 1fr;
}

.inventory-list.data-list .table-head,
.inventory-list.data-list .quick-row {
  grid-template-columns: minmax(180px, 1.4fr) minmax(128px, 0.9fr) 108px 86px 92px minmax(110px, 0.8fr) 116px 116px;
}

.inventory-list.data-list .quick-row {
  min-height: 62px;
}

.inventory-list.data-list strong,
.option-list.data-list strong {
  min-width: 0;
  font-size: 14px;
}

.inventory-list.data-list span,
.inventory-list.data-list small,
.option-list.data-list span,
.option-list.data-list small {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.quick-row label {
  gap: 3px;
  min-width: 0;
}

.quick-row label > span:not(.stock-stepper) {
  display: none;
  color: var(--muted);
  font-size: 11px;
}

.quick-row input,
.quick-row select {
  min-height: 38px;
  border-color: rgba(221, 228, 236, 0.55);
  background: #fbfcfd;
  padding: 8px 9px;
  box-shadow: none;
  font-size: 13px;
}

.quick-row:hover input,
.quick-row:hover select,
.quick-row input:focus,
.quick-row select:focus {
  border-color: var(--line);
  background: #fff;
}

.stock-stepper {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 4px;
}

.stock-stepper input {
  text-align: center;
  padding-inline: 6px;
}

.step-btn {
  width: 32px;
  min-width: 32px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  background: #fff;
  color: var(--teal-strong);
  font-weight: 900;
  cursor: pointer;
}

.step-btn:hover {
  border-color: rgba(0, 133, 116, 0.34);
  background: #eefaf7;
}

.data-list .quick-row.row-dirty {
  box-shadow: inset 3px 0 0 var(--gold);
}

.quick-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.quick-save {
  min-height: 38px;
  padding: 8px 12px;
  box-shadow: none !important;
}

.option-sheet {
  grid-column: 2;
}

.service-matrix-sheet {
  overflow: auto;
}

.service-matrix-sheet .admin-option-filters {
  grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 0.8fr) minmax(180px, 0.8fr);
  margin-bottom: 12px;
}

.compat-matrix {
  min-width: 100%;
  width: max-content;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.matrix-head,
.matrix-service-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) repeat(var(--model-count), minmax(82px, 0.56fr)) minmax(92px, 0.5fr);
  align-items: stretch;
}

.matrix-head {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 58px;
  background: #fbfcfd;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.matrix-head > span,
.matrix-service-row > * {
  min-width: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 9px 10px;
  border-inline-end: 1px solid var(--line);
}

.matrix-head > span:first-child,
.matrix-service-row > *:first-child {
  justify-items: start;
}

.matrix-head > span:last-child,
.matrix-service-row > *:last-child {
  border-inline-end: 0;
}

.matrix-head strong,
.matrix-head small {
  display: block;
}

.matrix-head strong {
  color: var(--ink);
  font-size: 15px;
}

.matrix-head small {
  font-weight: 500;
}

.matrix-category {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 10px 14px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
}

.matrix-category i {
  width: 24px;
  height: 24px;
  color: var(--graphite);
  display: grid;
  place-items: center;
}

.matrix-service-row {
  min-height: 54px;
  border-bottom: 1px solid var(--line);
  transition: 140ms ease;
}

.matrix-service-row:hover,
.matrix-service-row.row-active {
  background: #f4fbfa;
  box-shadow: inset 3px 0 0 var(--teal);
}

.matrix-service-title {
  justify-items: start !important;
  align-content: center;
}

.service-edit-trigger {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: right;
}

.service-edit-trigger:hover strong {
  color: var(--teal-strong);
}

.matrix-service-title strong,
.matrix-service-title small {
  min-width: 0;
  max-width: 100%;
  display: block;
}

.matrix-service-title strong {
  color: var(--ink);
  font-size: 14px;
}

.matrix-service-title small {
  color: var(--muted);
  font-size: 11px;
}

.matrix-toggle,
.icon-menu {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.matrix-toggle {
  width: 100%;
  min-height: 54px;
  display: grid;
  place-items: center;
  color: #a1aab5;
}

.matrix-toggle .ui-icon {
  width: 25px;
  height: 25px;
  transition: 140ms ease;
}

.matrix-toggle.active {
  color: #11945f;
}

.matrix-toggle.inactive {
  color: #a6afb9;
}

.matrix-toggle:hover .ui-icon {
  transform: scale(1.08);
}

.matrix-toggle:disabled {
  opacity: 0.55;
  cursor: wait;
}

.matrix-actions {
  display: grid;
  place-items: center;
}

.icon-menu {
  min-width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  gap: 2px;
  color: var(--graphite);
}

.matrix-actions .icon-menu {
  width: auto;
  min-width: 70px;
  grid-auto-flow: column;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 11px;
}

.icon-menu:hover {
  background: var(--surface-soft);
  color: var(--teal-strong);
}

.option-list.data-list .table-head,
.option-list.data-list article {
  grid-template-columns: minmax(180px, 1.35fr) minmax(120px, 0.8fr) minmax(110px, 0.72fr) minmax(120px, 0.82fr) auto;
}

#admin-options #optionForm,
#admin-vehicles #vehicleForm,
#admin-vehicles #vehicleModelForm {
  grid-column: 1;
}

#admin-options #optionForm {
  grid-row: 2 / span 3;
}

#admin-options .vehicle-services-workbench {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  grid-template-columns: minmax(190px, 0.5fr) minmax(0, 1.4fr);
  margin: 0;
}

#admin-options .option-sheet {
  grid-row: 2 / span 3;
}

#admin-options:not(.editor-open),
#admin-inventory:not(.editor-open) {
  grid-template-columns: 1fr;
}

#admin-options:not(.editor-open) .option-sheet,
#admin-inventory:not(.editor-open) .inventory-sheet {
  grid-column: 1 / -1;
}

#admin-options .option-list {
  border: 0;
  box-shadow: none;
}

#admin-options .admin-option-filters {
  grid-column: auto;
  margin: 0 0 12px;
}

#admin-options .option-list article {
  min-height: 58px;
}

#admin-vehicles > .subsection:first-of-type {
  direction: ltr;
  grid-column: 1 / -1;
  grid-template-columns: minmax(330px, 420px) minmax(0, 1fr);
}

#admin-vehicles > .subsection:first-of-type:not(.editor-open) {
  grid-template-columns: 1fr;
}

#admin-vehicles > .subsection:first-of-type > * {
  direction: rtl;
}

#admin-vehicles .vehicle-history-table {
  margin: 0;
}

.vehicle-model-sheet {
  grid-column: 1 / -1;
}

.vehicle-model-list.data-list .table-head,
.vehicle-model-list.data-list .quick-row {
  grid-template-columns: minmax(130px, 1fr) minmax(130px, 1fr) minmax(92px, 0.65fr) minmax(92px, 0.65fr) minmax(110px, 0.75fr) minmax(112px, auto);
}

.tech-skill-list.data-list .table-head,
.tech-skill-list.data-list > div {
  grid-template-columns: minmax(160px, 1fr) minmax(220px, 1.4fr) minmax(110px, auto);
}

.workbench-footer {
  grid-column: 1 / -1;
  padding: 16px;
}

.compact-form {
  grid-template-columns: repeat(5, minmax(140px, 1fr));
}

body[data-role="admin"] .data-sheet .compact-table {
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

body[data-role="admin"] .data-sheet .compact-table > div {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  min-height: 58px;
}

body[data-role="admin"] .data-sheet .compact-table > div:last-child {
  border-bottom: 0;
}

body[data-role="admin"] .subsection {
  border-top: 0;
}

body[data-role="admin"] .stock-low {
  background: #fffaf2 !important;
  box-shadow: inset 3px 0 0 #f59e0b;
}

@media (max-width: 980px) {
  .sidebar {
    display: none;
  }

  .workspace {
    margin-inline-start: 0;
    padding: 10px 10px 92px;
  }

  body[data-role="customer"] .workspace {
    grid-template-columns: 1fr;
  }

  body[data-role="customer"] .topbar,
  body[data-role="customer"] .hero-band,
  body[data-role="customer"] #customer-services,
  body[data-role="customer"] #customer-profile,
  body[data-role="customer"] #customer-vehicle,
  body[data-role="customer"] #customer-orders {
    grid-column: 1;
  }

  .topbar {
    position: static;
    top: auto;
    border-radius: 8px;
  }

  body[data-role="admin"] .admin-topbar {
    display: grid;
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 8px;
    padding: 8px;
  }

  .topbar-profile,
  .topbar-tools,
  .today-chip,
  .admin-stat-strip {
    border-inline-start: 0;
    border-block-start: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .topbar-profile {
    min-height: 58px;
    padding: 8px;
  }

  .topbar-tools {
    justify-content: space-between;
    padding: 8px;
  }

  .admin-stat-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(116px, 1fr);
    grid-template-columns: none;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .stat-chip {
    min-height: 72px;
    padding: 8px 10px;
    border-inline-end: 1px solid var(--line);
  }

  .stat-chip strong {
    font-size: 20px;
  }

  .today-chip {
    min-height: 54px;
    padding: 8px 10px;
  }

  .admin-workbench,
  #admin-inventory.admin-workbench,
  #admin-options.admin-workbench,
  #admin-vehicles.admin-workbench,
  #admin-vehicles > .subsection:first-of-type {
    grid-template-columns: 1fr;
  }

  .editor-sheet,
  .data-sheet,
  #admin-inventory #inventoryForm,
  #admin-inventory .inventory-sheet,
  #admin-options #optionForm,
  #admin-options .vehicle-services-workbench,
  #admin-options .option-sheet,
  #admin-vehicles #vehicleForm,
  #admin-vehicles #vehicleModelForm {
    grid-column: 1;
  }

  .editor-sheet {
    position: static;
    max-height: none;
  }

  #admin-options .vehicle-services-workbench {
    grid-template-columns: 1fr;
  }

  .service-matrix-sheet .admin-option-filters {
    grid-template-columns: 1fr;
  }

  .compat-matrix {
    min-width: 760px;
  }

  .data-list .table-head {
    display: none;
  }

  .hero-band {
    grid-template-columns: 1fr;
  }

  .hero-band::after {
    position: relative;
    inset: auto;
    width: 100%;
    min-height: 120px;
    opacity: 0.72;
    order: -1;
  }

  .hero-metrics,
  .metric-grid,
  .presence-card {
    grid-template-columns: 1fr;
  }

  .grid-form,
  .catalog-toolbar,
  .auth-shell,
  .install-shell,
  .report-columns,
  .admin-option-filters,
  #admin-options.workbench-panel,
  #admin-vehicles.workbench-panel,
  #admin-vehicles > .subsection:first-of-type,
  .vehicle-services-workbench {
    grid-template-columns: 1fr;
  }

  .vehicle-register-form {
    padding: 12px;
  }

  .vehicle-strip a {
    min-width: min(230px, 76vw);
  }

  #admin-options #optionForm,
  #admin-options .admin-option-filters,
  #admin-options .option-list {
    grid-column: 1;
  }

  #admin-options #optionForm {
    position: static;
  }

  #admin-vehicles #vehicleForm {
    position: static;
  }

  #admin-options .option-list article {
    grid-template-columns: 1fr;
    align-items: start;
    min-height: auto;
  }

  .inventory-list.data-list .table-head,
  .inventory-list.data-list .quick-row,
  .vehicle-model-list.data-list .quick-row,
  .option-list.data-list .table-head,
  .option-list.data-list article {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .quick-row label > span:not(.stock-stepper) {
    display: block;
  }

  .compact-form {
    grid-template-columns: 1fr;
  }

  body[data-role="admin"] .data-sheet .compact-table > div {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .service-matrix-groups {
    max-height: 56vh;
  }

  .grid-form .wide {
    grid-column: auto;
  }

  .service-grid {
    grid-template-columns: 1fr;
  }

  .service-card {
    grid-template-columns: 96px 1fr;
  }

  .order-row,
  .task-row,
  .admin-table > div,
  .assign-table > div,
  .compact-table > div {
    grid-template-columns: 1fr;
  }

  .cart-dock {
    position: fixed;
    inset-inline: 10px;
    bottom: 74px;
    margin: 0;
  }

  .mobile-nav {
    position: fixed;
    inset-inline: 10px;
    inset-block-end: 10px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 50;
    overflow: hidden;
    backdrop-filter: blur(14px);
  }

  .mobile-nav a {
    min-height: 54px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 2px;
    color: var(--muted);
    font-size: 12px;
  }

  .mobile-nav .nav-icon {
    width: 22px;
    height: 22px;
  }

  .mobile-nav a:hover {
    color: var(--teal-strong);
    background: var(--surface-soft);
  }

  .admin-page-switcher {
    display: flex;
    position: static;
    top: auto;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 4px 0 8px;
  }

  .admin-page-switcher .btn {
    flex: 0 0 auto;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 14px;
  }

  .auth-intro h1,
  .hero-band h1 {
    font-size: 25px;
  }

  .auth-page,
  .install-page {
    padding: 12px;
  }

  .auth-intro,
  .auth-panel,
  .panel,
  .hero-band {
    padding: 14px;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
  }

  body[data-role="admin"] .admin-topbar {
    align-items: stretch;
  }

  .admin-stat-strip {
    grid-auto-columns: minmax(112px, 45%);
  }

  .section-head {
    flex-direction: column;
  }

  .inline-form {
    flex-direction: column;
    align-items: stretch;
  }

  .cart-dock {
    flex-direction: row;
    align-items: center;
  }

  .cart-actions {
    flex-direction: row;
    align-items: center;
  }

  .service-card {
    grid-template-columns: 88px 1fr;
  }

  .service-thumb {
    min-height: 108px;
  }

  .cart-summary {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .cart-actions .btn {
    min-height: 38px;
    padding-inline: 10px;
    font-size: 12px;
  }

  .qr-scanner {
    grid-template-columns: 1fr;
  }
}
