:root{
  --sc-bg:#faf9f8; --sc-surface:#ffffff; --sc-border:#edebe9; --sc-text:#323130;
  --sc-text-secondary:#605e5c; --sc-accent:#0078d4; --sc-accent-dark:#106ebe;
  --sc-sidebar:#f3f2f1; --sc-danger:#a4262c; --sc-success:#107c10; --sc-warn:#797673;
  --sc-radius:4px; --sc-font:'Segoe UI',-apple-system,BlinkMacSystemFont,Roboto,Helvetica,Arial,sans-serif;
}
*{box-sizing:border-box}
body{margin:0;font-family:var(--sc-font);color:var(--sc-text);background:var(--sc-bg);font-size:14px;line-height:1.5}
a{color:var(--sc-accent);text-decoration:none}
a:hover{text-decoration:underline}
.sc-app{display:flex;height:100vh;flex-direction:column}
.sc-topbar{display:flex;align-items:center;height:48px;background:var(--sc-accent);color:#fff;padding:0 16px;gap:16px;position:sticky;top:0;z-index:10}
.sc-topbar .brand{font-weight:600;font-size:15px;letter-spacing:.2px}
.sc-topbar .spacer{flex:1}
/* The bell sits in an inline-block inside .topnav. With .topnav laid out as a block, its
   children align on the TEXT BASELINE — so a 17px emoji button, a 13px link and the avatar
   line up by their baselines rather than their centres, and the bell rides high. Making the
   nav a centred flex row is what actually fixes it, at every width. */
.sc-topbar .topnav{display:flex;align-items:center;gap:16px}
.sc-topbar .topnav a{color:#fff;opacity:.95;font-size:13px}
.sc-topbar .brand{white-space:nowrap}
.sc-topbar .sc-bell{margin-right:0!important;display:flex!important;align-items:center}
.sc-topbar .sc-bell button{display:flex;align-items:center;justify-content:center;width:32px;height:32px;line-height:1}
/* Inline width:300px would win over a stylesheet width, but not over max-width. */
#bellPanel{max-width:calc(100vw - 24px)}
/* Avatar user menu — collapses name / account / company switch / sign out into one dropdown. */
.sc-usermenu{position:relative;display:inline-block;margin-left:16px;vertical-align:middle}
.sc-avatar{width:30px;height:30px;border-radius:50%;border:1px solid rgba(255,255,255,.6);background:rgba(255,255,255,.15);color:#fff;font-size:12px;font-weight:600;cursor:pointer;line-height:1;padding:0}
.sc-avatar:hover{background:rgba(255,255,255,.28)}
.sc-usermenu-panel{position:absolute;right:0;top:38px;width:240px;background:#fff;color:var(--sc-text);border:1px solid var(--sc-border);border-radius:6px;box-shadow:0 4px 16px rgba(0,0,0,.15);z-index:50;padding:6px 0}
.sc-usermenu-name{padding:8px 14px;font-weight:600;font-size:13px}
.sc-usermenu-item{display:block;padding:8px 14px;text-decoration:none;font-size:13px;margin:0}
/* Override the white .sc-topbar .topnav a color inside the (white) dropdown panel — needs the higher specificity to win. */
.sc-topbar .topnav .sc-usermenu-panel a{color:var(--sc-text);opacity:1;margin-left:0}
.sc-topbar .topnav .sc-usermenu-panel a:hover{background:#f3f2f1;text-decoration:none}
.sc-usermenu-sep{height:1px;background:var(--sc-border);margin:4px 0}
.sc-usermenu-form{padding:8px 14px;margin:0}
.sc-usermenu-label{display:block;font-size:11px;color:var(--sc-text-secondary);margin-bottom:4px}
.sc-body{display:flex;flex:1;min-height:0}
.sc-sidebar{width:240px;flex:none;background:var(--sc-sidebar);border-right:1px solid var(--sc-border);padding:8px 0;overflow:auto;align-self:stretch;min-height:0}
.sc-sidebar .group{font-size:11px;text-transform:uppercase;letter-spacing:.6px;color:var(--sc-text-secondary);padding:12px 16px 4px;font-weight:600}
.sc-sidebar a.item,.sc-sidebar span.item{display:block;padding:7px 16px 7px 28px;color:var(--sc-text);font-size:13px;border-left:3px solid transparent}
.sc-sidebar a.item:hover{background:#eae9e8;text-decoration:none}
.sc-sidebar a.item.active{border-left-color:var(--sc-accent);background:#eae9e8;font-weight:600}
.sc-sidebar span.item.disabled{color:#a19f9d;cursor:not-allowed}
.sc-sidebar span.item.disabled::after{content:" · soon";font-size:10px;color:#bdbdbd}
.sc-main{flex:1;overflow:auto}
.sc-main-inner{padding:24px 28px}   /* padding lives here, not on the scroll container, so sticky headers pin flush under the topbar */
.sc-page-title{font-size:20px;font-weight:600;margin:0 0 16px}
.sc-card{background:var(--sc-surface);border:1px solid var(--sc-border);border-radius:var(--sc-radius);padding:20px;margin-bottom:16px}
.sc-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:16px}
.kpi{background:var(--sc-surface);border:1px solid var(--sc-border);border-radius:var(--sc-radius);padding:16px}
.kpi .label{color:var(--sc-text-secondary);font-size:12px}
.kpi .value{font-size:26px;font-weight:600;margin-top:6px}
label{display:block;font-weight:600;margin:12px 0 4px;font-size:13px}
input[type=text],input[type=email],input[type=password],input[type=number]{width:100%;padding:8px 10px;border:1px solid #8a8886;border-radius:var(--sc-radius);font-size:14px;font-family:inherit}
/* Date inputs: match the height/border of other controls but keep natural width (not 100%). */
input[type=date]{padding:8px 10px;border:1px solid #8a8886;border-radius:var(--sc-radius);font-size:14px;font-family:inherit;background:#fff;color:var(--sc-text)}
input:focus{outline:2px solid var(--sc-accent);border-color:var(--sc-accent)}
/* Styled native selects — custom chevron replaces the browser default; native keyboard/mobile behavior preserved.
   Tom Select hides the original <select> and renders its own .ts-wrapper, so these rules don't fight it. */
select{appearance:none;-webkit-appearance:none;-moz-appearance:none;padding:8px 32px 8px 10px;border:1px solid #8a8886;border-radius:var(--sc-radius);font-size:14px;font-family:inherit;background-color:#fff;color:var(--sc-text);cursor:pointer;background-repeat:no-repeat;background-position:right 10px center;background-size:12px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23605e5c' d='M2 4l4 4 4-4z'/%3E%3C/svg%3E")}
select:focus{outline:2px solid var(--sc-accent);border-color:var(--sc-accent)}
select:hover{border-color:#605e5c}
/* Tom Select (used on the ticket form's single-selects): match native control border/height. */
.ts-wrapper .ts-control{border:1px solid #8a8886;border-radius:var(--sc-radius);min-height:37px;font-size:14px}
.ts-wrapper.focus .ts-control{outline:2px solid var(--sc-accent);border-color:var(--sc-accent);box-shadow:none}
/* Single-select: keep the selected item + search input on one line so focus doesn't double the height. */
.ts-wrapper.single .ts-control{flex-wrap:nowrap}
.ts-wrapper.single .ts-control>.item{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ts-wrapper.single .ts-control>input{min-width:0}

/* Compact multi-select filter (msf) — summary button + searchable checkbox popover. */
.msf{position:relative;display:inline-block}
.msf-btn{display:inline-flex;align-items:center;gap:8px;min-width:140px;max-width:180px;padding:8px 10px;border:1px solid #8a8886;border-radius:var(--sc-radius);background:#fff;font-size:14px;font-family:inherit;color:var(--sc-text);cursor:pointer}
.msf-btn:hover{border-color:#605e5c}
.msf.msf-active .msf-btn{border-color:var(--sc-accent)}
.msf-label{flex:1;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.msf-label.msf-empty{color:#8a8886}
.msf-caret{color:#605e5c;font-size:11px}
.msf-pop{position:absolute;z-index:60;top:calc(100% + 4px);left:0;width:260px;max-width:92vw;background:#fff;border:1px solid var(--sc-border);border-radius:8px;box-shadow:0 6px 20px rgba(0,0,0,.15);padding:8px}
.msf-search{width:100%;padding:8px 10px;border:1px solid #8a8886;border-radius:var(--sc-radius);font-size:14px;margin-bottom:6px}
.msf-list{max-height:240px;overflow-y:auto}
.msf-opt{display:flex;align-items:center;gap:10px;padding:7px 8px;border-radius:6px;cursor:pointer;font-size:13px}
.msf-opt:hover{background:#f3f2f1}
.msf-opt input{width:auto;margin:0}
.msf-foot{border-top:1px solid var(--sc-border);margin-top:6px;padding-top:6px}
.msf-clear{background:none;border:none;color:var(--sc-accent);font-size:13px;cursor:pointer;padding:4px}
.msf-clear:hover{text-decoration:underline}
/* Reset-all-filters link next to the Filter button */
.sc-reset{align-self:center;color:var(--sc-accent);font-size:13px;text-decoration:none}
.sc-reset:hover{text-decoration:underline}
/* Uniform height + zeroed label margins so every filter control lines up on one row. */
.sc-filters input[type=text],.sc-filters input[type=date],.sc-filters .msf-btn,.sc-filters .btn{height:38px;box-sizing:border-box}
.sc-filters .btn{display:inline-flex;align-items:center}
.sc-filters label{margin:0;height:38px}   /* override global stacked-label margin (was pushing dates 4px down) */
.btn{display:inline-block;background:var(--sc-accent);color:#fff;border:none;padding:9px 18px;border-radius:var(--sc-radius);font-size:14px;cursor:pointer;font-family:inherit}
.btn:hover{background:var(--sc-accent-dark)}
.btn.secondary{background:#fff;color:var(--sc-text);border:1px solid #8a8886}
.btn.primary{background:var(--sc-accent);color:#fff;border:none}
.btn.primary:hover{background:var(--sc-accent-dark)}
.btn .btn-plus{font-weight:700;margin-right:6px;font-size:15px;line-height:1}
/* Segmented toggle — a connected group of filter options, visually distinct from action buttons. */
.sc-segment{display:inline-flex;border:1px solid var(--sc-border);border-radius:var(--sc-radius);overflow:hidden;background:#fff}
.sc-segment a{padding:6px 14px;font-size:13px;color:var(--sc-text);text-decoration:none;border-left:1px solid var(--sc-border);line-height:1.4}
.sc-segment a:first-child{border-left:none}
.sc-segment a:hover{background:#f3f2f1;text-decoration:none}
.sc-segment a.active{background:var(--sc-accent);color:#fff}
.flash{padding:10px 14px;border-radius:var(--sc-radius);margin-bottom:14px;font-size:13px;border:1px solid}
.flash.success{background:#dff6dd;border-color:#9fd89f;color:#0b6a0b}
.flash.error{background:#fde7e9;border-color:#f3b9be;color:var(--sc-danger)}
.flash.info{background:#eff6fc;border-color:#bfddf5;color:var(--sc-accent-dark)}
.sc-table{width:100%;border-collapse:collapse;background:var(--sc-surface);border:1px solid var(--sc-border)}
.sc-table th,.sc-table td{text-align:left;padding:9px 12px;border-bottom:1px solid var(--sc-border);font-size:13px}
.sc-table th{background:#f8f7f6;color:var(--sc-text-secondary);font-weight:600}
/* Sticky table header — sticks to the top of the .sc-main scroll container on long tables. */
.sc-table thead th{position:sticky;top:0;z-index:1}
.sc-table th.sortable a{color:inherit;text-decoration:none;cursor:pointer;white-space:nowrap;display:inline-block}
.sc-table th.sortable a:hover{color:var(--sc-accent)}
.sc-table th.sortable.active a{color:var(--sc-text)}
/* Pagination bar */
.sc-pagination{display:flex;align-items:center;justify-content:center;gap:16px;padding:12px 16px;border-top:1px solid var(--sc-border);font-size:13px}
.sc-pagination a{color:var(--sc-accent);text-decoration:none;padding:4px 10px;border:1px solid var(--sc-border);border-radius:var(--sc-radius)}
.sc-pagination a:hover{background:#f3f2f1;text-decoration:none}
.sc-pagination .disabled{color:#bdbdbd;padding:4px 10px;border:1px solid var(--sc-border);border-radius:var(--sc-radius)}
.sc-pagination-info{color:var(--sc-text-secondary)}
.badge{display:inline-block;padding:2px 8px;border-radius:10px;font-size:11px;font-weight:600}
.badge.PASS{background:#dff6dd;color:#0b6a0b}
.badge.WARN{background:#fff4ce;color:#7a5c00}
.badge.FAIL{background:#fde7e9;color:var(--sc-danger)}
.sc-auth{min-height:100vh;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#0078d4 0%,#106ebe 100%)}
.sc-auth .panel{background:#fff;border-radius:6px;padding:32px;width:380px;box-shadow:0 8px 30px rgba(0,0,0,.25)}
.sc-auth h1{font-size:20px;margin:0 0 4px}
.sc-auth .muted{color:var(--sc-text-secondary);font-size:13px;margin-bottom:18px}
.sc-footer{background:var(--sc-sidebar);color:var(--sc-text-secondary);text-align:center;font-size:12px;padding:12px 0;border-top:1px solid var(--sc-border)}
.sc-footer a{color:var(--sc-text-secondary);text-decoration:underline}
.muted{color:var(--sc-text-secondary)}

/* ---- Requester portal (Section 17) ---- */
.sc-portal{background:#faf9f8;color:#201f1e;margin:0;overflow-x:hidden}
.sc-portal-wrap{max-width:920px;margin:0 auto;padding:0 20px}
.sc-portal-head{background:#fff;border-bottom:1px solid #edebe9;padding:14px 0;position:sticky;top:0;z-index:5}
.sc-portal-brand{font-weight:700;font-size:18px;text-decoration:none;color:#201f1e}
.sc-portal-head nav a{color:#605e5c;text-decoration:none;font-size:14px}
.sc-portal-head nav a:hover{color:#0078d4}
.sc-portal-foot{border-top:1px solid #edebe9;padding:22px 0;color:#605e5c;font-size:13px;text-align:center;margin-top:40px}
/* Brand logo + desk pill in portal chrome (--pa is the desk accent, set on <body>) */
.sc-portal-brand{gap:11px}
.sc-brand-logo{height:22px;display:block}
.sc-desk-pill{font-size:11px;font-weight:700;letter-spacing:.02em;color:#fff;background:var(--pa,#0078d4);padding:3px 10px;border-radius:999px;line-height:1.6}
.sc-portal-signin{border:1px solid #d3d8df;border-radius:8px;padding:6px 12px;color:#201f1e !important}
.sc-portal-signin:hover{background:#f3f2f1;text-decoration:none}
.sc-foot-inner{display:flex;flex-direction:column;align-items:center;gap:12px}
.sc-foot-logo{height:30px;display:block}
.sc-foot-inner a{color:#605e5c}
/* Mobile: let the header wrap so the nav never overflows the viewport (was causing a horizontal scroll). */
@media (max-width:640px){
  .sc-portal-head > .sc-portal-wrap{flex-wrap:wrap;row-gap:6px}
  .sc-portal-head nav{flex-wrap:wrap;width:100%;justify-content:flex-start}
  .sc-portal-head nav a{font-size:13px}
}
.sc-hero{background:linear-gradient(135deg,#0078d4,#005a9e);color:#fff;border-radius:10px;padding:34px 28px;margin-bottom:22px}
.sc-hero h1{margin:0 0 8px;font-size:26px}
.sc-hero p{margin:0;opacity:.92}
.sc-search-box{display:flex;gap:8px;margin-top:18px}
.sc-search-box input{flex:1;padding:12px 14px;border:none;border-radius:6px;font-size:15px}
.sc-presence{display:inline-flex;align-items:center;gap:8px;padding:8px 14px;border-radius:20px;font-size:14px;font-weight:600}
.sc-presence.online{background:#dff6dd;color:#107c10}
.sc-presence.offline{background:#f3f2f1;color:#605e5c}
.sc-presence.busy{background:#fff4ce;color:#797673}
.sc-tile{display:block;background:#fff;border:1px solid #edebe9;border-radius:8px;padding:18px;text-decoration:none;color:#201f1e}
.sc-tile:hover{border-color:#0078d4;box-shadow:0 2px 8px rgba(0,0,0,.06)}
.sc-grid-3{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px}
.kb-result{padding:10px 0;border-bottom:1px solid #f3f2f1}
.kb-result a{color:#0078d4;text-decoration:none;font-weight:600}
.sc-chip{display:inline-block;background:#f3f2f1;border-radius:12px;padding:2px 10px;font-size:12px;color:#605e5c;margin-right:4px}

/* ---- Live chat (Section 21) ---- */
.chatmsg{margin-bottom:8px;padding:6px 10px;border-radius:6px;max-width:85%}
.chatmsg.visitor{background:#eef6fc;border-left:3px solid #0078d4}
.chatmsg.agent{background:#dff6dd;border-left:3px solid #107c10;margin-left:auto}
.chatmsg.system{background:#f3f2f1;color:#605e5c;font-size:12px;font-style:italic;text-align:center;max-width:100%}

/* ---- Employee 360 tabs (Section 11.6) ---- */
.sc-tabs{display:flex;gap:4px;border-bottom:2px solid #edebe9;margin:12px 0 16px;flex-wrap:wrap}
.sc-tab{border:none;background:none;padding:8px 14px;cursor:pointer;font-size:14px;color:#605e5c;border-bottom:2px solid transparent;margin-bottom:-2px}
.sc-tab.active{color:#0078d4;border-bottom-color:#0078d4;font-weight:600}
.sc-tabpane{display:none}
.sc-tabpane.active{display:block}

/* ---- Dashboards (Section 41) ---- */
.dash-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;margin-bottom:16px}
.kpi{background:#fff;border:1px solid #edebe9;border-radius:8px;padding:14px 16px}
.kpi .num{font-size:26px;font-weight:700;color:#201f1e;line-height:1.1}
.kpi .num.alert{color:#a4262c}.kpi .num.good{color:#107c10}
.kpi .lbl{font-size:12px;color:#605e5c;margin-top:4px}
.kpi a{font-size:12px}
.dash-switcher{display:flex;gap:4px;flex-wrap:wrap;margin-bottom:14px}
.dash-switcher a{padding:5px 10px;border-radius:4px;font-size:13px;text-decoration:none;color:#605e5c;border:1px solid #edebe9}
.dash-switcher a.active{background:#0078d4;color:#fff;border-color:#0078d4}
.dash-card{background:#fff;border:1px solid #edebe9;border-radius:8px;padding:14px 16px;margin-bottom:14px}
.dash-2col{display:grid;grid-template-columns:1fr 1fr;gap:14px;align-items:start}
@media(max-width:720px){.dash-2col{grid-template-columns:1fr}}

/* ---- Portal landing (repair patch) ---- */
.sc-grid-2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.sc-portal-2col{display:grid;grid-template-columns:1fr 320px;gap:20px;align-items:start}
.sc-portal-aside .sc-card{margin-bottom:14px}
.sc-metrics .sc-metric-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin:10px 0}
.sc-metrics .m-num{display:block;font-size:24px;font-weight:700;color:#0078d4;line-height:1.1}
.sc-metrics .m-lbl{display:block;font-size:12px;color:#605e5c;margin-top:2px}
@media(max-width:820px){.sc-portal-2col{grid-template-columns:1fr}.sc-metrics .sc-metric-grid{grid-template-columns:repeat(2,1fr)}.sc-grid-2{grid-template-columns:1fr}}

/* Collapsible sidebar groups (improvement patch d3.8) */
.sc-sidebar .group.group-toggle{cursor:pointer;user-select:none;display:flex;align-items:center;justify-content:space-between;border-radius:4px}
.sc-sidebar .group.group-toggle:hover{color:var(--sc-text)}
.sc-sidebar .group.group-toggle:hover::after{color:var(--sc-text)}
/* Prominent expand/collapse chevron (was too subtle). */
.sc-sidebar .group.group-toggle::after{content:'\25BE';font-size:13px;font-weight:700;color:var(--sc-text);margin-right:2px;transition:transform .15s ease}
.sc-sidebar .group.group-toggle.collapsed::after{transform:rotate(-90deg)}
.sc-sidebar .group-body{overflow:hidden}
/* Sidebar search entry (opens the command palette) */
.sc-navsearch{display:flex;align-items:center;justify-content:space-between;gap:8px;width:calc(100% - 16px);margin:8px;padding:7px 10px;background:#fff;border:1px solid var(--sc-border);border-radius:var(--sc-radius);color:var(--sc-text-secondary);font-size:13px;font-family:inherit;cursor:pointer}
.sc-navsearch:hover{border-color:#8a8886}
.sc-navsearch .sc-navsearch-label::before{content:'\1F50D\00a0';font-size:12px}
.sc-navsearch-kbd{font-size:11px;color:var(--sc-text-secondary);border:1px solid var(--sc-border);border-radius:4px;padding:0 5px;background:#faf9f8}
/* Command palette (⌘K) */
.sc-cmdk{position:fixed;inset:0;z-index:1000;display:flex;align-items:flex-start;justify-content:center;background:rgba(0,0,0,.35);padding-top:12vh}
.sc-cmdk[hidden]{display:none}
.sc-cmdk-box{width:560px;max-width:92vw;max-height:70vh;display:flex;flex-direction:column;background:#fff;border-radius:10px;box-shadow:0 12px 40px rgba(0,0,0,.28);overflow:hidden}
.sc-cmdk-input{border:none;border-bottom:1px solid var(--sc-border);padding:16px 18px;font-size:16px;font-family:inherit;outline:none;width:100%;box-sizing:border-box}
.sc-cmdk-results{overflow-y:auto;padding:6px}
.sc-cmdk-sec{font-size:11px;text-transform:uppercase;letter-spacing:.6px;color:var(--sc-text-secondary);padding:10px 12px 4px;font-weight:600}
.sc-cmdk-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 12px;border-radius:6px;cursor:pointer;font-size:14px;color:var(--sc-text)}
.sc-cmdk-item .sc-cmdk-path{font-size:12px;color:var(--sc-text-secondary)}
.sc-cmdk-item.active,.sc-cmdk-item:hover{background:var(--sc-accent);color:#fff}
.sc-cmdk-item.active .sc-cmdk-path,.sc-cmdk-item:hover .sc-cmdk-path{color:rgba(255,255,255,.85)}
.sc-cmdk-item mark{background:transparent;color:inherit;font-weight:700;text-decoration:underline}
.sc-cmdk-empty{padding:20px 16px;color:var(--sc-text-secondary);font-size:14px;text-align:center}
.sc-cmdk-hint{display:flex;gap:14px;padding:8px 14px;border-top:1px solid var(--sc-border);font-size:11px;color:var(--sc-text-secondary)}

/* Whole-sidebar collapse toggle (v1.2.1) */
.sb-toggle{background:none;border:none;color:#fff;font-size:18px;cursor:pointer;padding:4px 10px;margin-right:4px;line-height:1;border-radius:4px}
.sb-toggle:hover{background:rgba(255,255,255,.15)}
body.sb-collapsed .sc-sidebar{display:none}
body.sb-collapsed .sc-main{width:100%}

/* Text-based brand logo: brand IT Helpdesk */
.brand{display:inline-flex;align-items:center;gap:8px}
.brand-mark{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:6px;background:#fff;color:var(--sc-accent);font-weight:800;font-size:12px;letter-spacing:.5px;font-family:Georgia,'Times New Roman',serif}
.brand-name{font-weight:400;font-size:15px;letter-spacing:.3px}
.brand-name strong{font-weight:700}
.sc-auth .panel h1 .brand-mark{width:32px;height:32px;font-size:14px;background:var(--sc-accent,#0078d4);color:#fff;vertical-align:middle;display:inline-flex}
.sc-portal-brand{display:inline-flex;align-items:center;gap:8px;font-weight:400}
.sc-portal-brand strong{font-weight:700}
.brand-mark-accent{background:var(--sc-accent,#0078d4);color:#fff}

/* Org chart */
.oc-tree,.oc-children{list-style:none;margin:0;padding-left:22px}
.oc-tree{padding-left:0}
.oc-children{border-left:2px solid #edebe9;margin-left:11px}
.oc-item{margin:2px 0}
.oc-node{display:inline-flex;align-items:center;gap:8px;padding:5px 10px;border:1px solid #edebe9;border-radius:6px;background:#faf9f8;cursor:pointer;max-width:100%}
.oc-node:hover{border-color:#0078d4;background:#eff6fc}
.oc-name{font-weight:600;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:220px}
.oc-desig{font-size:11px;color:#605e5c;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:180px}
.oc-count{background:#0078d4;color:#fff;border-radius:10px;font-size:11px;padding:0 7px;font-weight:600}
.oc-toggle{width:20px;height:20px;border-radius:4px;border:1px solid #c8c6c4;background:#fff;cursor:pointer;font-weight:700;line-height:1;flex:none}
.oc-detail{position:fixed;right:18px;bottom:18px;width:320px;max-width:90vw;background:#fff;border:1px solid #c8c6c4;border-radius:8px;box-shadow:0 6px 24px rgba(0,0,0,.18);padding:14px;z-index:50}
@media (max-width:640px){.oc-name{max-width:140px}.oc-desig{display:none}}

/* ---- Phone shell (v2.74.0) — additive; nothing above this line changes on desktop ---- */
.sc-actions{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px}
.sc-tile.sc-action{display:flex;flex-direction:column;gap:2px;padding:16px 16px 14px;line-height:1.3}
.sc-tile.sc-action .ic{font-size:22px;line-height:1;margin-bottom:6px}
.sc-tile.sc-action strong{font-size:15px}
.sc-tile.sc-action .muted{font-size:12px}
.sc-bottomnav{display:none}
@media (max-width:720px){
  /* The 240px sidebar used to sit beside the page on a phone and squeeze it to a sliver. */
  .sc-body{position:relative}
  .sc-sidebar{position:fixed;top:48px;left:0;bottom:0;width:min(84vw,300px);height:calc(100vh - 48px);z-index:60;transform:translateX(-105%);transition:transform .18s ease;box-shadow:0 0 0 rgba(0,0,0,0)}
  body.sb-open .sc-sidebar{transform:none;box-shadow:12px 0 32px rgba(0,0,0,.18)}
  body.sb-collapsed .sc-sidebar{display:block}          /* the desktop pref must not hide the overlay */
  .sc-sb-backdrop{display:none;position:fixed;inset:48px 0 0 0;background:rgba(0,0,0,.35);z-index:55}
  body.sb-open .sc-sb-backdrop{display:block}
  body.sb-open{overflow:hidden}
  .sc-main{width:100%}
  .sc-main-inner{padding:14px 14px 76px}                /* room for the bottom bar */
  .sc-page-title{font-size:20px}
  .sc-table{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch}
  .sc-grid-3,.sc-actions{grid-template-columns:repeat(2,1fr);gap:10px}
  .sc-tile.sc-action{padding:14px 12px 12px}
  .sc-tile.sc-action strong{font-size:14px}
  .btn{min-height:42px}
  .sc-footer,footer.sc-footer{font-size:11px;padding-bottom:70px}
  .sc-bottomnav{display:flex;position:fixed;left:0;right:0;bottom:0;height:60px;background:#fff;border-top:1px solid #e1dfdd;z-index:50;padding-bottom:env(safe-area-inset-bottom)}
  .sc-bottomnav a{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:11px;color:#605e5c;text-decoration:none}
  .sc-bottomnav a .ic{font-size:20px;line-height:1}
  .sc-bottomnav a[aria-current="page"]{color:#0078d4;font-weight:600}

  /* --- the top bar -----------------------------------------------------------------
     Its intrinsic width is about 475px — hamburger, brand, a 200px employee search, the
     bell, a text link and the avatar. On every phone from 320px up that
     overflowed, the nav wrapped to four lines inside a 48px bar, and the bell ended up
     69px above the avatar and off the right edge. Drop what a phone does not need. */
  .sc-topbar{padding:0 10px;gap:8px}
  .sc-topbar form{display:none}                 /* employee lookup is an agent tool; the sidebar has it */
  .sc-topbar .brand-name{display:none}          /* the mark alone identifies the desk */
  .sc-topbar .topnav{gap:10px;flex-wrap:nowrap}
  .sc-topbar .topnav a{font-size:0}             /* keep the ⇄ glyph, drop the words after it */
  .sc-topbar .topnav a::first-letter{font-size:15px}
  .sc-topbar .topnav .sc-usermenu-panel a{font-size:13px}

  /* --- overflow guards -------------------------------------------------------------
     The commonest cause of a page scrolling sideways on a phone is an inline flex row:
     it declares display and gap but never flex-wrap, so a label / value / button row
     stays on one line and pushes the page wide. Setting flex-wrap from here is not a
     specificity fight — the inline style never declares that property, so this wins.
     It also cannot do harm: wrap only takes effect when the row would overflow anyway.
     The same trick caps hardcoded pixel widths, since max-width does not collide with
     an inline width either. Together these fix the pattern across every view without
     editing any of them. */
  .sc-main-inner [style*="display:flex"]{flex-wrap:wrap}
  .sc-main-inner [style*="width:"]{max-width:100%}
  /* The two-column case pages (journey | cards) are inline grids. A stylesheet cannot override
     an inline grid-template-columns, but it CAN make every child span the whole grid, which
     stacks the columns — the same "different property" trick as the flex-wrap guard. Scoped
     to the page-level layouts (gap:16px;align-items:start) so key/value grids inside cards
     keep their two columns. */
  .sc-main-inner [style*="grid-template-columns:2fr 1fr;gap:16px;align-items:start"]>*,
  .sc-main-inner [style*="grid-template-columns:1fr 1fr;gap:16px;align-items:start"]>*{grid-column:1 / -1}
  /* The record pages (ITIL record, ticket, notification template) pair the main column with a
     fixed 340px side column. Spanning is not enough there: the 340px track would still make the
     grid wider than a 375px phone. !important is the one way a stylesheet beats an inline
     declaration, so this one layout gets a single column outright. */
  .sc-main-inner [style*="grid-template-columns:1fr 340px;gap:16px;align-items:start"]{grid-template-columns:minmax(0,1fr)!important}
  .sc-main-inner img{max-width:100%;height:auto}
  .sc-card{padding:14px}                                /* 20px costs real width on a 390px screen */
  .sc-main-inner table{max-width:100%}
  /* The device threat report's tables carry real columns (a minute-by-minute time map), so
     squeezing them to fit makes them unreadable. Give them the same scroll .sc-table gets.
     Scoped to the phone breakpoint, so printing and the PDF path are untouched. */
  .secrep table.tl{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch;white-space:nowrap}
}

/* Sidebar: collapsible register group + the footer that sits below every group (v2.108.0).
   The fold is a native <details> so it needs no JS and keeps its state in the markup the server
   sends — the server opens it when you are on one of its pages. .sc-navfoot is a sentinel: the
   group-collapse script stops wrapping there, so My Workspace and Settings never get pulled
   inside the last group and vanish when it is collapsed. */
.sc-sidebar .sc-navfold{margin:0}
.sc-sidebar .sc-navfold>summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:7px;padding:7px 16px 7px 28px;font-size:13px;color:var(--sc-text-secondary);user-select:none;border-left:3px solid transparent}
.sc-sidebar .sc-navfold>summary::-webkit-details-marker{display:none}
.sc-sidebar .sc-navfold>summary::before{content:'\25B8';font-size:11px;line-height:1;transition:transform .15s ease}
.sc-sidebar .sc-navfold[open]>summary::before{transform:rotate(90deg)}
.sc-sidebar .sc-navfold>summary:hover{background:#eae9e8;color:var(--sc-text)}
.sc-sidebar .sc-navfold a.item{padding-left:44px}
.sc-navfold-n{margin-left:auto;font-size:11px;color:var(--sc-text-secondary);font-variant-numeric:tabular-nums}
.sc-sidebar .sc-navrule{height:1px;background:var(--sc-border);margin:14px 16px 8px}
.sc-sidebar .sc-navfoot a.item{display:flex;align-items:center}
/* Settings hub (v2.108.0) */
.sc-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.sc-hub-search{margin:0 0 20px}
.sc-hub-search input{width:100%;max-width:420px;box-sizing:border-box;padding:9px 12px;font:inherit;font-size:13px;border:1px solid var(--sc-border);border-radius:var(--sc-radius);background:#fff;color:var(--sc-text)}
.sc-hub-search input:focus{outline:2px solid var(--sc-accent);outline-offset:-1px}
.sc-hub-sec{margin:0 0 22px}
.sc-hub-sec>h2{display:flex;align-items:baseline;gap:9px;font-size:13px;font-weight:600;margin:0 0 9px;padding-bottom:6px;border-bottom:1px solid var(--sc-border)}
.sc-hub-sec>h2 .muted{font-size:11px;font-weight:400;font-variant-numeric:tabular-nums}
.sc-hub-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:8px}
.sc-hub-tile{display:block;padding:11px 13px;border:1px solid var(--sc-border);border-radius:var(--sc-radius);background:#fff;text-decoration:none;color:var(--sc-text)}
.sc-hub-tile:hover{border-color:var(--sc-accent);text-decoration:none}
.sc-hub-tile:focus-visible{outline:2px solid var(--sc-accent);outline-offset:1px}
.sc-hub-tile strong{display:block;font-size:13px;font-weight:600}
.sc-hub-tile span{display:block;font-size:11.5px;line-height:1.4;color:var(--sc-text-secondary);margin-top:3px}

/* Dashboards, rebuilt around what needs attention (v2.108.0). The band ranks the page: red rows
   first, then amber, each a sentence with somewhere to go. The blocks replace the flat KPI grid —
   same numbers, grouped and named, so the eye has somewhere to start. */
.dash-attn{background:#fff;border:1px solid var(--sc-border);border-radius:8px;overflow:hidden;margin:0 0 16px}
.dash-attn>header{display:flex;align-items:center;gap:8px;padding:10px 16px;border-bottom:1px solid #f3f2f1}
.dash-attn>header .dot{width:7px;height:7px;border-radius:50%;background:#a4262c}
.dash-attn>header h2{font-size:12px;font-weight:600;margin:0;letter-spacing:.01em}
.dash-attn>header .n{font-size:11px;color:var(--sc-text-secondary);font-variant-numeric:tabular-nums}
.dash-attn .row{display:flex;align-items:center;gap:13px;padding:9px 16px;border-bottom:1px solid #faf9f8}
.dash-attn .row:last-child{border-bottom:0}
.dash-attn .bullet{flex:0 0 auto;width:6px;height:6px;border-radius:50%}
.dash-attn .count{font-size:17px;font-weight:700;min-width:42px;text-align:right;font-variant-numeric:tabular-nums}
.dash-attn .what{flex:1 1 auto;font-size:13px;line-height:1.4}
.dash-attn .note{font-size:11.5px;color:var(--sc-text-secondary)}
.dash-attn .row>a{font-size:12px;font-weight:600;white-space:nowrap}
.dash-attn .row.bad .bullet,.dash-attn .row.bad .count{background:transparent;color:#a4262c}
.dash-attn .row.bad .bullet{background:#a4262c}
.dash-attn .row.warn .count{color:#8a5300}
.dash-attn .row.warn .bullet{background:#c19c00}
.dash-attn .row.info .count{color:#0078d4}
.dash-attn .row.info .bullet{background:#0078d4}
.dash-clear{color:var(--sc-text-secondary);font-size:13px;margin:0 0 16px}
@media(max-width:700px){
  .dash-attn .row{flex-wrap:wrap;gap:6px 10px}
  .dash-attn .note{flex-basis:100%;order:4;padding-left:55px}
}
.dash-blocks{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:14px;margin:0 0 14px}
.dash-block{background:#fff;border:1px solid var(--sc-border);border-radius:8px;padding:13px 16px 15px}
.dash-block h3{font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:var(--sc-text-secondary);margin:0 0 10px;padding-bottom:7px;border-bottom:1px solid #f3f2f1;font-weight:600}
.dash-block dl{margin:0;display:flex;flex-direction:column;gap:7px}
.dash-block dl>div{display:flex;align-items:baseline;gap:10px}
.dash-block dt{flex:1 1 auto;font-size:12.5px;color:#4a4f58;margin:0}
.dash-block dd{margin:0;font-size:14px;font-weight:700;font-variant-numeric:tabular-nums}
.dash-block dd.alert{color:#a4262c}
.dash-block dd.good{color:#107c10}
.fleet-bar{display:flex;height:26px;border-radius:5px;overflow:hidden}
.fleet-bar span{display:block;min-width:2px}
.fleet-key{display:flex;flex-wrap:wrap;gap:8px 20px;margin-top:14px}
.fleet-key a{display:flex;align-items:center;gap:7px;font-size:12.5px;color:#4a4f58;text-decoration:none}
.fleet-key a:hover{color:var(--sc-text)}
.fleet-key .sw{width:9px;height:9px;border-radius:2px}
.queue-card{display:flex;align-items:center;gap:16px}
.queue-card .tag{flex:0 0 auto;width:34px;height:34px;border-radius:7px;color:#fff;font-size:12px;font-weight:700;display:flex;align-items:center;justify-content:center}
.queue-card .tag.it{background:#0078d4}
.queue-card .who{flex:1 1 auto;font-size:13px}
.queue-card .fig{text-align:right;text-decoration:none;color:var(--sc-text);padding-left:16px;border-left:1px solid #f3f2f1}
.queue-card .fig b{display:block;font-size:26px;line-height:1;font-variant-numeric:tabular-nums}
.queue-card .fig span{display:block;font-size:10.5px;color:var(--sc-text-secondary);margin-top:3px}
.queue-card .fig.alert b{color:#a4262c}
.statbars{display:flex;flex-direction:column;gap:11px}
.statbars .lbl{display:flex;align-items:baseline;gap:8px;margin-bottom:4px;font-size:12.5px}
.statbars .lbl span{flex:1 1 auto;color:#4a4f58}
.statbars .lbl strong{font-variant-numeric:tabular-nums}
.statbars .track{height:7px;border-radius:4px;background:#f3f2f1;overflow:hidden}
.statbars .track i{display:block;height:7px;background:#0078d4}
/* ---------------------------------------------------------------------------------------------
   Accessibility and mobile corrections for the APPLICATION stylesheet (v3.2.0)

   APPEND this to static/css/app.css — do not add a second <link>, which would cost a request:

       cat static/css/a11y.css >> static/css/app.css && rm static/css/a11y.css

   Then bump 'version' in config/app.php so the ?v= cache-buster changes and browsers pick it up.

   What this fixes, and why each one is here:
     - no visible focus ring anywhere (WCAG 2.4.7) — the single biggest keyboard-navigation failure
     - no skip link (2.4.1)
     - touch targets under 44 px (2.5.8)
     - inputs under 16 px, which makes iOS Safari zoom the page on every focus
     - no prefers-reduced-motion handling (2.3.3)
     - the colour scheme is pinned to light (see the note near the end of this file)
     - tables forcing horizontal page scroll on a phone (1.4.10 reflow)
--------------------------------------------------------------------------------------------- */

/* --- Focus: visible, always. Never remove an outline without replacing it. ------------------ */
:focus-visible {
  outline: 3px solid var(--sc-accent, #0078d4);
  outline-offset: 2px;
  border-radius: 3px;
}
/* Older engines without :focus-visible still get a ring rather than nothing. */
a:focus, button:focus, input:focus, select:focus, textarea:focus, summary:focus, [tabindex]:focus {
  outline: 3px solid var(--sc-accent, #0078d4);
  outline-offset: 2px;
}
a:focus:not(:focus-visible), button:focus:not(:focus-visible),
input:focus:not(:focus-visible), select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) { outline: none; }

/* --- Skip link. Add this as the first element inside <body> in layouts/app.php and
       layouts/portal.php:  <a class="sc-skip" href="#sc-main">Skip to main content</a>
       and give the main content container id="sc-main".                                   ----- */
.sc-skip {
  position: absolute; left: -9999px; top: 0; z-index: 1000;
  background: var(--sc-accent, #0078d4); color: #fff;
  padding: 12px 18px; font-weight: 600; border-radius: 0 0 4px 0;
}
.sc-skip:focus { left: 0; }

/* --- Touch targets (WCAG 2.2 §2.5.8: 24 px minimum; 44 px on touch) ------------------------ */
.btn, .sc-segment a, .sc-bottomnav a, .sc-tabs a, .sc-usermenu > button, button {
  min-height: 36px;
}
@media (pointer: coarse) {
  .btn, .sc-segment a, .sc-bottomnav a, .sc-tabs a, .sc-chip, button,
  .sc-table td a, .sc-usermenu > button {
    min-height: 44px;
    min-width: 44px;
  }
  /* An icon-only control still needs the target even when the glyph is small. */
  .btn-plus { padding-left: 14px; padding-right: 14px; }
}

/* --- 16 px inputs: below this, iOS Safari zooms the viewport on focus and the person has to
       pinch back out on every single field.                                               ----- */
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=tel], input[type=search], input[type=url],
select, textarea {
  font-size: 16px;
}

/* --- Reduced motion ------------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Tables scroll inside their own container, never the page ------------------------------ */
@media (max-width: 720px) {
  .sc-table-wrap, .sc-card > .sc-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  body { overflow-x: hidden; }
}

/* --- Safe areas on notched phones ---------------------------------------------------------- */
@supports (padding: max(0px)) {
  .sc-bottomnav { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .sc-main-inner { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
}

/* --- Status must never be colour alone (WCAG 1.4.1). Pair every badge with its text; this
       adds a shape cue for the three that matter most.                                    ----- */
.badge.badge-danger::before { content: '● '; }
.badge.badge-warn::before   { content: '▲ '; }
.badge.badge-success::before{ content: '✓ '; }

/* --- Colour scheme: the application is LIGHT, whatever the device is set to. ---------------
   v3.2.0 added a "tokens only" dark mode here. It was wrong: dozens of application components
   (the sign-in and installer panel, cards, tiles, menus, secondary buttons, the help centre) set
   their own white background, so on a device in dark mode the tokens turned their TEXT light on
   a background that stayed white — the installer and every sign-in page were close to unreadable.
   Until every component is themed and checked, the app does not follow the device into dark
   mode. color-scheme also keeps the browser's own form controls and scrollbars light.
   (The public website's stylesheet has its own, complete dark theme and is unaffected.) */
:root { color-scheme: light; }

/* --- Print: reports and handover documents should come out clean --------------------------- */
@media print {
  .sc-topbar, .sc-sidebar, .sc-bottomnav, .sc-skip, .btn, .sc-segment { display: none !important; }
  .sc-main, .sc-main-inner { margin: 0 !important; padding: 0 !important; }
  body { background: #fff; color: #000; }
}

/* --- "Made in India … by Support IT Ventures" (v3.4.0) ------------------------------------- */
.sc-bare-foot a { color: #fff; text-decoration: underline; }
.sc-made a { font-weight: 600; }
