:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --panel-soft: #f9fbfc;
  --ink: #14202b;
  --muted: #66727f;
  --line: #dbe3ea;
  --line-strong: #c8d3dc;
  --teal: #247b7b;
  --blue: #2f6fba;
  --green: #2f855a;
  --amber: #b7791f;
  --red: #c53030;
  --violet: #6b46c1;
  --shadow: 0 18px 40px rgba(20, 32, 43, 0.08);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 22px 16px;
  background: #ffffff;
  border-right: 1px solid var(--line);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #d7eeee;
  color: #185c5c;
  font-weight: 800;
}

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

.brand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #344252;
  text-align: left;
}

.nav-item svg,
.icon-button svg,
.text-button svg,
.action-card svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.nav-item.active,
.nav-item:hover {
  background: #eef8f8;
  border-color: #c7e7e7;
  color: #185c5c;
}

.side-status {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.side-status strong,
.side-status span {
  display: block;
}

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

.pulse {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(47, 133, 90, 0.14);
}

.main {
  min-width: 0;
  padding: 22px;
}

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

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

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

h1 {
  font-size: 27px;
  line-height: 1.2;
}

h2 {
  font-size: 18px;
  line-height: 1.3;
}

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

.search-form {
  display: grid;
  grid-template-columns: 34px minmax(130px, 190px);
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.search-submit {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
}

.search-submit svg {
  width: 17px;
  height: 17px;
}

.search-form input {
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 0;
}

.search-form input:focus {
  outline: 0;
  border-color: transparent;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.segment {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.segment.active {
  background: var(--teal);
  color: #ffffff;
}

.icon-button,
.text-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #243342;
}

.icon-button {
  width: 38px;
  padding: 0;
}

.text-button {
  padding: 0 12px;
}

.text-button.ghost {
  background: #f7fafc;
}

.primary-button {
  padding: 0 14px;
  border: 1px solid #185c5c;
  border-radius: 8px;
  background: var(--teal);
  color: #ffffff;
  font-weight: 800;
}

.primary-button svg {
  width: 18px;
  height: 18px;
}

.icon-button:hover,
.text-button:hover,
.primary-button:hover,
.action-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 8px 24px rgba(20, 32, 43, 0.08);
}

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

.quick-action {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
}

.quick-action svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.quick-action strong,
.quick-action small {
  display: block;
}

.quick-action strong {
  font-size: 14px;
}

.quick-action small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.quick-action:hover {
  border-color: var(--line-strong);
  box-shadow: 0 8px 24px rgba(20, 32, 43, 0.08);
}

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

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

.metric-card {
  padding: 15px;
}

.metric-card span,
.metric-card small {
  display: block;
}

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

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

.metric-card small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

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

.left-stack,
.right-stack {
  display: grid;
  gap: 14px;
}

.panel {
  min-width: 0;
  padding: 16px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #f4f0ff;
  color: var(--violet);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.green {
  background: #e8f5ee;
  color: var(--green);
}

.stage-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(94px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.stage-item {
  min-height: 74px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.stage-item strong,
.stage-item span {
  display: block;
}

.stage-item strong {
  font-size: 22px;
  line-height: 1;
}

.stage-item span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.table-shell {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.jobs-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  table-layout: fixed;
}

.jobs-table th:nth-child(1),
.jobs-table td:nth-child(1) {
  width: 24%;
}

.jobs-table th:nth-child(2),
.jobs-table td:nth-child(2) {
  width: 14%;
}

.jobs-table th:nth-child(3),
.jobs-table td:nth-child(3) {
  width: 20%;
}

.jobs-table th:nth-child(4),
.jobs-table td:nth-child(4) {
  width: 27%;
}

.jobs-table th:nth-child(5),
.jobs-table td:nth-child(5) {
  width: 15%;
}

.jobs-table th,
.jobs-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.jobs-table th {
  background: #f7fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.jobs-table tr:last-child td {
  border-bottom: 0;
}

.jobs-table tbody tr {
  cursor: pointer;
}

.jobs-table tbody tr.selected,
.jobs-table tbody tr:hover {
  background: #eef8f8;
}

.vehicle-cell {
  display: grid;
  gap: 3px;
}

.vehicle-cell strong {
  font-size: 14px;
}

.vehicle-cell span,
.muted {
  color: var(--muted);
  font-size: 12px;
}

.state-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.state-badge.diagnosi {
  background: #e8f1ff;
  color: var(--blue);
}

.state-badge.preventivo {
  background: #fff4de;
  color: var(--amber);
}

.state-badge.ricambi {
  background: #f4f0ff;
  color: var(--violet);
}

.state-badge.lavorazione {
  background: #eafafa;
  color: var(--teal);
}

.state-badge.qualita,
.state-badge.pronta {
  background: #e8f5ee;
  color: var(--green);
}

.state-badge.ritardo {
  background: #ffeaea;
  color: var(--red);
}

.checkin-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(280px, 1fr);
  gap: 14px;
}

.camera-tile {
  position: relative;
  overflow: hidden;
  min-height: 248px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #e7edf2;
}

.camera-tile img {
  width: 100%;
  height: 100%;
  min-height: 248px;
  object-fit: cover;
  display: block;
}

.plate-readout {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(20, 32, 43, 0.16);
}

.plate-readout span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.plate-readout strong {
  font-size: 22px;
  line-height: 1;
}

.checkin-form {
  display: grid;
  gap: 12px;
  align-content: start;
}

.checkin-form label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 8px;
}

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

input,
select {
  min-height: 38px;
  padding: 0 11px;
}

input {
  text-transform: uppercase;
}

textarea {
  display: block;
  min-height: 92px;
  padding: 10px 11px;
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(36, 123, 123, 0.22);
  border-color: var(--teal);
}

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

.action-card {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 54px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.action-card span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.form-result {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #c7e7e7;
  border-radius: 8px;
  background: #eef8f8;
  color: #185c5c;
  font-size: 13px;
}

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

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

.file-action {
  position: relative;
  cursor: pointer;
}

.file-action input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

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

.evidence-empty,
.evidence-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.evidence-empty {
  grid-template-columns: 1fr;
  color: var(--muted);
  font-size: 13px;
}

.evidence-thumb {
  display: grid;
  place-items: center;
  width: 44px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.evidence-thumb svg {
  width: 18px;
  height: 18px;
}

.evidence-item strong,
.evidence-item span {
  display: block;
}

.evidence-item strong {
  font-size: 13px;
  font-weight: 400;
}

.evidence-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.office-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.55fr) minmax(0, 1.45fr);
  gap: 16px;
  align-items: start;
}

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.section-label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.section-label strong {
  color: var(--teal);
  font-size: 13px;
}

.office-queue-list {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.office-queue-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 74px;
  padding: 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.office-queue-item:last-child {
  border-bottom: 0;
}

.office-queue-item.active,
.office-queue-item:hover {
  background: #eef8f8;
}

.office-queue-item strong,
.office-queue-item span,
.office-queue-item small {
  display: block;
}

.office-queue-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.office-queue-item small {
  color: var(--muted);
  font-size: 12px;
}

.office-form {
  display: grid;
  gap: 14px;
}

.office-selected {
  display: grid;
  gap: 9px;
  padding: 13px;
  border: 1px solid #c7e7e7;
  border-radius: 8px;
  background: #eef8f8;
}

.office-selected strong,
.office-selected span {
  display: block;
}

.office-selected strong {
  font-size: 17px;
}

.office-selected span {
  color: #315e62;
  font-size: 13px;
}

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

.field-grid label,
.full-field {
  display: grid;
  gap: 7px;
}

.field-grid span,
.full-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.channel-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.channel-row label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #243342;
  font-size: 13px;
}

.channel-row input {
  width: 15px;
  height: 15px;
  min-height: 0;
  padding: 0;
  accent-color: var(--teal);
}

.office-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.mechanic-intro {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #c7e7e7;
  border-radius: 8px;
  background: #eef8f8;
}

.mechanic-intro strong,
.mechanic-intro span {
  display: block;
}

.mechanic-intro span {
  color: #315e62;
  font-size: 13px;
  line-height: 1.45;
}

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

.mechanic-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 74px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-decoration: none;
}

.mechanic-link:hover {
  border-color: #b8dddd;
  box-shadow: 0 8px 24px rgba(20, 32, 43, 0.08);
}

.mechanic-link svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--teal);
}

