/* =====================================================================
   Sunday Shrimps — prototype design system
   Navy primary · white surface · orange accent · status colours
   ===================================================================== */
:root {
  --ss-navy: #0b2a6f;
  --ss-navy-900: #001a56;
  --ss-navy-700: #173a8a;
  --ss-orange: #f77f00;
  --ss-orange-ink: #b45309;
  --ss-purple: #7c3aed;
  --ss-green: #16a34a;
  --ss-teal: #0d9488;
  --ss-blue: #2563eb;
  --ss-red: #dc2626;
  --ss-indigo: #4f46e5;
  --ss-gray: #64748b;

  --ss-bg: #f3f5fa;
  --ss-surface: #ffffff;
  --ss-border: #e6eaf2;
  --ss-ink: #0f1c3f;
  --ss-ink-2: #475069;
  --ss-muted: #7a839b;
  --ss-radius: 16px;
  --ss-radius-sm: 10px;
  --ss-shadow: 0 1px 2px rgba(15, 28, 63, .04), 0 6px 20px rgba(15, 28, 63, .05);
  --ss-shadow-lg: 0 10px 40px rgba(15, 28, 63, .12);
  --ss-sidebar-w: 268px;

  --bs-body-font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-color: var(--ss-ink);
  --bs-body-bg: var(--ss-bg);
  --bs-primary: var(--ss-navy);
  --bs-primary-rgb: 11, 42, 111;
  --bs-link-color: var(--ss-navy-700);
  --bs-link-hover-color: var(--ss-orange-ink);
  --bs-border-color: var(--ss-border);
}

