:root {
  --ink: #0b0f12;
  --muted: #65707a;
  --line: #dfe6e8;
  --paper: #f7f5ee;
  --panel: #ffffff;
  --accent: #ffd21f;
  --accent-dark: #e2b800;
  --danger: #d62922;
  --danger-dark: #9f1f1a;
  --green: #1f7a4d;
  --gold: #c89122;
  --shadow: 0 18px 45px rgba(16, 24, 32, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  overflow-x: hidden;
}

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

button {
  cursor: pointer;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px 1fr;
}

.sidebar {
  background: #0b0f12;
  color: #fff;
  padding: 26px 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.mark {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0;
}

.logo-box {
  width: 62px;
  height: 46px;
  border-radius: 8px;
  background: #fff;
  display: grid;
  place-items: center;
  padding: 7px;
}

.logo-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-wordmark {
  width: min(64%, 280px);
  min-height: 48px;
  display: grid;
  align-items: center;
  min-width: 0;
}

.brand-wordmark img {
  width: 100%;
  height: 46px;
  object-fit: contain;
  object-position: left center;
  display: block;
  min-width: 0;
}

.brand strong {
  display: block;
  font-size: 20px;
}

.brand span {
  color: #b9c3ca;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  text-align: left;
}

.nav button.active {
  background: var(--accent);
  color: var(--ink);
  border-color: var(--accent);
}

.nav-icon {
  width: 25px;
  display: grid;
  place-items: center;
  margin: 0 auto;
}

.nav-icon svg,
.placeholder-car svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.language {
  display: flex;
  gap: 8px;
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.language button,
.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  min-height: 40px;
  padding: 0 12px;
}

.top-controls .language button {
  min-height: 36px;
  padding: 0 9px;
  font-weight: 800;
}

.language button.active {
  border-color: var(--accent);
  color: var(--ink);
  background: var(--accent);
  font-weight: 700;
}

.main {
  padding: 28px;
  max-width: 1180px;
  width: min(100%, 1180px);
  min-width: 0;
}

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

.topbar > div {
  min-width: 0;
}

.eyebrow {
  color: #8a6a00;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 32px;
  margin-bottom: 0;
}

.profile-chip {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: #0b0f12;
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 900;
  padding: 0;
}

.muted {
  color: var(--muted);
  line-height: 1.5;
}

.notice {
  position: sticky;
  top: 14px;
  z-index: 30;
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 3px solid var(--accent);
  border-radius: 8px;
  background: #0b0f12;
  color: var(--accent);
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 20px 55px rgba(11, 15, 18, 0.24);
}

.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
}

.tour-dim {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(11, 15, 18, 0.58);
  pointer-events: auto;
}

.tour-card {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, calc(100vw - 28px));
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
}

.tour-card-bottom {
  bottom: 24px;
}

.tour-card-top {
  top: 18px;
}

.tour-card-center {
  top: 50%;
  transform: translate(-50%, -50%);
}

.tour-card h2 {
  margin: 12px 0 8px;
}

.tour-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.tour-highlight {
  position: relative;
  z-index: 100;
  outline: 4px solid var(--accent);
  outline-offset: 4px;
  box-shadow: 0 0 0 8px rgba(255, 210, 31, 0.28);
}

.nav .tour-highlight,
.top-controls .tour-highlight,
.profile-chip.tour-highlight {
  z-index: 110;
}

.grid {
  display: grid;
  gap: 16px;
}

.dashboard-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.two-col {
  grid-template-columns: 390px 1fr;
}

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

.panel {
  padding: 18px;
  min-width: 0;
  overflow: hidden;
}

.main > section + section {
  margin-top: 16px;
}

.stat {
  min-height: 132px;
  padding: 18px;
}

.stat span {
  color: var(--muted);
  display: block;
  margin-bottom: 10px;
}

.stat strong {
  font-size: 34px;
}

.form {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: #35414a;
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.field textarea {
  min-height: 84px;
  resize: vertical;
}

.primary {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--ink);
  font-weight: 800;
  padding: 0 16px;
}

.primary:hover {
  background: var(--accent-dark);
}

.danger {
  min-height: 40px;
  border: 1px solid #f0c9c7;
  border-radius: 8px;
  background: #fff6f5;
  color: var(--danger);
  font-weight: 800;
  padding: 0 12px;
}

.danger:hover {
  border-color: var(--danger);
  color: var(--danger-dark);
}

.list {
  display: grid;
  gap: 12px;
}