.mechanic-link strong,
.mechanic-link small {
  display: block;
}

.mechanic-link small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.call-list,
.notification-list,
.routing-rule-list,
.channel-grid {
  display: grid;
  gap: 10px;
}

.switchboard-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
  align-items: start;
}

.realtime-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.realtime-copy {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.realtime-copy strong,
.realtime-copy span {
  display: block;
}

.realtime-copy strong {
  font-weight: 400;
}

.realtime-copy span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.realtime-log {
  display: grid;
  gap: 8px;
  max-height: 180px;
  margin-top: 12px;
  overflow: auto;
}

.realtime-log:empty {
  display: none;
}

.realtime-log-item {
  display: grid;
  gap: 4px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.realtime-log-item span {
  color: var(--muted);
  font-size: 11px;
}

.realtime-log-item strong {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
}

.switchboard-form {
  display: grid;
  gap: 14px;
}

.preset-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.switchboard-result {
  display: grid;
  gap: 12px;
  min-height: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.switchboard-route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.switchboard-route span,
.switchboard-route strong,
.switchboard-facts span,
.switchboard-facts strong,
.routing-rule strong,
.routing-rule span,
.channel-card strong,
.channel-card span {
  display: block;
}

.switchboard-route span,
.switchboard-facts span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.switchboard-route strong {
  font-size: 14px;
  font-weight: 400;
}

.switchboard-route.ai {
  background: #ffffff;
}

.switchboard-route.operator {
  background: #ffffff;
  border-style: dashed;
}

.switchboard-greeting {
  font-size: 20px;
  line-height: 1.25;
  font-weight: 400;
}

.switchboard-result p {
  margin: 0;
  color: #202020;
  font-size: 14px;
  line-height: 1.5;
}

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

.switchboard-facts div {
  min-height: 62px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.switchboard-facts strong {
  margin-top: 5px;
  font-size: 13px;
  font-weight: 400;
}

.call-card,
.notification,
.routing-rule,
.channel-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
}

.call-top,
.notification-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.call-top strong,
.notification-top strong {
  display: block;
}

.call-top span,
.notification-top span {
  color: var(--muted);
  font-size: 12px;
}

.intent {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e8f1ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.intent.call-green {
  background: #e8f7ef;
  color: #197047;
}

.intent.call-yellow {
  background: #fff7df;
  color: #8a5b00;
}

.intent.call-red {
  background: #ffe8e5;
  color: #a8271e;
}

.call-card p,
.notification p {
  margin: 0;
  color: #324253;
  font-size: 13px;
  line-height: 1.45;
}

.call-route {
  margin-bottom: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
}

.call-route.yellow {
  border-style: dashed;
}

.call-route.green {
  background: #f6fbf8;
}

.call-route.red {
  border-color: #a8271e;
  background: #fff5f3;
}

.routing-rule span,
.channel-card span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.call-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.mini-button {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #243342;
  font-size: 13px;
}

.customer-card {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
}

.case-panel {
  display: grid;
  gap: 12px;
}

.case-summary,
.case-next,
.case-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.case-summary {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.case-vehicle strong,
.case-vehicle span,
.case-mini-grid span,
.case-mini-grid strong,
.case-next span,
.case-next strong,
.case-note strong,
.case-note span {
  display: block;
}

.case-vehicle strong {
  font-size: 20px;
  line-height: 1.2;
}

.case-vehicle span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

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

.case-mini-grid div {
  min-height: 58px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.case-mini-grid span,
.case-next span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.case-mini-grid strong {
  margin-top: 5px;
  font-size: 13px;
  font-weight: 400;
}

.case-next {
  display: grid;
  gap: 7px;
  padding: 13px;
}

.case-next strong {
  font-size: 15px;
  font-weight: 400;
}

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

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

.case-actions .action-card {
  min-height: 58px;
  text-decoration: none;
}

.case-note {
  display: grid;
  gap: 4px;
  padding: 12px;
}

.case-note strong {
  font-size: 13px;
  font-weight: 400;
}

.case-note span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.customer-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.customer-main strong {
  display: block;
  font-size: 17px;
}

.customer-main span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.eta-box {
  display: grid;
  gap: 2px;
  min-width: 86px;
  padding: 8px;
  border-radius: 8px;
  background: #ffffff;
  text-align: center;
}

.eta-box span {
  margin: 0;
  font-size: 11px;
  text-transform: uppercase;
}

.eta-box strong {
  font-size: 14px;
}

.portal-open-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 34px;
  margin-bottom: 12px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
}

.portal-open-link svg {
  width: 17px;
  height: 17px;
}

.agenda-layout,
.estimate-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
  align-items: start;
}

.agenda-board {
  display: grid;
  gap: 12px;
}

.agenda-list,
.mechanic-update-list,
.automation-list,
.integration-grid,
.estimate-card,
.estimate-actions {
  display: grid;
  gap: 10px;
}

.agenda-item,
.mechanic-update,
.automation-item,
.integration-item,
.estimate-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
}

.agenda-item strong,
.agenda-item span,
.mechanic-update strong,
.mechanic-update span,
.automation-item strong,
.automation-item span,
.integration-item strong {
  display: block;
}

.agenda-item span,
.mechanic-update span,
.automation-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.agenda-item p,
.mechanic-update p,
.integration-item p,
.estimate-card p {
  margin: 8px 0 0;
  color: #324253;
  font-size: 13px;
  line-height: 1.45;
}

.agenda-form {
  display: grid;
  gap: 14px;
}

.estimate-head,
.estimate-line,
.estimate-total,
.automation-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.estimate-head {
  align-items: center;
}

.estimate-head strong,
.estimate-head span {
  display: block;
}

.estimate-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.estimate-lines {
  display: grid;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.estimate-line span,
.estimate-total span {
  color: var(--muted);
  font-size: 13px;
}

.estimate-line strong,
.estimate-total strong {
  white-space: nowrap;
}

.estimate-total {
  align-items: center;
}

.estimate-total strong {
  font-size: 24px;
}

.estimate-actions .action-card {
  text-decoration: none;
}

.mechanic-update.empty,
.agenda-item.empty {
  color: var(--muted);
}

.automation-item small {
  flex: 0 0 auto;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 12px;
  white-space: nowrap;
}

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

.integration-status {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  margin-bottom: 10px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 12px;
}

.timeline {
  list-style: none;
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.timeline li {
  position: relative;
  display: grid;
  gap: 4px;
  min-height: 52px;
  padding-left: 28px;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: #ffffff;
}

.timeline li.done::before {
  border-color: var(--green);
  background: var(--green);
}

.timeline li.current::before {
  border-color: var(--teal);
  box-shadow: 0 0 0 5px rgba(36, 123, 123, 0.12);
}

.timeline li::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 20px;
  width: 2px;
  height: calc(100% - 12px);
  background: var(--line);
}

.timeline li:last-child::after {
  display: none;
}

.timeline strong,
.timeline span {
  display: block;
}

.timeline strong {
  font-size: 13px;
}

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

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(380px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid #c7e7e7;
  border-radius: 8px;
  background: #eef8f8;
  color: #185c5c;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

[data-panel] {
  display: block;
}

body:not([class^="section-"]) [data-panel]:not([data-panel~="dashboard"]) {
  display: none;
}

body[class^="section-"] .quick-actions,
body[class^="section-"] .metric-grid {
  display: none;
}

body.section-pratiche [data-panel]:not([data-panel~="pratiche"]),
body.section-ufficio [data-panel]:not([data-panel~="ufficio"]),
body.section-agenda [data-panel]:not([data-panel~="agenda"]),
body.section-preventivi [data-panel]:not([data-panel~="preventivi"]),
body.section-checkin [data-panel]:not([data-panel~="checkin"]),
body.section-meccanici [data-panel]:not([data-panel~="meccanici"]),
body.section-centralino [data-panel]:not([data-panel~="centralino"]),
body.section-portale [data-panel]:not([data-panel~="portale"]),
body.section-ops [data-panel]:not([data-panel~="ops"]) {
  display: none;
}

body.section-pratiche .workspace,
body.section-ufficio .workspace,
body.section-agenda .workspace,
body.section-preventivi .workspace,
body.section-checkin .workspace,
body.section-meccanici .workspace,
body.section-centralino .workspace,
body.section-portale .workspace,
body.section-ops .workspace {
  grid-template-columns: minmax(0, 1fr);
}

body.section-pratiche .right-stack,
body.section-agenda .right-stack,
body.section-preventivi .right-stack,
body.section-checkin .right-stack,
body.section-meccanici .right-stack,
body.section-centralino .left-stack,
body.section-portale .left-stack,
body.section-ops .left-stack,
body.section-ops .right-stack {
  display: contents;
}

@media (max-width: 1200px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

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

  .notifications-panel {
    grid-column: 1 / -1;
  }

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

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    gap: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow-x: auto;
  }

  .nav-item {
    justify-content: center;
    min-width: 86px;
    padding: 0 8px;
  }

  .nav-item span {
    display: none;
  }

  .side-status {
    display: none;
  }

  .main {
    padding: 16px;
  }

  .topbar {
    display: grid;
  }

  .topbar-actions {
    justify-content: start;
  }

  .search-form {
    width: 100%;
    grid-template-columns: 34px minmax(0, 1fr);
  }

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

  .checkin-grid,
  .office-layout,
  .switchboard-layout,
  .realtime-layout,
  .agenda-layout,
  .estimate-layout,
  .right-stack {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  h1 {
    font-size: 23px;
  }

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

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

  .segmented {
    width: 100%;
  }

  .segment {
    flex: 1;
    padding: 0 8px;
  }

  .panel {
    padding: 13px;
  }

  .panel-header {
    display: grid;
  }

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

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

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

  .case-actions,
  .case-mini-grid,
  .switchboard-facts {
    grid-template-columns: 1fr;
  }

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

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

  .mechanic-link-grid {
    grid-template-columns: 1fr;
  }

  .table-shell {
    overflow: visible;
    border: 0;
  }

  .jobs-table {
    display: block;
    min-width: 0;
  }

  .jobs-table thead {
    display: none;
  }

  .jobs-table tbody {
    display: grid;
    gap: 8px;
  }

  .jobs-table tr {
    display: grid;
    grid-template-columns: 1fr;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
  }

  .jobs-table tbody tr.selected,
  .jobs-table tbody tr:hover {
    background: #ffffff;
    border-color: #b8dddd;
  }

  .jobs-table td {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    width: auto !important;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
  }

  .jobs-table td:last-child {
    border-bottom: 0;
  }

  .jobs-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .vehicle-cell {
    min-width: 0;
  }

  .state-badge {
    width: fit-content;
    max-width: 100%;
    white-space: normal;
  }
}

/* Minimal monochrome skin */
:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-soft: #ffffff;
  --ink: #050505;
  --muted: #4d4d4d;
  --line: #000000;
  --line-strong: #000000;
  --teal: #000000;
  --blue: #000000;
  --green: #000000;
  --amber: #000000;
  --red: #000000;
  --violet: #000000;
  --shadow: none;
}

body {
  background: #ffffff;
  color: #050505;
  font-weight: 300;
}

h1,
h2,
strong,
.brand strong,
.metric-card strong,
.stage-item strong,
.vehicle-cell strong,
.customer-main strong,
.office-selected strong,
.office-queue-item strong {
  font-weight: 400;
}

.eyebrow,
.jobs-table th,
.section-label span,
.field-grid span,
.full-field span,
.status-pill,
.state-badge,
.intent {
  font-weight: 400;
}

.sidebar,
.metric-card,
.quick-action,
.search-form,
.search-submit,
.case-summary,
.case-next,
.case-note,
.case-mini-grid div,
.realtime-copy,
.realtime-log-item,
.switchboard-result,
.switchboard-route,
.switchboard-facts div,
.routing-rule,
.channel-card,
.call-route,
.panel,
.stage-item,
.table-shell,
.jobs-table th,
.jobs-table td,
.camera-tile,
.form-result,
.evidence-panel,
.evidence-empty,
.evidence-item,
.evidence-thumb,
.mechanic-intro,
.mechanic-link,
.call-card,
.notification,
.customer-card,
.eta-box,
.office-queue-list,
.office-queue-item,
.office-selected,
.channel-row label,
.side-status,
.icon-button,
.text-button,
.primary-button,
.action-card,
input,
select,
textarea,
.segmented,
.status-pill,
.state-badge,
.intent,
.mini-button,
.toast {
  border-color: #000000;
  box-shadow: none;
}

.portal-open-link,
.agenda-item,
.mechanic-update,
.automation-item,
.integration-item,
.estimate-card,
.automation-item small,
.integration-status {
  border-color: #000000;
  box-shadow: none;
}

.brand-mark,
.nav-item.active,
.nav-item:hover,
.segment.active,
.form-result,
.evidence-panel,
.evidence-empty,
.evidence-item,
.evidence-thumb,
.mechanic-intro,
.office-selected,
.office-queue-item.active,
.office-queue-item:hover,
.jobs-table tbody tr.selected,
.jobs-table tbody tr:hover,
.stage-item,
.jobs-table th,
.call-card,
.notification,
.customer-card,
.eta-box,
.status-pill,
.state-badge,
.intent,
.toast {
  background: #ffffff;
  color: #050505;
}

.portal-open-link,
.agenda-item,
.mechanic-update,
.automation-item,
.integration-item,
.estimate-card,
.automation-item small,
.integration-status {
  background: #ffffff;
  color: #050505;
}

.segment.active,
.primary-button {
  background: #050505;
  border-color: #050505;
  color: #ffffff;
}

.primary-button:hover {
  background: #000000;
  color: #ffffff;
}

.quick-action:hover {
  border-color: #000000;
  box-shadow: none;
}

.brand-mark {
  border: 1px solid #000000;
}

.pulse {
  background: #000000;
  box-shadow: none;
}

.status-pill,
.state-badge,
.intent {
  border: 1px solid #000000;
}

.state-badge.diagnosi,
.state-badge.preventivo,
.state-badge.ricambi,
.state-badge.lavorazione,
.state-badge.qualita,
.state-badge.pronta,
.state-badge.ritardo,
.status-pill.green {
  background: #ffffff;
  color: #050505;
}

.plate-readout {
  background: #ffffff;
  border: 1px solid #000000;
  box-shadow: none;
}

.timeline li::before {
  border-color: #000000;
}

.timeline li.done::before,
.timeline li.current::before {
  background: #000000;
  border-color: #000000;
  box-shadow: none;
}

.timeline li::after {
  background: #000000;
}
