:root {
  --bg: #f6f7fb;
  --ink: #18202f;
  --muted: #657084;
  --panel: #ffffff;
  --line: #dfe4ee;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --normal: #1f9d61;
  --review: #d99a22;
  --damaged: #d64545;
  --missing: #7b8496;
  --warning-bg: #fff4e2;
  --shadow: 0 16px 48px rgba(24, 32, 47, .11);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, .12), transparent 36%),
    linear-gradient(315deg, rgba(214, 69, 69, .08), transparent 34%),
    var(--bg);
  font-family: "Segoe UI", Arial, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.topbar,
.summary-grid,
.workspace {
  margin-bottom: 18px;
}

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

.eyebrow {
  margin: 0 0 5px;
  color: var(--brand-dark);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.85rem, 4vw, 3.3rem);
  line-height: 1;
}

h2 {
  font-size: 1.2rem;
}

.date-box,
.metric,
.panel {
  background: rgba(255, 255, 255, .86);
  border: 1px solid rgba(223, 228, 238, .86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.date-box {
  display: grid;
  gap: 8px;
  min-width: 210px;
  padding: 14px;
  border-radius: 8px;
}

.date-box span,
.metric-label {
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
}

input[type="date"],
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

input[type="date"] {
  padding: 10px 11px;
}

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

.metric {
  min-height: 96px;
  padding: 17px;
  border-radius: 8px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
  line-height: 1;
}

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

.issues-panel {
  margin-bottom: 26px;
}

.detail-drawer {
  margin-bottom: 18px;
}

.summary-head {
  align-items: flex-start;
}

.export-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.export-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
}

.export-button:hover {
  background: var(--brand-dark);
}

.export-button.secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--brand-dark);
}

.export-button.secondary:hover {
  border-color: var(--brand);
  background: #e6f5f3;
}

.export-button:disabled {
  border-color: var(--line);
  background: #edf1f7;
  color: var(--muted);
  cursor: not-allowed;
}

.issue-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.issue-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 14px 16px;
  border-radius: 8px;
  color: #fff;
}

.issue-total span {
  font-weight: 900;
}

.issue-total strong {
  font-size: 2rem;
  line-height: 1;
}

.issue-summary {
  display: grid;
  gap: 12px;
}

.empty-summary {
  display: grid;
  gap: 4px;
  padding: 18px;
  border: 1px dashed #b9c3d3;
  border-radius: 8px;
  background: #f8fafc;
}

.empty-summary strong {
  font-size: 1.05rem;
}

.empty-summary span {
  color: var(--muted);
  font-weight: 700;
}

.issue-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.issue-group header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.issue-group h3 {
  margin: 0;
  font-size: 1rem;
}

.issue-group header span {
  color: var(--muted);
  font-size: .84rem;
  font-weight: 900;
}

.issue-table {
  display: grid;
}

.issue-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(132px, .6fr) minmax(260px, 1.4fr);
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-bottom: 1px solid #edf1f7;
}

.issue-row.compact {
  grid-template-columns: minmax(170px, .9fr) minmax(180px, 1fr) minmax(132px, .7fr) minmax(220px, 1.4fr);
  gap: 10px;
  padding: 9px 12px;
}

.issue-row.compact small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
}

.issue-row:last-child {
  border-bottom: 0;
}

.issue-row-head {
  color: var(--muted);
  background: #fbfcfe;
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.issue-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  color: #fff;
  font-size: .82rem;
  font-weight: 900;
}

.config-panel {
  margin-bottom: 18px;
}

.component-editor {
  display: grid;
  gap: 10px;
}

.component-edit-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.2fr) minmax(220px, 1.4fr) 80px 76px 76px 82px;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.edit-preview {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.edit-preview span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #eef4f7;
  font-weight: 900;
}

.edit-preview strong {
  overflow-wrap: anywhere;
}

.component-edit-row label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 900;
}

.component-edit-row input,
.component-edit-row select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
  background: #fff;
  color: var(--ink);
}

.component-edit-row select {
  cursor: pointer;
  font-weight: 850;
}

.delete-component {
  min-height: 38px;
  border: 1px solid #f0b6b6;
  border-radius: 8px;
  background: #fff5f5;
  color: #a82020;
  cursor: pointer;
  font-weight: 900;
}

.delete-component:hover {
  background: #ffe8e8;
}

.panel {
  border-radius: 8px;
  padding: 18px;
}

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

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--brand);
}

.icon-button.danger:hover {
  color: #b22626;
  border-color: #f0b6b6;
  background: #fff5f5;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.tab,
.lane-button,
.state-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.tab {
  min-height: 42px;
  font-weight: 800;
}

.tab.active,
.lane-button.active {
  border-color: var(--brand);
  background: #e6f5f3;
  color: var(--brand-dark);
}

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

.mobile-selectors {
  display: none;
  gap: 10px;
  margin-bottom: 14px;
}

.mobile-selectors label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
}

