/* ISG Staff Portal, 24 Nov 2026 redesign (Tony: sleeker, sharper, Microsoft-like). */
:root {
  --ink: #1b1b1b; --muted: #616161; --line: #e0e0e0; --line-strong: #c7c7c7;
  --bg: #f5f5f5; --card: #ffffff; --accent: #0f6cbd; --accent-dark: #0c5aa0; --accent-soft: #ebf3fc;
  --danger: #c4314b; --ok: #107c10; --warn: #bc4b09; --top: #1f1f1f;
  --r: 4px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 1px 1px rgba(0,0,0,.04); --shadow-hover: 0 4px 12px rgba(0,0,0,.10);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--accent); }

/* Top bar */
/* 24 Nov 2026 (Tony): the brand sits in a fixed left rail, so the tabs and the page content start on the same line. */
:root { --rail: 250px; --edge: 20px; }
header.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 20px; height: 52px; padding: 0 var(--edge); background: var(--top); color: #fff; }
.head-left { flex: 0 0 var(--rail); display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 600; font-size: 15px; letter-spacing: .1px; white-space: nowrap; }
.brand .logo { height: 38px; width: auto; display: block; margin: -2px 0; } /* 24 Nov 2026: ISG globe logo (white version) */
.env { padding: 2px 8px; border-radius: 2px; background: #bc4b09; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; }
.tabs { display: flex; height: 100%; gap: 4px; }
.tabs a { display: flex; align-items: center; padding: 0 12px; color: #d6d6d6; text-decoration: none; font-size: 14px; border-bottom: 2px solid transparent; }
.tabs a:hover { color: #fff; background: rgba(255,255,255,.06); }
.tabs a.on { color: #fff; border-bottom-color: #4ea8f0; }
.spacer { flex: 1; }

/* Account menu */
.account { position: relative; }
.account summary { list-style: none; cursor: pointer; display: flex; align-items: center; position: relative; }
.account summary::-webkit-details-marker { display: none; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: #4f6bed; color: #fff; font-size: 13px; font-weight: 600; }
.avatar.big { width: 44px; height: 44px; font-size: 16px; flex: 0 0 44px; }
.account .dot { position: absolute; right: -1px; top: -1px; width: 10px; height: 10px; border-radius: 50%; background: #ffb900; border: 2px solid var(--top); }
.account[open] summary .avatar { box-shadow: 0 0 0 2px #fff; }
.menu { position: absolute; right: 0; top: 44px; width: 320px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 8px 24px rgba(0,0,0,.16); overflow: hidden; }
.menu-who { display: flex; gap: 12px; align-items: center; padding: 16px; }
.menu-who strong { display: block; font-size: 15px; } .menu-who .muted { display: block; font-size: 13px; word-break: break-all; }
.menu-sec { margin: 0 16px 12px; padding: 10px 12px; border-radius: var(--r); font-size: 13px; background: #f3f9f1; border-left: 3px solid var(--ok); }
.menu-sec.warn { background: #fdf6f0; border-left-color: #ffb900; }
.menu-sec .muted { display: block; margin-top: 4px; font-size: 12px; }
.menu-signout { width: 100%; text-align: left; border-radius: 0 !important; background: #fafafa !important; color: var(--ink) !important; border-top: 1px solid var(--line) !important; padding: 12px 16px !important; font-weight: 600; }
.menu-signout:hover { background: #f0f0f0 !important; }

.menu-links { display: none; border-top: 1px solid var(--line); margin-bottom: 12px; }
.menu-links a { display: block; padding: 10px 16px; color: var(--ink); text-decoration: none; font-size: 14px; border-bottom: 1px solid #f0f0f0; }
.menu-links a.on { font-weight: 600; color: var(--accent); }

/* Page */
main { max-width: 860px; margin: 0 auto; padding: 28px 24px 48px; }
/* Wide pages line up with the first tab ("Home") and run to the right edge. */
main.wide { max-width: none; margin: 0; padding-left: calc(var(--edge) + var(--rail) + 20px + 12px); padding-right: calc(var(--edge) + 12px); }
h1 { font-size: 24px; font-weight: 600; margin: 4px 0 20px; letter-spacing: -.2px; }
h2 { font-size: 16px; font-weight: 600; margin: 28px 0 10px; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; }
.big { font-size: 16px; } .muted { color: var(--muted); font-size: 13px; }
.notice, .error { padding: 10px 14px; border-radius: var(--r); font-size: 14px; font-weight: 500; border-left: 3px solid; }
.notice { background: #f3f9f1; border-color: var(--ok); } .error { background: #fdf3f4; border-color: var(--danger); color: var(--danger); }

/* App tiles */
.group h2 { margin: 26px 0 10px; color: #424242; }
.group:first-of-type h2 { margin-top: 4px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 10px; }
.tile { min-width: 0; display: flex; align-items: center; gap: 14px; height: 76px; padding: 0 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); transition: box-shadow .12s, border-color .12s; }
.tile:hover { box-shadow: var(--shadow-hover); border-color: var(--line-strong); }
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tile-icon { flex: 0 0 40px; width: 40px; height: 40px; padding: 7px; border-radius: var(--r); background: var(--accent-soft); object-fit: contain; }
img.tile-icon[src$=".png"] { padding: 2px; background: #fff; border: 1px solid var(--line); }
.tile-text { display: flex; flex-direction: column; min-width: 0; }
.tile-text strong { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-text span { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Buttons and forms */
a.button, button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 6px 16px; border: 1px solid transparent; border-radius: var(--r); background: var(--accent); color: #fff; font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; }
a.button:hover, button:hover { background: var(--accent-dark); }
a.button.small { min-height: 28px; padding: 3px 12px; font-size: 13px; }
.secondary { background: #fff !important; color: var(--ink) !important; border-color: var(--line-strong) !important; } .secondary:hover { background: #f5f5f5 !important; }
.danger { background: var(--danger) !important; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; min-height: 0; } form.inline { display: inline; }
label { display: block; margin: 14px 0; font-weight: 600; font-size: 14px; }
input, select, textarea { display: block; width: 100%; margin-top: 6px; padding: 8px 10px; font: inherit; font-size: 14px; border: 1px solid var(--line-strong); border-radius: var(--r); background: #fff; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
input[type=checkbox], input[type=radio] { display: inline-block; width: 18px; height: 18px; margin: 0 8px 0 0; vertical-align: -3px; accent-color: var(--accent); box-shadow: none; }
label.choice { font-weight: 400; margin: 8px 0; } label.choice.big { font-size: 15px; font-weight: 600; } .choices { display: flex; gap: 24px; flex-wrap: wrap; }
form.row { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; } form.row label { flex: 1 1 240px; margin: 0; }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 6px 18px 14px; margin: 14px 0; background: #fff; } legend { font-weight: 600; padding: 0 6px; font-size: 14px; }
.app-access { padding: 6px 0; border-bottom: 1px solid #eee; } .app-access:last-child { border-bottom: 0; } .sections { padding-left: 28px; }

/* Tables */
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--r); font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #eee; vertical-align: middle; }
th { background: #fafafa; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
tr:hover td { background: #fbfbfb; } tr.off td { opacity: .55; }
.badge { background: #f0f0f0; border-radius: 2px; padding: 1px 6px; font-size: 12px; }
td.with-icon { display: flex; gap: 12px; align-items: center; }
.row-icon { flex: 0 0 30px; width: 30px; height: 30px; padding: 5px; border-radius: var(--r); background: var(--accent-soft); object-fit: contain; }
img.row-icon[src$=".png"] { padding: 2px; background: #fff; border: 1px solid var(--line); }

details { margin-top: 28px; padding: 12px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
details.account { margin: 0; padding: 0; background: none; border: 0; }
summary { cursor: pointer; font-weight: 600; } details form { margin: 12px 0; }
details.account form { margin: 0; }

/* Icon picker (Manage apps) */
.icon-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 14px; }
.icon-pick legend { grid-column: 1 / -1; }
.icon-choice { display: flex; align-items: center; gap: 8px; font-size: 14px; } .icon-choice input { flex: 0 0 18px; }
.icon-choice img { width: 32px; height: 32px; padding: 5px; border-radius: var(--r); background: var(--accent-soft); object-fit: contain; }
.icon-choice img[src$=".png"] { padding: 2px; background: #fff; border: 1px solid var(--line); }

/* Local login box */
.local-login { margin-top: 28px; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.local-login h2 { margin-top: 0; font-size: 15px; }

@media (max-width: 720px) {
  header.top { gap: 12px; padding: 0 12px; }
  .head-left { flex: 0 1 auto; }
  main.wide { padding-left: 16px; padding-right: 16px; }
  .tabs { display: none; }
  .menu-links { display: block; }
  .menu { width: calc(100vw - 24px); }
  main { padding: 20px 16px 40px; }
  .tiles { grid-template-columns: minmax(0, 1fr); }
  .brand { font-size: 14px; }
  th:nth-child(4), td:nth-child(4) { display: none; }
}

/* ---- Home dashboard (24 Nov 2026) ---- */
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dash-note { margin: 0 0 10px; padding: 8px 12px; border-left: 3px solid var(--line-strong); background: var(--card); font-size: 14px; color: var(--muted); }
.dash-note.warn { border-left-color: var(--warn); color: var(--warn); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 10px; margin: 6px 0 14px; }
.kpi { min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
a.kpi:hover { box-shadow: var(--shadow-hover); }
.kpi-title { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi-big { font-size: 34px; font-weight: 600; line-height: 1.15; }
.kpi-big.warn { color: var(--warn); }
.kpi-sub { font-size: 13px; color: var(--muted); }
.bad { color: var(--danger); font-weight: 600; }
.ok { color: var(--ok); font-weight: 600; }
/* Three columns. Each row is as tall as its tallest panel that has no scroll bar (e.g. Phone calls), never less than
   340px; panels with long lists (deliveries, needs attention, reviews) fill that height and scroll inside. */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: stretch; }
.dash-grid > .panel { display: flex; flex-direction: column; min-height: 340px; }
.scroll { position: relative; flex: 1 1 auto; min-height: 120px; }
.scroll-in { position: absolute; inset: 0; overflow-y: auto; overflow-x: auto; padding-right: 4px; }
.scroll-in .dash-table th { position: sticky; top: 0; background: var(--card); z-index: 1; }
.panel { min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.panel h2 { margin: 0; font-size: 16px; }
.panel h3 { margin: 12px 0 6px; font-size: 14px; }
.table-wrap { overflow-x: auto; }
.dash-table { width: 100%; font-size: 14px; border-collapse: collapse; }
.dash-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.dash-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.block { display: block; font-size: 12px; }
.small { font-size: 12px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; white-space: nowrap; background: #f0f0f0; color: var(--muted); }
.pill.overdue { background: #fde7ea; color: var(--danger); }
.pill.out { background: #e7f4e7; color: var(--ok); }
.pill.transit { background: var(--accent-soft); color: var(--accent-dark); }
.attention, .plain, .by-line, .reviews, .top-pages { list-style: none; margin: 0; padding: 0; }
.attention li { padding: 7px 0 7px 14px; border-bottom: 1px solid var(--line); position: relative; font-size: 14px; }
.attention li::before { content: ""; position: absolute; left: 0; top: 14px; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.attention li.bad::before { background: var(--danger); }
.plain li { padding: 3px 0; font-size: 14px; }
.live-dot { font-size: 12px; font-weight: 600; color: var(--ok); }
.live-dot::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--ok); }
.site-live + .site-live { border-top: 1px solid var(--line); margin-top: 8px; }
.stages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stages span { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.stages strong { font-size: 22px; color: var(--ink); font-weight: 600; }
.top-pages { margin-top: 8px; font-size: 13px; }
.top-pages li { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.top-pages li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend { font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; margin: 0 3px 0 8px; border-radius: 2px; }
.legend i.ans, .stack { background: var(--accent); }
.legend i.mis, .stack .mis { background: var(--danger); }
.hours { display: flex; align-items: flex-end; gap: 4px; height: 130px; padding-top: 6px; }
.hour { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; }
.stack { width: 100%; max-width: 26px; border-radius: 2px 2px 0 0; display: flex; flex-direction: column; overflow: hidden; }
.stack .mis { display: block; width: 100%; }
.hl { font-size: 10px; color: var(--muted); }
.by-line { margin-top: 10px; font-size: 13px; }
.by-line li { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px solid var(--line); }
.reviews li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.reviews p { margin: 2px 0; color: var(--ink); font-size: 13px; }
.stars { color: #c98a00; letter-spacing: 1px; margin-right: 6px; }
.stars .off { color: #ddd; }
.stack.b0 { height: calc((100% - 16px) * 0); min-height: 0; }
.stack.b1 { height: calc((100% - 16px) * 0.05); min-height: 2px; }
.stack.b2 { height: calc((100% - 16px) * 0.1); min-height: 2px; }
.stack.b3 { height: calc((100% - 16px) * 0.15); min-height: 2px; }
.stack.b4 { height: calc((100% - 16px) * 0.2); min-height: 2px; }
.stack.b5 { height: calc((100% - 16px) * 0.25); min-height: 2px; }
.stack.b6 { height: calc((100% - 16px) * 0.3); min-height: 2px; }
.stack.b7 { height: calc((100% - 16px) * 0.35); min-height: 2px; }
.stack.b8 { height: calc((100% - 16px) * 0.4); min-height: 2px; }
.stack.b9 { height: calc((100% - 16px) * 0.45); min-height: 2px; }
.stack.b10 { height: calc((100% - 16px) * 0.5); min-height: 2px; }
.stack.b11 { height: calc((100% - 16px) * 0.55); min-height: 2px; }
.stack.b12 { height: calc((100% - 16px) * 0.6); min-height: 2px; }
.stack.b13 { height: calc((100% - 16px) * 0.65); min-height: 2px; }
.stack.b14 { height: calc((100% - 16px) * 0.7); min-height: 2px; }
.stack.b15 { height: calc((100% - 16px) * 0.75); min-height: 2px; }
.stack.b16 { height: calc((100% - 16px) * 0.8); min-height: 2px; }
.stack.b17 { height: calc((100% - 16px) * 0.85); min-height: 2px; }
.stack.b18 { height: calc((100% - 16px) * 0.9); min-height: 2px; }
.stack.b19 { height: calc((100% - 16px) * 0.95); min-height: 2px; }
.stack.b20 { height: calc((100% - 16px) * 1); min-height: 2px; }
.mis.b0 { height: 0%; }
.mis.b1 { height: 5%; }
.mis.b2 { height: 10%; }
.mis.b3 { height: 15%; }
.mis.b4 { height: 20%; }
.mis.b5 { height: 25%; }
.mis.b6 { height: 30%; }
.mis.b7 { height: 35%; }
.mis.b8 { height: 40%; }
.mis.b9 { height: 45%; }
.mis.b10 { height: 50%; }
.mis.b11 { height: 55%; }
.mis.b12 { height: 60%; }
.mis.b13 { height: 65%; }
.mis.b14 { height: 70%; }
.mis.b15 { height: 75%; }
.mis.b16 { height: 80%; }
.mis.b17 { height: 85%; }
.mis.b18 { height: 90%; }
.mis.b19 { height: 95%; }
.mis.b20 { height: 100%; }
.nowrap { white-space: nowrap; }
@media (max-width: 1500px) { .dash-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .dash-grid > .wide-panel { grid-column: 1 / -1; min-height: 440px; } }
@media (max-width: 1100px) { :root { --rail: 200px; } }
@media (max-width: 700px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } .dash-grid > .panel { min-height: 0; } .scroll { flex: none; height: 360px; } .kpi-big { font-size: 28px; } }
.reviews p { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* source links (24 Nov 2026) */
a.src { font-size: 12px; font-weight: 600; color: var(--accent); text-decoration: underline; white-space: nowrap; }
a.src:hover { color: var(--accent-dark); }
.head-right { display: inline-flex; align-items: baseline; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.attention li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.with-src { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.src-row { margin: -2px 0 6px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