.car-card,
.record {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.car-card {
  display: grid;
  gap: 10px;
}

.car-card.selected {
  border: 4px solid var(--accent);
  background: #fff4b8;
  box-shadow: 0 16px 38px rgba(11, 15, 18, 0.14);
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.section-head {
  margin-bottom: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef2f4;
  color: #35414a;
  font-size: 12px;
  font-weight: 700;
}

.pill.green {
  background: #fff5c2;
  color: #5f4900;
}

.pill.gold {
  background: #fff4d8;
  color: #7b5715;
}

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

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.check-option {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  font-size: 13px;
}

.check-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

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

.service-extra.is-hidden {
  display: none;
}

.service-extra-inline {
  grid-column: 1 / -1;
  margin-top: -4px;
  margin-bottom: 4px;
}

.service-extra h3 {
  margin: 0;
  font-size: 16px;
}

.check-option:has(input:checked) {
  border-color: var(--accent);
  background: #fff8d1;
}

.service-extra-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.photo-grid figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.photo-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.photo-grid figcaption {
  padding: 6px;
  font-size: 11px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.summary-record {
  cursor: pointer;
}

.summary-record:hover {
  border-color: var(--accent);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.detail-grid strong {
  overflow-wrap: anywhere;
}

.detail-notes {
  margin-top: 14px;
}

button:disabled {
  opacity: 0.58;
  cursor: progress;
}

.garage-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 10px;
}

.bottom-actions {
  margin-top: 16px;
  justify-content: flex-end;
}

.car-card-head {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
}

.car-photo {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  border: 1px solid var(--line);
  object-fit: cover;
  background: #fff;
}

.placeholder-car {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  background: #0b0f12;
  color: var(--accent);
  font-weight: 800;
  text-align: center;
}

.placeholder-car span {
  font-size: 28px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.placeholder-car small {
  max-width: 60px;
  font-size: 10px;
  line-height: 1.1;
  color: #fff4b8;
}

.photo-upload-trigger {
  display: block;
  cursor: pointer;
}

.photo-upload-trigger input {
  display: none;
}

.selected-car-panel {
  margin-top: 16px;
  padding: 16px;
  border: 4px solid var(--accent);
  border-radius: 8px;
  background: #fff4b8;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.dashboard-car {
  cursor: default;
}

.car-picker {
  margin-bottom: 16px;
}

.service-filters {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(180px, 260px);
  gap: 10px;
  align-items: end;
  margin: 0 0 16px;
}

.expense-list {
  display: grid;
  gap: 10px;
}

.expense-list div {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: #fff;
}

.expense-list span {
  color: var(--muted);
}

.selected-car-top {
  margin-top: 0;
  margin-bottom: 16px;
  box-shadow: 0 16px 38px rgba(11, 15, 18, 0.14);
}

.selected-car-panel h3 {
  margin: 8px 0 6px;
  font-size: 24px;
}

.shop-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  min-width: 0;
  flex-wrap: wrap;
}

.shop-tools strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.shop-launcher {
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fa 100%);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  text-align: center;
  padding: 26px;
}

.ecwid-shell {
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  overflow: hidden;
}

.custom-shop {
  display: grid;
  gap: 14px;
}

.shop-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.shop-filters input,
.shop-filters select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
  min-width: 0;
}

.shop-filters input,
.shop-filters select {
  flex: 1 1 190px;
}

.facet-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.facet-filters label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.facet-filters span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.facet-filters select {
  min-width: 0;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 10px;
}

.category-back {
  width: fit-content;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.category-landing {
  display: grid;
  gap: 14px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.category-tile {
  width: 100%;
  min-width: 0;
  min-height: 146px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: grid;
  gap: 8px;
  place-items: center;
  padding: 14px;
  text-align: center;
}

.category-tile:hover {
  border-color: var(--accent);
  box-shadow: 0 14px 30px rgba(11, 15, 18, 0.12);
}

.category-tile img {
  width: 82px;
  height: 82px;
  object-fit: contain;
}

.category-tile span {
  width: 62px;
  height: 62px;
  border-radius: 8px;
  background: #0b0f12;
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 30px;
  font-weight: 900;
}

.product-card {
  min-width: 0;
  width: 100%;
  min-height: 250px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  display: grid;
  grid-template-rows: 160px 1fr;
}

.product-card:hover {
  border-color: var(--accent);
  box-shadow: 0 14px 30px rgba(11, 15, 18, 0.12);
}

.product-card img {
  width: 100%;
  height: 160px;
  object-fit: contain;
  background: #fafafa;
  padding: 8px;
}

.product-card div {
  display: grid;
  gap: 7px;
  padding: 12px;
}

.product-card strong {
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.product-card span,
.product-price {
  color: #0b0f12;
  font-size: 18px;
  font-weight: 900;
}

.category-tile,
.product-card,
.product-detail,
.custom-shop,
.ecwid-shell {
  max-width: 100%;
}

.category-tile strong {
  max-width: 100%;
  overflow-wrap: anywhere;
}

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

.stock-in,
.stock-out {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.stock-in {
  background: #fff5c2;
  color: #5f4900;
}

.stock-out {
  background: #fff0ef;
  color: var(--danger);
}

.shop-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.product-detail {
  display: grid;
  gap: 14px;
}

.product-detail-grid {
  display: grid;
  grid-template-columns: minmax(260px, 430px) 1fr;
  gap: 18px;
}

.product-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.product-images img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.product-description {
  color: var(--muted);
  line-height: 1.5;
  max-height: 280px;
  overflow: auto;
  margin: 12px 0;
}

.shop-error {
  position: static;
  box-shadow: none;
}

.expense-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.expense-filter select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 10px;
}

.shop-launcher h2 {
  margin-bottom: 0;
  font-size: 32px;
}

.shop-launcher p {
  max-width: 560px;
  margin-bottom: 2px;
  color: var(--muted);
  line-height: 1.5;
}

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

.shop-logo {
  width: 136px;
  height: 82px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  padding: 14px;
}

.shop-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #0b0f12;
}

.login-card {
  width: min(440px, 100%);
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.login-logo {
  min-height: 76px;
  border-radius: 8px;
  background: #0b0f12;
  display: grid;
  place-items: center;
  padding: 14px;
  margin-bottom: 20px;
}

.login-logo img {
  width: min(100%, 320px);
  height: 48px;
  object-fit: contain;
}

.rtl {
  direction: rtl;
}

.rtl .nav button,
.rtl .topbar,
.rtl .row,
.rtl .shop-tools {
  text-align: right;
}

@media (max-width: 860px) {
  .shell {
    display: block;
    padding-bottom: 86px;
  }

  .sidebar {
    padding: 16px;
    gap: 14px;
  }

  .sidebar-top {
    min-height: 50px;
  }

  .brand-wordmark {
    width: 58%;
    max-width: 330px;
  }

  .brand-wordmark img {
    height: 44px;
  }

  .nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    background: #101820;
    border-radius: 8px;
    padding: 7px;
    box-shadow: var(--shadow);
  }

  .nav button {
    min-height: 54px;
    padding: 0 4px;
    justify-content: center;
    font-size: 12px;
    display: grid;
    gap: 2px;
  }

  .nav-icon {
    width: auto;
    font-size: 18px;
  }

  .top-controls {
    margin-left: auto;
  }

  .main {
    padding: 20px 10px;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .topbar,
  .shop-tools {
    display: flex;
  }

  .topbar {
    margin-bottom: 8px;
  }

  .shop-tools .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .shop-tools .actions .primary,
  .shop-tools .actions .ghost {
    width: 100%;
    justify-content: center;
  }

  h1 {
    font-size: 26px;
  }

  .dashboard-grid,
  .two-col,
  .garage-list,
  .checkbox-grid,
  .service-extra-grid,
  .photo-grid,
  .detail-grid,
  .product-detail-grid {
    grid-template-columns: 1fr;
  }

  .shop-filters input,
  .shop-filters select {
    flex-basis: 100%;
    width: 100%;
  }

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

  .facet-filters {
    grid-template-columns: 1fr;
  }

  .category-grid,
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    max-width: 100%;
  }

  .category-tile {
    min-height: 126px;
    padding: 9px 6px;
    min-width: 0;
  }

  .category-tile img {
    width: 66px;
    height: 66px;
  }

  .product-card {
    min-height: 196px;
    grid-template-rows: 110px 1fr;
    min-width: 0;
    width: 100%;
  }

  .product-card img {
    height: 110px;
    padding: 5px;
  }

  .product-card div {
    padding: 8px;
    min-width: 0;
  }

  .product-card strong {
    font-size: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .product-card span,
  .product-price {
    font-size: 15px;
  }

  .selected-car-panel {
    display: grid;
  }

  .shop-launcher {
    min-height: 460px;
  }

  .tour-card-bottom {
    bottom: 96px;
  }

  .tour-card-top {
    top: 14px;
  }
}