.mobile-selectors select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  font-weight: 800;
}

.side-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.side-action {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand-dark);
  cursor: pointer;
  font-weight: 900;
}

.side-action:hover,
.side-action.active {
  border-color: var(--brand);
  background: #e6f5f3;
}

.lane-button {
  min-height: 72px;
  padding: 10px;
  text-align: left;
}

.lane-button strong,
.lane-button span {
  display: block;
}

.lane-button strong {
  margin-bottom: 7px;
}

.lane-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: #e9edf5;
}

.lane-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.lane-heading {
  align-items: flex-start;
}

.status-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.legend {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #fff;
  font-size: .8rem;
  font-weight: 800;
}

.normal,
.status-normal {
  background: var(--normal);
}

.review,
.status-review {
  background: var(--review);
}

.damaged,
.status-damaged {
  background: var(--damaged);
}

.missing,
.status-missing {
  background: var(--missing);
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(300px, .76fr) minmax(400px, 1fr);
  gap: 18px;
}

.road-view {
  min-height: 640px;
  border: 1px solid #c9d1df;
  border-radius: 8px;
  overflow: hidden;
  background: #dde5ef;
}

.road {
  position: relative;
  height: 100%;
  min-height: 640px;
  background:
    linear-gradient(90deg, #6a7280 0 15%, #3c4350 15% 85%, #6a7280 85%),
    #4b5563;
}

.lane-line {
  position: absolute;
  inset: 0 auto 0 50%;
  width: 5px;
  transform: translateX(-50%);
  background: repeating-linear-gradient(to bottom, #f6d45f 0 38px, transparent 38px 72px);
  opacity: .85;
}

.vehicle {
  position: absolute;
  left: 50%;
  bottom: 54px;
  width: 74px;
  height: 118px;
  transform: translateX(-50%);
  border-radius: 18px 18px 10px 10px;
  background: linear-gradient(#e9eef7, #aab6c9);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .28);
}

.vehicle::before,
.vehicle::after {
  content: "";
  position: absolute;
  top: 24px;
  width: 12px;
  height: 22px;
  border-radius: 5px;
  background: #273142;
}

.vehicle::before {
  left: -8px;
}

.vehicle::after {
  right: -8px;
}

.booth-box {
  position: absolute;
  top: 20px;
  right: 22px;
  display: grid;
  place-items: center;
  width: 108px;
  height: 96px;
  border: 3px solid #d8b76b;
  border-radius: 8px;
  background: #f9e6aa;
  color: #584116;
  font-weight: 900;
}

.barrier-arm {
  position: absolute;
  top: 136px;
  left: 48%;
  width: 190px;
  height: 12px;
  transform: rotate(-16deg);
  transform-origin: left center;
  border-radius: 99px;
  background: repeating-linear-gradient(90deg, #f7f7f7 0 28px, #d64545 28px 54px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .22);
}

.component-marker {
  position: absolute;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
}

.component-marker.to-left {
  transform: translate(-50%, -50%);
}

.marker-dot {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 2px solid rgba(255, 255, 255, .8);
  border-radius: 50%;
  color: #fff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .28);
}

.marker-label {
  position: absolute;
  left: 46px;
  z-index: 2;
  width: 118px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(24, 32, 47, .72);
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.15;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-4px);
  transition: opacity .16s ease, transform .16s ease;
}

.component-marker.to-left .marker-label {
  right: 46px;
  left: auto;
  text-align: right;
  transform: translateX(4px);
}

.component-marker:hover .marker-label,
.component-marker:focus-visible .marker-label {
  opacity: 1;
  transform: translateX(0);
}

.component-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.component-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(430px, auto);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.component-row.has-note {
  border-color: #d99a22;
  box-shadow: 0 0 0 3px rgba(217, 154, 34, .14);
}

.component-row.note-open {
  background: #fffaf0;
}

.component-name {
  display: flex;
  align-items: flex-start;
  min-width: 0;
  gap: 10px;
  font-weight: 800;
}

.component-name small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
  line-height: 1.2;
}

.component-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #eef4f7;
}

.component-actions {
  display: grid;
  grid-template-columns: 1fr 82px;
  gap: 8px;
  align-items: center;
}

.state-group {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 106px));
  gap: 6px;
}

.state-button {
  min-height: 36px;
  padding: 0 7px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.1;
}

.state-button span {
  margin-right: 4px;
}

.state-button.active {
  border-color: transparent;
  color: #fff;
}

.state-button.status-normal.active,
.state-button.status-review.active,
.state-button.status-damaged.active,
.state-button.status-missing.active {
  color: #fff;
}

.note-toggle {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand-dark);
  cursor: pointer;
  font-size: .8rem;
  font-weight: 900;
}

.note-toggle:hover,
.note-toggle.has-content {
  border-color: #d99a22;
  background: var(--warning-bg);
  color: #7a4b00;
}