body { background: var(--ss-bg); color: var(--ss-ink); font-size: .925rem; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6 { color: var(--ss-ink); font-weight: 700; letter-spacing: -.01em; }
a { text-decoration: none; }
.text-muted { color: var(--ss-muted) !important; }
.small-caps { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--ss-muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; }
.fw-800 { font-weight: 800; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Colour utilities ---------- */
.c-navy { --c: var(--ss-navy); --c-soft: #e7ecf8; }
.c-orange { --c: var(--ss-orange-ink); --c-soft: #fff1e0; --c-solid: var(--ss-orange); }
.c-purple { --c: var(--ss-purple); --c-soft: #f1eafe; }
.c-green { --c: var(--ss-green); --c-soft: #e6f6ec; }
.c-teal { --c: var(--ss-teal); --c-soft: #e2f5f3; }
.c-blue { --c: var(--ss-blue); --c-soft: #e8effd; }
.c-red { --c: var(--ss-red); --c-soft: #fdecec; }
.c-indigo { --c: var(--ss-indigo); --c-soft: #eceafd; }
.c-gray { --c: var(--ss-gray); --c-soft: #eef1f5; }
.tint { background: var(--c-soft); color: var(--c); }
.ink { color: var(--c); }
.solid { background: var(--c-solid, var(--c)); color: #fff; }

/* ---------- Buttons ---------- */
.btn { border-radius: 10px; font-weight: 600; padding: .55rem 1rem; font-size: .875rem; }
.btn-sm { padding: .35rem .7rem; font-size: .8rem; border-radius: 8px; }
.btn-lg { padding: .8rem 1.4rem; font-size: 1rem; border-radius: 12px; }
.btn-primary { --bs-btn-bg: var(--ss-navy); --bs-btn-border-color: var(--ss-navy); --bs-btn-hover-bg: var(--ss-navy-700); --bs-btn-hover-border-color: var(--ss-navy-700); --bs-btn-active-bg: var(--ss-navy-900); --bs-btn-disabled-bg: var(--ss-navy); }
.btn-accent { --bs-btn-color: #fff; --bs-btn-bg: var(--ss-orange); --bs-btn-border-color: var(--ss-orange); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #e06f00; --bs-btn-hover-border-color: #e06f00; --bs-btn-active-bg: #c96300; --bs-btn-active-color: #fff; --bs-btn-disabled-bg: var(--ss-orange); --bs-btn-disabled-color: #fff; box-shadow: 0 6px 16px rgba(247, 127, 0, .28); }
.btn-soft { background: #eef2fb; color: var(--ss-navy); border: 1px solid transparent; }
.btn-soft:hover { background: #e1e8f8; color: var(--ss-navy); }
.btn-outline-primary { --bs-btn-color: var(--ss-navy); --bs-btn-border-color: #cdd6ea; --bs-btn-hover-bg: var(--ss-navy); --bs-btn-hover-border-color: var(--ss-navy); }
.btn-success { --bs-btn-bg: var(--ss-green); --bs-btn-border-color: var(--ss-green); }
.btn-demo { background: repeating-linear-gradient(135deg, #fff7ed, #fff7ed 8px, #ffedd5 8px, #ffedd5 16px); color: var(--ss-orange-ink); border: 1px dashed #fdba74; }
.btn-demo:hover { color: #92400e; border-color: var(--ss-orange); }

/* ---------- Shell ---------- */
.ss-shell { display: flex; min-height: 100vh; }
.ss-sidebar {
  width: var(--ss-sidebar-w); flex-shrink: 0; position: fixed; inset: 0 auto 0 0; z-index: 1040;
  background: linear-gradient(180deg, var(--ss-navy-900) 0%, #06205f 55%, #0b2a6f 100%);
  color: rgba(255, 255, 255, .78); display: flex; flex-direction: column; transition: transform .25s ease;
}
.ss-sidebar .brand { padding: 1.1rem 1.25rem .9rem; display: block; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.ss-sidebar .brand img { height: 78px; width: auto; }
.ss-sidebar nav { overflow-y: auto; padding: .75rem .75rem 2rem; flex: 1; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.ss-nav-title { font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .42); font-weight: 700; padding: 1rem .75rem .4rem; }
.ss-nav-link {
  display: flex; align-items: center; gap: .75rem; padding: .58rem .75rem; border-radius: 10px; color: rgba(255, 255, 255, .78);
  font-weight: 500; font-size: .9rem; position: relative; width: 100%; background: none; border: 0; text-align: left;
}
.ss-nav-link i.bi:first-child { font-size: 1.05rem; width: 1.25rem; text-align: center; opacity: .9; }
.ss-nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.ss-nav-link.active { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 600; }
.ss-nav-link.active::before { content: ""; position: absolute; left: -.75rem; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--ss-orange); }
.ss-nav-link .chev { margin-left: auto; font-size: .7rem; transition: transform .2s; }
.ss-nav-link[aria-expanded="true"] .chev { transform: rotate(90deg); }
.ss-subnav { padding: .15rem 0 .35rem 2.6rem; }
.ss-subnav a { display: block; padding: .38rem .6rem; font-size: .84rem; color: rgba(255, 255, 255, .62); border-radius: 8px; }
.ss-subnav a:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.ss-subnav a.active { color: #fff; font-weight: 600; }
.ss-subnav a.active::before { content: "•"; color: var(--ss-orange); margin-left: -.8rem; margin-right: .45rem; }
/* Sidebar count badges — items waiting for this user (see App\Support\NavCounts). */
.nav-count {
  margin-left: auto; min-width: 1.35rem; height: 1.35rem; padding: 0 .4rem; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--ss-orange); color: #fff; font-size: .68rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .12);
}
.nav-count + .chev { margin-left: .5rem; }
.ss-nav-link[aria-expanded="true"] .nav-count { display: none; }   /* expanded: the children show their own counts */
.ss-subnav a:has(.nav-count) { display: flex; align-items: center; gap: .5rem; }
.ss-subnav .nav-count { min-width: 1.2rem; height: 1.2rem; font-size: .64rem; }
.ss-sidebar-foot { padding: .9rem 1.25rem; border-top: 1px solid rgba(255, 255, 255, .08); font-size: .75rem; color: rgba(255, 255, 255, .5); }

.ss-main { flex: 1; margin-left: var(--ss-sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.ss-topbar {
  position: sticky; top: 0; z-index: 1030; background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ss-border); height: 68px; display: flex; align-items: center; gap: .75rem; padding: 0 1.5rem;
}
.ss-content { padding: 1.5rem 1.75rem 7rem; max-width: 1560px; width: 100%; }
.ss-search { position: relative; flex: 1; max-width: 440px; }
.ss-search input { padding-left: 2.4rem; border-radius: 12px; background: #f3f5fa; border-color: transparent; height: 42px; }
.ss-search input:focus { background: #fff; border-color: #cdd6ea; box-shadow: 0 0 0 4px rgba(11, 42, 111, .08); }
.ss-search .bi-search { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--ss-muted); }
.ss-search-results { position: absolute; top: 48px; left: 0; right: 0; background: #fff; border-radius: 14px; box-shadow: var(--ss-shadow-lg); border: 1px solid var(--ss-border); max-height: 420px; overflow: auto; display: none; }
.ss-search-results.show { display: block; }
.ss-search-results a { display: flex; gap: .75rem; align-items: center; padding: .6rem .9rem; color: var(--ss-ink); border-bottom: 1px solid #f1f3f8; }
.ss-search-results a:hover, .ss-search-results a.focus { background: #f6f8fc; }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: #f3f5fa; color: var(--ss-ink-2); border: 0; position: relative; font-size: 1.1rem; }
.icon-btn:hover { background: #e8ecf5; color: var(--ss-navy); }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; min-width: 18px; height: 18px; font-size: .65rem; border-radius: 9px; background: var(--ss-orange); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; border: 2px solid #fff; }
.dropdown-menu { border-radius: 14px; border: 1px solid var(--ss-border); box-shadow: var(--ss-shadow-lg); padding: .4rem; }
.dropdown-item { border-radius: 8px; padding: .5rem .75rem; font-size: .875rem; }
.dropdown-item.active, .dropdown-item:active { background: var(--ss-navy); }
.ss-notif { width: 380px; max-width: 92vw; }
.ss-notif .item { display: flex; gap: .7rem; padding: .6rem .6rem; border-radius: 10px; color: var(--ss-ink); }
.ss-notif .item:hover { background: #f6f8fc; }
.user-chip { display: flex; align-items: center; gap: .6rem; padding: .25rem .5rem .25rem .25rem; border-radius: 14px; background: #f3f5fa; border: 0; }
.user-chip:hover { background: #e8ecf5; }

/* ---------- Avatars / chips ---------- */
.avatar { width: 36px; height: 36px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; flex-shrink: 0; }
.avatar-lg { width: 52px; height: 52px; border-radius: 15px; font-size: 1.05rem; }
.icon-chip { width: 44px; height: 44px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }
.icon-chip.sm { width: 34px; height: 34px; border-radius: 10px; font-size: 1rem; }
.role-chip { display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; }

/* ---------- Page header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-head h1 { font-size: 1.55rem; margin: 0; }
.page-head .subtitle { color: var(--ss-ink-2); margin-top: .25rem; }
.breadcrumb { font-size: .8rem; margin-bottom: .35rem; --bs-breadcrumb-divider-color: #b3bacb; }
.breadcrumb a { color: var(--ss-muted); }
.breadcrumb .active { color: var(--ss-ink-2); }

/* ---------- Cards ---------- */
.ss-card { background: var(--ss-surface); border: 1px solid var(--ss-border); border-radius: var(--ss-radius); box-shadow: var(--ss-shadow); }
.ss-card > .card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem 1.25rem; border-bottom: 1px solid #eef1f6; }
.ss-card > .card-head h6, .ss-card > .card-head h5 { margin: 0; font-size: .98rem; display: flex; align-items: center; gap: .55rem; }
.ss-card > .card-body { padding: 1.25rem; }
.ss-card > .card-foot { padding: .9rem 1.25rem; border-top: 1px solid #eef1f6; background: #fafbfd; border-radius: 0 0 var(--ss-radius) var(--ss-radius); }
.ss-card.hover { transition: transform .15s, box-shadow .15s; }
.ss-card.hover:hover { transform: translateY(-2px); box-shadow: var(--ss-shadow-lg); }

/* KPI tile */
.kpi { padding: 1.1rem 1.2rem; display: flex; gap: .95rem; align-items: center; height: 100%; color: inherit; }
.kpi .label { color: var(--ss-ink-2); font-size: .8rem; font-weight: 600; }
.kpi .value { font-size: 1.55rem; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; color: var(--ss-ink); font-variant-numeric: tabular-nums; }
a.kpi-link { color: inherit; display: block; height: 100%; }
a.kpi-link:hover .ss-card { box-shadow: var(--ss-shadow-lg); border-color: #d6ddec; }

/* Hero */
.hero {
  border-radius: 22px; color: #fff; padding: 1.8rem 2rem; position: relative; overflow: hidden;
  background: radial-gradient(1200px 400px at 110% -20%, rgba(247, 127, 0, .35), transparent 60%),
              linear-gradient(120deg, var(--ss-navy-900), #0b2a6f 60%, #173a8a);
}
.hero h1, .hero h2 { color: #fff; }
.hero .muted { color: rgba(255, 255, 255, .72); }
.hero::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 280px; height: 280px; border-radius: 50%; border: 40px solid rgba(255, 255, 255, .04); }
.hero-logo { height: 96px; }

/* ---------- Status badge ---------- */
.ss-badge { display: inline-flex; align-items: center; gap: .38rem; font-size: .74rem; font-weight: 700; padding: .28rem .6rem; border-radius: 999px; background: var(--c-soft); color: var(--c); white-space: nowrap; line-height: 1.2; }
.ss-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ss-badge.no-dot::before { display: none; }
.sim-label { display: inline-flex; align-items: center; gap: .3rem; font-size: .7rem; font-weight: 700; padding: .15rem .5rem; border-radius: 6px; background: #fff7ed; color: var(--ss-orange-ink); border: 1px dashed #fdba74; }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; margin: 0; font-size: .875rem; }
.table > :not(caption) > * > * { padding: .8rem 1rem; border-color: #eef1f6; vertical-align: middle; }
.table thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ss-muted); font-weight: 700; background: #fafbfd; border-bottom: 1px solid #eef1f6; white-space: nowrap; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #f7f9fd; }
.table a.ref { font-weight: 700; color: var(--ss-navy-700); }
.table a.ref:hover { color: var(--ss-orange-ink); }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: .82rem; color: var(--ss-ink-2); margin-bottom: .35rem; }
.form-control, .form-select { border-radius: 10px; border-color: #d9dfeb; padding: .58rem .8rem; font-size: .9rem; }
.form-control:focus, .form-select:focus { border-color: #8ea3d6; box-shadow: 0 0 0 4px rgba(11, 42, 111, .08); }
.form-check-input:checked { background-color: var(--ss-navy); border-color: var(--ss-navy); }
.form-section { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; color: var(--ss-navy-700); margin: .5rem 0 .9rem; display: flex; align-items: center; gap: .5rem; }
.form-section::after { content: ""; flex: 1; height: 1px; background: #e6eaf2; }
.input-group-text { border-radius: 10px; background: #f6f8fc; border-color: #d9dfeb; color: var(--ss-muted); font-size: .85rem; }
.was-filled { animation: filled .9s ease; }
@keyframes filled { 0% { background: #fff4e5; } 100% { background: #fff; } }

/* ---------- Detail list ---------- */
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem 1.5rem; }
.dl-grid .dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ss-muted); font-weight: 700; margin-bottom: .2rem; }
.dl-grid .dd { font-weight: 600; color: var(--ss-ink); word-break: break-word; }

/* ---------- Workflow progress (10 stages) ---------- */
.wf-progress { display: flex; align-items: flex-start; overflow-x: auto; padding: .25rem .25rem .5rem; gap: 0; scrollbar-width: thin; }
.wf-progress .wf-step { flex: 1; min-width: 84px; text-align: center; position: relative; }
.wf-progress .wf-step::before { content: ""; position: absolute; top: 19px; left: -50%; right: 50%; height: 3px; background: #e2e7f0; z-index: 0; }
.wf-progress .wf-step:first-child::before { display: none; }
.wf-progress .wf-dot { width: 40px; height: 40px; border-radius: 50%; margin: 0 auto .45rem; display: flex; align-items: center; justify-content: center; background: #eef1f6; color: #9aa3b8; position: relative; z-index: 1; font-size: 1.05rem; border: 3px solid #fff; box-shadow: 0 0 0 1px #e2e7f0; }
.wf-progress .wf-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #9aa3b8; }
.wf-progress .done .wf-dot { background: var(--ss-green); color: #fff; box-shadow: 0 0 0 1px var(--ss-green); }
.wf-progress .done::before, .wf-progress .current::before { background: var(--ss-green); }
.wf-progress .done .wf-label { color: var(--ss-green); }
.wf-progress .current .wf-dot { background: var(--ss-blue); color: #fff; box-shadow: 0 0 0 5px rgba(37, 99, 235, .18); animation: pulse 2s infinite; }
.wf-progress .current .wf-label { color: var(--ss-blue); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 5px rgba(37, 99, 235, .18); } 50% { box-shadow: 0 0 0 9px rgba(37, 99, 235, .06); } }

/* ---------- Horizontal flow (landing) ---------- */
.flow { display: flex; align-items: stretch; gap: .5rem; overflow-x: auto; padding-bottom: .5rem; scrollbar-width: thin; }
.flow .node { flex: 1; min-width: 104px; border-radius: 14px; padding: .9rem .6rem; text-align: center; background: var(--c-soft); color: var(--c); position: relative; transition: transform .15s; }
.flow a.node:hover { transform: translateY(-3px); }
.flow .node i { font-size: 1.5rem; display: block; margin-bottom: .35rem; }
.flow .node .t { font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.flow .arrow { display: flex; align-items: center; color: #b8c0d3; }

/* ---------- 22-step workflow board ---------- */
.step-card { border-radius: 16px; background: #fff; border: 1px solid var(--ss-border); padding: 1rem 1rem .9rem; height: 100%; display: flex; flex-direction: column; gap: .5rem; position: relative; color: inherit; transition: transform .15s, box-shadow .15s, border-color .15s; box-shadow: var(--ss-shadow); }
.step-card:hover { transform: translateY(-3px); box-shadow: var(--ss-shadow-lg); border-color: var(--c); color: inherit; }
.step-card .num { width: 34px; height: 34px; border-radius: 50%; background: var(--c-solid, var(--c)); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: .95rem; flex-shrink: 0; }
.step-card .title { font-weight: 800; font-size: .88rem; line-height: 1.25; color: var(--c); text-transform: uppercase; letter-spacing: .01em; }
.step-card .desc { font-size: .8rem; color: var(--ss-ink-2); flex: 1; }
.step-card .foot { display: flex; align-items: center; justify-content: space-between; font-size: .72rem; }
.step-card.is-done { border-top: 4px solid var(--ss-green); }
.step-card.is-current { border-top: 4px solid var(--ss-blue); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12), var(--ss-shadow); }
.step-card.is-pending { opacity: .78; }
.step-icon { font-size: 1.7rem; color: var(--c); }
.stage-band { border-radius: 14px; padding: .55rem 1rem; font-weight: 800; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; display: flex; align-items: center; gap: .5rem; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 2.4rem; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(#dfe5f0, #dfe5f0); }
.tl-item { position: relative; padding-bottom: 1.25rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: -2.4rem; top: 0; width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: .95rem; background: var(--c-soft); color: var(--c); border: 3px solid #fff; box-shadow: 0 0 0 1px #e6eaf2; }
.tl-item.pending .tl-dot { background: #f1f3f7; color: #aab2c4; }
.tl-item.pending .tl-title { color: #9aa3b8; }
.tl-title { font-weight: 700; font-size: .9rem; }
.tl-meta { font-size: .78rem; color: var(--ss-muted); }

/* ---------- Traceability journey ---------- */
.journey { position: relative; max-width: 880px; margin: 0 auto; }
.journey .j-item { display: grid; grid-template-columns: 1fr 64px 1fr; align-items: center; position: relative; }
.journey .j-item::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; transform: translateX(-50%); background: #dfe5f0; }
.journey .j-item.done::before { background: linear-gradient(var(--ss-green), var(--ss-green)); }
.journey .j-item:first-child::before { top: 50%; }
.journey .j-item:last-child::before { bottom: 50%; }
.journey .j-node { grid-column: 2; width: 54px; height: 54px; border-radius: 16px; margin: 1.1rem auto; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; background: var(--c-soft); color: var(--c); border: 4px solid #fff; box-shadow: 0 0 0 1px #e1e6ef, 0 6px 16px rgba(15, 28, 63, .08); position: relative; z-index: 1; }
.journey .j-item.pending .j-node { background: #f1f3f7; color: #b3bacb; }
.journey .j-card { background: #fff; border: 1px solid var(--ss-border); border-radius: 16px; padding: .9rem 1.1rem; box-shadow: var(--ss-shadow); }
.journey .j-item:nth-child(odd) .j-card { grid-column: 1; grid-row: 1; margin-right: .5rem; }
.journey .j-item:nth-child(even) .j-card { grid-column: 3; grid-row: 1; margin-left: .5rem; }
.journey .j-item:nth-child(odd) .j-side { grid-column: 3; grid-row: 1; padding-left: 1rem; }
.journey .j-item:nth-child(even) .j-side { grid-column: 1; grid-row: 1; text-align: right; padding-right: 1rem; }
.journey .j-label { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--c); }
.journey .j-headline { font-size: 1.12rem; font-weight: 800; color: var(--ss-ink); line-height: 1.25; }
.journey .j-item.pending .j-card { background: #fafbfd; box-shadow: none; }
.journey .j-item.pending .j-headline { color: #9aa3b8; font-weight: 600; font-size: .95rem; }
.journey .j-details { display: flex; flex-wrap: wrap; gap: .35rem .9rem; margin-top: .45rem; font-size: .76rem; color: var(--ss-ink-2); }
.journey .j-details b { color: var(--ss-muted); font-weight: 600; }
.stars { color: #f59e0b; letter-spacing: 2px; }
@media (max-width: 767.98px) {
  .journey .j-item { grid-template-columns: 56px 1fr; }
  .journey .j-item::before { left: 28px; }
  .journey .j-node { grid-column: 1 !important; width: 44px; height: 44px; font-size: 1.1rem; }
  .journey .j-item .j-card { grid-column: 2 !important; margin: .5rem 0 !important; }
  .journey .j-item .j-side { display: none; }
}

/* ---------- QR / scanner / OTP ---------- */
.qr-box { background: #fff; border: 1px solid var(--ss-border); border-radius: 14px; padding: .6rem; display: inline-block; line-height: 0; }
.qr-box svg { width: 100%; height: auto; max-width: 200px; }
.barcode svg { max-width: 100%; height: auto; }
.scanner { border-radius: 16px; background: #0b1533; color: #cfd8f3; position: relative; overflow: hidden; aspect-ratio: 4 / 3; max-height: 240px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: .5rem; }
.scanner .frame { width: 130px; height: 130px; border-radius: 16px; position: relative; background:
  linear-gradient(#f77f00, #f77f00) top left / 26px 4px no-repeat, linear-gradient(#f77f00, #f77f00) top left / 4px 26px no-repeat,
  linear-gradient(#f77f00, #f77f00) top right / 26px 4px no-repeat, linear-gradient(#f77f00, #f77f00) top right / 4px 26px no-repeat,
  linear-gradient(#f77f00, #f77f00) bottom left / 26px 4px no-repeat, linear-gradient(#f77f00, #f77f00) bottom left / 4px 26px no-repeat,
  linear-gradient(#f77f00, #f77f00) bottom right / 26px 4px no-repeat, linear-gradient(#f77f00, #f77f00) bottom right / 4px 26px no-repeat; }
.scanner .laser { position: absolute; left: 8%; right: 8%; height: 2px; background: #ff9a2e; box-shadow: 0 0 12px #ff9a2e; top: 10%; animation: laser 1.8s ease-in-out infinite alternate; }
.scanner.scanning .laser { animation-duration: .5s; }
.scanner.scanned { background: #053d2b; }
.scanner.scanned .laser { display: none; }
@keyframes laser { to { top: 88%; } }
.otp-input { letter-spacing: .6em; font-size: 1.6rem; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; padding: .55rem .5rem .55rem 1.1rem; }
.otp-reveal { border: 2px dashed #fdba74; background: #fff7ed; color: #9a3412; border-radius: 14px; padding: .7rem 1rem; }
.otp-reveal .code { font-size: 1.6rem; font-weight: 800; letter-spacing: .35em; font-variant-numeric: tabular-nums; }

/* ---------- Rating input (pure CSS stars) ---------- */
.rating { display: inline-flex; flex-direction: row-reverse; gap: .2rem; }
.rating input { position: absolute; opacity: 0; pointer-events: none; }
.rating label { font-size: 2.1rem; color: #d7dce7; cursor: pointer; line-height: 1; transition: transform .1s, color .1s; }
.rating label:hover, .rating label:hover ~ label, .rating input:checked ~ label { color: #f59e0b; }
.rating label:active { transform: scale(1.2); }
.rating input:focus-visible + label { outline: 2px solid var(--ss-blue); border-radius: 4px; }

/* ---------- Demo bar ---------- */
.demo-bar { position: fixed; left: calc(var(--ss-sidebar-w) + 1.25rem); right: 1.25rem; bottom: 1rem; z-index: 1035; background: linear-gradient(110deg, #001a56, #0b2a6f); color: #fff; border-radius: 18px; box-shadow: 0 16px 40px rgba(0, 26, 86, .35); padding: .75rem .9rem .75rem 1.2rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.demo-bar .progress { height: 6px; background: rgba(255, 255, 255, .15); border-radius: 3px; flex: 1; min-width: 120px; }
.demo-bar .progress-bar { background: var(--ss-orange); }
.demo-bar .step-pill { background: var(--ss-orange); color: #fff; font-weight: 800; border-radius: 999px; padding: .2rem .7rem; font-size: .78rem; white-space: nowrap; }
.demo-bar .btn-ghost { color: #fff; border: 1px solid rgba(255, 255, 255, .25); background: transparent; }
.demo-bar .btn-ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; }

/* ---------- Misc ---------- */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--ss-muted); }
.empty i { font-size: 2.2rem; color: #c3cad9; display: block; margin-bottom: .5rem; }
.divider-v { width: 1px; background: var(--ss-border); align-self: stretch; }
.pill-tabs { display: flex; gap: .35rem; flex-wrap: wrap; }
.pill-tabs a { padding: .4rem .8rem; border-radius: 999px; font-size: .8rem; font-weight: 600; color: var(--ss-ink-2); background: #fff; border: 1px solid var(--ss-border); }
.pill-tabs a.active { background: var(--ss-navy); color: #fff; border-color: var(--ss-navy); }
.pill-tabs a .count { opacity: .65; margin-left: .25rem; }
.nav-tabs.ss-tabs { border: 0; gap: .25rem; border-bottom: 1px solid var(--ss-border); }
.nav-tabs.ss-tabs .nav-link { border: 0; color: var(--ss-ink-2); font-weight: 600; font-size: .86rem; padding: .7rem 1rem; border-bottom: 3px solid transparent; border-radius: 0; }
.nav-tabs.ss-tabs .nav-link.active { color: var(--ss-navy); border-bottom-color: var(--ss-orange); background: none; }
.checklist .item { display: flex; align-items: center; gap: .75rem; padding: .75rem .9rem; border: 1px solid var(--ss-border); border-radius: 12px; margin-bottom: .5rem; cursor: pointer; transition: background .15s, border-color .15s; }
.checklist .item:has(input:checked) { background: #f0faf3; border-color: #bfe6cc; }
.checklist .item input { width: 1.25rem; height: 1.25rem; margin: 0; }
.channel-opt { border: 1px solid var(--ss-border); border-radius: 12px; padding: .7rem .9rem; display: flex; align-items: center; gap: .6rem; cursor: pointer; }
.channel-opt:has(input:checked) { border-color: var(--ss-navy); background: #f3f6fd; }
.wa-bubble { background: #e7fbe0; border-radius: 14px 14px 14px 4px; padding: .75rem .9rem; font-size: .85rem; color: #1f3b17; position: relative; max-width: 420px; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.wa-bubble .link { color: #0b63c7; word-break: break-all; }
.map-sim { position: relative; border-radius: 16px; overflow: hidden; background:
  linear-gradient(0deg, rgba(255,255,255,.55), rgba(255,255,255,.55)),
  repeating-linear-gradient(0deg, #e8eef8 0 1px, transparent 1px 38px), repeating-linear-gradient(90deg, #e8eef8 0 1px, transparent 1px 38px), #f5f8fd; height: 300px; border: 1px solid var(--ss-border); }
.map-sim svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-pin { position: absolute; transform: translate(-50%, -100%); text-align: center; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.map-pin i { font-size: 1.8rem; display: block; line-height: 1; }
.truck { position: absolute; transform: translate(-50%, -50%); width: 42px; height: 42px; border-radius: 50%; background: var(--ss-orange); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 6px rgba(247, 127, 0, .2); transition: left 1s, top 1s; }
.label-sheet { width: 420px; max-width: 100%; border: 2px solid var(--ss-ink); border-radius: 12px; padding: 1rem; background: #fff; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
/* Brand panel — one solid navy (the sidebar's colour), no glow or gradient shade. */
.auth-brand { background: var(--ss-navy-900); color: #fff; padding: 3rem 3.5rem; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; }
.auth-brand .muted { color: rgba(255, 255, 255, .7); }
.auth-logo { height: 120px; width: auto; align-self: flex-start; }
.auth-hero { max-width: 560px; }
.auth-eyebrow { font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ss-orange); }
.auth-title { font-size: clamp(2rem, 3.2vw, 2.9rem); font-weight: 800; line-height: 1.12; letter-spacing: -.02em; margin: .6rem 0 1rem; color: #fff; }
.auth-lead { color: rgba(255, 255, 255, .72); font-size: 1rem; line-height: 1.6; margin-bottom: 1.75rem; }
.auth-flow { list-style: none; padding: 0; margin: 0 0 1.75rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.auth-flow li { display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .75rem .4rem .4rem; border-radius: 999px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); font-size: .8rem; font-weight: 600; color: rgba(255, 255, 255, .9); }
.auth-flow-icon { width: 1.6rem; height: 1.6rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(247, 127, 0, .16); color: #ffb35c; font-size: .8rem; }
.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.auth-points li { display: flex; align-items: center; gap: .6rem; color: rgba(255, 255, 255, .8); font-size: .9rem; }
.auth-points i { color: #ffb35c; font-size: 1rem; }
.auth-foot { color: rgba(255, 255, 255, .55); font-size: .8rem; }
/* Sign-in panel */
.auth-panel { position: relative; padding: 2.5rem; display: flex; align-items: center; justify-content: center; background: #fff; }
.auth-theme { position: absolute; top: 1.25rem; right: 1.25rem; }
.auth-box { width: 100%; max-width: 500px; }
.auth-welcome { font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ss-orange); margin-bottom: .2rem; }
.auth-section-label { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--bs-secondary-color); margin-bottom: .5rem; }
.auth-roles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.role-card { border: 1px solid var(--ss-border); border-radius: 14px; padding: .7rem .8rem; display: flex; align-items: center; gap: .7rem; background: #fff; width: 100%; text-align: left; transition: border-color .15s, box-shadow .15s, transform .15s; }
.role-card:hover, .role-card:focus-visible { border-color: var(--c); box-shadow: 0 6px 18px rgba(15, 28, 63, .08); transform: translateY(-1px); outline: none; }
.role-card .role-go { color: var(--c); opacity: 0; transform: translateX(-4px); transition: opacity .15s, transform .15s; font-size: .9rem; }
.role-card:hover .role-go, .role-card:focus-visible .role-go { opacity: 1; transform: none; }
.auth-divider { display: flex; align-items: center; gap: .75rem; color: var(--bs-secondary-color); font-size: .82rem; margin: 0 0 1.25rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; border-top: 1px solid var(--ss-border); }
.auth-input { position: relative; }
.auth-input > i { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--bs-secondary-color); pointer-events: none; }
.auth-input .form-control { padding-left: 2.5rem; height: 48px; border-radius: 12px; }
.auth-input .form-control:has(+ .auth-eye) { padding-right: 2.75rem; }
.auth-eye { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--bs-secondary-color); padding: .35rem .5rem; border-radius: 8px; }
.auth-eye:hover { color: var(--bs-body-color); }
.auth-submit { height: 50px; border-radius: 12px; font-weight: 700; }
@media (max-width: 575.98px) { .auth-roles { grid-template-columns: 1fr; } }

/* ---------- Portal (supplier & customer mobile) ---------- */
.portal-body { background: linear-gradient(180deg, #001a56 0, #0b2a6f 220px, var(--ss-bg) 220px); min-height: 100vh; }
.portal-wrap { max-width: 560px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.portal-head { color: #fff; display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }

/* ---------- Toasts ---------- */
.toast-container { z-index: 1090; }
.toast { border: 0; border-radius: 14px; box-shadow: var(--ss-shadow-lg); overflow: hidden; }

/* ---------- Responsive ---------- */
.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .ss-sidebar { transform: translateX(-100%); }
  .ss-sidebar.open { transform: none; }
  .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(0, 10, 40, .45); z-index: 1035; }
  .ss-main { margin-left: 0; }
  .ss-content { padding: 1.1rem 1rem 8rem; }
  .ss-topbar { padding: 0 1rem; }
  .demo-bar { left: .6rem; right: .6rem; bottom: .6rem; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-brand { padding: 2rem 1.5rem; }
  .auth-logo { height: 84px; }
  .auth-points { display: none; }
}
@media (max-width: 575.98px) {
  .page-head h1 { font-size: 1.3rem; }
  .kpi .value { font-size: 1.3rem; }
  .hero { padding: 1.4rem; }
  .table > :not(caption) > * > * { padding: .65rem .75rem; }
}
@media print {
  .ss-sidebar, .ss-topbar, .demo-bar, .no-print, .toast-container { display: none !important; }
  .ss-main { margin: 0; }
  body { background: #fff; }
}

.min-w-0 { min-width: 0; }
.lh-tight { line-height: 1.2; }
.chart-box { position: relative; height: 260px; }
.chart-box.sm { height: 200px; }
.activity-item { display: flex; gap: .75rem; padding: .7rem 0; border-bottom: 1px dashed #e8ecf4; }
.activity-item:last-child { border-bottom: 0; }
@media (min-width: 1200px) { .row-cols-xl-7 > * { flex: 0 0 auto; width: 14.2857%; } }
/* Compact KPI (7-up rows): icon above, full-width label */
.kpi-compact .kpi { flex-direction: column; align-items: flex-start; gap: .6rem; }
.kpi-compact .kpi .label { white-space: normal; overflow: visible; }
.kpi-compact .kpi .value { font-size: 1.3rem; }
.flow .node { min-width: 76px; padding: .8rem .35rem; }
.flow .node .t { font-size: .6rem; letter-spacing: .03em; }
.flow .arrow { font-size: .7rem; }

/* Product illustration (shared with the customer shop) for admin catalog thumbnails */
.art { position: relative; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--art-bg); }
.art img.photo { width: 100%; height: 100%; object-fit: cover; }
.art .glyph { width: 58%; height: 70%; object-fit: contain; }
.art svg.glyph { width: 62%; height: 62%; }
.art.v-fresh { --art-bg: linear-gradient(145deg, #5b8def 0%, #2f56c6 55%, #1e3a8a 100%); }
.art.v-pud { --art-bg: linear-gradient(145deg, #b69cff 0%, #8b5cf6 55%, #5b21b6 100%); }
.art.v-rtc { --art-bg: linear-gradient(145deg, #ffb35c 0%, #f77f00 55%, #c2410c 100%); }
.art.v-live { --art-bg: linear-gradient(145deg, #5eead4 0%, #0d9488 55%, #065f58 100%); }

/* Read-only values shown in forms (e.g. PO quantity / balance) */
.form-control[readonly] { background-color: #f3f5fa; cursor: default; }
.form-control[readonly]:focus { box-shadow: none; border-color: var(--ss-border); }

/* Demo bar on the mobile portal pages (supplier secure links, QR trace): no sidebar to offset */
.portal-body .demo-bar { left: 1rem; right: 1rem; }
.portal-body.has-demo-bar { padding-bottom: 7rem; }

/* Cooking videos (click-to-play YouTube; shared by the shop and the admin preview) */
.video-card { background: var(--ss-surface, #fff); border: 1px solid var(--ss-border, #e9edf5); border-radius: 16px; overflow: hidden; }
.h-scroll .video-card { width: 280px; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.video-thumb { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; padding: 0; background: #0b1120; overflow: hidden; cursor: pointer; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-thumb .play { position: absolute; inset: 0; margin: auto; width: 56px; height: 56px; border-radius: 50%; background: rgba(220, 38, 38, .92); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; }
.video-thumb iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }