:root {
  --ink: #18211f;
  --muted: #66736f;
  --line: #dce4df;
  --paper: #f5f7f3;
  --white: #ffffff;
  --red: #b43a31;
  --green: #2e7256;
  --steel: #3d5660;
  --amber: #b9852c;
  --dark: #101917;
  --shadow: 0 18px 50px rgba(24, 33, 31, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Inter", Arial, sans-serif;
}

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

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

.hidden {
  display: none !important;
}

.public-screen {
  min-height: 100vh;
  background: var(--paper);
}

.public-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px clamp(18px, 5vw, 70px);
  color: var(--white);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
}

.public-nav {
  display: flex;
  gap: clamp(14px, 3vw, 34px);
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  font-weight: 800;
}

.public-hero {
  min-height: 92vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 440px);
  gap: 34px;
  align-items: center;
  padding: 120px clamp(20px, 6vw, 80px) 54px;
  color: var(--white);
  background:
    linear-gradient(90deg, rgba(12, 20, 18, 0.92) 0%, rgba(12, 20, 18, 0.68) 42%, rgba(12, 20, 18, 0.28) 100%),
    url("assets/hero-europe-parts.png") center / cover;
}

.hero-copy {
  max-width: 820px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.public-hero .eyebrow {
  color: #d9eee3;
}

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

.public-hero h1 {
  max-width: 800px;
  margin-bottom: 20px;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 0.98;
  letter-spacing: 0;
}

.public-hero p {
  max-width: 720px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
  line-height: 1.62;
}

.hero-tags,
.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-tags span,
.tag-grid span,
.tag-grid a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 800;
}

.auth-card,
.panel,
.metric-card,
.service-card,
.split-info article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 1px 0 rgba(24, 33, 31, 0.04);
}

.auth-card {
  display: grid;
  gap: 18px;
  padding: clamp(22px, 4vw, 34px);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.auth-card p {
  color: var(--muted);
}

.auth-form,
.auth-intro {
  display: grid;
  gap: 16px;
}

.auth-actions,
.login-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
}

.primary {
  color: var(--white);
  background: var(--red);
}

.secondary {
  color: var(--ink);
  border-color: var(--line);
  background: var(--white);
}

.danger-button {
  color: var(--red);
  border-color: #edc7c2;
  background: #fff6f5;
}

label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--ink);
  background: #fbfcfa;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(46, 114, 86, 0.2);
  border-color: var(--green);
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.public-section {
  padding: 76px clamp(20px, 6vw, 80px);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

.section-heading h2,
.split-info h2 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.06;
}

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

.service-card {
  min-height: 230px;
  padding: 24px;
}

.service-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 38px;
  margin-bottom: 28px;
  border-radius: 8px;
  color: var(--white);
  background: var(--steel);
  font-weight: 800;
}

.service-card:nth-child(2) .service-icon {
  background: var(--green);
}

.service-card:nth-child(3) .service-icon {
  background: var(--red);
}

.service-card p,
.legal-note {
  color: var(--muted);
  line-height: 1.55;
}

.split-info {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  background: #eef2ed;
}

.split-info article {
  padding: 24px;
}

.tag-grid span,
.tag-grid a {
  color: var(--ink);
  border-color: var(--line);
  background: #fbfcfa;
}

.tag-grid a:hover {
  color: var(--green);
  border-color: var(--green);
}

.legal-note {
  margin: 18px 0 0;
  font-size: 14px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
  color: var(--white);
  background: #101917;
}

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

.nav-item {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 14px;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
}

.admin-only {
  display: none;
}

.is-admin .admin-only {
  display: block;
}

.is-admin .client-only {
  display: none;
}