.component-note {
  grid-column: 1 / -1;
  display: grid;
  gap: 7px;
}

.component-note[hidden] {
  display: none;
}

.component-note label {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 800;
}

.component-note textarea {
  min-height: 84px;
}

.notes-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 800;
}

textarea {
  resize: vertical;
  min-height: 118px;
  padding: 12px;
}

@media (max-width: 1050px) {
  .workspace,
  .layout-grid {
    grid-template-columns: 1fr;
  }

  .road-view,
  .road {
    min-height: 540px;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1440px);
    padding: 18px 0;
  }

  .topbar,
  .lane-heading {
    align-items: stretch;
    flex-direction: column;
  }

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

  .issue-totals,
  .issue-row,
  .component-edit-row {
    grid-template-columns: 1fr;
  }

  .summary-head {
    align-items: stretch;
    flex-direction: column;
  }

  .export-actions {
    justify-content: stretch;
  }

  .export-button {
    flex: 1;
  }

  .lane-buttons {
    grid-template-columns: 1fr;
  }

  .component-row {
    grid-template-columns: 1fr;
  }

  .component-actions {
    grid-template-columns: 1fr;
  }

  .state-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status-legend {
    justify-content: flex-start;
  }
}

@media print {
  body {
    background: #fff;
  }

  .topbar,
  .summary-grid,
  .workspace,
  .export-actions {
    display: none;
  }

  .shell {
    width: 100%;
    padding: 0;
  }

  .panel {
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
  }

  .issue-row {
    break-inside: avoid;
  }
}

/* Modern dashboard refresh */
:root {
  --bg: #f8fafc;
  --ink: #0f172a;
  --muted: #64748b;
  --panel: #ffffff;
  --line: #e2e8f0;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --normal: #16a34a;
  --review: #f59e0b;
  --damaged: #dc2626;
  --missing: #64748b;
  --shadow: 0 18px 45px rgba(15, 23, 42, .08);
  --soft-shadow: 0 8px 22px rgba(15, 23, 42, .06);
}

body {
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, .10), transparent 30%),
    linear-gradient(180deg, #ffffff 0, #f8fafc 320px, #f8fafc 100%);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.shell {
  width: min(1500px, calc(100% - 48px));
  padding: 26px 0 22px;
}

.topbar {
  align-items: flex-start;
  margin-bottom: 18px;
}

.eyebrow {
  color: var(--brand);
  font-size: .72rem;
  letter-spacing: 0;
}

h1 {
  color: #020617;
  font-size: clamp(2.2rem, 4vw, 3.25rem);
  font-weight: 850;
}

.subtitle {
  margin: 8px 0 0;
  color: #475569;
  font-size: 1rem;
}

.header-actions {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.date-box,
.metric,
.panel,
.progress-dock {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(14px);
}

.date-box {
  min-width: 248px;
  box-shadow: none;
}

.primary-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 152px;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #10a37f, var(--brand));
  color: #fff;
  box-shadow: 0 10px 22px rgba(15, 118, 110, .24);
  cursor: pointer;
  font-weight: 850;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.primary-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(15, 118, 110, .28);
}

.primary-save.saved {
  background: linear-gradient(180deg, #16a34a, #15803d);
}

.summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.metric {
  position: relative;
  display: grid;
  grid-template-columns: 58px 1fr;
  grid-template-rows: auto auto;
  column-gap: 14px;
  min-height: 86px;
  padding: 16px;
  overflow: hidden;
}

.metric::after {
  content: "";
  position: absolute;
  inset: auto 16px 0 16px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(15, 118, 110, .8), transparent);
  opacity: .45;
}

.metric-icon {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: #e6f5f3;
  color: var(--brand);
  font-size: 1.35rem;
  font-weight: 900;
}

.metric-icon.ok {
  background: #dcfce7;
  color: var(--normal);
}

.metric-icon.warn {
  background: #fef3c7;
  color: var(--review);
}

.metric-label {
  align-self: end;
  color: #475569;
  font-size: .8rem;
}

.metric strong {
  margin-top: 4px;
  color: #020617;
  font-size: 2rem;
  font-weight: 850;
}

.workspace {
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 18px;
}

.panel {
  padding: 16px;
  border-radius: 10px;
}

.lane-list {
  position: sticky;
  top: 18px;
}

.panel-head h2 {
  color: #0f172a;
  font-size: 1.05rem;
}

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  box-shadow: none;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

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

.tabs {
  grid-template-columns: 1fr;
  gap: 8px;
}

.tab,
.lane-button,
.side-action {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.tab {
  min-height: 44px;
  padding: 0 14px;
  text-align: left;
}

.tab::before {
  content: "⌂";
  margin-right: 9px;
  color: var(--brand);
}

.tab:hover,
.lane-button:hover,
.side-action:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, .45);
  box-shadow: 0 10px 22px rgba(15, 23, 42, .07);
}

