/* ==========================================================================
   Union Group look for IT Ticketing: shell, sign-in, buttons, headings.
   Loaded LAST (after tokens.css, fonts.css, style.css). Colours come only from tokens.css variables; style.css already maps its own
   variable names onto the tokens, so this file only restyles what a variable swap cannot: the dark sidebar, the gold button,
   the sign-in layout and the headings. ONE light theme, no dark mode. No inline styles are needed by any screen (CSP).
   Benchmark: PLU Management Portal / it-portal-tug (assets/css/shell.css, login.css).
   ========================================================================== */

body { font-family: var(--font-body); background: var(--bg-cream); color: var(--text-primary); }
h1, h2, h3, h4, .page-title, .page-head h2, .auth-title, .kpi-val, .brand-text { font-family: var(--font-display); }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.005em; }
.page-title { font-weight: 600; }
:focus-visible { outline: 2px solid var(--accent-gold-deep); }

/* ---------- sidebar: a fixed dark surface, as in the PLU portal ---------- */
.sidebar { background: var(--bg-dark); border-right: 0; color: rgba(255, 255, 255, 0.5); padding: 0 10px 12px; }
.brand { flex-direction: column; align-items: center; gap: 9px; padding: 22px 16px 16px; margin: 0 -10px 8px; text-align: center; border-bottom: 1px solid rgba(255, 255, 255, 0.07); position: relative; }
.brand-logo { width: 112px; height: auto; }
.brand-text { font-size: 12.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-gold); line-height: 1.35; }
.drawer-close { position: absolute; top: 8px; right: 6px; color: rgba(255, 255, 255, 0.6); }
.nav-menu { padding-top: 8px; }
.nav-item { border-radius: 5px; font-size: 13px; color: rgba(255, 255, 255, 0.5); min-height: 40px; }
.nav-item svg { color: rgba(255, 255, 255, 0.4); }
.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: rgba(255, 255, 255, 0.85); }
.nav-item:hover svg { color: rgba(255, 255, 255, 0.7); }
.nav-item.active { background: rgba(201, 168, 76, 0.12); color: var(--accent-gold); font-weight: 600; }
.nav-item.active svg { color: var(--accent-gold); }
.nav-item.active::before { left: -10px; background: var(--accent-gold); }
.nav-menu { scrollbar-width: none; -ms-overflow-style: none; overscroll-behavior: contain; } /* still scrolls, no bar shown */
.nav-menu::-webkit-scrollbar { display: none; }
.sidebar-footer { border-top: 1px solid rgba(255, 255, 255, 0.07); }
.user-name { color: rgba(255, 255, 255, 0.9); font-size: 12.5px; font-weight: 600; }
.user-role { color: rgba(255, 255, 255, 0.45); font-size: 11px; }
.sidebar .side-btn { color: rgba(255, 255, 255, 0.5); border-radius: 5px; font-size: 12.5px; }
.sidebar .side-btn:hover { background: rgba(255, 255, 255, 0.05); color: rgba(255, 255, 255, 0.85); }
.avatar, .tl-avatar, .tl-item.mine .tl-avatar, .team-avatar { background: var(--accent-gradient, linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold) 55%, var(--accent-gold-deep))); color: var(--text-primary); }
.brand-mark { background: var(--accent-gold); color: var(--text-primary); box-shadow: none; }

/* ---------- top bar ---------- */
.topbar { background: rgba(250, 247, 242, 0.9); border-bottom: 1px solid var(--border); }
.icon-btn { border-radius: var(--radius-control); }

/* ---------- buttons: gold primary, dark secondary ---------- */
.btn-primary {
  background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold) 55%, var(--accent-gold-deep));
  color: var(--text-primary); border-radius: var(--radius-control); letter-spacing: 0.03em; box-shadow: var(--shadow-gold);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold) 55%, var(--accent-gold-deep)); filter: brightness(1.05); }
.btn-outline, .btn-ghost, .btn-danger, .icon-btn { border-radius: var(--radius-control); }
.btn-danger { background: var(--danger); color: var(--bg-card); }
.btn-danger:hover { background: var(--danger-hover); }
input:focus, select:focus, textarea:focus { border-color: var(--accent-gold); box-shadow: 0 0 0 3px var(--accent-gold-ring); outline: 0; }
.ops-pill.active .ops-pill-n { background: rgba(26, 16, 8, 0.12); color: var(--text-primary); }

/* ---------- sign-in: dark brand panel + cream card ---------- */
.auth-hero { background: var(--bg-dark); color: rgba(255, 255, 255, 0.78); border-right: 0; }
.auth-hero::after { content: ""; position: absolute; inset: auto -20% -35% auto; width: 70%; height: 70%; border-radius: 50%; background: radial-gradient(closest-side, rgba(201, 168, 76, 0.22), transparent); pointer-events: none; }
.auth-hero .brand-sub { color: var(--accent-gold); }
.auth-hero h1 { font-weight: 600; color: var(--accent-gold-light); }
.auth-hero p { color: rgba(255, 255, 255, 0.7); }
.auth-points li { color: rgba(255, 255, 255, 0.85); }
.auth-points svg { color: var(--accent-gold); background: rgba(201, 168, 76, 0.16); }
.auth-main { background: var(--bg-cream); }
.auth-card { background: var(--bg-card); border-color: var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-card-md); }
.auth-logo { display: block; width: 112px; height: auto; margin-bottom: 10px; }
.auth-brand { flex-direction: column; align-items: flex-start; gap: 4px; }
.auth-hero .auth-brand-text .brand-text { color: var(--accent-gold); }
.auth-mobile-brand .brand-text { color: var(--text-primary); }
.auth-title { font-weight: 600; }

