/* Fanan Job Orders – look and feel.
   Colours are defined once here; change them to restyle the whole app. */
:root {
  --fanan-red: #e0322b;
  --fanan-red-dark: #c0241e;
  --fanan-red-soft: #fdecec;
  --ink: #0f1b3d;          /* headings, main text */
  --ink-2: #4a5470;        /* secondary text */
  --muted: #8a92a8;        /* hints */
  --line: #e7e9f0;         /* borders */
  --page: #f6f7fb;         /* page background */
  --card: #ffffff;
  --sidebar-w: 248px;
  --topbar-h: 76px;  /* the logo area uses the same height, so their bottom lines meet */
  --radius: 14px;

  --blue: #2563eb;   --blue-soft: #e8f0fe;
  --purple: #7c3aed; --purple-soft: #f1eafe;
  --green: #16a34a;  --green-soft: #e7f7ed;
  --amber: #d97706;  --amber-soft: #fef3e2;
  --red-soft: #fdecec;

  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-color: var(--ink);
  --bs-border-color: var(--line);
}

body { background: var(--page); color: var(--ink); font-size: .935rem; }
h1, h2, h3, h4, h5 { color: var(--ink); font-weight: 700; letter-spacing: -.01em; }
a { color: var(--ink); }
.text-muted { color: var(--muted) !important; }
.text-secondary { color: var(--ink-2) !important; }

/* ---------- Layout: sidebar + main ---------- */
.app-sidebar { width: var(--sidebar-w); background: var(--card); border-right: 1px solid var(--line); }
@media (min-width: 992px) {
  .app-sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 1030; }
  .app-main { margin-left: var(--sidebar-w); }
}
.app-main { min-height: 100vh; }