.tab.active,
.lane-button.active,
.side-action.active {
  border-color: var(--brand);
  background: linear-gradient(180deg, #f0fdfa, #ecfdf5);
  box-shadow: inset 3px 0 0 var(--brand), 0 10px 22px rgba(15, 118, 110, .10);
}

.lane-buttons {
  grid-template-columns: 1fr;
  gap: 8px;
}

.lane-button {
  min-height: 56px;
  padding: 10px 12px;
}

.lane-button strong {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: .92rem;
}

.lane-button strong::after {
  content: "OK";
  color: var(--brand);
  font-size: .68rem;
  font-weight: 900;
}

.lane-progress {
  height: 6px;
  background: #e2e8f0;
}

.lane-progress i {
  background: linear-gradient(90deg, var(--brand), #22c55e);
}

.side-actions {
  grid-template-columns: 1fr 1fr;
}

.side-action {
  background: #fff;
}

.checklist-panel {
  padding: 18px 20px;
}

.lane-heading {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.lane-heading h2 {
  font-size: 1.45rem;
}

.status-legend {
  gap: 14px;
}

.legend {
  gap: 7px;
  min-height: 30px;
  padding: 0;
  border-radius: 0;
  background: transparent !important;
  color: #0f172a;
  font-size: .86rem;
}

.legend::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
}

.legend.normal {
  color: var(--normal);
}

.legend.review {
  color: var(--review);
}

.legend.damaged {
  color: var(--damaged);
}

.legend.missing {
  color: var(--missing);
}

.layout-grid {
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 20px;
}

.road-view {
  min-height: 590px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fafc, #eef2f7);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.7);
}

.road {
  min-height: 590px;
  background:
    linear-gradient(90deg, #cbd5e1 0 12%, transparent 12% 88%, #cbd5e1 88%),
    linear-gradient(180deg, #1f2937, #111827);
  box-shadow: inset 0 0 70px rgba(0,0,0,.28);
}

.lane-line {
  width: 4px;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.95) 0 30px, transparent 30px 64px);
}

.booth-box {
  width: 100px;
  height: 82px;
  border: 2px solid #d6a84b;
  background: linear-gradient(145deg, #f9e6aa, #f7d77a);
  box-shadow: 0 12px 24px rgba(0,0,0,.22);
}

.barrier-arm {
  height: 10px;
  border: 1px solid rgba(255,255,255,.8);
}

.component-marker {
  border-radius: 50%;
  transition: transform .16s ease, filter .16s ease;
}

.component-marker:hover,
.component-marker.selected {
  transform: translate(-50%, -50%) scale(1.08);
  filter: drop-shadow(0 0 14px rgba(34, 197, 94, .45));
}

.marker-dot {
  border: 2px solid rgba(255, 255, 255, .92);
  box-shadow: 0 12px 24px rgba(0, 0, 0, .30);
}

.marker-dot.status-review {
  background: var(--review);
}

.marker-dot.status-damaged {
  background: var(--damaged);
}

.marker-dot.status-missing {
  background: var(--missing);
}

.component-list {
  gap: 10px;
}

.component-row {
  grid-template-columns: 1fr;
  padding: 12px 12px;
  border-color: #e5eaf1;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15,23,42,.03);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.component-row:hover,
.component-row.selected {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, .42);
  box-shadow: 0 12px 26px rgba(15, 23, 42, .08);
}

.component-row.selected {
  background: linear-gradient(90deg, rgba(15,118,110,.07), #fff 34%);
}

.component-icon {
  border-radius: 50%;
  background: #e6f5f3;
  color: var(--brand);
}

.component-name small {
  color: #64748b;
}

.component-actions {
  grid-template-columns: minmax(0, 1fr) 42px;
}

.state-group {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  justify-content: stretch;
  gap: 8px;
}

.state-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 7px;
  border-radius: 8px;
  background: #f8fafc;
  font-size: .68rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.65);
}

.state-button.status-normal {
  border-color: #bbf7d0;
  color: #15803d;
}

.state-button.status-review {
  border-color: #fde68a;
  color: #b45309;
}

.state-button.status-damaged {
  border-color: #fecaca;
  color: #b91c1c;
}

.state-button.status-missing {
  border-color: #e2e8f0;
  color: #475569;
}

.state-button.active {
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .12);
}

.note-toggle {
  width: 38px;
  min-height: 34px;
  border-color: rgba(15, 118, 110, .45);
  color: var(--brand);
  font-size: 0;
}

.note-toggle::before {
  content: "▤";
  font-size: 1rem;
}

.note-toggle.has-content {
  background: #ecfdf5;
}

.notes-label {
  margin-top: 8px;
}

textarea {
  border-color: var(--line);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .03);
}

.progress-dock {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 420px) auto;
  gap: 20px;
  align-items: center;
  margin: 4px 0 18px;
  padding: 14px 18px;
}

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

.shield-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #ecfdf5;
  color: var(--brand);
  font-weight: 900;
}

