:root {
  --th-primary: #0d4f8b;
  --th-primary-dark: #093b69;
  --th-accent: #1597e4;
  --th-bg: #f4f6f9;
}

body { background: var(--th-bg); }

.th-navbar { background: linear-gradient(90deg, var(--th-primary-dark), var(--th-primary)); }
.th-navbar .navbar-brand { display: inline-flex; align-items: center; gap: .55rem; }
/* Coppola logo sits on a white chip so the red/yellow mark stays crisp on the dark navbar */
.th-brand-logo { height: 45px; width: auto; background: #fff; padding: 4px 11px; border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.th-brand-word { font-weight: 600; letter-spacing: .3px; }
/* Customer header: company denomination centered, large + bold */
.th-customer-name { font-size: 1.6rem; letter-spacing: .3px; white-space: nowrap; pointer-events: none;
  max-width: 56%; overflow: hidden; text-overflow: ellipsis; text-align: center; }

/* Landing tier chooser */
.th-hero { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--th-primary-dark), var(--th-accent)); }
.th-tile { transition: transform .12s ease, box-shadow .12s ease; border: none; }
.th-tile:hover { transform: translateY(-4px); box-shadow: 0 .8rem 2rem rgba(0,0,0,.18); }
.th-tile .fa-solid { color: var(--th-primary); }

/* Auth cards */
.th-auth-card { max-width: 420px; margin: 8vh auto; border: none; box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.12); }
.th-auth-logo { height: 60px; width: auto; }

/* Status badges — the 5 lifecycle states (+ ANOMALIA for negative outcomes) */
.th-status { font-weight: 600; letter-spacing: .2px; }
.th-status.IN_PIANIFICAZIONE { background: #eceff3; color: #5a6573; }
.th-status.PIANIFICATA       { background: #e8e7ff; color: #4b46c0; }
.th-status.IN_VIAGGIO        { background: #e7f1ff; color: #0b5ed7; }
.th-status.IN_PIATTAFORMA    { background: #fff1d6; color: #9a6400; }
.th-status.CONSEGNATA        { background: #d8f5e3; color: #0f8a4d; }
.th-status.ANOMALIA          { background: #ffe2e2; color: #c92a2a; }

.th-row-anomaly { box-shadow: inset 3px 0 0 #c92a2a; }

table.th-grid { background: #fff; }
table.th-grid tbody tr { cursor: pointer; }
table.th-grid tbody tr:hover { background: #f0f6fd; }
.th-grid th { font-size: .78rem; text-transform: uppercase; letter-spacing: .4px; color: #6b7480; white-space: nowrap; }
.th-grid td { vertical-align: middle; }
/* Multi-line cells: primary line + a smaller muted sub-line */
.th-cell-main { font-weight: 600; line-height: 1.15; }
.th-sub { font-size: .76rem; color: #7a828d; line-height: 1.12; }
.th-num { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.th-grid th.th-num { text-align: right; }

.th-card { border: none; box-shadow: 0 .25rem .9rem rgba(0,0,0,.07); }
.th-kv { display: grid; grid-template-columns: 150px 1fr; gap: .25rem .75rem; }
.th-kv dt { color: #6b7480; font-weight: 500; }
.th-kv dd { margin: 0; font-weight: 500; }

/* Public tracking page */
.th-track-wrap { max-width: 680px; margin: 5vh auto; }
.th-track-hero { background: linear-gradient(135deg, var(--th-primary-dark), var(--th-accent)); color: #fff;
  border-radius: 1rem 1rem 0 0; padding: 1.5rem 1.5rem 1.25rem; }
.th-track-hero .th-status { font-size: .95rem; padding: .45rem .8rem; }
/* compact horizontal stepper */
.th-steps { display: flex; gap: 0; margin: 0; padding: 0; list-style: none; }
.th-steps li { flex: 1; text-align: center; position: relative; font-size: .72rem; color: #98a0ab; padding-top: 1.7rem; }
.th-steps li::before { content: ''; position: absolute; top: 8px; left: 50%; width: 14px; height: 14px; margin-left: -7px;
  border-radius: 50%; background: #dfe4ea; border: 2px solid #fff; box-shadow: 0 0 0 1px #dfe4ea; z-index: 2; }
.th-steps li::after { content: ''; position: absolute; top: 14px; left: -50%; width: 100%; height: 2px; background: #dfe4ea; z-index: 1; }
.th-steps li:first-child::after { display: none; }
.th-steps li.done { color: #0f8a4d; }
.th-steps li.done::before { background: #0f8a4d; box-shadow: 0 0 0 1px #0f8a4d; }
.th-steps li.done::after { background: #0f8a4d; }
.th-steps li.current { color: var(--th-primary); font-weight: 700; }
.th-steps li.current::before { background: var(--th-accent); box-shadow: 0 0 0 3px rgba(21,151,228,.25); }
.th-steps li.anomaly.current::before { background: #c92a2a; box-shadow: 0 0 0 3px rgba(201,42,42,.22); }
.th-steps li.anomaly.current { color: #c92a2a; }
.th-fact-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem 1.25rem; }
.th-fact-grid .th-fact .lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .4px; color: #8a929d; }
.th-fact-grid .th-fact .val { font-weight: 600; }
.th-fact-grid .th-fact.full { grid-column: 1 / -1; }
.th-timeline { list-style: none; padding-left: 0; }
.th-timeline li { position: relative; padding: 0 0 1rem 1.75rem; border-left: 2px solid #dfe4ea; }
.th-timeline li::before { content: ''; position: absolute; left: -7px; top: 2px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--th-accent); }
.th-timeline li.done::before { background: #0f8a4d; }
.th-timeline li.anomaly::before { background: #c92a2a; }

.th-pod-link { white-space: nowrap; }
.copyable { cursor: pointer; }