.logo { display: flex; flex-direction: column; align-items: center; justify-content: center; height: var(--topbar-h); padding: 0 1.5rem; margin-bottom: .75rem; border-bottom: 1px solid var(--line); text-decoration: none; }
.logo-img { width: 172px; max-width: 100%; height: auto; }
.logo-badge { display: inline-block; background: #fff; border-radius: 14px; padding: .75rem 1rem; }
.logo-badge img { width: 210px; height: auto; display: block; }

.side-nav { padding: .5rem .75rem; }
.side-nav .nav-link {
  display: flex; align-items: center; gap: .85rem; color: var(--ink-2); font-weight: 500;
  padding: .7rem .9rem; border-radius: 10px; margin-bottom: .2rem;
}
.side-nav .nav-link i { font-size: 1.15rem; }
.side-nav .nav-link:hover { background: var(--page); color: var(--ink); }
.side-nav .nav-link.active { background: var(--fanan-red-soft); color: var(--fanan-red); font-weight: 600; }
.side-nav .nav-badge { margin-left: auto; background: var(--fanan-red); color: #fff; font-size: .7rem; border-radius: 99px; padding: .1rem .45rem; }
.side-footer { border-top: 1px solid var(--line); padding: 1rem; font-size: .8rem; color: var(--muted); }

.topbar { background: var(--page); height: var(--topbar-h); padding: 0 1.5rem; display: flex; align-items: center; gap: .75rem; }
/* The top bar stays in place while the page scrolls; links to #sections stop below it */
.topbar { position: sticky; top: 0; z-index: 1020; border-bottom: 1px solid var(--line); transition: box-shadow .2s; }
.topbar.is-scrolled { box-shadow: 0 4px 14px rgba(15, 27, 61, .05); }
html { scroll-padding-top: 90px; }
.topbar-search { position: relative; flex: 1; max-width: 440px; margin-left: auto; }
.topbar-search i { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.topbar-search input { padding-left: 2.4rem; border-radius: 10px; border-color: var(--line); height: 42px; background: var(--card); }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--ink); position: relative; font-size: 1.2rem; }
.icon-btn:hover { background: var(--card); }
.icon-btn .dot { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--fanan-red); color: #fff; font-size: .68rem; font-weight: 600; display: flex; align-items: center; justify-content: center; border: 2px solid var(--page); }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; font-size: .9rem; border: 0; }
.content { padding: 1.25rem 1.5rem 2rem; }
@media (max-width: 575.98px) { .content, .topbar { padding-left: 1rem; padding-right: 1rem; } }

.crumbs { font-size: .82rem; color: var(--muted); margin-bottom: .25rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.page-title { font-size: 1.75rem; margin-bottom: 1rem; }

/* ---------- Buttons ---------- */
.btn { border-radius: 10px; font-weight: 600; padding: .55rem 1rem; }
.btn-sm { padding: .35rem .7rem; border-radius: 8px; }
.btn-fanan { background: var(--fanan-red); border-color: var(--fanan-red); color: #fff; }
.btn-fanan:hover, .btn-fanan:focus { background: var(--fanan-red-dark); border-color: var(--fanan-red-dark); color: #fff; }
.btn-outline-ink { border: 1.5px solid var(--ink); color: var(--ink); background: var(--card); }
.btn-outline-ink:hover { background: var(--ink); color: #fff; }

/* ---------- Cards ---------- */
.card-x { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.card-x .card-x-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.card-x .card-x-head h2 { font-size: 1.05rem; margin: 0; display: flex; align-items: center; gap: .55rem; }
.card-x .card-x-body { padding: 1.1rem 1.25rem; }
.link-more { font-size: .82rem; text-decoration: none; color: var(--ink-2); font-weight: 500; }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat-card { display: flex; gap: .75rem; align-items: flex-start; padding: 1.1rem 1.15rem; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; position: relative; }
.stat-card:hover { border-color: #cfd3e0; box-shadow: 0 4px 14px rgba(15, 27, 61, .06); color: inherit; }
.stat-card.selected { border-color: var(--fanan-red); box-shadow: 0 0 0 3px var(--fanan-red-soft); }
.stat-icon { width: 46px; height: 46px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.stat-label { font-size: .85rem; color: var(--ink-2); font-weight: 500; }
.stat-value { font-size: 1.85rem; font-weight: 800; line-height: 1.15; }
.stat-hint { font-size: .78rem; color: var(--muted); }
.stat-card .chev { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted); }

/* Colour themes used by icons, pills and badges */
.tone-red    { background: var(--red-soft);    color: var(--fanan-red); }
.tone-blue   { background: var(--blue-soft);   color: var(--blue); }
.tone-purple { background: var(--purple-soft); color: var(--purple); }
.tone-green  { background: var(--green-soft);  color: var(--green); }
.tone-amber  { background: var(--amber-soft);  color: var(--amber); }
.tone-gray   { background: #eef0f5;            color: var(--ink-2); }

/* Stage colours */
.stage-reception          { background: var(--blue-soft);   color: var(--blue); }
.stage-coordinator        { background: var(--amber-soft);  color: var(--amber); }
.stage-designer           { background: var(--purple-soft); color: var(--purple); }
.stage-production_manager { background: var(--red-soft);    color: var(--fanan-red); }
.stage-delivery           { background: #e6f6f8;            color: #0e7490; }
.stage-completed  { background: var(--green-soft);  color: var(--green); }

.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .28rem .65rem; border-radius: 99px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.status { display: inline-block; padding: .28rem .7rem; border-radius: 8px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.status-success { background: var(--green-soft);  color: var(--green); }
.status-danger  { background: var(--red-soft);    color: var(--fanan-red); }
.status-warning { background: var(--amber-soft);  color: var(--amber); }
.status-info    { background: #fff4e5;            color: #c2410c; }

/* ---------- Orders table ---------- */
.orders-table { margin: 0; }
.orders-table th { font-size: .8rem; font-weight: 600; color: var(--ink-2); background: #fafbfd; border-bottom: 1px solid var(--line); padding: .8rem 1rem; white-space: nowrap; }
.orders-table td { padding: .85rem 1rem; vertical-align: middle; border-color: var(--line); }
.orders-table tbody tr { cursor: pointer; }
.orders-table tbody tr:hover td { background: #fafbfd; }
.orders-table tr.row-sent-back td:first-child { box-shadow: inset 4px 0 0 var(--fanan-red); }
.job-no { font-weight: 600; white-space: nowrap; }
.mini-track { display: flex; gap: 3px; width: 92px; }
.mini-track span { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.mini-track span.done { background: var(--green); }
.mini-track span.current { background: var(--fanan-red); }

/* Mobile order cards */
.order-card { display: block; padding: 1rem; margin-bottom: .75rem; text-decoration: none; color: inherit; }
.order-card.sent-back { border-left: 4px solid var(--fanan-red); }

/* ---------- Workflow stepper ---------- */
.stepper { display: flex; align-items: flex-start; }
.stepper .step { flex: 1; position: relative; }
.stepper .step-head { display: flex; align-items: center; }
.stepper .step-dot { width: 40px; height: 40px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 700; background: #eef0f5; color: var(--ink-2); }
.stepper .step-line { flex: 1; height: 2px; background: var(--line); margin: 0 .6rem; }
.stepper .step:last-child .step-line { display: none; }
.stepper .done .step-dot, .stepper .current .step-dot { background: var(--fanan-red); color: #fff; }
.stepper .done .step-line, .stepper .skipped .step-line { background: var(--fanan-red); }
.stepper .step-title { font-weight: 600; margin-top: .55rem; font-size: .9rem; }
.stepper .step-state { font-size: .78rem; color: var(--muted); }
.stepper .current .step-state { color: var(--fanan-red); font-weight: 500; }
@media (max-width: 575.98px) {
  .stepper .step-title { font-size: .72rem; }
  .stepper .step-state { display: none; }
  .stepper .step-dot { width: 32px; height: 32px; font-size: .85rem; }
}

/* ---------- Activity timeline ---------- */
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; gap: .85rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.activity li:last-child { border-bottom: 0; }
.activity .a-icon, .notif-urgent .a-icon, .settings-log-entry .a-icon { width: 34px; height: 34px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; }
.activity .a-text { font-size: .875rem; font-weight: 500; }
.activity .a-meta { font-size: .78rem; color: var(--muted); }
.activity .a-time { margin-left: auto; font-size: .76rem; color: var(--muted); white-space: nowrap; }
.activity .a-note { font-size: .82rem; color: var(--ink-2); margin-top: .15rem; }

/* ---------- Forms ---------- */
.form-control, .form-select { border-radius: 10px; border-color: #dfe2ea; padding: .55rem .8rem; }
.form-control:focus, .form-select:focus { border-color: var(--fanan-red); box-shadow: 0 0 0 3px var(--fanan-red-soft); }
.form-control:disabled { background: #f3f4f8; }
.form-label { font-weight: 500; color: var(--ink-2); }
.form-check-input:checked { background-color: var(--fanan-red); border-color: var(--fanan-red); }
.section-icon { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; }
.cost-table { width: 100%; }
.cost-table td { padding: .35rem 0; vertical-align: middle; }
.cost-total { background: #fafbfd; border-radius: 10px; padding: .75rem 1rem; display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.cost-total .amount { font-size: 1.35rem; }
.action-bar { position: sticky; bottom: 0; z-index: 10; background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem; display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; box-shadow: 0 -6px 20px rgba(15, 27, 61, .06); }

/* Filter bar */
.filter-bar { padding: .75rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.filter-bar .form-select, .filter-bar .form-control { width: auto; min-width: 120px; }
.filter-bar input[type=search] { min-width: 200px; }
.filter-bar .date-range { width: auto; flex-wrap: nowrap; }
.filter-bar .date-range .input-group-text { background: #fafbfd; border-color: #dfe2ea; color: var(--ink-2); font-size: .85rem; }
.filter-bar .date-range .form-control { min-width: 135px; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .75rem; border-radius: 99px; border: 1px solid var(--line); background: var(--card); font-size: .82rem; font-weight: 500; color: var(--ink-2); text-decoration: none; }
.chip:hover { border-color: #cfd3e0; color: var(--ink); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Empty states */
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty i { font-size: 2.4rem; color: var(--green); }

/* Login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-art { background: var(--ink); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art::after { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; background: var(--fanan-red); opacity: .9; right: -140px; bottom: -140px; }
.login-art h1 { color: #fff; font-size: 2.2rem; max-width: 420px; position: relative; z-index: 1; }
.login-art p { color: #c7cbe0; max-width: 380px; position: relative; z-index: 1; }
.login-art .flow { display: flex; gap: .5rem; flex-wrap: wrap; position: relative; z-index: 1; }
.login-art .flow span { background: rgba(255, 255, 255, .1); border-radius: 99px; padding: .35rem .8rem; font-size: .85rem; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--card); }
.login-form form { width: 100%; max-width: 360px; }
@media (max-width: 991.98px) { .login-wrap { grid-template-columns: 1fr; } .login-art { display: none; } }

/* Alerts */
.alert { border-radius: 12px; border: 0; }

/* Dashboard: one card per role plus Completed, all on one row on wide screens */
@media (min-width: 1200px) {
  .stat-grid-stages { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .75rem; }
  .stat-grid-stages .stat-card { flex-direction: column; gap: .5rem; padding: 1rem; }
  .stat-grid-stages .chev { top: 1.4rem; transform: none; }
}

/* Phones: compact stat cards, two per row */
@media (max-width: 575.98px) {
  .stat-grid { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .stat-card { padding: .75rem; gap: .6rem; }
  .stat-icon { width: 34px; height: 34px; font-size: 1rem; }
  .stat-value { font-size: 1.4rem; }
  .stat-label { font-size: .78rem; }
  .stat-hint, .stat-card .chev { display: none; }
  .page-title { font-size: 1.4rem; }
}

/* Waiting time and "pending too long" */
.status-muted { background: #eef0f5; color: var(--ink-2); }
.waiting { color: var(--ink-2); font-weight: 500; }
.waiting.stuck { color: var(--fanan-red); font-weight: 700; }
.alert-stuck { background: var(--red-soft); color: var(--fanan-red-dark); display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.alert-stuck i { font-size: 1.3rem; }
.stat-hint.stuck { color: var(--fanan-red); font-weight: 600; }
.time-row { display: grid; grid-template-columns: 110px 1fr 70px; align-items: center; gap: .6rem; padding: .3rem 0; font-size: .85rem; }
.time-bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.time-bar span { display: block; height: 100%; background: var(--ink); border-radius: 4px; }
.time-row.current .time-bar span { background: var(--fanan-red); }
.time-row .t { text-align: right; font-weight: 600; white-space: nowrap; }

/* ---------- Animations ---------- */
/* Bell: a gentle ring every few seconds while there are unread notifications. */
@keyframes bell-ring {
  0%, 30%, 100% { transform: rotate(0); }
  3% { transform: rotate(16deg); }
  7% { transform: rotate(-14deg); }
  11% { transform: rotate(10deg); }
  15% { transform: rotate(-8deg); }
  19% { transform: rotate(4deg); }
  23% { transform: rotate(-2deg); }
}
.bell.has-unread i { display: inline-block; transform-origin: 50% 4px; animation: bell-ring 4s ease-in-out infinite; }
.bell.ring-now i { animation: bell-ring 1.4s ease-in-out 2; }

/* Red count badges: a soft ripple. */
@keyframes ripple {
  0% { box-shadow: 0 0 0 0 rgba(224, 50, 43, .45); }
  70% { box-shadow: 0 0 0 8px rgba(224, 50, 43, 0); }
  100% { box-shadow: 0 0 0 0 rgba(224, 50, 43, 0); }
}
.icon-btn .dot, .side-nav .nav-badge { animation: ripple 2s ease-out infinite; }

/* Delayed jobs: pulsing badge and a turning hourglass. */
.status-delayed { background: var(--red-soft); color: var(--fanan-red); animation: ripple 2s ease-out infinite; }
@keyframes hourglass {
  0%, 40% { transform: rotate(0); }
  50%, 90% { transform: rotate(180deg); }
  100% { transform: rotate(360deg); }
}
.waiting.stuck i, .alert-stuck > i, .stat-card.is-alert .stat-icon i { display: inline-block; animation: hourglass 3s ease-in-out infinite; }
@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224, 50, 43, 0); }
  50% { box-shadow: 0 0 0 4px rgba(224, 50, 43, .15); }
}
.alert-stuck { animation: glow 2.5s ease-in-out infinite; }
.stat-hint.stuck::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--fanan-red); margin-right: 5px; vertical-align: 1px; animation: ripple 2s ease-out infinite; }

/* Respect the "reduce motion" setting on phones and computers. */
@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; }
}

/* Running total in the bottom button bar */
.bar-total { display: flex; align-items: center; gap: .4rem; font-size: .9rem; color: var(--ink-2); }
.bar-total strong { color: var(--ink); font-size: 1.05rem; }
@media (max-width: 575.98px) { .action-bar .bar-total { width: 100%; justify-content: space-between; } }

/* Notes per stage */
.note { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 0 10px 10px 0; padding: .65rem .85rem; margin-bottom: .6rem; background: #fcfcfe; }
.note-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .35rem; }
.note-text { font-size: .9rem; white-space: normal; }
.stage-border-reception { border-left-color: var(--blue); }
.stage-border-coordinator { border-left-color: var(--amber); }
.stage-border-designer { border-left-color: var(--purple); }
.stage-border-production_manager { border-left-color: var(--fanan-red); }
.stage-border-delivery { border-left-color: #0e7490; }

/* Reports */
.report-table th, .report-table td { white-space: nowrap; font-size: .85rem; }
.report-table td.wrap { white-space: normal; min-width: 160px; }
.kv { display: grid; grid-template-columns: minmax(110px, 40%) 1fr; gap: .45rem 1rem; font-size: .9rem; }
.kv dt, .kv dd { padding-bottom: .45rem; border-bottom: 1px dashed var(--line); }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; padding-bottom: 0; }
.kv dt { color: var(--ink-2); font-weight: 500; }
.kv dd { margin: 0; word-break: break-word; }
.history-table td { vertical-align: top; font-size: .85rem; }

/* Printing / Save as PDF: only the report itself */
@media print {
  .app-sidebar, .topbar, .no-print, .alert { display: none !important; }
  .app-main { margin-left: 0 !important; }
  body { background: #fff; font-size: 11px; }
  .content { padding: 0; }
  .card-x { border: 1px solid #ccc; }
  .history-table tr { break-inside: avoid; }
  .stat-grid { grid-template-columns: repeat(4, 1fr) !important; gap: .5rem; }
  .stat-card { padding: .6rem; }
  .stat-value { font-size: 1.2rem; }
  /* Cards size to their own content on paper (no stretching), and never split across pages. */
  .h-100 { height: auto !important; }
  .report-details { display: grid !important; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 10px 0 !important; }
  .report-details > div { width: auto !important; max-width: none !important; padding: 0 !important; margin: 0 !important; break-inside: avoid; page-break-inside: avoid; }
  .note, .stat-card { break-inside: avoid; page-break-inside: avoid; }
  .card-x-head { break-after: avoid; page-break-after: avoid; }  /* a heading stays with its content */
  .card-x { margin-bottom: 10px !important; }
  .time-row { grid-template-columns: 130px 1fr 60px; }
  a { text-decoration: none; color: inherit; }
  @page { size: A4; margin: 12mm; }
}

/* Copies and attachments: one row per box */
.file-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; align-items: center; gap: .75rem; padding: .7rem 1.25rem; border-bottom: 1px solid var(--line); }
.file-row:last-child { border-bottom: 0; }
.file-row-info { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; min-width: 0; }
.file-name { font-weight: 500; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row-actions { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; align-self: start; }
.file-row-actions .btn { white-space: nowrap; }
.file-row.drag-over { background: var(--fanan-red-soft); outline: 2px dashed var(--fanan-red); outline-offset: -4px; }
/* A box can hold several files: one line each */
.file-list { display: flex; flex-direction: column; width: 100%; min-width: 0; }
.file-list:empty { display: none; }
.file-item { display: flex; align-items: center; gap: .6rem; padding: .4rem 0; min-width: 0; }
.file-item + .file-item { border-top: 1px dashed var(--line); }
.file-item-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.file-item-actions { display: flex; gap: .35rem; flex: none; }
.upload-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin: .25rem 0 .15rem; }
.upload-bar span { display: block; height: 100%; width: 0; background: var(--fanan-red); border-radius: 3px; transition: width .2s; }
/* "Take photo" only on phones and tablets (touch screens) */
.touch-only { display: none !important; }
@media (pointer: coarse) { .touch-only { display: inline-flex !important; align-items: center; gap: .25rem; } }
@media (max-width: 575.98px) {
  .file-row { grid-template-columns: 1fr auto; }
  .file-row-info { grid-column: 1 / -1; grid-row: 2; }
}

/* Start work */
.status-notstarted { background: #eef0f5; color: var(--ink-2); }
.work-banner { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: .8rem 1rem; border-radius: 12px; margin-bottom: 1rem; background: #eef0f5; color: var(--ink-2); }
.work-banner > i { font-size: 1.3rem; }
.work-banner.started { background: var(--blue-soft); color: #1e40af; }

/* Pagination */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; margin-top: 1rem; font-size: .85rem; }
.pager-sizes, .pager-pages { display: flex; align-items: center; gap: .3rem; }
.pager-btn { min-width: 32px; height: 32px; padding: 0 .55rem; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink-2); text-decoration: none; font-weight: 500; }
.pager-btn:hover { border-color: #cfd3e0; color: var(--ink); }
.pager-btn.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.pager-gap { padding: 0 .2rem; color: var(--muted); }

/* Skipping roles */
.forward-control { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; border-top: 1px dashed var(--line); padding-top: .6rem; }
.send-to-title { font-weight: 600; font-size: .85rem; color: var(--ink-2); }
.send-to-pills { display: inline-flex; flex-wrap: wrap; gap: .3rem; }
.send-pill { position: relative; margin: 0; padding: .3rem .7rem; border: 1px solid var(--line); border-radius: 99px; background: var(--card);
  font-size: .82rem; font-weight: 500; color: var(--ink-2); cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, color .12s; }
.send-pill:hover { border-color: #cfd3e0; color: var(--ink); }
.send-pill input { position: absolute; opacity: 0; pointer-events: none; }
.send-pill:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--fanan-red-soft); }
.send-pill:has(input:checked) { color: #fff; font-weight: 600; }
.stage-card-coordinator:has(input:checked) { background: var(--amber); border-color: var(--amber); }
.stage-card-designer:has(input:checked) { background: var(--purple); border-color: var(--purple); }
.stage-card-production_manager:has(input:checked) { background: var(--fanan-red); border-color: var(--fanan-red); }
.stage-card-delivery:has(input:checked) { background: #0e7490; border-color: #0e7490; }
.forward-control .js-skip-reason { width: 230px; flex: 0 1 230px; }
.stepper .skipped .step-dot, .stepper .not_needed .step-dot { background: repeating-linear-gradient(45deg, #eef0f5, #eef0f5 4px, #e2e5ec 4px, #e2e5ec 8px); color: var(--muted); }
.stepper .skipped .step-title, .stepper .not_needed .step-title { color: var(--muted); text-decoration: line-through; }
.mini-track span.skipped, .mini-track span.not_needed { background: repeating-linear-gradient(90deg, var(--line), var(--line) 3px, transparent 3px, transparent 5px); }

.time-row.skipped > span:first-child { color: var(--muted); text-decoration: line-through; }
.time-row.skipped .t { color: var(--muted); font-weight: 500; font-style: italic; }
.time-row.skipped .time-bar { background: repeating-linear-gradient(90deg, var(--line), var(--line) 3px, transparent 3px, transparent 5px); }

/* Send back dialog */
.came-from-note { display: flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--ink-2); background: #f3f5f9; border-radius: 10px; padding: .5rem .75rem; margin-bottom: .9rem; }
.back-pill { padding: .4rem .8rem; }
.modal .send-to-pills { display: flex; }
.stage-card-reception:has(input:checked) { background: var(--blue); border-color: var(--blue); }

/* ---------- One colour per role: soft pastel shades ----------
   For each role:  --c-ROLE        soft pastel  (bars, outlines, selected buttons, stripes)
                   --c-ROLE-soft   very light   (label / icon backgrounds, hover)
                   --c-ROLE-text   darker shade (text, so it stays readable)
                   --c-ROLE-strong main colour  (dots, sidebar edge, avatar, icons)
   Change a role's values here and it updates everywhere. */
:root {
  --c-reception: #93c5fd; --c-reception-soft: #e0edff; --c-reception-text: #1d4ed8; --c-reception-strong: #2563eb;  /* blue */
  --c-coordinator: #fca48a; --c-coordinator-soft: #ffe6de; --c-coordinator-text: #b4472a; --c-coordinator-strong: #ee7350;  /* coral */
  --c-designer: #c4b0f7; --c-designer-soft: #efe7fd; --c-designer-text: #6b3fc4; --c-designer-strong: #8b5cf6;  /* purple */
  --c-production_manager: #fcd34d; --c-production_manager-soft: #fef6d6; --c-production_manager-text: #8a6514; --c-production_manager-strong: #dfae3a;  /* yellow */
  --c-delivery: #5eead4; --c-delivery-soft: #d9f7f2; --c-delivery-text: #0f766e; --c-delivery-strong: #0d9488;  /* teal */
  --c-completed: #86efac; --c-completed-soft: #ddf8e6; --c-completed-text: #15803d; --c-completed-strong: #16a34a;  /* green */
}
.stage-reception { background: var(--c-reception-soft); color: var(--c-reception-text); }
.stage-coordinator { background: var(--c-coordinator-soft); color: var(--c-coordinator-text); }
.stage-designer { background: var(--c-designer-soft); color: var(--c-designer-text); }
.stage-production_manager { background: var(--c-production_manager-soft); color: var(--c-production_manager-text); }
.stage-delivery { background: var(--c-delivery-soft); color: var(--c-delivery-text); }
.stage-completed { background: var(--c-completed-soft); color: var(--c-completed-text); }
.stage-border-reception { border-left-color: var(--c-reception); }
.stage-border-coordinator { border-left-color: var(--c-coordinator); }
.stage-border-designer { border-left-color: var(--c-designer); }
.stage-border-production_manager { border-left-color: var(--c-production_manager); }
.stage-border-delivery { border-left-color: var(--c-delivery); }

/* Send to next / Send back buttons: soft outline, pastel fill when chosen, dark text */
.send-pill { border-width: 1.5px; }
.stage-card-reception { --role: var(--c-reception); --role-soft: var(--c-reception-soft); --role-text: var(--c-reception-text); }
.stage-card-coordinator { --role: var(--c-coordinator); --role-soft: var(--c-coordinator-soft); --role-text: var(--c-coordinator-text); }
.stage-card-designer { --role: var(--c-designer); --role-soft: var(--c-designer-soft); --role-text: var(--c-designer-text); }
.stage-card-production_manager { --role: var(--c-production_manager); --role-soft: var(--c-production_manager-soft); --role-text: var(--c-production_manager-text); }
.stage-card-delivery { --role: var(--c-delivery); --role-soft: var(--c-delivery-soft); --role-text: var(--c-delivery-text); }
.stage-card-completed { --role: var(--c-completed); --role-soft: var(--c-completed-soft); --role-text: var(--c-completed-text); }
.send-pill[class*="stage-card-"] { border-color: var(--role); color: var(--role-text); background: var(--card); }
.send-pill[class*="stage-card-"]:hover { background: var(--role-soft); color: var(--role-text); }
.send-pill[class*="stage-card-"]:has(input:checked) { background: var(--role); border-color: var(--role); color: var(--role-text); }
.send-pill[class*="stage-card-"]:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--role-soft); }

/* Role colours in Time taken dots and history */
.time-row.role-reception { --dot: var(--c-reception-strong); }
.role-icon-reception { background: var(--c-reception-soft); color: var(--c-reception-text); }
.history-table tr.role-row-reception td:first-child { box-shadow: inset 4px 0 0 var(--c-reception); }
.time-row.role-coordinator { --dot: var(--c-coordinator-strong); }
.role-icon-coordinator { background: var(--c-coordinator-soft); color: var(--c-coordinator-text); }
.history-table tr.role-row-coordinator td:first-child { box-shadow: inset 4px 0 0 var(--c-coordinator); }
.time-row.role-designer { --dot: var(--c-designer-strong); }
.role-icon-designer { background: var(--c-designer-soft); color: var(--c-designer-text); }
.history-table tr.role-row-designer td:first-child { box-shadow: inset 4px 0 0 var(--c-designer); }
.time-row.role-production_manager { --dot: var(--c-production_manager-strong); }
.role-icon-production_manager { background: var(--c-production_manager-soft); color: var(--c-production_manager-text); }
.history-table tr.role-row-production_manager td:first-child { box-shadow: inset 4px 0 0 var(--c-production_manager); }
.time-row.role-delivery { --dot: var(--c-delivery-strong); }
.role-icon-delivery { background: var(--c-delivery-soft); color: var(--c-delivery-text); }
.history-table tr.role-row-delivery td:first-child { box-shadow: inset 4px 0 0 var(--c-delivery); }
.time-row.role-completed { --dot: var(--c-completed-strong); }
.role-icon-completed { background: var(--c-completed-soft); color: var(--c-completed-text); }
.history-table tr.role-row-completed td:first-child { box-shadow: inset 4px 0 0 var(--c-completed); }
.time-row.current > span:first-child { font-weight: 700; }
.role-tag { display: inline-block; padding: .05rem .5rem; border-radius: 99px; font-size: .78rem; font-weight: 600; vertical-align: 1px; }

/* Time taken: a small dot in the role colour before each name; skipped roles get a grey dot */
.time-row[class*="role-"] > span:first-child { position: relative; padding-left: 16px; }
.time-row[class*="role-"] > span:first-child::before { content: ""; position: absolute; left: 0; top: .45em; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--muted)); }
.time-row.skipped > span:first-child::before { background: var(--line); }

/* Role theme: each role's screens carry its colour (strip at the top, role badge, menu, avatar, My jobs banner) */
.theme-reception { --theme: var(--c-reception); --theme-soft: var(--c-reception-soft); --theme-text: var(--c-reception-text); --theme-strong: var(--c-reception-strong); }
.theme-coordinator { --theme: var(--c-coordinator); --theme-soft: var(--c-coordinator-soft); --theme-text: var(--c-coordinator-text); --theme-strong: var(--c-coordinator-strong); }
.theme-designer { --theme: var(--c-designer); --theme-soft: var(--c-designer-soft); --theme-text: var(--c-designer-text); --theme-strong: var(--c-designer-strong); }
.theme-production_manager { --theme: var(--c-production_manager); --theme-soft: var(--c-production_manager-soft); --theme-text: var(--c-production_manager-text); --theme-strong: var(--c-production_manager-strong); }
.theme-delivery { --theme: var(--c-delivery); --theme-soft: var(--c-delivery-soft); --theme-text: var(--c-delivery-text); --theme-strong: var(--c-delivery-strong); }
/* The left menu is tinted in the role colour, with a coloured edge and a solid role box at the bottom */
.role-theme .app-sidebar { background: var(--theme-soft); border-right: 3px solid var(--theme-strong); }
.role-theme .side-nav .nav-link:hover { background: rgba(255, 255, 255, .6); color: var(--theme-text); }
.role-theme .side-nav .nav-link.active { background: #fff; color: var(--theme-text); box-shadow: inset 3px 0 0 var(--theme-strong), 0 1px 3px rgba(15, 27, 61, .06); border-radius: 0 10px 10px 0; }
.role-theme .side-footer { background: var(--theme); border-top: 0; color: var(--theme-text); display: flex; align-items: center; gap: .65rem; }
.role-theme .side-footer .fw-semibold { color: var(--theme-text) !important; }
.side-footer-icon { width: 36px; height: 36px; border-radius: 10px; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; background: var(--theme-strong); color: #fff; }
.role-theme .avatar { background: var(--theme-strong); }
.role-theme .stat-card.selected { border-color: var(--theme-strong); box-shadow: 0 0 0 3px var(--theme-soft); }
.role-badge { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .85rem; border-radius: 99px; background: var(--theme-soft); color: var(--theme-text); border: 1px solid var(--theme); font-weight: 600; font-size: .88rem; white-space: nowrap; }
@media (max-width: 575.98px) { .role-badge { padding: .4rem .6rem; } .role-badge .role-badge-text { display: none; } }
.role-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; border-radius: 16px; background: var(--theme-soft, var(--card)); border: 1px solid var(--theme, var(--line)); border-left: 6px solid var(--theme-strong, var(--line)); }
.role-banner-icon { width: 48px; height: 48px; border-radius: 12px; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem; background: var(--theme-strong, var(--ink)); color: #fff; }
.role-banner-role { font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--theme-text, var(--muted)); }
@media print { .role-badge { display: none; } }

/* "Dispatched": Delivery picked the job up and still has to deliver it (brown, unlike any role colour) */
:root { --c-dispatched: #d6b49a; --c-dispatched-soft: #f5ebe1; --c-dispatched-text: #7c4a2b; --c-dispatched-strong: #a86b45; }
.status-dispatched, .tag-dispatched, .tone-dispatched { background: var(--c-dispatched-soft); color: var(--c-dispatched-text); }
.text-dispatched { color: var(--c-dispatched-text) !important; }
.btn-dispatched { background: var(--c-dispatched-strong); border-color: var(--c-dispatched-strong); color: #fff; }
.btn-dispatched:hover, .btn-dispatched:focus { background: var(--c-dispatched-text); border-color: var(--c-dispatched-text); color: #fff; }
.role-icon-dispatched { background: var(--c-dispatched-soft); color: var(--c-dispatched-text); }

/* The admin login: its own dark navy theme and badge, so it's clear at a glance */
.theme-admin { --theme: #b9c0d6; --theme-soft: #e9ecf4; --theme-text: #0f1b3d; --theme-strong: #0f1b3d; }
.alert-admin { background: #e9ecf4; color: #0f1b3d; border: 1px solid #b9c0d6; }

/* ---------- Settings (admin only) ---------- */
.settings-tabs { display: flex; flex-wrap: wrap; gap: .35rem; border-bottom: 1px solid var(--line); }
.settings-tabs a { padding: .55rem .9rem; border-radius: 10px 10px 0 0; color: var(--ink-2); text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.settings-tabs a:hover { color: var(--ink); background: var(--card); }
.settings-tabs a.active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.settings-card { position: relative; display: flex; gap: 1rem; align-items: flex-start; padding: 1.25rem 2.5rem 1.25rem 1.25rem; text-decoration: none; color: inherit; transition: box-shadow .15s, transform .15s; }
.settings-card:hover { box-shadow: 0 8px 24px rgba(15, 27, 61, .08); transform: translateY(-1px); color: inherit; }
.settings-card h2 { font-size: 1.1rem; margin: 0 0 .25rem; }
.settings-card p { color: var(--ink-2); font-size: .9rem; margin: 0 0 .5rem; }
.settings-card .chev { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.settings-card-fact { font-size: .82rem; font-weight: 600; color: var(--ink); }
.settings-help { display: flex; gap: .75rem; padding: .85rem 1rem; border-radius: 12px; background: #eef4ff; border: 1px solid #d6e4ff; color: #1e3a6e; font-size: .9rem; }
.settings-help > i { font-size: 1.15rem; margin-top: .05rem; }
.settings-section { border-top: 1px dashed var(--line); margin-top: 1.25rem; padding-top: 1.1rem; }
.settings-preview { display: flex; align-items: center; gap: .5rem; padding: .6rem .85rem; border-radius: 10px; background: var(--page); font-size: .9rem; }
.settings-advanced { display: flex; gap: .75rem; padding: .85rem 1rem; border-radius: 12px; border: 1px dashed var(--line); color: var(--ink-2); font-size: .88rem; }
.settings-log-entry { display: flex; gap: .75rem; align-items: flex-start; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.settings-log-entry:last-child { border-bottom: 0; }
.role-explain { padding-left: 1.1rem; }
.role-explain li { margin-bottom: .2rem; }
.notify-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; }
.notify-sub { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: .35rem; }
.notify-line { display: flex; align-items: center; gap: .5rem; padding: .35rem 0; border-bottom: 1px dashed var(--line); }
.notify-line:last-child { border-bottom: 0; }
.notify-card[class*="role-edge-"] { border-top: 4px solid var(--edge, var(--line)); }
.role-edge-reception { --edge: var(--c-reception-strong); }
.role-edge-coordinator { --edge: var(--c-coordinator-strong); }
.role-edge-designer { --edge: var(--c-designer-strong); }
.role-edge-production_manager { --edge: var(--c-production_manager-strong); }
.role-edge-delivery { --edge: var(--c-delivery-strong); }
.pill-admin { background: #e9ecf4; color: #0f1b3d; }
.stage-card-admin { --role: #0f1b3d; --role-soft: #e9ecf4; --role-text: #0f1b3d; }
.stage-card-admin:has(input:checked) { color: #fff; }

/* Notifications: "Waiting for you" rows stand out with the role colour; other updates stay quiet */
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-urgent { display: flex; align-items: center; gap: .75rem; padding: .8rem 1.25rem; border-bottom: 1px solid var(--line);
  box-shadow: inset 4px 0 0 var(--theme-strong, var(--fanan-red)); }
.notif-urgent:last-child { border-bottom: 0; }
.notif-urgent.is-unread { background: var(--theme-soft, var(--fanan-red-soft)); }
.notif-urgent .a-text { font-weight: 600; }
.notif-text { flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.notif-count { display: inline-block; min-width: 1.6rem; padding: .05rem .5rem; border-radius: 99px; background: var(--fanan-red); color: #fff; font-size: .8rem; text-align: center; vertical-align: 2px; }
.notif-dot { font-size: .5rem; vertical-align: middle; }
.pill-mine { background: #eef0f5; color: var(--ink-2); font-size: .72rem; margin-left: .25rem; vertical-align: 1px; }

/* ---------- Graph / Table switch above the orders list ---------- */
.view-switch-bar { display: flex; justify-content: flex-end; padding: .6rem 1rem 0; }
.view-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.view-switch a { padding: .3rem .8rem; font-size: .82rem; font-weight: 500; color: var(--ink-2); text-decoration: none; display: inline-flex; gap: .35rem; align-items: center; }
.view-switch a + a { border-left: 1px solid var(--line); }
.view-switch a.active { background: var(--ink); color: #fff; }
/* Narrow phones: the From / To date filter shrinks instead of pushing the page sideways */
@media (max-width: 575.98px) {
  .filter-bar .date-range { width: 100%; }
  .filter-bar .date-range .form-control { min-width: 0; }
}

.min-w-0 { min-width: 0; }

/* ---------- Graph view: the table's columns, plus a strip of role steps under each job ---------- */
.gl { --gl-cols: 140px minmax(0, 1.3fr) minmax(0, 1.2fr) 52px 150px 130px 150px; }
.gl.with-amount { --gl-cols: 140px minmax(0, 1.3fr) minmax(0, 1.2fr) 52px 150px 130px 100px 150px; }
.gl-cols { display: grid; grid-template-columns: var(--gl-cols); column-gap: 14px; align-items: center; }
.gl-head { padding: .6rem 1.25rem; margin-top: .6rem; background: #fafbfd; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.gl-job { display: block; padding: .85rem 1.25rem 1rem; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; font-size: .9rem; }
.gl-job:last-child { border-bottom: 0; }
.gl-job:hover { background: #fafbfd; color: inherit; }
.gl-job.is-sent-back { box-shadow: inset 4px 0 0 var(--fanan-red); }
.gl-sub { font-size: .78rem; color: var(--muted); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gl-label { display: none; }
.gl-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); column-gap: 10px; margin-top: .75rem; }
.gl-step { --r-strong: #c9ced8; border-top: 5px solid var(--r-strong); padding: .45rem .6rem 0; min-height: 4.1rem; font-size: .78rem; line-height: 1.45; min-width: 0; }
.gl-step.role-reception { --r-strong: var(--c-reception-strong); }
.gl-step.role-coordinator { --r-strong: var(--c-coordinator-strong); }
.gl-step.role-designer { --r-strong: var(--c-designer-strong); }
.gl-step.role-production_manager { --r-strong: var(--c-production_manager-strong); }
.gl-step.role-delivery { --r-strong: var(--c-delivery-strong); }
.gl-step.gl-dispatched { --r-strong: var(--c-dispatched-strong); }
.gl-step.gl-delivered { --r-strong: #16a34a; }
.gl-step.gl-cancelled { --r-strong: #9aa1ad; }
.gl-step-name { display: flex; align-items: center; gap: .4rem; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gl-step-meta { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gl-step-strong { color: var(--ink); font-weight: 500; }
.gl-ok { color: #16a34a; font-size: .85rem; }
.gl-todo, .gl-skipped, .gl-not_needed { border-top-color: var(--line); }
.gl-todo .gl-step-name, .gl-skipped .gl-step-name, .gl-not_needed .gl-step-name { color: #b4b9c3; font-weight: 500; }
.gl-skipped, .gl-not_needed { border-top-style: dashed; border-top-color: #c9ced8; }
.gl-current, .gl-dispatched, .gl-delivered, .gl-cancelled { background: #f6f7fa; border-radius: 0 0 8px 8px; padding-bottom: .45rem; }
.gl-step.is-late .gl-step-name, .gl-step.is-late .gl-step-strong { color: var(--fanan-red); }
/* The soft ripple where the order has reached */
.gl-ripple { position: relative; width: 9px; height: 9px; border-radius: 50%; background: var(--r-strong); flex: none; }
.gl-ripple::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--r-strong); animation: gl-ripple 1.8s ease-out infinite; }
.gl-step.is-late .gl-ripple, .gl-step.is-late .gl-ripple::after { background: var(--fanan-red); }
@keyframes gl-ripple { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(3.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .gl-ripple::after { animation: none; } }
@media (max-width: 991.98px) {
  .gl-head { display: none; }
  .gl-cols { display: flex; flex-wrap: wrap; gap: .3rem .9rem; align-items: center; }
  .gl-cols > div:first-child { flex: 1 1 100%; }
  .gl-label { display: inline; color: var(--muted); }
  .gl-steps { grid-template-columns: 1fr; row-gap: .4rem; }
  .gl-step { min-height: 0; display: grid; grid-template-columns: 9.5rem 1fr 1fr; column-gap: .5rem; border-top-width: 0; border-left: 3px solid var(--r-strong); padding: .2rem .5rem; border-radius: 0; }
  .gl-skipped, .gl-not_needed { border-left-style: dashed; }
  .gl-current, .gl-dispatched, .gl-delivered, .gl-cancelled { border-radius: 0 8px 8px 0; }
}
.gl-cols .status { white-space: normal; display: inline-block; line-height: 1.3; }

/* Graph view: each job is its own box (with space between), details on a grey band, steps on white below */
.gl { padding-bottom: 1rem; }
.gl-head { margin-bottom: .75rem; }
.gl-job { margin: 0 1rem .75rem; padding: 0; border: 1px solid #d9dde5; border-radius: 12px; background: var(--card);
  box-shadow: 0 1px 3px rgba(15, 27, 61, .06); overflow: hidden; transition: box-shadow .15s, border-color .15s; }
.gl-job:last-child { border-bottom: 1px solid #d9dde5; }
.gl-job:hover { background: var(--card); border-color: #c3c9d4; box-shadow: 0 6px 18px rgba(15, 27, 61, .08); }
.gl-job > .gl-cols { background: #eef1f6; padding: .7rem 1.25rem; }  /* no line under the band: the grey shade alone separates it from the graph */
.gl-job > .gl-steps { margin-top: 0; padding: .75rem 1.25rem .9rem; }
.gl-job.is-sent-back { box-shadow: inset 4px 0 0 var(--fanan-red), 0 1px 3px rgba(15, 27, 61, .06); }
.gl-head { padding-left: calc(1.25rem + 1rem + 1px); padding-right: calc(1.25rem + 1rem + 1px); }
@media (max-width: 991.98px) {
  .gl-job { margin: 0 .6rem .6rem; }
  .gl-job > .gl-cols, .gl-job > .gl-steps { padding-left: .9rem; padding-right: .9rem; }
}

/* Orders lists: the customer is what people recognise, so it is the bold one; the job number is plain */
.orders-table .job-no, .gl .job-no, .order-card .job-no { font-weight: 400; color: var(--ink-2); }
.customer-name { font-weight: 700; color: var(--ink); }

/* Graph view: the current step is a light wash of its role colour with a thin pastel outline (red tones when delayed) */
.gl-step.role-reception { --r-soft: var(--c-reception-soft); --r-pastel: var(--c-reception); }
.gl-step.role-coordinator { --r-soft: var(--c-coordinator-soft); --r-pastel: var(--c-coordinator); }
.gl-step.role-designer { --r-soft: var(--c-designer-soft); --r-pastel: var(--c-designer); }
.gl-step.role-production_manager { --r-soft: var(--c-production_manager-soft); --r-pastel: var(--c-production_manager); }
.gl-step.role-delivery { --r-soft: var(--c-delivery-soft); --r-pastel: var(--c-delivery); }
.gl-step.gl-dispatched { --r-soft: var(--c-dispatched-soft); --r-pastel: var(--c-dispatched); }
.gl-step.gl-delivered { --r-soft: var(--c-completed-soft); --r-pastel: var(--c-completed); }
.gl-current, .gl-dispatched, .gl-delivered { background: var(--r-soft, #f6f7fa); box-shadow: inset 1px 0 0 var(--r-pastel), inset -1px 0 0 var(--r-pastel), inset 0 -1px 0 var(--r-pastel); }
.gl-step.is-late { --r-soft: #fdecec; --r-pastel: #f3b4b0; }
.gl-cancelled { background: #f6f7fa; }

/* Graph view: a stronger border around each job so jobs are easy to tell apart */
.gl-job, .gl-job:last-child { border: 1.5px solid #aab2c0; }
.gl-job:hover { border-color: #7f8a9c; }
.gl-job { margin-bottom: 1.5rem; }  /* more space between jobs in the Graph view */
@media (max-width: 991.98px) { .gl-job { margin-bottom: 1.1rem; } }

/* Graph view: darker border around each job */
.gl-job, .gl-job:last-child { border-color: #8d97a8; }
.gl-job:hover { border-color: #5f6b7e; }

/* TV screen (admin): the job list fills the screen exactly; the page shows one set of jobs at a time */
.tv { height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: .6rem; padding: .7rem 1.25rem .9rem; overflow: hidden; }
.tv-bar { flex: none; display: flex; align-items: center; gap: .6rem 1rem; flex-wrap: wrap; }
.tv-logo { height: 34px; width: auto; }
.tv-title { font-size: 1.15rem; font-weight: 700; margin: 0; }
.tv-bar-end { margin-left: auto; display: flex; align-items: center; gap: 1rem; }
.tv-pages { display: inline-flex; align-items: center; gap: .6rem; font-weight: 600; color: var(--ink); white-space: nowrap; }
.tv-pager { display: inline-flex; align-items: center; gap: .35rem; }
.tv-foot { flex: none; display: flex; justify-content: center; }
.tv-pager.is-single { visibility: hidden; }
.tv-nav { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; }
.tv-nav:hover, .tv-nav:focus-visible { border-color: var(--ink); }
.tv-dots { display: inline-flex; gap: 2px; }
.tv-dots button { width: 18px; height: 18px; padding: 0; border: 0; background: none; display: inline-flex; align-items: center; justify-content: center; }
.tv-dots button::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #c9ced8; }
.tv-dots button.on::before { background: var(--ink); }
.tv-dots button:hover::before { background: #7f8a9c; }
.tv-clock { color: var(--muted); white-space: nowrap; }
.tv-filters { flex: none; margin: 0; }
.tv-filters .filter-bar { border-bottom: 0 !important; }
.tv-board { flex: 1; min-height: 0; margin: 0; display: flex; flex-direction: column; overflow: hidden; }
.tv-list { flex: 1; min-height: 0; overflow: hidden; position: relative; }
.tv-more { margin: 0; padding: .4rem 1rem; color: var(--muted); font-size: .8rem; }
/* compact job boxes so more fit on the TV */
.tv .gl { padding-bottom: 0; }
.tv .gl-head { margin: 0 0 .5rem; padding-top: .45rem; padding-bottom: .45rem; }
.tv .gl-job { margin: 0 .75rem 1.1rem; }
.tv .gl-job > .gl-cols { padding: .4rem 1rem; }
.tv .gl-job > .gl-steps { padding: .4rem 1rem .5rem; }
.tv .gl-step { min-height: 0; padding: .3rem .55rem 0; line-height: 1.35; }
.tv .gl-current, .tv .gl-dispatched, .tv .gl-delivered, .tv .gl-cancelled { padding-bottom: .3rem; }
.tv .gl-sub { line-height: 1.3; }
/* bigger text in the Graph view on the TV, easy to read from across the room */
.tv .gl { --gl-cols: 165px minmax(0, 1.3fr) minmax(0, 1.2fr) 60px 175px 150px 175px; }
.tv .gl.with-amount { --gl-cols: 165px minmax(0, 1.3fr) minmax(0, 1.2fr) 60px 175px 150px 115px 175px; }
.tv .gl-job { font-size: 1.08rem; }
.tv .gl-head { font-size: .82rem; }
.tv .gl-sub { font-size: .9rem; }
.tv .gl-job .pill, .tv .gl-job .status { font-size: .92rem; }
.tv .gl-step { font-size: .92rem; }
.tv .gl-ok { font-size: 1rem; }
.tv .gl-ripple { width: 11px; height: 11px; }
.tv .orders-table td { padding-top: 1.05rem; padding-bottom: 1.05rem; font-size: 1.05rem; }  /* bigger rows, easy to read from across the room */
.tv .orders-table th { font-size: .9rem; }
@media (max-width: 575.98px) {
  .tv { padding: .6rem 16px; }
  .tv-logo, .tv-clock { display: none; }
}