.progress-copy strong,
.progress-copy span,
.global-progress span,
.global-progress small {
  display: block;
}

.progress-copy span,
.global-progress small {
  color: var(--muted);
  font-size: .82rem;
}

.global-progress {
  display: grid;
  gap: 7px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #334155;
  font-size: .82rem;
  font-weight: 800;
}

.progress-meta strong {
  color: var(--normal);
  font-size: 1.35rem;
}

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #22c55e);
  transition: width .24s ease;
}

.detail-drawer .panel {
  box-shadow: var(--soft-shadow);
}

.issue-totals {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.issue-total {
  min-height: 54px;
  padding: 10px 12px;
  border-radius: 8px;
}

.issue-total strong {
  font-size: 1.45rem;
}

.issue-row.compact {
  border-bottom-color: #eef2f7;
}

.component-edit-row {
  border-radius: 10px;
}

@media (max-width: 1180px) {
  .layout-grid,
  .workspace,
  .progress-dock {
    grid-template-columns: 1fr;
  }

  .lane-list {
    position: static;
  }

  .layout-grid {
    gap: 16px;
  }

  .road-view,
  .road {
    min-height: 520px;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1440px);
  }

  .header-actions,
  .progress-dock {
    grid-template-columns: 1fr;
    display: grid;
  }

  .topbar {
    gap: 14px;
  }

  h1 {
    font-size: 2rem;
  }

  .subtitle {
    font-size: .92rem;
  }

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

  .metric {
    min-height: 76px;
  }

  .mobile-selectors {
    display: grid;
  }

  .tabs,
  .lane-buttons {
    display: none;
  }

  .lane-list {
    padding: 14px;
  }

  .side-actions {
    margin-top: 4px;
  }

  .checklist-panel {
    padding: 14px;
  }

  .lane-heading {
    gap: 10px;
  }

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

  .layout-grid {
    gap: 14px;
  }

  .road-view {
    min-height: 430px;
  }

  .road {
    min-height: 430px;
  }

  .booth-box {
    width: 86px;
    height: 68px;
    right: 14px;
  }

  .barrier-arm {
    width: 150px;
  }

  .marker-label {
    display: none;
  }

  .component-row,
  .component-actions,
  .state-group,
  .issue-row.compact {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .state-group {
    justify-content: stretch;
  }

  .state-button {
    min-height: 38px;
    font-size: .74rem;
  }

  .component-row {
    padding: 12px;
  }

  .component-name {
    align-items: center;
  }

  .note-toggle {
    width: 100%;
  }

  .note-toggle::before {
    content: "Nota";
    font-size: .85rem;
  }

  .component-note textarea,
  textarea {
    min-height: 96px;
  }

  .progress-dock {
    padding: 14px;
  }

  .primary-save {
    width: 100%;
  }

  .issue-totals {
    grid-template-columns: 1fr;
  }

  .component-edit-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .shell {
    width: min(100% - 14px, 1440px);
    padding-top: 14px;
  }

  h1 {
    font-size: 1.72rem;
  }

  .date-box {
    min-width: 0;
  }

  .summary-grid,
  .workspace,
  .topbar {
    margin-bottom: 12px;
  }

  .panel,
  .metric,
  .progress-dock {
    border-radius: 9px;
  }

  .status-legend {
    grid-template-columns: 1fr;
  }

  .road-view,
  .road {
    min-height: 380px;
  }

  .component-marker,
  .marker-dot {
    width: 34px;
    height: 34px;
  }

  .state-group {
    grid-template-columns: 1fr;
  }

  .side-actions {
    grid-template-columns: 1fr;
  }
}


/* Lucide icon integration */
[data-lucide],
.lucide {
  width: 1em;
  height: 1em;
  stroke-width: 2.25;
  vertical-align: middle;
}

.primary-save,
.export-button,
.side-action,
.tab,
.lane-button strong,
.component-name small,
.issue-badge,
.marker-label {
  gap: 8px;
}

.primary-save,
.export-button,
.side-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary-save [data-lucide],
.export-button [data-lucide],
.side-action [data-lucide] {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.metric-icon [data-lucide],
.shield-icon [data-lucide] {
  width: 25px;
  height: 25px;
}

.icon-button [data-lucide] {
  width: 18px;
  height: 18px;
}

.tab {
  display: flex;
  align-items: center;
}

.tab::before {
  content: none;
}

.tab-icon,
.lane-icon {
  width: 17px;
  height: 17px;
  color: var(--brand);
  flex: 0 0 auto;
}

.lane-button strong {
  align-items: center;
}

.lane-button strong::after {
  content: none;
}

.lane-button strong small {
  margin-left: auto;
  color: var(--brand);
  font-size: .68rem;
  font-weight: 900;
}

.component-icon .component-svg,
.edit-preview .edit-icon {
  width: 18px;
  height: 18px;
}

.component-name small {
  display: inline-flex;
  align-items: center;
}

.state-mini,
.marker-label-icon,
.issue-badge-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.state-button {
  gap: 5px;
}

.state-button .state-button-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.marker-dot .marker-svg {
  width: 19px;
  height: 19px;
}

.marker-label {
  display: inline-flex;
  align-items: center;
}

.note-toggle::before {
  content: none;
}

.note-toggle::after {
  content: "";
  width: 17px;
  height: 17px;
  background: currentColor;
  display: inline-block;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a4 4 0 0 1-4 4H7l-4 4V7a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a4 4 0 0 1-4 4H7l-4 4V7a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4z'/%3E%3C/svg%3E") center / contain no-repeat;
}


/* Enhanced toll-lane simulator visualization */
.simulator-layout {
  grid-template-columns: minmax(520px, 1.15fr) minmax(420px, .85fr);
  align-items: start;
}

.simulator-column {
  display: grid;
  gap: 14px;
}

.simulator-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

.view-tabs,
.zoom-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.view-tab,
.zoom-tools button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  font-weight: 850;
}

.view-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
}

