:root {
  --bg: #0d0f12;
  --panel: #15181d;
  --panel-soft: #111419;
  --ink: #f5f1e9;
  --muted: #a59f96;
  --line: #2b3037;
  --sidebar: #0a0c0f;
  --green: #55c878;
  --green-dark: #76dd91;
  --gold: #f0c35b;
  --red: #e45a50;
  --blue: #57b7ed;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); max-width: 100%; overflow-x: hidden; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--bg);
  background-image: linear-gradient(180deg, #101318 0%, #0d0f12 46%, #0b0d10 100%);
  overflow-x: hidden;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(340px, .9fr) minmax(420px, 1.1fr);
}
.auth-visual {
  color: #fff;
  background:
    linear-gradient(145deg, rgba(9,11,14,.98), rgba(21,25,28,.94)),
    #0b0d10;
  padding: 42px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.brand, .user-mini, .row-flex, .button-row, .topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--green);
  color: #07110d;
  display: grid;
  place-items: center;
  font-weight: 950;
}
.brand-logo {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  object-fit: cover;
  object-position: center 42%;
  border: 1px solid rgba(124, 255, 80, .28);
  box-shadow: 0 0 0 1px rgba(0,0,0,.55), 0 10px 24px rgba(68, 255, 63, .12);
  flex: 0 0 auto;
}
.brand strong { display: block; font-size: 18px; }
.brand span { color: rgba(255,255,255,.66); font-size: 13px; }
.auth-logo-showcase {
  margin: auto 0;
  width: min(520px, 88%);
  align-self: center;
  border: 1px solid rgba(124, 255, 80, .18);
  border-radius: 8px;
  overflow: hidden;
  background: #050806;
  box-shadow: 0 32px 90px rgba(0,0,0,.55), 0 0 64px rgba(77, 255, 70, .12);
}
.auth-logo-showcase img {
  display: block;
  width: 100%;
  height: min(64vh, 680px);
  object-fit: cover;
  object-position: center;
}
.auth-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.auth-stats div, .panel, .metric, .card-button, .pack, .info-card, .table-wrap, .dropzone {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(0,0,0,.28);
}
.auth-stats div { border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.06); padding: 16px; }
.auth-stats span { color: rgba(255,255,255,.62); font-size: 13px; }
.auth-stats strong { display: block; margin-top: 5px; font-size: 18px; }
.auth-panel { display: grid; place-items: center; padding: 32px; background: var(--bg); }
.auth-card { width: min(440px, 100%); padding: 34px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.auth-card h1 { margin: 0 0 8px; font-size: 28px; }
.auth-card p { margin: 0 0 22px; color: var(--muted); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 292px minmax(0,1fr); background: var(--bg); }
.sidebar {
  background: var(--sidebar);
  color: #f8f4ed;
  padding: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
  border-right: 1px solid #252a31;
}
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--gold);
  color: #1b1307;
  font-weight: 900;
  font-size: 13px;
}
.user-mini {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  border-radius: 8px;
  padding: 12px;
}
.user-mini span { display: block; color: rgba(255,255,255,.56); font-size: 12px; }
.user-mini strong { color: #fff; font-size: 14px; }
.nav-group { display: grid; gap: 6px; margin-bottom: 16px; }
.nav-label { color: rgba(255,255,255,.42); text-transform: uppercase; font-size: 11px; font-weight: 900; }
.nav-link {
  width: 100%;
  border: 0;
  border-radius: 7px;
  padding: 10px 11px;
  color: rgba(255,255,255,.76);
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
}
.nav-link:hover, .nav-link.active { background: rgba(85,200,120,.18); color: #fff; }
.hours { margin-top: auto; padding: 14px; border-radius: 8px; background: rgba(255,255,255,.06); display: grid; gap: 8px; }
.hours strong { text-transform: uppercase; font-size: 12px; }
.hours span { display: flex; justify-content: space-between; color: rgba(255,255,255,.66); font-size: 12px; }

.topbar {
  min-height: 84px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 22px 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(13,15,18,.94);
  position: sticky;
  top: 0;
  z-index: 3;
  backdrop-filter: blur(12px);
}
.eyebrow { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; font-weight: 900; }
.topbar h1 { margin: 2px 0 0; font-size: 26px; }
.auth-tools {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}
.language-switcher label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.language-switcher select {
  width: auto;
  min-width: 126px;
  min-height: 34px;
  padding: 6px 28px 6px 10px;
  border-radius: 999px;
  background: #101319;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}
.language-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 22px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: #172433;
  color: #8bd0ff;
  border: 1px solid #28465f;
  font-weight: 900;
}
.app-shell > div { min-width: 0; background: var(--bg); }
.content { max-width: 1480px; margin: 0 auto; padding: 34px; background: var(--bg); }
.stack { display: grid; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.metric, .panel, .pack, .info-card { padding: 18px; }
.metric span { color: var(--muted); font-size: 13px; font-weight: 800; }
.metric strong { display: block; margin-top: 8px; font-size: 26px; color: var(--ink); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 18px; }
h2, h3 { margin: 0; }
p { color: var(--muted); }
.card-button {
  min-height: 118px;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
}
.card-button:hover { border-color: var(--green); background: #182119; }
.card-button span, .card-button small { display: block; }
.card-button small { color: var(--muted); margin-top: 4px; }

.pill, .badge, .status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.pill { background: #202832; color: #7fd6ff; border: 1px solid #2b5265; margin: 3px; }
.credit-widget {
  display: inline-grid;
  grid-template-columns: minmax(150px, auto) auto;
  align-items: stretch;
  gap: 8px;
}
.credit-badge {
  min-height: 46px;
  display: grid;
  align-content: center;
  gap: 2px;
  border: 1px solid #285a39;
  border-radius: 8px;
  background: linear-gradient(180deg, #173d28, #102319);
  color: var(--ink);
  padding: 7px 13px;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(127,225,156,.08), 0 10px 26px rgba(0,0,0,.22);
}
.credit-badge span {
  color: #9cbea7;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.credit-badge strong {
  color: #7fe19c;
  font-size: 15px;
  line-height: 1.1;
  white-space: nowrap;
}
.credit-widget.low .credit-badge {
  border-color: #644a15;
  background: linear-gradient(180deg, #493916, #21170a);
}
.credit-widget.low .credit-badge span,
.credit-widget.low .credit-badge strong { color: #ffd861; }
.credit-widget.critical .credit-badge {
  border-color: #73322b;
  background: linear-gradient(180deg, #52221f, #23100f);
}
.credit-widget.critical .credit-badge span,
.credit-widget.critical .credit-badge strong { color: #ff9a91; }
.credit-buy {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #2b5265;
  border-radius: 8px;
  background: #101722;
  color: #7fd6ff;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 950;
  text-decoration: none;
  white-space: nowrap;
}
.credit-buy:hover { border-color: var(--green); color: var(--green); }
.badge { background: #493916; color: #ffd861; }
.status.pending { background: #4c3915; color: #ffcf69; }
.status.processing { background: #20334b; color: #85c7ff; }
.status.completed { background: #173d28; color: #7fe19c; }
.status.archived { background: #282c33; color: #beb7ac; }
.status.deleted { background: #52221f; color: #ff8b83; }
.plate-code { color: var(--gold); }
.ticket-link {
  display: grid;
  gap: 2px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.ticket-link strong,
.ticket-link small {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.ticket-link .vehicle-line {
  color: var(--green-dark);
  font-weight: 900;
  line-height: 1.2;
}
.ticket-link:hover strong { color: var(--green); }

form { margin: 0; }
label { display: grid; gap: 7px; color: #ddd7cc; font-size: 14px; font-weight: 800; }
input, select, textarea {
  width: 100%;
  border: 1px solid #343941;
  border-radius: 7px;
  background: #0f1216;
  color: var(--ink);
  padding: 11px 12px;
  min-height: 44px;
  outline: none;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(85,200,120,.18); }
input[disabled] { background: #20242b; color: #7b756c; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.wide { grid-column: 1 / -1; }
.btn {
  min-height: 40px;
  border-radius: 7px;
  border: 1px solid transparent;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 900;
  cursor: pointer;
  background: var(--green);
  color: #07110d;
}
.btn.secondary { background: #111419; color: var(--ink); border-color: var(--line); }
.btn.danger { background: var(--red); color: #fff; }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 12px; }
.btn.full { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.button-row { flex-wrap: wrap; }
.notice, .error { padding: 12px 14px; border-radius: 8px; font-weight: 700; }
.notice { background: #10251a; border: 1px solid #235a38; color: #8ee5a8; }
.error { background: #331918; border: 1px solid #6d302b; color: #ff9a91; }

.dropzone {
  min-height: 150px;
  display: grid;
  place-items: center;
  text-align: center;
  border-style: dashed;
  padding: 28px;
  position: relative;
}
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone strong, .dropzone span { display: block; }
.dropzone span { color: var(--muted); font-size: 13px; margin-top: 5px; }
.service-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chip input { display: none; }
.check-chip span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 11px;
  background: #111419;
  font-size: 12px;
  font-weight: 900;
}
.check-chip span em {
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
}
.check-chip input:checked + span { border-color: var(--green); background: #173d28; color: #7fe19c; }
.check-chip input:disabled + span { opacity: .35; cursor: not-allowed; }

.upload-wizard { scroll-margin-top: 110px; }
.estimate-box {
  min-width: 210px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101319;
}
.estimate-box span, .estimate-box small,
.review-grid span, .request-details span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.estimate-box strong { display: block; margin: 3px 0; font-size: 22px; color: var(--green); }
.credit-cost-board {
  min-width: min(520px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 8px;
  align-items: stretch;
}
.credit-cost-board > div,
.credit-cost-board > small {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101319;
  padding: 10px 12px;
}
.credit-cost-board > div span,
.credit-cost-board > small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.credit-cost-board > div strong {
  display: block;
  margin-top: 4px;
  color: var(--green);
  font-size: 17px;
  line-height: 1.15;
}
.credit-cost-board > small {
  grid-column: 1 / -1;
  min-height: 0;
  padding: 9px 12px;
  text-transform: none;
}
.credit-cost-board.is-low > div:nth-child(3) strong,
.credit-cost-board.is-low > small { color: #ffd861; }
.credit-cost-board.is-missing > div:nth-child(3) strong,
.credit-cost-board.is-missing > small { color: #ff9a91; }
.wizard-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.wizard-steps button {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101319;
  color: var(--muted);
  font-weight: 900;
  text-align: left;
  padding: 10px;
  cursor: pointer;
}
.wizard-steps button span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-right: 8px;
  border-radius: 50%;
  background: #202832;
  color: var(--ink);
}
.wizard-steps button.active,
.wizard-steps button.done {
  border-color: #23623d;
  background: #132117;
  color: #f8f4ed;
}
.wizard-steps button.active span,
.wizard-steps button.done span { background: var(--green); color: #07110d; }
.wizard-panel { display: none; }
.wizard-panel.active { display: block; }
.wizard-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 0 0;
  background: linear-gradient(180deg, rgba(13,15,18,0), var(--bg) 35%);
}
.vehicle-type-grid, .remap-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.vehicle-tile, .remap-card {
  display: block;
  cursor: pointer;
}
.vehicle-tile input, .remap-card input { position: absolute; opacity: 0; pointer-events: none; }
.vehicle-tile span, .remap-card span {
  min-height: 118px;
  display: grid;
  align-content: start;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101319;
  padding: 14px;
}
.vehicle-tile strong, .remap-card strong { color: var(--ink); }
.vehicle-tile small, .remap-card small,
.vehicle-tile em, .remap-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}
.vehicle-tile input:checked + span,
.remap-card input:checked + span {
  border-color: var(--green);
  background: #142119;
  box-shadow: 0 0 0 3px rgba(85,200,120,.12);
}
.vehicle-tile.disabled {
  opacity: .45;
  cursor: not-allowed;
}
.vehicle-repository-panel {
  display: grid;
  grid-template-columns: minmax(280px, 1.15fr) minmax(280px, .85fr);
  gap: 14px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1116;
  padding: 14px;
}
.vehicle-repository-panel label {
  margin: 0;
}
.vehicle-repository-panel > label.wide,
.repo-cascade {
  grid-column: 1 / -1;
}
.repo-cascade {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.repo-preview {
  min-height: 78px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
}
.repo-preview strong,
.repo-preview span,
.repo-preview small {
  display: block;
}
.repo-preview strong { color: var(--green); }
.repo-preview span,
.repo-preview small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.section-head.compact { margin-bottom: 6px; }
.section-head.compact h3 { margin: 0; font-size: 18px; }
.section-head.compact p { margin: 4px 0 0; }
.section-head.compact strong { color: var(--green); }
.service-policy-options {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.service-rate-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.service-rate-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
}
.service-rate-grid strong,
.service-rate-grid span {
  display: block;
}
.service-rate-grid span {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  margin-top: 5px;
}
.report-filter-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) repeat(2, minmax(150px, .8fr)) auto auto;
  gap: 12px;
  align-items: end;
}
.compact-table table small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}
.dtc-form .notice { margin: 0; }
.review-grid, .request-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.review-grid > div, .request-details > div {
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 13px;
}
.review-grid strong, .request-details strong {
  display: block;
  margin-top: 5px;
  word-break: break-word;
}
.request-details .wide { grid-column: 1 / -1; }

.table-wrap { width: 100%; max-width: 100%; overflow: auto; padding: 0; background: var(--panel); }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--line); padding: 13px 12px; text-align: left; vertical-align: top; }
th { background: #111419; color: var(--muted); font-size: 12px; text-transform: uppercase; }
td small { display: block; color: var(--muted); margin-top: 3px; }
tr:hover { background: #12171d; }
.client-files-table table { min-width: 1520px; table-layout: fixed; }
.client-files-table th:nth-child(1), .client-files-table td:nth-child(1) { width: 13%; }
.client-files-table th:nth-child(2), .client-files-table td:nth-child(2) { width: 18%; }
.client-files-table th:nth-child(3), .client-files-table td:nth-child(3) { width: 13%; }
.client-files-table th:nth-child(4), .client-files-table td:nth-child(4) { width: 8%; }
.client-files-table th:nth-child(5), .client-files-table td:nth-child(5) { width: 9%; }
.client-files-table th:nth-child(6), .client-files-table td:nth-child(6) { width: 16%; }
.client-files-table th:nth-child(7), .client-files-table td:nth-child(7) { width: 15%; }
.client-files-table th:nth-child(8), .client-files-table td:nth-child(8) { width: 8%; }
.client-files-table td:nth-child(3),
.admin-files-table td:nth-child(3) {
  min-width: 0;
}
.client-files-table td:nth-child(3) .pill,
.admin-files-table td:nth-child(3) .pill {
  max-width: 100%;
  min-height: 26px;
  margin: 3px 2px;
  padding: 4px 9px;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  text-align: left;
  vertical-align: top;
}
.service-tags {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 5px;
}
.service-tags .pill {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.2;
}
.client-files-table td:nth-child(5) .chat-link {
  min-width: 108px;
  max-width: 100%;
  justify-content: flex-start;
}
.client-files-table td:nth-child(6) {
  min-width: 0;
  overflow: hidden;
}
.client-files-table td:nth-child(6) .response-stack,
.client-files-table td:nth-child(6) .response-item {
  max-width: 100%;
}
.client-files-table td:nth-child(7) {
  min-width: 0;
  overflow: hidden;
}
.client-files-table td:nth-child(8) {
  white-space: nowrap;
}
.inline-credit-adjust {
  margin-top: 9px;
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e1419;
}
.inline-credit-state {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.inline-credit-state span,
.inline-credit-state small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.inline-credit-state strong {
  color: var(--green);
  font-size: 13px;
}
.inline-credit-form {
  display: grid;
  grid-template-columns: minmax(56px, 78px) auto;
  gap: 6px;
  align-items: center;
}
.inline-credit-form input {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
}
.inline-credit-empty {
  color: #ff9a91;
}
.file-name-link {
  display: block;
  max-width: 100%;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.admin-files-table table {
  min-width: 1000px;
  table-layout: fixed;
}
.admin-files-table th:nth-child(1), .admin-files-table td:nth-child(1) { width: 19%; }
.admin-files-table th:nth-child(2), .admin-files-table td:nth-child(2) { width: 27%; }
.admin-files-table th:nth-child(3), .admin-files-table td:nth-child(3) { width: 22%; }
.admin-files-table th:nth-child(4), .admin-files-table td:nth-child(4) { width: 24%; }
.admin-files-table th:nth-child(5), .admin-files-table td:nth-child(5) { width: 8%; }
.admin-files-table td {
  padding-top: 16px;
  padding-bottom: 16px;
}
.admin-ticket-link {
  display: grid;
  gap: 5px;
  text-decoration: none;
}
.admin-ticket-link .plate-code {
  color: #ffcf69;
  font-size: 15px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.admin-ticket-link .vehicle-line {
  color: #65f28f;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.admin-ticket-link small:not(.vehicle-line) {
  color: #c5beb3;
  overflow-wrap: anywhere;
}
.admin-client-service-cell,
.admin-workflow-cell,
.admin-files-cell {
  min-width: 0;
}
.admin-client-card {
  display: grid;
  gap: 3px;
  margin-bottom: 10px;
}
.admin-client-card > strong {
  font-size: 14px;
}
.admin-client-card .language-badge {
  margin-top: 4px;
}
.admin-workflow-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
.admin-workflow-cell .status-select {
  width: 100%;
  min-width: 0;
  max-width: none;
}
.admin-workflow-stack .chat-link {
  justify-self: start;
}
.admin-workflow-stack .client-upload-toggle-form label {
  width: 100%;
  justify-content: center;
}
.admin-action-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 2px;
}
.admin-action-toolbar form {
  margin: 0;
}
.admin-action-toolbar .icon-btn,
.admin-files-cell .icon-btn {
  flex: 0 0 auto;
}
.admin-file-groups {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
.file-stack-title {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}
.admin-files-cell .original-stack {
  margin: 0;
  padding: 0;
  border-bottom: 0;
}
.admin-files-cell .response-stack {
  gap: 5px;
}
.admin-files-cell .response-item {
  min-height: 34px;
  padding: 5px 7px;
  background: #0f1319;
}
.admin-files-cell .response-name {
  max-width: 100%;
}
.admin-files-cell .response-meta {
  display: none;
}
.download-state {
  width: fit-content;
  margin-top: 8px;
  border: 1px solid rgba(255, 207, 105, .28);
  border-radius: 999px;
  background: rgba(255, 207, 105, .08);
  color: #ffcf69;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 900;
}
.actions { display: flex; flex-wrap: wrap; gap: 7px; }
.icon-actions { align-items: center; flex-wrap: nowrap; }
.client-actions { min-width: 0; }
.client-action-grid {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: start;
  gap: 7px;
  min-width: 0;
  width: 100%;
}
.compact-reupload {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 6px;
}
.reupload-locked {
  min-width: 0;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101319;
  color: var(--muted);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-picker {
  min-width: 0;
  display: block;
}
.file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.file-picker span {
  min-height: 34px;
  max-width: 100%;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101319;
  color: var(--ink);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-picker:hover span { border-color: var(--green); color: var(--green); }
.client-upload-toggle-form {
  flex-basis: 100%;
  margin-top: 3px;
}
.client-upload-toggle-form label {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e1419;
  color: var(--muted);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.client-upload-toggle-form input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}
.client-upload-toggle-form input:checked + span { color: var(--green); }
.response-stack {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.original-stack {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.response-item {
  min-width: 0;
  min-height: 36px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101319;
  padding: 5px 8px;
  text-decoration: none;
}
.response-item:hover { border-color: var(--green); }
.response-item .badge { min-height: 22px; padding: 0 7px; }
.response-item .tree-badge { min-width: 34px; min-height: 24px; padding: 0 8px; }
.response-item .tree-badge.original { min-width: 58px; color: #ffcf69; border-color: #584319; background: #1d170b; }
.response-item > .tree-badge:first-child + .response-copy {
  grid-column: 2 / 4;
}
.response-item > .badge + .tree-badge + .response-copy {
  grid-column: auto;
}
.response-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}
.response-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.response-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}
.admin-note-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 230px;
  margin-top: 6px;
  border: 1px solid rgba(255, 207, 105, .28);
  border-radius: 999px;
  background: rgba(255, 207, 105, .08);
  color: var(--gold);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-note-chip .icon {
  width: 14px;
  height: 14px;
}
.searchbar { display: flex; gap: 10px; align-items: center; }
.searchbar input { max-width: 430px; }
.modal {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(0,0,0,.42);
  padding: 20px;
}

.icon {
  display: block;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}
.icon-btn, .chat-link {
  min-width: 34px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: #d8d3ca;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  padding: 0;
}
.icon-btn:hover, .chat-link:hover { background: #17202a; color: var(--green); }
.icon-btn.accent { color: var(--blue); }
.icon-btn.warn { color: var(--gold); }
.icon-btn.danger { color: var(--red); }
.chat-link {
  width: auto;
  padding: 0 11px;
  gap: 8px;
  font-weight: 900;
  color: var(--green);
}
.chat-link.has-unread {
  border: 1px solid rgba(255, 255, 255, .95);
  background: rgba(255, 68, 169, .14);
  color: #ff4fb3;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .22), 0 0 16px rgba(255, 68, 169, .38);
  animation: chatBubblePink 1.05s ease-in-out infinite;
}
.chat-link.has-unread:hover {
  background: rgba(255, 68, 169, .22);
  color: #ff8ccc;
}
.chat-link.has-unread .icon,
.chat-link.has-unread span {
  animation: chatPulsePink 1.05s ease-in-out infinite;
}
@keyframes chatBubblePink {
  0%, 100% {
    border-color: rgba(255, 255, 255, .68);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .18), 0 0 8px rgba(255, 68, 169, .24);
  }
  50% {
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .34), 0 0 22px rgba(255, 68, 169, .82);
  }
}
@keyframes chatPulsePink {
  0%, 100% {
    opacity: .7;
    filter: drop-shadow(0 0 1px rgba(255,255,255,.75)) drop-shadow(0 0 0 rgba(255, 68, 169, 0));
  }
  50% {
    opacity: 1;
    filter: drop-shadow(0 0 2px rgba(255,255,255,1)) drop-shadow(0 0 10px rgba(255, 68, 169, .85));
  }
}

.status-form { display: grid; gap: 6px; align-items: start; }
.status-select {
  width: 166px;
  min-width: 166px;
  max-width: 166px;
  min-height: 40px;
  padding: 8px 30px 8px 12px;
  border-radius: 8px;
  font-weight: 900;
  font-size: 14px;
}
.status-select.status-pending { color: #ffcf69; background: #15120b; border-color: #584319; }
.status-select.status-processing { color: #85c7ff; background: #101824; border-color: #274763; }
.status-select.status-completed { color: #7fe19c; background: #101d16; border-color: #235a38; }
.status-select.status-archived { color: #c6bfb5; background: #15171b; border-color: #3a3f46; }
.timer {
  color: #7fe19c;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  font-weight: 900;
  padding-left: 3px;
}

.response-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.response-summary > div {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  border-radius: 8px;
  padding: 14px;
}
.response-summary span, .response-summary small { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.response-summary strong { display: block; margin-top: 5px; word-break: break-word; }
.response-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.response-context p { margin: 6px 0 0; }
.response-modal .dropzone { min-height: 130px; }
.ticket-tree { scroll-margin-top: 100px; }
.tree-group-title {
  margin: 8px 0 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.admin-ticket-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.admin-ticket-actions .panel {
  min-width: 0;
}
.admin-ticket-actions p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.mini-ledger {
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
}
.mini-ledger div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101319;
  padding: 8px 10px;
}
.mini-ledger strong,
.mini-ledger span {
  display: block;
  overflow-wrap: anywhere;
}
.mini-ledger span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.ticket-timeline {
  display: grid;
  gap: 8px;
  border-left: 1px solid var(--line);
  margin-left: 10px;
  padding-left: 16px;
}
.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101319;
  padding: 10px 12px;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 18px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(85, 200, 120, .14);
}
.timeline-item time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.timeline-item strong,
.timeline-item p {
  overflow-wrap: anywhere;
}
.timeline-item p {
  margin: 4px 0 0;
  color: var(--muted);
  white-space: pre-wrap;
}
.file-tree {
  display: grid;
  gap: 10px;
  position: relative;
  margin-left: 12px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}
.tree-node {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  border-radius: 8px;
  padding: 12px;
  position: relative;
}
.tree-node::before {
  content: "";
  position: absolute;
  left: -19px;
  top: 50%;
  width: 18px;
  height: 1px;
  background: var(--line);
}
.tree-node strong {
  display: block;
  word-break: break-word;
}
.tree-node small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}
.tree-node small.internal-only {
  color: var(--gold);
}
.tree-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #27331d;
  color: var(--gold);
  border: 1px solid #5b4b1c;
  font-weight: 950;
}
.tree-badge.version {
  background: #122b1d;
  color: var(--green);
  border-color: #2f6843;
}
.tree-empty {
  margin-left: 24px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
}

.live-chat-backdrop {
  position: fixed;
  inset: 0;
  z-index: 78;
  background: rgba(0,0,0,.72);
}
.live-chat-backdrop[hidden] { display: none; }
.live-chat-window {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 80;
  width: min(560px, calc(100vw - 28px));
  max-height: min(760px, 82vh);
  display: grid;
  grid-template-rows: auto minmax(220px, 1fr) auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11151b;
  box-shadow: 0 28px 80px rgba(0,0,0,.58);
  overflow: hidden;
}
.live-chat-window[hidden] { display: none; }
.live-chat-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  background: #151a21;
  padding: 14px 14px 12px;
}
.live-chat-head h2 {
  margin: 3px 0 0;
  font-size: 18px;
}
.live-chat-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.live-chat-body {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 220px;
  max-height: 52vh;
  overflow: auto;
  padding: 14px;
  background: #0b0f14;
}
.live-chat-context {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #151a21;
  padding: 10px 12px;
}
.live-chat-context strong {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.live-chat-context p {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: 13px;
}
.live-bubble {
  max-width: 86%;
  justify-self: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #1a2028;
}
.live-bubble.mine {
  justify-self: end;
  background: #14341f;
  border-color: #245b38;
}
.live-bubble strong {
  display: block;
  color: var(--green);
  font-size: 12px;
}
.live-bubble strong span {
  color: var(--muted);
  font-weight: 800;
}
.live-bubble p {
  margin: 5px 0 0;
  white-space: normal;
  word-break: break-word;
}
.live-bubble small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  margin-top: 5px;
}
.chat-empty {
  align-self: center;
  justify-self: center;
  color: var(--muted);
  font-weight: 800;
}
.live-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 12px;
  background: #151a21;
}
.live-chat-form textarea {
  min-height: 48px;
  max-height: 120px;
  resize: vertical;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.positive { color: var(--green-dark); font-weight: 900; }
.negative { color: var(--red); font-weight: 900; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.pack { display: flex; flex-direction: column; gap: 14px; }
.pack-top { display: flex; justify-content: space-between; gap: 12px; }
.pack-price { color: var(--green-dark); font-size: 22px; font-weight: 950; white-space: nowrap; }
.telegram-code {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 14px 18px;
  border: 1px solid rgba(116, 206, 132, .55);
  border-radius: 8px;
  background: rgba(116, 206, 132, .12);
  color: #9bf0a8;
  font-size: 22px;
  font-weight: 950;
  letter-spacing: 0;
}
.log-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.log-row span {
  color: var(--muted);
  min-width: 0;
  overflow-wrap: anywhere;
}
.log-row small { color: var(--muted); }

@media (max-width: 1100px) {
  .app-shell, .auth-page { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
    align-items: start;
    border-right: 0;
    border-bottom: 1px solid #252a31;
  }
  .sidebar nav {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
  }
  .sidebar .hours { margin-top: 0; }
  .nav-group { margin-bottom: 0; }
  .grid-4 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .response-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .admin-ticket-actions { grid-template-columns: 1fr; }
  .credit-cost-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .credit-cost-board .credit-buy { grid-column: 1 / -1; }
  .auth-logo-showcase { width: min(520px, 100%); }
  .auth-logo-showcase img { height: 420px; }
}
@media (max-width: 900px) {
  .sidebar .hours { display: none; }
}
@media (max-width: 720px) {
  .sidebar {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
    overflow: hidden;
  }
  .sidebar nav {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    margin: 0 -14px;
    padding: 0 14px 6px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }
  .nav-group {
    display: contents;
  }
  .nav-label { display: none; }
  .nav-link {
    width: auto;
    flex: 0 0 auto;
    min-height: 38px;
    padding: 9px 10px;
    white-space: nowrap;
    scroll-snap-align: start;
  }
  .user-mini { padding: 10px; }
  .sidebar > form .nav-link {
    justify-content: center;
    border: 1px solid var(--line);
    background: #111419;
  }
  .content, .topbar, .auth-panel, .auth-visual { padding: 18px 14px; }
  .content { padding-bottom: 86px; }
  .grid-2, .grid-3, .grid-4, .form-grid, .response-summary, .wizard-steps, .vehicle-type-grid, .remap-grid, .review-grid, .request-details, .service-rate-grid, .vehicle-repository-panel, .repo-cascade, .report-filter-grid { grid-template-columns: 1fr; }
  .section-head, .topbar, .response-context { align-items: stretch; flex-direction: column; }
  .topbar-actions { justify-content: flex-start; }
  .credit-widget { width: 100%; grid-template-columns: minmax(0, 1fr) auto; }
  .credit-cost-board { grid-template-columns: 1fr; }
  .credit-cost-board .credit-buy { grid-column: auto; }
  .topbar h1 { font-size: 24px; }
  .auth-stats { grid-template-columns: 1fr; }
  .searchbar { flex-direction: column; align-items: stretch; }
  .searchbar input { max-width: none; }
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .client-files-table table { min-width: 1280px; }
  .admin-files-table table { min-width: 1000px; }
  .wizard-steps button { min-height: 46px; }
  .wizard-actions { flex-direction: column; }
  .wizard-actions .btn { width: 100%; }
  .tree-node { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 1fr; }
  .log-row { grid-template-columns: 1fr; }
  .brand-logo { width: 44px; height: 44px; }
  .auth-logo-showcase img { height: 320px; }
  .live-chat-window {
    left: 10px;
    right: 10px;
    top: 10px;
    bottom: 10px;
    transform: none;
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }
  .live-chat-form { grid-template-columns: 1fr; }
}