/* ---------- print keeps the cream-free white page ---------- */
@media print { .sidebar { display: none !important; } }

/* ---------- utility classes that replace former inline style="" attributes (so style-src can be 'self') ---------- */
.h-90 { height: 90px; } .h-240 { height: 240px; }
.card-flat { border: none; }
.mr-xs { margin-right: 4px; }
.pad-btn { padding: 8px 14px; } .pad-btn-sm { padding: 7px 12px; }
.lbl-inline { cursor: pointer; font-size: .82rem; }
.w-auto { width: auto; }
.fs-78 { font-size: .78rem; } .fs-80 { font-size: .8rem; }
.pad-xs { padding: 4px 2px; }
.hint-pad { padding: 6px 4px; }
.pad-b-12 { padding: 0 0 12px; }
.td-center { text-align: center; padding: 16px; }
.mb-4 { margin-bottom: 4px; } .mb-8 { margin-bottom: 8px; } .mb-10 { margin-bottom: 10px; } .mb-12 { margin-bottom: 12px; }
.flex-wrap-gap { display: flex; gap: 8px; flex-wrap: wrap; }
.noscript-msg { padding: 24px; font-family: system-ui, sans-serif; }

/* ---------- Activity Log: PLU layout (tiles, filter card, table with detail drawer, pager) ---------- */
.al-live { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--text-secondary); cursor: pointer; }
.al-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.al-tile { display: flex; flex-direction: column; gap: 2px; padding: 10px 16px; text-align: left; font: inherit; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); color: var(--text-primary); }
.al-tile-l { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-secondary); }
.al-tile b { font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.al-tile-btn { cursor: pointer; transition: border-color 150ms, box-shadow 150ms; }
.al-tile-btn:hover, .al-tile-btn.active { border-color: var(--accent-gold); box-shadow: var(--shadow-card-md); }
.al-tile-btn.is-bad b { color: var(--danger); }
.al-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); overflow: hidden; margin-bottom: 12px; }
.al-filters { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; overflow: visible; }
.al-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.al-dates { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; }
.al-dates input { width: auto; min-height: 32px; font-size: 0.8rem; padding: 0.2rem 0.5rem; }
.al-dates input.is-bad { border-color: var(--danger); }
.al-err { font-size: 0.75rem; color: var(--danger); }
.al-search { flex: 0 1 300px; min-width: 200px; }
.al-row select { width: auto; min-width: 140px; max-width: 240px; min-height: 32px; font-size: 0.8rem; padding: 0.2rem 0.6rem; }
.al-reset { border: 0; background: none; color: var(--text-secondary); font: inherit; font-size: 0.75rem; text-decoration: underline; cursor: pointer; padding: 6px 4px; }
.al-cat-n { margin-left: 6px; opacity: 0.7; font-variant-numeric: tabular-nums; }
.fbtn.is-zero { opacity: 0.5; }
.al-table.is-loading { opacity: 0.55; transition: opacity 120ms; }
.al-tr { cursor: pointer; }
.al-tr.is-failed td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.al-tr.is-sel td { background: rgba(201, 168, 76, 0.16) !important; }
.al-tr:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: -2px; }
.al-strong { font-weight: 500; }
.al-sub { font-size: 0.72rem; color: var(--text-secondary); }
.al-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.al-act { min-width: 240px; max-width: 440px; }
.al-rec { max-width: 180px; font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; }
.al-ticket { font-weight: 600; }
.al-chev, .al-chev-h { width: 24px; color: var(--text-secondary); text-align: center; }
.badge.al-cat { --fam: var(--text-secondary); }
.badge.al-fail { --fam: var(--status-down-text); --fam-bg: var(--status-down-bg); --fam-bd: var(--status-down-border); }
.al-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 0.78rem; color: var(--text-secondary); }
.al-info strong { color: var(--text-primary); font-weight: 600; font-variant-numeric: tabular-nums; }
.pager-size { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.pager-size select { width: auto; min-height: 30px; padding: 0 0.4rem; font-size: 0.78rem; }
.pager-nav { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }
.pager-btn { height: 30px; min-width: 30px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 6px; background: transparent; color: var(--text-primary); font: inherit; font-size: 0.78rem; font-variant-numeric: tabular-nums; cursor: pointer; transition: background 150ms, border-color 150ms; }
.pager-btn:hover:not(:disabled) { background: rgba(201, 168, 76, 0.12); border-color: var(--accent-gold); }
.pager-btn:disabled { opacity: 0.4; cursor: default; }
.pager-btn[aria-current="page"] { font-weight: 700; background: rgba(201, 168, 76, 0.18); border-color: var(--accent-gold); }
.pager-gap { padding: 0 4px; }
/* drawer */
.al-scrim { position: fixed; inset: 0; z-index: 90; background: rgba(26, 16, 8, 0.35); animation: al-fade 150ms ease; }
.al-drawer { position: fixed; z-index: 91; top: 0; right: 0; bottom: 0; width: min(440px, 100%); display: flex; flex-direction: column; background: var(--bg-card); border-left: 1px solid var(--border); box-shadow: -12px 0 40px rgba(26, 16, 8, 0.2); animation: al-slide 200ms ease; }
.al-d-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--border); }
.al-d-kicker { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-secondary); }
.al-d-head h3 { font-size: 1.25rem; margin-top: 2px; }
.al-d-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.al-d-state { margin-bottom: 12px; }
.al-d-list { display: grid; gap: 10px; margin: 0 0 16px; }
.al-d-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; font-size: 0.85rem; }
.al-d-row dt { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-secondary); padding-top: 2px; }
.al-d-row dd { margin: 0; overflow-wrap: anywhere; }
.al-d-h { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-secondary); margin: 0 0 6px; font-family: var(--font-body); }
.al-d-detail { margin: 0 0 16px; padding: 12px; background: var(--bg-row-alt); border: 1px solid var(--border); border-radius: 6px; font-size: 0.85rem; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.al-d-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); }
@keyframes al-slide { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes al-fade { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 760px) {
  .al-filters { padding: 12px; }
  .al-row select, .al-search { flex: 1 1 100%; max-width: none; }
  .al-row:first-child { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .al-dates { flex: none; }
  .al-cats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .al-cats .fbtn { flex: none; white-space: nowrap; }
  .pager-nav { margin-left: 0; width: 100%; justify-content: center; }
  .al-drawer { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .al-drawer, .al-scrim { animation: none; } }

/* ==========================================================================
   Shell, as in the portal (assets/css/shell.css): breadcrumb, Quick launch, clock, user menu, sectioned sidebar, user footer.
   ========================================================================== */
.topbar { height: 60px; padding: 0 28px; gap: 14px; background: rgba(250, 247, 242, 0.9); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.crumbs { font-size: 13px; color: var(--text-secondary); white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.crumbs b { color: var(--text-primary); font-weight: 600; }
.crumb-sep { margin: 0 8px; opacity: 0.5; }
.quick-btn { display: flex; align-items: center; gap: 10px; min-width: 280px; margin-left: 16px; padding: 7px 12px; border-radius: var(--radius-control); border: 1px solid var(--border); background: var(--bg-card); font: inherit; font-size: 12.5px; color: var(--text-muted); cursor: pointer; transition: border-color 150ms; }
.quick-btn:hover { border-color: var(--input-border); }
kbd { font-family: var(--font-body); font-size: 10.5px; padding: 1px 6px; border: 1px solid var(--border); border-radius: 4px; background: rgba(26, 16, 8, 0.04); color: var(--text-muted); }
.quick-btn kbd { margin-left: auto; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.clock { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; color: var(--text-primary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.clock svg { color: var(--text-muted); }
.clock small { font-size: 11.5px; color: var(--text-muted); font-weight: 400; }
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border-radius: 999px; border: 1px solid var(--border); background: rgba(26, 16, 8, 0.04); color: var(--text-primary); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; }
.user-btn:hover { border-color: var(--input-border); }
.user-btn .avatar { width: 28px; height: 28px; font-size: 12px; }
.user-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 80; min-width: 240px; padding: 6px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-card-md); }
.user-pop-head { display: flex; flex-direction: column; padding: 10px 10px 8px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.user-pop-head b { font-size: 13px; }
.user-pop-head small { font-size: 11.5px; color: var(--text-muted); overflow-wrap: anywhere; }
.menu-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 10px; border: 0; border-radius: 6px; background: none; font: inherit; font-size: 13px; color: var(--text-secondary); text-align: left; cursor: pointer; }
.menu-item:hover { background: rgba(26, 16, 8, 0.05); color: var(--text-primary); }
.menu-item.danger:hover { color: var(--danger); background: var(--status-down-bg); }

/* quick launch */
.ql { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 0; background: rgba(26, 16, 8, 0.5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.ql-box { width: min(560px, 100%); background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: 0 30px 80px -10px rgba(26, 16, 8, 0.45); overflow: hidden; }
.ql-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.ql-input input { flex: 1; padding: 15px 0; background: transparent; border: 0; outline: 0; box-shadow: none; color: var(--text-primary); font: inherit; font-size: 15px; min-height: 0; }
.ql-input input:focus { border: 0; box-shadow: none; }
.ql-list { list-style: none; max-height: 50vh; overflow-y: auto; padding: 6px; margin: 0; }
.ql-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 6px; font-size: 13.5px; cursor: pointer; }
.ql-item small { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.ql-item.active { background: rgba(201, 168, 76, 0.14); color: var(--status-pending-text); }
.ql-hint { display: flex; gap: 8px; align-items: center; padding: 9px 14px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-muted); }

/* sidebar: section headings and the user row */
.nav-label { padding: 16px 10px 6px; font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255, 255, 255, 0.3); }
.nav-menu .nav-label:first-child { padding-top: 8px; }
.side-foot { display: flex; align-items: center; gap: 10px; padding: 12px 10px; margin: 8px -10px -12px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.side-foot .avatar { width: 32px; height: 32px; font-size: 13px; }
.side-user { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.side-user b { font-size: 12.5px; color: rgba(255, 255, 255, 0.9); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user small { font-size: 11px; color: rgba(255, 255, 255, 0.45); }
.side-signout { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; background: none; border-radius: 5px; color: rgba(255, 255, 255, 0.5); cursor: pointer; }
.side-signout:hover { background: rgba(224, 131, 107, 0.16); color: #E0836B; }

/* ---------- filter bar: buttons, not dropdowns (one pressed button per group) ---------- */
.filter-bar { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 14px 16px; }
.filter-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-top .search { flex: 1 1 260px; }
.fgroups { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.fgroup { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.fgroup-label { font-size: 0.67rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-secondary); }
.fbtns { display: flex; flex-wrap: wrap; gap: 6px; }
.fbtns-detail { flex-basis: 100%; padding-top: 2px; }
.fbtn, .fbtn.qf { display: inline-flex; align-items: center; min-height: 32px; padding: 0.3rem 0.8rem; border-radius: var(--radius-control); border: 1px solid var(--border); background: transparent; color: var(--text-primary); font: 500 0.8rem var(--font-body); letter-spacing: 0.02em; cursor: pointer; transition: background 150ms, color 150ms, border-color 150ms; }
.fbtn:hover, .fbtn.qf:hover { background: var(--border); border-color: var(--input-border); }
.fbtn.active, .fbtn.qf.active { background: var(--bg-dark); border-color: var(--bg-dark); color: var(--accent-gold); }
.fbtn.qf-danger:not(.active) { color: var(--danger); }
.fbtn-more { border-style: dashed; color: var(--text-secondary); }
.fbtn-more[aria-expanded="true"] { background: var(--bg-row-alt); }
.seg-b.active { background: var(--bg-dark); color: var(--accent-gold); }
.seg:empty { display: none; }
.tabbar .tab.active, .ops-pill.active, .qf.active { background: var(--bg-dark); border-color: var(--bg-dark); color: var(--accent-gold); }
.ops-pill.active .ops-pill-n { background: rgba(201, 168, 76, 0.22); color: var(--accent-gold); }
.role-pill, .dept-tag { background: rgba(26, 16, 8, 0.05); color: var(--text-secondary); border: 1px solid var(--border); }
.fgroup select { width: auto; min-width: 120px; min-height: 32px; padding: 0.2rem 0.6rem; font-size: 0.8rem; border-radius: var(--radius-control); }
.bi-filter .fgroup-label { display: block; margin-bottom: 6px; }
.bi-buttons .fbtns, .bi-period .fbtns { flex-wrap: wrap; }

@media (max-width: 1100px) { .clock { display: none; } .quick-btn { min-width: 0; } }
@media (max-width: 960px) {
  .topbar { padding: 0 14px; gap: 8px; }
  .quick-btn { margin-left: auto; padding: 8px; min-width: 0; }
  .quick-btn span, .quick-btn kbd { display: none; }
  .topbar-actions { margin-left: 0; gap: 8px; }
  .user-btn-name, .user-btn > svg { display: none; }
  .user-btn { padding: 3px; }
  .crumb-root, .crumb-sep { display: none; }
  .crumbs { flex: 1; font-size: 14px; }
}
@media (max-width: 760px) {
  .filter-bar { padding: 12px; gap: 10px; }
  .fgroups { gap: 10px; }
  .fgroup { width: 100%; gap: 4px; }
  .fgroup-label { flex-basis: 100%; }
  .fbtns { flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; padding-bottom: 2px; }
  .fbtns::-webkit-scrollbar { display: none; }
  .fbtn, .fbtn.qf { flex: none; white-space: nowrap; }
}

/* ---------- Dashboard filters: same filter-bar card as the ticket list (period and short lists as buttons) ---------- */
.bi-filters { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 14px 16px; }
.bi-filters .bi-filter { max-width: none; min-width: 0; flex: none; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.bi-filters .bi-filter label { margin: 0; font-size: 0.67rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-secondary); }
.bi-filters .bi-filter select { width: auto; min-width: 130px; min-height: 32px; padding: 0.2rem 0.6rem; font-size: 0.8rem; border-radius: var(--radius-control); }
.bi-filters .bi-filter.is-set select { border-color: var(--bg-dark); background-color: var(--bg-row-alt); }
.bi-filters .bi-period { display: flex; max-width: none; flex: 1 1 100%; }
.bi-filters .bi-range { margin-left: 4px; }
.bi-filters .bi-range input { flex: none; width: 150px; min-width: 0; min-height: 32px; font-size: 0.8rem; padding: 0.2rem 0.5rem; }
.bi-filters .bi-filter-end { margin-left: auto; }
@media (min-width: 961px) { .bi-filters { display: flex; flex-wrap: wrap; gap: 12px 28px; } }
@media (max-width: 960px) {
  .bi-filters.is-open { display: flex; flex-direction: column; gap: 12px; }
  .bi-filters .bi-filter { flex-direction: column; align-items: stretch; }
  .bi-filters .bi-filter .fbtns { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .bi-filters .bi-filter .fbtn { flex: none; white-space: nowrap; }
  .bi-filters .bi-range input { flex: 1; width: auto; }
}

/* ==========================================================================
   PLU look (benchmark: plu-portal-tug app/globals.css). Calm cards, one table style, three status families.
   Presentation only: no markup, route or copy change. Colours come from tokens.css.
   Families: pending = gold, done = green, down = brick red, anything else = neutral.
   ========================================================================== */
.badge, .sla-chip, .urg-pill, .dept-tag, .role-pill, .src-chip { --fam: var(--text-secondary); --fam-bg: rgba(26, 16, 8, 0.04); --fam-bd: var(--border); }
.badge, .sla-chip, .urg-pill {
  background: var(--fam-bg); color: var(--fam); border: 1px solid var(--fam-bd);
  font-weight: 600; letter-spacing: 0.01em; padding: 4px 10px;
}
/* pending */
.st-New, .st-Open, .st-Assigned, .st-OnScheduled, .st-OnProgress, .st-WaitingSparepart, .st-WaitingVendor, .st-PendingOutletResponse,
.ur-High, .sla-warn, .st-InTransit, .st-InRepair, .st-InStock { --fam: var(--status-pending-text); --fam-bg: var(--status-pending-bg); --fam-bd: var(--status-pending-border); }
/* done */
.st-Resolved, .st-Closed, .sla-ok, .sla-met, .st-InService { --fam: var(--status-done-text); --fam-bg: var(--status-done-bg); --fam-bd: var(--status-done-border); }
/* down */
.st-Escalated, .ur-Critical, .sla-bad, .st-Quarantine, .st-Missing { --fam: var(--status-down-text); --fam-bg: var(--status-down-bg); --fam-bd: var(--status-down-border); }
/* neutral */
.st-Cancelled, .ur-Low, .ur-Medium, .sla-idle, .st-Retired { --fam: var(--text-secondary); --fam-bg: rgba(26, 16, 8, 0.04); --fam-bd: var(--border); }
.badge.st-Closed { --fam: var(--text-secondary); --fam-bg: rgba(26, 16, 8, 0.04); --fam-bd: var(--border); }
.src-chip { background: rgba(26, 16, 8, 0.04); color: var(--text-secondary); border: 1px solid var(--border); }

/* ---------- cards ---------- */
.panel, .card, .kpi, .ticket-row, .filter-bar, .bi-filters, .al-card, .al-filter {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-card);
}
.kpi::before, .ticket-row::before { display: none; }
.kpi, .ticket-row { transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease; }
.kpi.is-link:hover, .ticket-row:hover { transform: none; border-color: var(--accent-gold); box-shadow: var(--shadow-card-md); }
.ticket-row.urg-Critical { box-shadow: inset 3px 0 0 var(--danger), var(--shadow-card); }

/* KPI tile: small caps label, one big number, equal heights, no orphan cells */
.kpi-grid, .kpi-grid-bi, .kpi-grid-fit { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.kpi { gap: 4px; padding: 12px 16px; min-height: 0; }
.kpi-top { align-items: flex-start; }
.kpi-label { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-secondary); }
.kpi-icon { width: 28px; height: 28px; border-radius: 6px; background: var(--bg-row-alt); color: var(--text-secondary); }
.kpi-n, .kpi-val { font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; line-height: 1.15; letter-spacing: 0; color: var(--text-primary); }
.tone-danger .kpi-n { color: var(--danger); }
.kpi-sub { color: var(--text-secondary); }
.sec-title { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em; color: var(--text-secondary); }

/* ticket card: number + subject on the left, state on the right, quiet meta line */
.ticket-list { gap: 10px; }
.ticket-row { padding: 14px 18px; gap: 18px; }
.tnum, .dt-num { font-family: var(--font-body); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.ttitle { font-weight: 600; font-size: 0.95rem; margin: 4px 0 6px; }
.tmeta { font-size: 0.78rem; color: var(--text-secondary); }
.unassigned { color: var(--status-pending-text); font-weight: 600; }
.tbadges { flex-direction: row; flex-wrap: wrap; justify-content: flex-end; max-width: 340px; }
.sla-chip { font-weight: 500; }

/* ---------- tables: cream header in capitals, zebra rows, gold hover, tabular numbers ---------- */
table.data { border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.data th { background: var(--bg-row-alt); color: var(--text-secondary); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; padding: 0.7rem 1rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data th:first-child, table.data th:last-child { border-radius: 0; }
table.data td { padding: 0.6rem 1rem; font-size: 0.82rem; border-bottom: 1px solid var(--border); }
table.data tbody tr:nth-child(even) td { background: var(--bg-row-alt); }
table.data tbody tr:hover td { background: rgba(201, 168, 76, 0.09); }
table.data.dt { min-width: 0; }
table.data.dt tr.urg-Critical td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
table.data.dt tr.urg-High td:first-child { box-shadow: none; }
.dt-subject { max-width: 280px; font-weight: 500; }
.dt-foot, .al-foot { background: var(--bg-card); border-top: 1px solid var(--border); font-size: 0.78rem; color: var(--text-secondary); border-radius: 0; }
.empty-cell, .table-empty { padding: 3rem 1.5rem; text-align: center; color: var(--text-secondary); }

/* ---------- page header ---------- */
.page-head h2 { font-size: 1.7rem; font-weight: 600; }
.page-head p { color: var(--text-secondary); font-size: 0.85rem; margin-top: 4px; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-primary); }
.btn-outline:hover { background: var(--border); }
.btn-primary { background: var(--bg-dark); color: var(--accent-gold); box-shadow: none; letter-spacing: 0.04em; }
.btn-primary:hover { background: #2A1A10; filter: none; }
.topbar .btn-primary, .topbar-report { background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold) 55%, var(--accent-gold-deep)); color: var(--text-primary); box-shadow: var(--shadow-gold); }

/* next-move chip: same three families */
.ops-chip { --fam: var(--text-secondary); --fam-bg: rgba(26, 16, 8, 0.04); --fam-bd: var(--border); background: var(--fam-bg); color: var(--fam); border: 1px solid var(--fam-bd); font-weight: 600; padding: 4px 10px; }
.ops-chip.tone-warn { --fam: var(--status-pending-text); --fam-bg: var(--status-pending-bg); --fam-bd: var(--status-pending-border); }
.ops-chip.tone-danger { --fam: var(--status-down-text); --fam-bg: var(--status-down-bg); --fam-bd: var(--status-down-border); }
.ops-chip.tone-ok { --fam: var(--status-done-text); --fam-bg: var(--status-done-bg); --fam-bd: var(--status-done-border); }
.ops-strip { background: var(--bg-card); box-shadow: var(--shadow-card); }
.ops-strip-label { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.12em; color: var(--text-secondary); }
.ops-pill.has .ops-pill-n { background: var(--status-pending-bg); color: var(--status-pending-text); }
.ops-pill.has { border-color: var(--status-pending-border); }
.ops-pill { background: transparent; }
.ops-pill:hover { border-color: var(--accent-gold); background: rgba(201, 168, 76, 0.08); }
.ops-pill.active { background: var(--bg-dark); border-color: var(--bg-dark); color: var(--accent-gold); }

/* tiles and tables: tighter so a page reads at a glance */
.kpi-grid, .kpi-grid-bi, .kpi-grid-fit { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }
.kpi-label { font-size: 0.66rem; letter-spacing: 0.08em; }
.kpi-foot { min-height: 0; }
table.data th { padding: 0.65rem 0.75rem; }
table.data td { padding: 0.55rem 0.75rem; }
.tone-ok .kpi-n { color: var(--text-primary); }
table.data.dt .sla-chip, table.data.dt .ops-chip { white-space: normal; line-height: 1.25; max-width: 150px; }
table.data.dt td { vertical-align: middle; }

/* ---------- toasts: the PLU portal's (sonner) look: white card, top right, small icon, soft shadow ---------- */
.toast-container { top: 24px; right: 24px; bottom: auto; left: auto; transform: none; width: 356px; max-width: calc(100% - 32px); gap: 8px; }
.toast { align-items: flex-start; gap: 10px; padding: 16px; border-radius: 8px; background: #fff; color: #171717; border: 1px solid #ededed; border-left-width: 1px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); font: 400 13px/1.4 var(--font-body); transform: translateX(16px); }
.toast.show { transform: none; }
.toast-ico { display: inline-flex; flex: none; margin-top: 1px; color: #171717; }
.toast.success .toast-ico, .toast.error .toast-ico { color: #171717; }
.toast-msg { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
@media (max-width: 760px) {
  .toast-container, .app-shell:not([hidden]) ~ .toast-container { top: 16px; right: 16px; left: 16px; bottom: auto; width: auto; max-width: none; }
}
@media (prefers-reduced-motion: reduce) { .toast { transition: none; transform: none; } }
.toast, .toast.success, .toast.error { border-left-color: #ededed; }

/* ---------- Access Control: the PLU portal's layout (role list left, one card right, flat rows with a HAS / NO pill and a select) ---------- */
.ac-layout { display: grid; grid-template-columns: minmax(240px, 300px) 1fr; gap: 16px; align-items: start; }
.ac-loading { padding: 2rem; text-align: center; color: var(--text-secondary); }
.ac-side { overflow: hidden; }
.ac-side-head { padding: 0.75rem 0.875rem; border-bottom: 1px solid var(--border); }
.ac-role { display: block; width: 100%; text-align: left; padding: 0.6rem 0.875rem; border: 0; border-bottom: 1px solid var(--border); background: transparent; font: inherit; color: var(--text-primary); cursor: pointer; transition: background 150ms; }
.ac-role:last-child { border-bottom: 0; }
.ac-role:hover { background: rgba(201, 168, 76, 0.07); }
.ac-role.is-on { background: rgba(201, 168, 76, 0.14); }
.ac-role-name { display: block; font-size: 0.85rem; font-weight: 500; }
.ac-role-sub { display: block; font-size: 0.7rem; color: var(--text-secondary); }
.ac-custom { margin-left: 6px; color: #8B6914; font-weight: 700; }
.ac-main { padding: 0; overflow: hidden; }
.ac-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.ac-head-who { flex: 1; min-width: 200px; }
.ac-head-name { font-weight: 600; }
.ac-head-sub { font-size: 0.75rem; color: var(--text-secondary); }
.ac-dirty { font-size: 0.75rem; font-weight: 600; color: #8B6914; }
#ac-save:disabled { opacity: 0.5; cursor: default; }
.ac-group-head { padding: 0.75rem 1.25rem 0.35rem; background: var(--bg-cream); }
.ac-group-head h3 { margin: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
.ac-menu-name { display: flex; align-items: center; gap: 8px; padding: 0.55rem 1.25rem; border-bottom: 1px solid var(--border); background: var(--bg-row-alt); font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }
.ac-menu-name svg { color: var(--text-secondary); }
.ac-menu-note { margin-left: auto; font-size: 0.7rem; font-weight: 500; color: var(--text-secondary); }
.ac-menu.is-never .ac-row { opacity: 0.5; }
.ac-row { display: flex; align-items: center; gap: 1rem; padding: 0.6rem 1.25rem; border-bottom: 1px solid var(--border); }
.ac-row.is-changed { background: rgba(201, 168, 76, 0.1); }
.ac-row.is-blocked, .ac-row.is-locked { opacity: 0.6; }
.ac-row-copy { flex: 1; min-width: 0; }
.ac-row-name { font-size: 0.83rem; font-weight: 500; }
.ac-row-desc { font-size: 0.72rem; color: var(--text-secondary); }
.ac-row-desc em { font-style: normal; color: #8B6914; }
.ac-sens { margin-left: 6px; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.06em; color: #B3261E; }
.ac-pill { width: 54px; flex: none; text-align: center; border-radius: 9999px; padding: 0.15rem 0; font-size: 0.7rem; font-weight: 700; color: var(--text-secondary); background: var(--bg-cream); }
.ac-pill.is-has { color: #1B6E3C; background: rgba(27, 110, 60, 0.1); }
.ac-select { width: 210px; flex: none; height: 34px; min-height: 34px; padding: 0 0.625rem; font-size: 0.8rem; border-radius: 0.375rem; }
.ac-lock { width: 210px; flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 0.7rem; color: var(--text-secondary); }
@media (max-width: 960px) {
  .ac-layout { grid-template-columns: 1fr; }
  .ac-side { display: flex; overflow-x: auto; }
  .ac-side-head { display: none; }
  .ac-role { flex: none; width: auto; min-width: 150px; border-bottom: 0; border-right: 1px solid var(--border); }
}
@media (max-width: 640px) {
  .ac-row { flex-wrap: wrap; gap: 6px 12px; }
  .ac-row-copy { flex: 1 1 100%; }
  .ac-select, .ac-lock { flex: 1; width: auto; min-width: 0; }
}

/* ==========================================================================
   One meaning per colour (so an indicator can be read without the words):
     blue  = new or queued          gold = someone is working, or it needs a move
     green = finished               red  = a problem (escalated, critical, late)      grey = inactive
   Status is a dot and a word, not a boxed pill; only urgency High/Critical and "next move" chips get a tinted tag.
   ========================================================================== */
:root {
  --ind-new: #5B83B0; --ind-new-bg: rgba(91, 131, 176, 0.12); --ind-new-text: #365E8A;
  --ind-work: #C9A84C;
  --ind-done: #5E8C61;
  --ind-bad: #B5503A;
  --ind-idle: #A89B8C;
}
.tone-info { --tone: var(--ind-new); --tone-ink: var(--ind-new-text); }
.tone-warn, .tone-progress { --tone: var(--ind-work); --tone-ink: var(--status-pending-text); }
.tone-ok { --tone: var(--ind-done); --tone-ink: var(--status-done-text); }
.tone-danger { --tone: var(--ind-bad); --tone-ink: var(--status-down-text); }

/* status: a coloured dot, then the word in the normal ink */
.badge { --dot: var(--ind-idle); background: none; border: 0; padding: 0; gap: 7px; color: var(--text-primary); font-size: 0.78rem; font-weight: 600; letter-spacing: 0; }
.badge::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--dot); }
.st-New, .st-Open, .st-Assigned, .st-OnScheduled, .st-InStock, .st-InTransit { --dot: var(--ind-new); }
.st-OnProgress, .st-InRepair { --dot: var(--ind-work); }
.st-WaitingSparepart, .st-WaitingVendor, .st-PendingOutletResponse { --dot: transparent; }
.st-WaitingSparepart::before, .st-WaitingVendor::before, .st-PendingOutletResponse::before { box-shadow: inset 0 0 0 2px var(--ind-work); }
.st-Resolved, .st-InService { --dot: var(--ind-done); }
.st-Closed { --dot: transparent; }
.st-Closed::before { box-shadow: inset 0 0 0 2px var(--ind-done); }
.st-Escalated, .st-Quarantine, .st-Missing { --dot: var(--ind-bad); }
.st-Cancelled, .st-Retired { --dot: var(--ind-idle); }
.badge.al-cat { --dot: var(--ind-idle); font-weight: 500; color: var(--text-secondary); }
.badge.al-fail { --dot: var(--ind-bad); color: var(--status-down-text); }

/* urgency: Critical and High are tags, Medium and Low are quiet words */
.badge.ur-Critical, .badge.ur-High { padding: 3px 9px; gap: 0; border: 1px solid; border-radius: 999px; font-size: 0.72rem; }
.badge.ur-Critical::before, .badge.ur-High::before { display: none; }
.badge.ur-Critical { color: var(--status-down-text); background: var(--status-down-bg); border-color: var(--status-down-border); }
.badge.ur-High { color: var(--status-pending-text); background: var(--status-pending-bg); border-color: var(--status-pending-border); }
.badge.ur-Medium, .badge.ur-Low { --dot: transparent; color: var(--text-secondary); font-weight: 500; }
.badge.ur-Medium::before, .badge.ur-Low::before { display: none; }

/* "next move" and SLA chips use the same four colours */
.ops-chip.tone-info { --fam: var(--ind-new-text); --fam-bg: var(--ind-new-bg); --fam-bd: rgba(91, 131, 176, 0.3); }
.sla-chip { font-weight: 600; }

/* selected = soft gold, not a black block */
.fbtn.active, .fbtn.qf.active, .seg-b.active, .ops-pill.active, .tabbar .tab.active, .qf.active {
  background: rgba(201, 168, 76, 0.2); border-color: var(--accent-gold); color: #4A3708; font-weight: 600;
}
.seg-b.active { box-shadow: none; }
.ops-pill.active .ops-pill-n { background: rgba(201, 168, 76, 0.35); color: #4A3708; }
.fbtn.qf-danger:not(.active) { color: var(--status-down-text); }

/* buttons: one gold primary everywhere */
.btn-primary { background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold) 55%, var(--accent-gold-deep)); color: var(--text-primary); box-shadow: var(--shadow-gold); letter-spacing: 0.02em; }
.btn-primary:hover { background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold) 55%, var(--accent-gold-deep)); filter: brightness(1.05); }

/* the stage banner on a ticket follows the same colours, quieter */
.stage-banner { border-left-width: 3px; background: color-mix(in srgb, var(--tone) 7%, var(--bg-card)); }
.sb-ic { border-radius: 8px; }

/* tickets list: filters behind one button, a key for the colours, no row of zeros */
#t-more-btn { gap: 6px; }
.t-more-n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent-gold); color: var(--text-primary); font-size: 0.68rem; font-weight: 700; }
.fgroups-more { display: flex; flex-wrap: wrap; gap: 12px 28px; flex-basis: 100%; padding-top: 12px; border-top: 1px dashed var(--border); }
.list-meta-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; margin: 4px 2px 10px; }
.list-meta-row .list-meta { margin: 0; }
.legend { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.72rem; color: var(--text-secondary); }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ind-idle); }
.lg-new::before { background: var(--ind-new); } .lg-work::before { background: var(--ind-work); }
.lg-done::before { background: var(--ind-done); } .lg-bad::before { background: var(--ind-bad); }
.ops-clear { font-size: 0.8rem; color: var(--status-done-text); font-weight: 500; }
.all-clear { margin: 0 0 14px; padding: 12px 16px; background: var(--status-done-bg); border: 1px solid var(--status-done-border); border-radius: var(--radius-card); color: var(--status-done-text); font-size: 0.85rem; }

/* fewer words: list screens do not repeat what the menu already says */
body[data-page="tickets"] .page-head p, body[data-page="assets"] .page-head p, body[data-page="shipments"] .page-head p,
body[data-page="schedules"] .page-head p, body[data-page="users"] .page-head p, body[data-page="categories"] .page-head p,
body[data-page="locations"] .page-head p, body[data-page="reports"] .page-head p { display: none; }
.fgroups-more { min-width: 0; width: 100%; }
@media (max-width: 760px) { .fgroups-more { gap: 10px; } .t-more-n { margin-left: 2px; } #t-more-btn span:not(.t-more-n) { display: inline; } }
.kpi-grid, .kpi-grid-bi, .kpi-grid-fit { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
.label-caps { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-secondary); }
.ac-group-head h3 { font-size: inherit; font-weight: inherit; letter-spacing: inherit; text-transform: inherit; }