.view-tab.active {
  border-color: rgba(15, 118, 110, .35);
  background: #ecfdf5;
  color: var(--brand);
}

.zoom-tools {
  color: #475569;
  font-weight: 800;
}

.zoom-tools button {
  display: grid;
  place-items: center;
  width: 38px;
  padding: 0;
}

.road-view {
  position: relative;
  min-height: 720px;
  padding: 28px 36px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 18%, rgba(15, 118, 110, .12), transparent 28%),
    linear-gradient(180deg, #f8fafc, #eef2f7);
  overflow: hidden;
}

.road-view[data-view="isometric"] .road {
  transform: perspective(980px) rotateX(7deg);
  transform-origin: center top;
}

.road-view[data-view="plan"] .road {
  transform: none;
}

.road {
  position: relative;
  width: min(500px, 100%);
  min-height: 660px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: visible;
  background:
    linear-gradient(90deg, #cbd5e1 0 12%, transparent 12% 88%, #cbd5e1 88%),
    linear-gradient(180deg, #273244 0%, #111827 100%);
  box-shadow:
    0 28px 60px rgba(15, 23, 42, .22),
    inset 0 0 80px rgba(0,0,0,.32);
}

.road::before,
.road::after {
  content: "";
  position: absolute;
  top: 150px;
  bottom: 36px;
  width: 18px;
  border-radius: 999px;
  background: repeating-linear-gradient(to bottom, #facc15 0 18px, #1f2937 18px 36px);
  opacity: .92;
  z-index: 1;
}

.road::before {
  left: 18%;
}

.road::after {
  right: 18%;
}

.lane-line {
  z-index: 2;
  width: 5px;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.96) 0 34px, transparent 34px 72px);
}

.gantry {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 24px;
  height: 82px;
  z-index: 8;
  display: grid;
  grid-template-columns: 1fr 86px 86px 86px 1fr;
  align-items: center;
  gap: 10px;
}

.gantry::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 28px;
  height: 18px;
  border-radius: 6px;
  background:
    linear-gradient(135deg, transparent 0 42%, rgba(255,255,255,.22) 42% 58%, transparent 58%),
    linear-gradient(180deg, #475569, #1e293b);
  box-shadow: 0 8px 18px rgba(0,0,0,.25);
}

.gantry-post {
  position: absolute;
  top: 36px;
  width: 16px;
  height: 130px;
  border-radius: 8px;
  background: linear-gradient(180deg, #64748b, #334155);
  box-shadow: 0 12px 24px rgba(0,0,0,.28);
}

.gantry-post.left {
  left: 3%;
}

.gantry-post.right {
  right: 3%;
}

.gantry-panel {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  height: 60px;
  border: 3px solid #334155;
  border-radius: 10px;
  background: linear-gradient(180deg, #0f172a, #111827);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 12px 22px rgba(0,0,0,.24);
}

.gantry-panel.arrow {
  grid-column: 2;
  color: #22c55e;
}

.gantry-panel.arrow svg {
  width: 38px;
  height: 38px;
  stroke-width: 3;
}

.gantry-panel.tag {
  grid-column: 3;
  font-size: 1.25rem;
  letter-spacing: .04em;
}

.gantry-panel.speed {
  grid-column: 4;
  width: 62px;
  height: 62px;
  justify-self: center;
  border: 5px solid #fbbf24;
  border-radius: 999px;
  font-size: 1.45rem;
}

.detector-pad {
  position: absolute;
  left: 39%;
  width: 22%;
  height: 50px;
  z-index: 3;
  border: 2px solid rgba(148, 163, 184, .9);
  border-radius: 5px;
  background:
    linear-gradient(90deg, transparent 0 45%, rgba(250, 204, 21, .75) 45% 55%, transparent 55%),
    repeating-linear-gradient(90deg, rgba(148,163,184,.28) 0 8px, transparent 8px 16px);
  box-shadow: inset 0 0 16px rgba(255,255,255,.18);
}

.pad-top { top: 228px; }
.pad-bottom { top: 440px; }

.island {
  position: absolute;
  z-index: 2;
  width: 48px;
  height: 210px;
  border-radius: 999px 999px 18px 18px;
  background: linear-gradient(180deg, #fbbf24, #d97706);
  box-shadow: 0 14px 28px rgba(0,0,0,.26);
}

.island-left {
  left: 23%;
  top: 292px;
}

.island-right {
  right: 23%;
  top: 268px;
}

.traffic-light-object {
  position: absolute;
  left: 23%;
  top: 333px;
  z-index: 5;
  display: grid;
  gap: 6px;
  width: 38px;
  padding: 7px;
  border-radius: 12px;
  background: #1f2937;
  box-shadow: 0 12px 20px rgba(0,0,0,.25);
}

.traffic-light-object span {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

.traffic-light-object span:first-child { background: #ef4444; }
.traffic-light-object span:last-child { background: #22c55e; }

.booth-box {
  top: 280px;
  right: 18%;
  z-index: 4;
  width: 104px;
  height: 150px;
  border: 2px solid #94a3b8;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(14,165,233,.15), transparent 34%),
    linear-gradient(145deg, #e2e8f0, #94a3b8);
  color: #0f172a;
}

.booth-box::before {
  content: "";
  position: absolute;
  inset: 16px 22px 70px;
  border-radius: 10px;
  background: linear-gradient(180deg, #38bdf8, #075985);
  box-shadow: inset 0 0 12px rgba(255,255,255,.3);
}

.booth-box span {
  position: absolute;
  bottom: 18px;
  font-size: .82rem;
}

.barrier-arm {
  top: 426px;
  left: 29%;
  z-index: 6;
  width: 230px;
  transform: rotate(0deg);
}

.vehicle {
  bottom: 34px;
  z-index: 4;
  width: 110px;
  height: 172px;
  border-radius: 32px 32px 18px 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.82), rgba(255,255,255,.12) 40%, transparent 41%),
    linear-gradient(180deg, #f8fafc, #94a3b8);
}

.vehicle::before,
.vehicle::after {
  top: 52px;
  width: 14px;
  height: 28px;
}

.component-map {
  position: absolute;
  inset: 0;
  z-index: 10;
}

.simulator-marker {
  width: 44px;
  height: 44px;
  background: transparent;
}

.simulator-marker:hover,
.simulator-marker.selected {
  z-index: 30;
}

.marker-dot {
  width: 44px;
  height: 44px;
  border: 3px solid #fff;
  box-shadow: 0 10px 24px rgba(15,23,42,.25);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

.simulator-marker:hover .marker-dot,
.simulator-marker.selected .marker-dot {
  transform: scale(1.14);
  box-shadow: 0 0 0 7px rgba(22,163,74,.16), 0 18px 34px rgba(15,23,42,.30);
}

.simulator-marker.status-review.selected .marker-dot {
  box-shadow: 0 0 0 7px rgba(245,158,11,.2), 0 18px 34px rgba(15,23,42,.30);
}

.simulator-marker.status-damaged.selected .marker-dot {
  box-shadow: 0 0 0 7px rgba(220,38,38,.2), 0 18px 34px rgba(15,23,42,.30);
}

.marker-svg {
  width: 22px;
  height: 22px;
}

.marker-label {
  display: grid;
  gap: 2px;
  width: 190px;
  padding: 10px 12px;
  border: 1px solid rgba(226,232,240,.35);
  border-radius: 12px;
  background: rgba(15,23,42,.88);
  box-shadow: 0 16px 30px rgba(15,23,42,.24);
  color: #fff;
}

.marker-label strong {
  font-size: .82rem;
}

.marker-label small {
  color: #cbd5e1;
  font-size: .72rem;
  font-weight: 800;
}

.component-zone-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 4px 4px;
  margin-top: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.component-zone-header:first-child {
  margin-top: 0;
}

.zone-header-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.zone-alert-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--review);
  margin-left: auto;
  flex-shrink: 0;
}

.component-side-panel {
  display: grid;
  gap: 12px;
  max-height: 760px;
  overflow: auto;
  padding-right: 4px;
}

.component-side-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  gap: 12px;
  padding-bottom: 8px;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
}

.component-side-head h3 {
  margin: 0;
  color: #0f172a;
  font-size: 1.05rem;
}

.component-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: #64748b;
}

.component-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: #0f172a;
}

.component-row.compact-component {
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #fbfdff);
}

.component-row.selected {
  border-color: rgba(15,118,110,.45);
  background: linear-gradient(180deg, #f0fdfa, #fff);
  box-shadow: 0 12px 28px rgba(15,118,110,.10);
}

.component-name {
  align-items: center;
}

.component-name em {
  display: inline-flex;
  width: max-content;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: .68rem;
  font-style: normal;
  font-weight: 900;
}

.component-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #e6f5f3;
  color: var(--brand);
}

.component-actions {
  grid-template-columns: 1fr 44px;
}

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

.state-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  border-radius: 10px;
  background: #f8fafc;
}

.state-button span {
  margin: 0;
}

.note-toggle {
  display: grid;
  place-items: center;
  min-height: 34px;
  width: 42px;
  padding: 0;
  border-color: rgba(15,118,110,.4);
}

.note-toggle span {
  display: none;
}

.selected-component-card {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 16px;
  align-items: center;
  min-height: 124px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.selected-icon {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border: 6px solid #dcfce7;
  border-radius: 22px;
  color: #fff;
  background: var(--normal);
}

.selected-icon.status-review { border-color: #fef3c7; background: var(--review); }
.selected-icon.status-damaged { border-color: #fee2e2; background: var(--damaged); }
.selected-icon.status-missing { border-color: #e2e8f0; background: var(--missing); }

.selected-card-icon {
  width: 34px;
  height: 34px;
}

.selected-copy {
  display: grid;
  gap: 6px;
}

.selected-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.selected-title-row strong {
  font-size: 1.05rem;
}

.selected-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: max-content;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: #fff;
  font-size: .78rem;
  font-weight: 900;
}

.selected-zone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #475569;
  font-weight: 850;
}

.selected-copy small {
  color: #64748b;
  font-weight: 800;
}

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

  .component-side-panel {
    max-height: none;
  }
}

@media (max-width: 720px) {
  .road-view {
    min-height: 620px;
    padding: 18px 14px;
  }

  .road {
    min-height: 580px;
  }

  .state-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .simulator-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .selected-component-card {
    grid-template-columns: 1fr;
  }
}

.state-button.status-normal.active {
  border-color: #16a34a;
  background: linear-gradient(180deg, #22c55e, #16a34a);
  color: #fff;
  box-shadow: 0 8px 18px rgba(22, 163, 74, .28), inset 0 0 0 1px rgba(255, 255, 255, .22);
}

.state-button.status-review.active {
  border-color: #f59e0b;
  background: linear-gradient(180deg, #fbbf24, #f59e0b);
  color: #451a03;
  box-shadow: 0 8px 18px rgba(245, 158, 11, .30), inset 0 0 0 1px rgba(255, 255, 255, .25);
}

.state-button.status-damaged.active {
  border-color: #dc2626;
  background: linear-gradient(180deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 8px 18px rgba(220, 38, 38, .28), inset 0 0 0 1px rgba(255, 255, 255, .22);
}

.state-button.status-missing.active {
  border-color: #64748b;
  background: linear-gradient(180deg, #94a3b8, #64748b);
  color: #fff;
  box-shadow: 0 8px 18px rgba(100, 116, 139, .24), inset 0 0 0 1px rgba(255, 255, 255, .20);
}

.component-zone-header.flow-entry,
.component-zone-header.flow-exit {
  display: grid;
  grid-template-columns: 32px 1fr auto auto;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  color: #0f172a;
  letter-spacing: 0;
  text-transform: none;
}

.component-zone-header.flow-entry:first-child,
.component-zone-header.flow-exit:first-child {
  margin-top: 0;
}

.component-zone-header.flow-entry .zone-header-icon,
.component-zone-header.flow-exit .zone-header-icon {
  width: 16px;
  height: 16px;
}

.component-zone-header.flow-entry > .zone-header-icon,
.component-zone-header.flow-exit > .zone-header-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 7px;
  border-radius: 10px;
}

.component-zone-header.flow-entry > .zone-header-icon {
  background: #ccfbf1;
  color: #0f766e;
}

.component-zone-header.flow-exit > .zone-header-icon {
  background: #e0f2fe;
  color: #0369a1;
}

.component-zone-header span {
  display: grid;
  gap: 2px;
}

.component-zone-header strong {
  font-size: .84rem;
  font-weight: 950;
}

.component-zone-header small {
  color: #64748b;
  font-size: .7rem;
  font-weight: 750;
  line-height: 1.25;
}

.component-zone-header b {
  min-width: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: .72rem;
  text-align: center;
}

.component-edit-row {
  grid-template-columns: minmax(170px, 1.2fr) minmax(220px, 1.4fr) minmax(92px, .75fr) 70px 70px 82px;
}

@media (max-width: 980px) {
  .component-edit-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .edit-preview,
  .delete-component {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .component-zone-header.flow-entry,
  .component-zone-header.flow-exit {
    grid-template-columns: 30px 1fr auto;
  }

  .component-zone-header.flow-entry .zone-alert-dot,
  .component-zone-header.flow-exit .zone-alert-dot {
    grid-column: 1 / -1;
    width: 100%;
    height: 3px;
    border-radius: 999px;
  }

  .component-zone-header small {
    display: none;
  }

  .component-edit-row {
    grid-template-columns: 1fr;
  }
}