.sidebar-note {
  margin-top: 0;
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-search {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.sidebar-search label {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
}

.sidebar-search input {
  min-height: 38px;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

.search-results {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}

.search-result {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 9px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.06);
  text-align: left;
  cursor: pointer;
}

.search-result span,
.search-result small {
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
}

.sidebar-note span {
  color: rgba(255, 255, 255, 0.66);
  font-size: 13px;
  line-height: 1.45;
}

.workspace {
  min-width: 0;
  padding: 18px;
}

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

.topbar h1 {
  margin-bottom: 0;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px 9px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

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

.text-button {
  border: 0;
  padding: 0;
  color: var(--green);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.metric-card {
  min-height: 84px;
  display: grid;
  align-content: space-between;
  gap: 6px;
  padding: 12px;
}

.metric-card span,
.metric-card small {
  color: var(--muted);
}

.metric-card strong {
  font-size: 20px;
  line-height: 1.12;
}

.metric-card small,
.metric-card span {
  font-size: 12px;
}

.account-strip {
  position: sticky;
  top: 0;
  z-index: 4;
  padding-bottom: 4px;
  background: var(--paper);
}

.content-grid,
.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
}

.dashboard-flow {
  display: grid;
  gap: 12px;
}

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

.full-row {
  grid-column: 1 / -1;
}

.panel {
  padding: 14px;
}

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

.panel-head h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--green);
  background: #e6f0ea;
  font-size: 12px;
  font-weight: 800;
}

.pill.danger {
  color: var(--red);
  background: #f7e7e5;
}

.timeline,
.quote-list,
.admin-list,
.quote-form,
.admin-form {
  display: grid;
  gap: 9px;
}

#ordersView {
  display: none;
}

#ordersView.active {
  display: grid;
  gap: 18px;
}

.compact-form {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.form-row,
.inline-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.inline-form {
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 0.7fr) minmax(140px, 0.7fr) minmax(220px, 1fr) auto;
  align-items: end;
}

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

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

.check-grid input {
  width: auto;
}

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

.timeline-item,
.quote-item,
.admin-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #fbfcfa;
}

.timeline-item strong,
.quote-item strong,
.admin-item strong {
  display: block;
  margin-bottom: 5px;
}

.timeline-item span,
.quote-item span,
.admin-item span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.admin-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.request-panel {
  margin-top: 18px;
}

.work-item summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.work-item summary::-webkit-details-marker {
  display: none;
}

.work-item summary::after {
  content: "Открыть";
  justify-self: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--green);
  background: var(--white);
  font-size: 12px;
  font-weight: 800;
}

.work-item[open] summary::after {
  content: "Скрыть";
}

.work-item-body {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tab-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted);
  background: #fbfcfa;
  font-weight: 800;
  cursor: pointer;
}

.tab-button.active {
  color: var(--white);
  border-color: var(--green);
  background: var(--green);
}

.user-tab {
  display: none;
}

.user-tab.active {
  display: grid;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 14px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.status.quote {
  color: var(--amber);
  background: #f8efd9;
}

.status.buy {
  color: var(--steel);
  background: #e6eef1;
}

.status.transit {
  color: var(--green);
  background: #e6f0ea;
}

.status.done {
  color: var(--red);
  background: #f7e7e5;
}

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

.quote-price {
  text-align: right;
  font-weight: 800;
}

@media (max-width: 1100px) {
  .public-hero,
  .app-shell,
  .content-grid,
  .admin-grid,
  .split-info {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .side-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metric-grid,
  .service-grid,
  .request-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .public-header {
    position: static;
    color: var(--ink);
    background: var(--white);
  }

  .public-brand .brand-mark {
    color: var(--white);
    background: var(--dark);
  }

  .public-nav {
    display: none;
  }

  .public-hero {
    min-height: auto;
    padding: 44px 16px;
  }

  .public-hero h1 {
    font-size: 38px;
  }

  .public-section,
  .sidebar,
  .workspace {
    padding: 16px;
  }

  .side-nav,
  .metric-grid,
  .service-grid,
  .quote-item,
  .form-row,
  .inline-form,
  .check-grid,
  .request-grid {
    grid-template-columns: 1fr;
  }

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