/* HelpLane — dashboard.
   Palette carried over from the v1 dashboard: navy chrome, soft blue-grey
   page, white cards with a coloured left edge. Built to be readable on a
   phone in a truck stop and on a TV across the room. */

:root {
  --navy:      #1f2b4d;
  --navy-2:    #26345c;
  --navy-3:    #34456f;
  --page:      #f4f6fa;
  --card:      #ffffff;
  --line:      #e3e8f0;
  --ink:       #1f2937;
  --ink-soft:  #6b7280;
  --ink-faint: #9aa3b2;

  --blue:      #3b82f6;   /* open / in progress */
  --green:     #16a34a;   /* resolved */
  --teal:      #0d9488;   /* timing */
  --amber:     #d97706;   /* waiting */
  --red:       #dc2626;   /* overdue / problems */

  --radius:    8px;
  --shadow:    0 1px 2px rgba(31,43,77,.06), 0 1px 3px rgba(31,43,77,.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
a { color: var(--blue); }
.mono { font-variant-numeric: tabular-nums; }

/* ---- header ---- */
/* ---- app shell: fixed left sidebar + content ---- */
:root { --side: 232px; }

body.app { margin:0; }

.sidebar {
  position:fixed; top:0; left:0; bottom:0; width:var(--side);
  background:var(--navy); color:#cdd6e8; display:flex; flex-direction:column;
  z-index:40; overflow-y:auto;
}
.sidelogo { display:flex; align-items:center; padding:16px 18px 4px; }
.sidelogo img { height:28px; }
.sidelogo .logo-text { font-size:19px; color:#fff; font-weight:500; } .sidelogo .logo-text b{font-weight:700;}
.sideco { padding:0 18px 14px; font-size:13px; color:#8d97b0; border-bottom:1px solid #2c3a5e; margin-bottom:8px; }

.sidenav { flex:1; padding:4px 10px; }
.navsep { font-size:10.5px; text-transform:uppercase; letter-spacing:.5px; color:#69759a; padding:14px 10px 5px; }
.navitem {
  display:flex; align-items:center; gap:11px; padding:9px 12px; margin:1px 0;
  color:#c2cbde; text-decoration:none; border-radius:7px; font-size:14.5px; font-weight:500;
}
.navitem:hover { background:#2a3a63; color:#fff; }
.navitem.on { background:var(--blue); color:#fff; }
.navitem .ico { width:19px; height:19px; flex:0 0 19px; }

.sidefoot { padding:10px; border-top:1px solid #2c3a5e; }
.sideuser { padding:4px 12px 10px; font-size:14px; color:#e6ebf5; font-weight:600; }
.sideuser span { display:block; font-size:12px; color:#8d97b0; font-weight:400; }

.content { margin-left:var(--side); padding:22px 26px 48px; max-width:none; }

/* ---- collapsible sidebar (desktop) ---- */
:root { --side-collapsed: 64px; }
.sidetop { display:flex; align-items:center; justify-content:space-between; padding-right:8px; }
.collapsebtn {
  background:none; border:0; color:#8d97b0; cursor:pointer; padding:6px; border-radius:6px;
  display:flex; align-items:center;
}
.collapsebtn:hover { background:#2a3a63; color:#fff; }
.collapsebtn svg { width:20px; height:20px; transition:transform .2s; }

/* When collapsed: narrow rail, labels hidden, icons centered. */
body.sidecollapsed .sidebar { width:var(--side-collapsed); }
body.sidecollapsed .content { margin-left:var(--side-collapsed); }
body.sidecollapsed .sideco,
body.sidecollapsed .navsep,
body.sidecollapsed .navitem span,
body.sidecollapsed .sideuser,
body.sidecollapsed .logo-text { display:none; }
body.sidecollapsed .sidelogo { padding:16px 0 4px; justify-content:center; width:100%; }
body.sidecollapsed .sidelogo img { height:26px; }
body.sidecollapsed .navitem { justify-content:center; padding:11px 0; }
body.sidecollapsed .navitem .ico { margin:0; }
body.sidecollapsed .collapsebtn svg { transform:rotate(180deg); }
body.sidecollapsed .sidetop { justify-content:center; padding:0; flex-direction:column; gap:6px; }
body.sidecollapsed .sidefoot { padding:8px 0; }
body.sidecollapsed .sidefoot .navitem { justify-content:center; }

/* smooth-ish */
.sidebar, .content { transition:width .15s ease, margin-left .15s ease; }


.mobilebar { display:none; }
.navscrim { display:none; }



.pagehead { display:flex; align-items:baseline; gap:12px; margin-bottom:14px; flex-wrap:wrap; }
.pagehead h1 { font-size:24px; }
.pagehead .sub { color:var(--ink-soft); font-size:13px; }

/* ---- cards ---- */
.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--blue);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px;
}
.stat.g { border-left-color: var(--green); }
.stat.t { border-left-color: var(--teal); }
.stat.n { border-left-color: var(--navy); }
.stat .k { font-size: 13px; color: var(--ink-soft); }
.stat .v { font-size: 34px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; }

/* ---- board ---- */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
/* Kanban B — each status is a bordered column with a colored top bar. */
.col { background:#fff; border:1px solid var(--line); border-top:3px solid var(--ink-soft); border-radius:10px; padding:12px 12px 14px; }
.col.waiting { border-top-color: var(--amber); }
.col.moving  { border-top-color: var(--blue); }
.col.done    { border-top-color: var(--green); }
.colhead {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600; padding: 0 2px 10px; color: var(--navy);
}
.colhead .n {
  margin-left: auto; background: #eef2f8; color: var(--ink-soft);
  border-radius: 11px; padding: 1px 9px; font-size: 12px; font-weight: 600;
}
.col.waiting .colhead .n { background:#fdf0d8; color:#8a5c05; }
.col.moving  .colhead .n { background:#e8f0fe; color:#1d4ed8; }
.col.done    .colhead .n { background:#e7f6ec; color:#14663a; }
.stack { display: flex; flex-direction: column; gap: 10px; min-height: 50px; }
/* cards inside a bordered column lose their own heavy border, keep the left accent */
.col .tk { border:1px solid var(--line); box-shadow:none; }

.tk {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--blue);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 11px 13px;
}
.tk.w { border-left-color: var(--amber); }
.tk.m { border-left-color: var(--blue); }
.tk.d { border-left-color: var(--green); }
.tk.late { border-left-color: var(--red); }
.tk h3 { font-size: 16px; }
.tk .no { font-size: 12px; color: var(--ink-faint); font-weight: 600; }
.tk .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--ink-soft); font-size: 13px; margin-top: 5px; }
.clock { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.tk.late .clock { color: var(--red); }

.tag {
  display: inline-block; font-size: 12px; font-weight: 500;
  padding: 1px 8px; border-radius: 11px;
  background: #eef2f8; border: 1px solid var(--line); color: var(--ink-soft);
}
.tag.dept { background: #e8f0fe; border-color: #cfe0fb; color: #1d4ed8; }
.tag.xfer { background: #fef3e2; border-color: #fadfb4; color: #b45309; }
.tag.bad  { background: #fdeaea; border-color: #f7c9c9; color: var(--red); }

/* ---- tables ---- */
.scroller { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: var(--ink-soft);
  padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
  background: #fafbfd;
}
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafbfd; }

/* ---- forms ---- */
input[type=text], input[type=email], input[type=password], input[type=time], input[type=date], select, textarea {
  font: inherit; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 6px; background: #fff; color: var(--ink); max-width: 100%;
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 1px;
}
button, .btn {
  font: inherit; font-weight: 600; padding: 8px 15px;
  border: 1px solid var(--navy); background: var(--navy); color: #fff;
  border-radius: 6px; cursor: pointer; text-decoration: none; display: inline-block;
}
button.ghost, .btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
button:hover { opacity: .92; }
.bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }

/* preset range buttons, as in v1 */
.presets { display: flex; gap: 8px; flex-wrap: wrap; }
.presets a {
  padding: 7px 14px; border-radius: 6px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500;
}
.presets a.on { background: var(--navy); color: #fff; border-color: var(--navy); }

.empty { color: var(--ink-soft); padding: 22px; text-align: center; font-size: 14px; }
.flash { background: #e7f6ec; border: 1px solid #bfe5cc; color: #14663a; padding: 9px 12px; border-radius: 6px; margin-bottom: 14px; }
.warn { color: var(--red); font-weight: 600; }
.hint { color: var(--ink-soft); font-size: 13px; }

/* ---- login ---- */
.login {
  max-width: 360px; margin: 8vh auto; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
}
.login-logo { text-align: center; }
.login-logo img { max-width: 200px; height: auto; }
.login-logo .logo-text { font-size: 26px; font-weight: 500; color: var(--navy); }
.login-logo .logo-text b { font-weight: 700; }
.login p.sub { text-align: center; color: var(--ink-soft); font-size: 13px; margin: 2px 0 20px; }
.login label { display: block; font-size: 13px; color: var(--ink-soft); margin: 12px 0 4px; font-weight: 500; }
.login input { width: 100%; }
.login button { width: 100%; margin-top: 18px; padding: 11px; }
.err { background: #fdeaea; border: 1px solid #f7c9c9; color: #a11; padding: 9px 11px; border-radius: 6px; font-size: 14px; }

.chk { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.chk label { font-size: 14px; display: flex; gap: 6px; align-items: center; }

.progress { background: #eef2f8; border-radius: 4px; height: 16px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--amber); }
.progress i.done { background: var(--green); }

/* ---- phones ---------------------------------------------------------
   Staff open this on the road. Tables scroll instead of squashing,
   filters go full width, and everything stays thumb-sized. */
@media (max-width: 860px) {
  .board { grid-template-columns: 1fr; gap: 18px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat .v { font-size: 27px; }
  .wrap { padding: 14px 12px 34px; }
  .topbar { padding: 10px 14px; gap: 8px; }
  .topbar .who { display: none; }
  .topbar .logo img { height: 24px; }
  .topbar .company { font-size: 13px; padding-left: 9px; }
  .tabs a { flex: 0 0 auto; padding: 13px 16px; }
  .pagehead h1 { font-size: 21px; }
  .bar > form, .bar { width: 100%; }
  .bar input[type=text], .bar select { flex: 1 1 140px; min-width: 0; }
  button, .btn, .presets a { padding: 10px 14px; }   /* thumb targets */
  th, td { padding: 10px 11px; }
  .tk { padding: 13px; }
  .tk h3 { font-size: 17px; }
}
@media (max-width: 420px) {
  .stats { grid-template-columns: 1fr; }
}

/* ---- TV mode ----------------------------------------------------
   A wall screen read from across the room. No controls, bigger type,
   and the page NEVER fully reloads — a reload resets the browser's
   audio unlock and silently kills the next chime. */
/* ============================================================
   TV MODE — light theme, tabbed (Board / Overview), wall-readable
   ============================================================ */
body.tv { background:#eef1f6; color:var(--ink); margin:0; }

.tvtabs {
  display:flex; align-items:stretch; background:var(--navy);
  position:sticky; top:0; z-index:20;
}
.tvtab {
  padding:18px 40px; color:#9aa6c4; text-decoration:none;
  font-size:22px; font-weight:600; border-bottom:4px solid transparent;
}
.tvtab.on { color:#fff; font-weight:700; border-bottom-color:var(--blue); }
.tvtab:hover { color:#fff; }
.tvbrand { margin-left:auto; display:flex; align-items:center; padding:0 28px;
  color:#c4cde0; font-size:20px; font-weight:600; }
.tvtab.tvexit { margin-left:0; font-size:16px; font-weight:500; color:#7c88a8; display:flex; align-items:center; }

.tvwrap { padding:20px 24px 30px; max-width:none; }

/* big page heading + banner */
body.tv .pagehead { margin-bottom:16px; }
body.tv .pagehead h1 { font-size:30px; }
body.tv .flash { font-size:17px; padding:14px 18px; }

/* three columns, larger */
body.tv .board { gap:18px; }
body.tv .col { padding:16px 16px 18px; border-radius:12px; border-top-width:5px; }
body.tv .colhead { font-size:24px; font-weight:700; padding-bottom:14px; }
body.tv .colhead .n { font-size:19px; padding:2px 13px; }
body.tv .stack { gap:13px; }
body.tv .tk { padding:16px 18px; border-radius:10px; border-left-width:5px; }
body.tv .tk .no { font-size:16px; color:#9aa2b4; }
body.tv .tk h3 { font-size:23px; line-height:1.3; font-weight:700; color:#1a2540; }
body.tv .tk .meta { font-size:17px; margin-top:8px; }
body.tv .clock { font-size:19px; font-weight:600; color:#374151; }
body.tv .tag.dept { font-size:15px; padding:3px 11px; }
body.tv .empty { color:#9aa2b4; font-size:19px; padding:10px 2px; }

/* overview on TV: bigger stat cards + tables */
body.tv .stats { gap:18px; margin-bottom:26px; }
body.tv .statcard { padding:18px 20px; }
body.tv .statcard .k { font-size:16px; }
body.tv .statcard .v { font-size:40px; }
body.tv table { font-size:18px; }
body.tv th { font-size:14px; padding:12px 14px; }
body.tv td { padding:12px 14px; }
body.tv h2 { font-size:22px; }

#sound-hint {
  position: fixed; right: 18px; bottom: 18px; z-index: 40;
  background: var(--amber); color: #fff; border: 0;
  padding: 14px 22px; border-radius: 10px; cursor: pointer;
  font-size: 17px; font-weight: 700;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---- mobile: sidebar slides in ---- */
@media (max-width: 860px) {
  .mobilebar {
    display:flex; align-items:center; gap:12px;
    background:var(--navy); color:#fff; padding:11px 14px;
    position:sticky; top:0; z-index:30;
  }
  .burger { background:none; border:0; color:#fff; padding:4px; cursor:pointer; }
  .burger svg { width:24px; height:24px; display:block; }
  .mobilebrand { font-size:18px; font-weight:500; } .mobilebrand b{font-weight:700;color:#7fb2f0;}
  .mobilco { margin-left:auto; font-size:13px; color:#b8c2d8; }

  .sidebar {
    transform:translateX(-100%); transition:transform .2s ease;
    box-shadow:2px 0 16px rgba(0,0,0,.3);
  }
  body.navopen .sidebar { transform:translateX(0); }
  body.navopen .navscrim {
    display:block; position:fixed; inset:0; background:rgba(15,23,42,.5); z-index:35;
  }
  .content { margin-left:0; padding:16px 14px 40px; }
}

/* ---- collapsible page filters (header treatment A) ---- */
.filtertoggle {
  display:inline-flex; align-items:center; gap:7px;
  background:var(--navy); color:#fff; border:0; border-radius:8px;
  padding:8px 14px; font:inherit; font-weight:600; font-size:14px; cursor:pointer;
}
.filtertoggle:hover { opacity:.92; }
.filtertoggle .ti { font-size:17px; }
.filtercount { font-size:12px; color:var(--ink-soft); margin-left:2px; }
.filterpanel { display:none; margin-top:10px; }
body.filtersopen .filterpanel { display:flex; }
.filterhead { display:flex; align-items:center; gap:10px; margin-bottom:0; }

/* live/offline indicator in the TV tab bar */
.tvlive { font-size:13px; font-weight:600; color:#7fd6a0; background:#14371f;
  border-radius:10px; padding:2px 10px; margin-left:10px; vertical-align:middle; }
.tvlive.off { color:#ffb4b4; background:#4a1d1d; }
