:root {
  color-scheme: light;
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-soft: #f9f8f5;
  --ink: #17191d;
  --muted: #69707a;
  --line: #e5e2dc;
  --orange: #ff8a18;
  --orange-dark: #de6f05;
  --charcoal: #2f3137;
  --green: #11835b;
  --shadow: 0 24px 70px rgba(27, 28, 31, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

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

.login-card {
  width: min(460px, 100%);
  display: grid;
  gap: 24px;
  padding: 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.login-logo {
  width: 220px;
  height: auto;
}

.login-card h1 {
  margin: 6px 0 0;
  font-size: 34px;
  line-height: 1.05;
}

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

.login-form input {
  width: 100%;
  min-height: 56px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 18px;
  outline: none;
}

.login-form input:focus {
  border-color: var(--orange);
}

.login-message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
}

.page {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.topbar {
  min-height: 84px;
  display: grid;
  grid-template-columns: 230px auto;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0 0 24px 24px;
  box-shadow: 0 16px 40px rgba(32, 33, 36, 0.04);
}

.brand-logo {
  width: 210px;
  height: auto;
  display: block;
}

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

.topbar-actions a,
.cart-pill,
.primary-button,
.order-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 18px;
  text-decoration: none;
  border: 1px solid var(--line);
  font-weight: 600;
}

.cart-pill {
  cursor: pointer;
}

.topbar-actions a {
  background: var(--charcoal);
  color: #fff;
  border-color: var(--charcoal);
}

.cart-pill {
  min-width: 124px;
  gap: 9px;
  background: #f7f3ed;
  color: var(--ink);
  border-color: #ede1d3;
}

.cart-pill strong {
  min-width: 24px;
  height: 24px;
  margin-left: 8px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font-size: 13px;
}

.cart-icon {
  width: 20px;
  height: 18px;
  display: inline-block;
  border: 0;
  border-bottom: 2px solid currentColor;
  position: relative;
}

.cart-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 2px;
  width: 13px;
  height: 8px;
  border: 2px solid currentColor;
  border-top: 0;
  transform: skewX(-10deg);
}

.cart-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  bottom: -6px;
  width: 16px;
  height: 4px;
  background:
    radial-gradient(circle, currentColor 0 2px, transparent 2.2px) left center / 8px 4px no-repeat,
    radial-gradient(circle, currentColor 0 2px, transparent 2.2px) right center / 8px 4px no-repeat;
}

.search-hero {
  margin-top: 28px;
  padding: 48px 44px 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 30px;
  text-align: center;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--orange-dark);
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  margin: 0 auto;
  font-size: clamp(30px, 3.7vw, 50px);
  line-height: 1.08;
  font-weight: 760;
  letter-spacing: 0;
}

.lead {
  max-width: 700px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.search-panel {
  width: min(1040px, 100%);
  margin: 26px auto 0;
  padding: 8px;
  background: #ebe8e1;
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.mode-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 8px;
  background: #e4e1db;
  border-radius: 999px;
}

.tab {
  min-height: 38px;
  min-width: 190px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
}

.tab.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(22, 24, 29, 0.08);
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 8px;
}

.car-form {
  display: grid;
  gap: 8px;
}

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

.car-bottom-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.25fr) minmax(260px, 1fr) 132px;
  gap: 8px;
  align-items: center;
}

.car-bottom-row .primary-button {
  width: 100%;
}

.side-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 6px;
  background: #dedbd4;
  border-radius: 16px;
}

.side-switch label {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 12px;
  background: transparent;
  color: #59606a;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.side-switch label:has(input:checked) {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(22, 24, 29, 0.07);
}

.side-switch input {
  width: auto;
  min-height: auto;
  margin: 0;
  accent-color: var(--orange);
}

input {
  width: 100%;
  min-height: 58px;
  border: 1px solid transparent;
  border-radius: 17px;
  padding: 0 18px;
  background: #fff;
  color: var(--ink);
  outline: none;
  font-size: 16px;
}

input:focus {
  border-color: rgba(255, 134, 23, 0.85);
  box-shadow: 0 0 0 4px rgba(255, 134, 23, 0.14);
}

.primary-button {
  min-height: 58px;
  border: 0;
  background: var(--orange);
  color: #fff;
  cursor: pointer;
  border-radius: 17px;
  box-shadow: 0 10px 22px rgba(255, 134, 23, 0.2);
  font-weight: 650;
}

.primary-button:hover,
.order-button:hover {
  background: var(--orange-dark);
}

.primary-button:active,
.order-button:active {
  transform: translateY(1px);
}

.hidden {
  display: none !important;
}

.geo-line {
  max-width: 900px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 14px;
}

.results-section {
  margin-top: 24px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
}

.cart-panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 24px;
  background: rgba(23, 25, 29, 0.34);
}

.cart-card {
  width: min(920px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 30px 90px rgba(23, 25, 29, 0.22);
}

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

.cart-head h2 {
  font-size: 30px;
}

.cart-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.ghost-button,
.remove-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}

.cart-empty {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}

.cart-items {
  display: grid;
  gap: 8px;
}

.cart-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.cart-item strong {
  display: block;
  line-height: 1.3;
}

.cart-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.cart-item-price {
  font-weight: 760;
  white-space: nowrap;
}

.checkout-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  color: var(--muted);
}

.cart-total strong {
  color: var(--ink);
  font-size: 26px;
}

.checkout-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 8px;
}

.checkout-fields input {
  min-height: 54px;
  border-color: #d8d3ca;
  background: #f9f8f5;
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.checkout-fields input::placeholder {
  color: #8a8d93;
}

.checkout-message {
  min-height: 22px;
  color: var(--green);
  font-weight: 650;
}

.manager-page .topbar {
  margin-bottom: 24px;
}

.manager-layout {
  display: grid;
  grid-template-columns: 430px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.orders-list-wrap,
.order-detail {
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 16px 46px rgba(27, 28, 31, 0.06);
}

.manager-title h1 {
  margin: 0;
  font-size: 34px;
}

.manager-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 18px 0;
}

.manager-stats div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.manager-stats span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.manager-stats strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
}

.manager-tools {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.manager-tools input {
  min-height: 48px;
  border-color: var(--line);
}

.status-filter,
.type-filter,
.quick-statuses {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.status-filter button,
.type-filter button,
.quick-statuses button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: #fff;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
}

.status-filter button.active,
.type-filter button.active,
.quick-statuses button.active {
  border-color: rgba(255, 138, 24, 0.45);
  background: #fff4e8;
  color: #ba5a00;
}

.orders-list {
  display: grid;
  gap: 8px;
}

.order-card {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.order-card.active {
  border-color: rgba(255, 138, 24, 0.72);
  box-shadow: 0 0 0 4px rgba(255, 138, 24, 0.12);
}

.order-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.order-card em {
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff4e8;
  color: #ba5a00;
  font-style: normal;
  font-size: 12px;
}

.order-card small,
.order-card span:not(.order-card-top) {
  color: var(--muted);
}

.order-type {
  width: fit-content;
  padding: 4px 9px;
  border-radius: 999px;
  background: #f2f0eb;
  color: var(--ink) !important;
  font-size: 12px;
  font-weight: 700;
}

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

.detail-head h2 {
  font-size: 36px;
}

.detail-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.detail-head select {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  background: #fff;
  font: inherit;
}

.client-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.client-grid div,
.client-comment {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.call-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-top: 10px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--charcoal);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
}

.client-grid span,
.client-comment span,
.manager-comment span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 13px;
}

.detail-items {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.selection-request {
  display: grid;
  gap: 6px;
  margin: 0 0 18px;
  padding: 18px;
  border: 1px solid rgba(255, 138, 24, 0.3);
  border-radius: 18px;
  background: #fff7ed;
}

.selection-request span {
  color: var(--orange-dark);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.selection-request strong {
  font-size: 22px;
}

.selection-request p {
  margin: 0;
  color: var(--muted);
}

.selection-result {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.selection-result-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.selection-result span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
}

.selection-result h3 {
  margin: 0;
}

.selection-result-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 8px;
}

.selection-result input,
.selection-result textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--surface-soft);
  font: inherit;
  outline: none;
}

.selection-result textarea {
  min-height: 92px;
  resize: vertical;
}

.quick-statuses {
  margin: -6px 0 18px;
}

.detail-items article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.detail-items span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.detail-items em {
  font-style: normal;
  font-weight: 760;
  white-space: nowrap;
}

.manager-comment {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.manager-comment textarea {
  min-height: 110px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  font: inherit;
  outline: none;
}

.comment-history {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

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

.comment-history article,
.comment-history > p {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.comment-history article strong {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.comment-history article p {
  margin: 0;
}

.client-comment {
  margin-bottom: 12px;
}

.client-comment p {
  margin: 0;
}

.save-message {
  min-height: 22px;
  margin-top: 10px;
  color: var(--green);
  font-weight: 700;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

h2 {
  margin: 0;
  font-size: 30px;
}

.section-title p {
  margin: 6px 0 0;
  color: var(--muted);
}

.results {
  display: grid;
  gap: 10px;
}

.empty-state,
.loading,
.error {
  min-height: 132px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
}

.empty-state strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 22px;
}

.error {
  color: #aa3333;
}

.result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px 150px 144px;
  gap: 16px;
  align-items: center;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.title {
  font-weight: 700;
  line-height: 1.32;
}

.meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.price {
  font-size: 22px;
  font-weight: 760;
  white-space: nowrap;
}

.small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.stock {
  color: var(--green);
  font-weight: 700;
}

.order-button {
  min-height: 42px;
  border: 0;
  background: #2f3137;
  color: #fff;
  border: 1px solid #2f3137;
  cursor: pointer;
  box-shadow: none;
  font-size: 14px;
  font-weight: 600;
}

.order-button:hover {
  color: #fff;
}

.order-button:disabled {
  background: #eef7f2;
  color: var(--green);
  border-color: rgba(17, 131, 91, 0.18);
  cursor: default;
}

.manual-form {
  width: min(620px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  margin-top: 18px;
}

.manual-form input {
  min-height: 52px;
}

.manual-success {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(17, 131, 91, 0.1);
  color: var(--green);
  font-weight: 800;
}

@media (max-width: 1040px) {
  .manager-layout {
    grid-template-columns: 1fr;
  }

  .car-fields {
    grid-template-columns: 1fr 1fr;
  }

  .result-row,
  .manual-form,
  .selection-result-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .search-hero {
    padding: 52px 22px 28px;
  }

  .car-fields,
  .search-form,
  .car-form,
  .car-bottom-row,
  .cart-item,
  .checkout-fields,
  .client-grid,
  .detail-items article {
    grid-template-columns: 1fr;
  }

  .cart-head {
    display: grid;
  }
}

@media (max-width: 620px) {
  .page {
    width: min(100% - 24px, 520px);
    padding-top: 12px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .mode-switch {
    width: 100%;
  }

  .tab {
    min-width: 0;
  }
}
