/* ============================================================================
   Talosco Scheduler — app shell + dashboard (on top of Tabler 1.x)
   styles.css still owns the board, panels and modal; this file:
     1. points Tabler's primary colour at the Talosco brand,
     2. maps the board's own tokens onto Tabler's so both share one palette
        in Day and Night mode,
     3. lays out the sidebar / header / views,
     4. styles the Dashboard.
   ========================================================================== */

/* ---------- 1. Brand (TalosFlow purple — talos-brand/talos-tokens.css) ---------- */
:root {
  --tblr-primary: #8944AB;
  --tblr-primary-rgb: 137, 68, 171;
  --tblr-primary-text-emphasis: #6E3590;
  --tblr-link-color: #7A3B9C;
  --tblr-link-color-rgb: 122, 59, 156;
  --tblr-font-sans-serif: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --shell-left: 0px; /* sidebar width on desktop — kept in sync by js/ui/shell.js */
  --app-header-h: 64px;
  /* Talos four-line motif, in brand order: Ops, Flow, Plan, IQ */
  --line-ops: #D63384; --line-flow: #8944AB; --line-plan: #FF9500; --line-iq: #0071E3;
}
:root[data-theme="dark"] {
  --tblr-primary: #9455BD;
  --tblr-primary-rgb: 148, 85, 189;
  --tblr-primary-text-emphasis: #C08AE6;
  --tblr-link-color: #C08AE6;
  --tblr-link-color-rgb: 192, 138, 230;
}

/* ---------- 2. One palette for board + Tabler ---------- */
:root, :root[data-theme="dark"] {
  --bg: var(--tblr-body-bg);
  --panel: var(--tblr-bg-surface);
  --border: var(--tblr-border-color);
  --text: var(--tblr-body-color);
  --text-dim: var(--tblr-secondary);
  --accent: var(--tblr-primary);
  --accent-hover: color-mix(in srgb, var(--tblr-primary) 85%, #000);
  --dash-surface: var(--tblr-bg-surface);
  --dash-ink-1: var(--tblr-body-color);
}
:root { --dash-ink-2: #5d6a7e; --dash-grid: #e6e9ef; --dash-series: #8944AB; --heat-rgb: 137, 68, 171; }
:root[data-theme="dark"] { --dash-ink-2: #a3acb9; --dash-grid: #2c3440; --dash-series: #B07AD9; --heat-rgb: 176, 122, 217; }

html, body { font-family: var(--tblr-font-sans-serif); }
body { font-size: 14px; }

/* ---------- 3. Layout ---------- */
.page { min-height: 100vh; }

/* Sidebar */
.app-sidebar { border-right: 1px solid var(--tblr-border-color); background: var(--tblr-bg-surface); }
.app-sidebar .container-fluid { min-height: 100%; }
.app-brand {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px 4px 10px; margin: 0;
  color: var(--tblr-body-color) !important; text-decoration: none;
}
/* The logo PNG has transparent padding round the lettering; the negative margins pull it flush */
.app-brand .brand-logo { height: 52px; width: auto; display: block; margin: -6px 0 -6px -4px; }
.app-brand .brand-logo-dark, .app-brand .brand-mark { display: none; }
:root[data-theme="dark"] .app-brand .brand-logo-light { display: none; }
:root[data-theme="dark"] .app-brand .brand-logo-dark { display: block; }
.brand-lines { display: flex; gap: 4px; }
.brand-lines i { width: 32px; height: 3px; border-radius: 2px; opacity: .22; }
.brand-lines i:nth-child(1) { background: var(--line-ops); }
.brand-lines i:nth-child(2) { background: var(--line-flow); opacity: 1; }
.brand-lines i:nth-child(3) { background: var(--line-plan); }
.brand-lines i:nth-child(4) { background: var(--line-iq); }
.app-sidebar .navbar-collapse { flex-direction: column; align-items: stretch; }
.app-sidebar .navbar-nav { width: 100%; gap: 1px; }
.app-sidebar .nav-label {
  padding: 14px 12px 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--tblr-secondary); list-style: none;
}
.app-sidebar .nav-link {
  display: flex; align-items: center; gap: 2px; width: 100%;
  border-radius: 8px; padding: 8px 12px; margin: 0 4px; width: calc(100% - 8px);
  color: var(--tblr-body-color); background: none; border: 0; text-align: left; font-size: 14px;
  position: relative;
}
.app-sidebar .nav-link:hover { background: rgba(var(--tblr-primary-rgb), .07); }
.app-sidebar .nav-link .nav-link-icon { color: var(--tblr-secondary); }
.app-sidebar .nav-link .nav-link-icon .ti { font-size: 19px; }
.app-sidebar .nav-item.active > .nav-link,
.app-sidebar .nav-link.active {
  background: rgba(var(--tblr-primary-rgb), .1); color: var(--tblr-primary-text-emphasis); font-weight: 600;
}
.app-sidebar .nav-item.active > .nav-link .nav-link-icon { color: var(--tblr-primary-text-emphasis); }
.app-sidebar .nav-item.active > .nav-link::before {
  content: ""; position: absolute; left: -4px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--flow);
}
#nav-backlog-count:empty { display: none; }

.sidebar-footer {
  margin-top: auto; width: 100%; padding: 14px 8px 16px; border-top: 1px solid var(--tblr-border-color);
  display: flex; flex-direction: column; gap: 10px;
}
.sidebar-footer .status-pill { align-self: flex-start; max-width: 100%; white-space: normal; line-height: 1.35; }
/* The connection pill. styles.css later reuses .status-pill (white text) for
   the coloured follow-up chips in task rows, which used to wash this one
   out — pin its own colours by id. */
#status-pill { font-size: 12px; font-weight: 500; padding: 3px 10px; color: #92600a; background: #fff8e1; border: 1px solid #f1d9a0; }
#status-pill.ok { color: #3f6f1a; background: #eef7e5; border-color: #cfe6b5; }
#status-pill.err { color: #b32424; background: #fdecec; border-color: #f3bcbc; }
:root[data-theme="dark"] #status-pill { color: #f2c46b; background: rgba(242, 196, 107, .08); border-color: #6a5a36; }
:root[data-theme="dark"] #status-pill.ok { color: #a6d977; background: rgba(166, 217, 119, .08); border-color: #3f5a2a; }
:root[data-theme="dark"] #status-pill.err { color: #f3a9a9; background: #45292a; border-color: #6e3b3c; }
.sidebar-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sidebar-user .avatar { flex: none; background: rgba(var(--tblr-primary-rgb), .12); color: var(--tblr-primary-text-emphasis); font-weight: 600; font-size: 12px; }
.sidebar-user-text { min-width: 0; font-size: 13px; }
#who { font-weight: 500; }
#who:empty::before { content: "Not signed in"; color: var(--tblr-secondary); font-weight: 400; }
.sidebar-user-actions { display: flex; gap: 6px; }
.btn .ti { font-size: 17px; margin-right: 6px; }
.btn-icon .ti { margin-right: 0; }

/* Main column: header + one visible view, filling the viewport */
.app-main {
  /* flex:none — Tabler's .page is a column flexbox, where flex:1 would let
     the content stretch this past the viewport instead of scrolling inside */
  display: flex; flex-direction: column; flex: none; height: 100vh; min-width: 0;
  transition: padding-left .2s ease, padding-bottom .2s ease;
}
.app-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: var(--app-header-h); padding: 10px 24px; flex-shrink: 0;
  background: var(--tblr-bg-surface); border-bottom: 1px solid var(--tblr-border-color);
}
.app-header-title { margin-right: auto; }
.app-sidebar-toggle { margin: 0 -6px 0 -10px; }
.app-header .page-title { margin: 0; font-size: 20px; font-weight: 700; color: var(--tblr-body-color); }
.app-header .page-pretitle { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--tblr-secondary); font-weight: 600; }
.app-header-actions { display: flex; align-items: center; gap: 8px; }
.view { flex: 1; min-height: 0; }
#view-dashboard { overflow-y: auto; padding: 20px 0 32px; margin: 0; }

/* The board (#app) lives inside the main column now instead of being the page */
#app { height: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; }
#app[hidden] { display: none !important; }
body.panel-open #app, body.setup-open #app, body.planned-open #app { margin: 0; }

/* Scheduler toolbar (was the old top bar) */
.topbar {
  gap: 10px; padding: 10px 24px; border-bottom: 1px solid var(--tblr-border-color);
  box-shadow: none; background: var(--tblr-bg-surface); flex-shrink: 0;
}
.topbar .btn-group .btn { padding-inline: 10px; }
.topbar .btn .ti-chevron-left { margin-right: 4px; }
.topbar .btn .ti-chevron-right { margin-left: 4px; margin-right: 0; }
.topbar .range-label { color: var(--tblr-body-color); font-weight: 600; font-size: 14px; min-width: 120px; }
.topbar #view-days { width: auto; min-width: 170px; }
.sch-legend { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--tblr-secondary); flex-wrap: wrap; }
.sch-legend > span { padding: 3px 8px; border: 1px solid var(--tblr-border-color); border-radius: 999px; background: var(--tblr-bg-surface); }
/* Undo the old .topbar button rules — Tabler's .btn styles these now */
.topbar button, .topbar select { border-radius: var(--tblr-border-radius); }
.topbar .btn { background: var(--tblr-bg-surface); color: var(--tblr-body-color); border-color: var(--tblr-border-color); }
.topbar .btn.btn-primary, .app-header .btn.btn-primary, .sidebar-footer .btn.btn-primary { background: var(--tblr-primary); border-color: var(--tblr-primary); color: #fff; }
.topbar .btn:hover { filter: none; background: rgba(var(--tblr-primary-rgb), .06); }
.topbar .btn.btn-primary:hover { background: var(--accent-hover); }
.board-scroll { background: var(--tblr-bg-surface); }

/* Resource filters + workload groups (boardSections / renderGroupRow in js/board/render.js) */
.board-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.board-search { position: relative; width: 200px; }
.board-search .ti {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  font-size: 15px; line-height: 1; color: var(--tblr-secondary); pointer-events: none;
}
.topbar .board-search input { height: 32px; padding: 0 10px 0 32px; font-size: 13px; border-radius: var(--tblr-border-radius); }
.topbar #board-group { width: auto; height: 32px; padding: 0 32px 0 10px; font-size: 13px; font-weight: 400; }
.board-only-booked { margin: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; color: var(--tblr-secondary); cursor: pointer; }
.board-only-booked .form-check-input { margin-top: 0; cursor: pointer; }

.sch-group-row { --group-bg: color-mix(in srgb, var(--tblr-bg-surface) 95%, var(--tblr-body-color)); min-height: 34px; background: var(--group-bg); cursor: pointer; }
.sch-group-row .sch-group-label {
  background: var(--group-bg); border: 0; border-right: 1px solid var(--border); font: inherit; color: var(--text);
  justify-content: flex-start; gap: 8px; text-align: left; cursor: pointer;
}
.sch-group-row .sch-group-label .ti { font-size: 16px; color: var(--text-dim); }
.sch-group-row:hover .sch-group-label .ti { color: var(--accent); }
.sch-group-name { font-size: 13px; font-weight: 600; }
.sch-group-count { font-size: 11px; font-weight: 600; line-height: 1.6; padding: 0 8px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.grp-overbooked .sch-group-count { background: rgba(214, 57, 57, .12); color: #c02a2a; }
.grp-busy .sch-group-count { background: rgba(var(--flow-rgb), .14); color: var(--tblr-primary-text-emphasis); }
.grp-capacity .sch-group-count { background: rgba(90, 148, 41, .14); color: #4b7f20; }
.grp-free .sch-group-count { background: rgba(100, 116, 139, .14); color: var(--text-dim); }
:root[data-theme="dark"] .grp-overbooked .sch-group-count { background: rgba(248, 113, 113, .16); color: #f87171; }
:root[data-theme="dark"] .grp-capacity .sch-group-count { background: rgba(159, 211, 107, .14); color: #9fd36b; }
.sch-group-band { flex-shrink: 0; display: flex; align-items: center; }
.sch-group-hint { position: sticky; left: calc(var(--label-w) + 4px); padding: 0 12px; font-size: 12px; color: var(--text-dim); white-space: nowrap; }

/* Slide-in panels dock beside the sidebar and push the main column over */
.side-panel { left: var(--shell-left); border-radius: 0 12px 12px 0; }
.bottom-panel { left: var(--shell-left); }
.panel-resize-x { left: calc(var(--shell-left) + var(--tasks-panel-w) - 3px); }
.panel-resize-y { left: var(--shell-left); }
.panel-resize-setup { left: calc(var(--shell-left) + var(--setup-panel-w) - 3px); }
body.panel-open .app-main { padding-left: 360px; }
body.setup-open .app-main { padding-left: var(--setup-panel-w); }
body.planned-open .app-main { padding-left: var(--tasks-panel-w); padding-bottom: var(--planned-h); }
body.panel-resizing .app-main { transition: none; }

/* Debug panel floats bottom-right as before; its toggle moved to the sidebar */
.debug-panel { bottom: 16px; z-index: 1040; }

/* Item modal (renamed from .modal so Bootstrap's own .modal can't hide it) */
.overlay { z-index: 1050; }
.sch-modal input, .sch-modal select, .sch-modal textarea { border-color: var(--tblr-border-color); }
.context-menu { z-index: 1060; }
.sch-modal { border: 1px solid var(--tblr-border-color); }
.sch-modal .actions button {
  font: inherit; font-size: 13px; font-weight: 500; padding: 6px 14px; border-radius: var(--tblr-border-radius, 6px);
  border: 1px solid var(--tblr-border-color); background: var(--tblr-bg-surface); color: var(--tblr-body-color); cursor: pointer;
}
.sch-modal .actions button:hover { background: rgba(var(--tblr-primary-rgb), .06); }
.sch-modal .actions #modal-save { background: var(--tblr-primary); border-color: var(--tblr-primary); color: #fff; }
.sch-modal .actions #modal-save:hover { background: var(--accent-hover); }
.tasks-panel-filters .tasks-search { min-width: 0; }
.tasks-panel-filters select { max-width: 45%; }

/* ---------- 4. Dashboard ---------- */
.dash-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.dash-scope { font-size: 16px; font-weight: 600; }
#dash-period .btn { background: var(--tblr-bg-surface); }
#dash-period .btn.active { background: var(--tblr-primary); border-color: var(--tblr-primary); color: #fff; }

.kpi-card .card-body { padding: 16px 18px; }
.kpi-card .subheader { font-size: 11.5px; letter-spacing: .05em; }
.kpi-icon {
  width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.kpi-icon .ti { font-size: 18px; }
.kpi-blue  { background: rgba(137, 68, 171, .12); color: #8944AB; }
.kpi-navy  { background: rgba(91, 44, 120, .10); color: #5B2C78; }
.kpi-green { background: rgba(90, 148, 41, .14); color: #4b7f20; }
.kpi-red   { background: rgba(214, 57, 57, .12); color: #c02a2a; }
.kpi-gray  { background: rgba(100, 116, 139, .12); color: #64748b; }
:root[data-theme="dark"] .kpi-blue  { color: #C08AE6; background: rgba(192, 138, 230, .14); }
:root[data-theme="dark"] .kpi-navy  { color: #D9BDF0; background: rgba(217, 189, 240, .12); }
:root[data-theme="dark"] .kpi-green { color: #9fd36b; background: rgba(159, 211, 107, .14); }
:root[data-theme="dark"] .kpi-red   { color: #f87171; background: rgba(248, 113, 113, .14); }
:root[data-theme="dark"] .kpi-gray  { color: #a3acb9; background: rgba(163, 172, 185, .12); }
.kpi-value { font-size: 28px; font-weight: 700; line-height: 1.1; margin: 12px 0 6px; font-variant-numeric: tabular-nums; }
.kpi-of { font-size: 16px; font-weight: 500; color: var(--tblr-secondary); }
.kpi-progress { margin: 2px 0 8px; height: 5px; }
.kpi-sub { font-size: 12.5px; color: var(--tblr-secondary); line-height: 1.45; }
.kpi-sub .ti { font-size: 14px; vertical-align: -2px; }

.card-subtitle { margin: 2px 0 0; font-size: 12.5px; color: var(--tblr-secondary); }
.dash-chart { min-height: 240px; }
.dash-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 200px; padding: 24px; text-align: center; color: var(--tblr-secondary); font-size: 13px;
}
.dash-empty .ti { font-size: 30px; opacity: .6; }

/* Heatmap (plain table so every cell is clickable + readable) */
.heat-legend { display: flex; gap: 12px; font-size: 12px; color: var(--tblr-secondary); }
.heat-key { display: inline-flex; align-items: center; gap: 5px; }
.heat-swatch { width: 14px; height: 14px; border-radius: 4px; background: rgba(var(--heat-rgb), var(--a)); border: 1px solid var(--tblr-border-color); }
.heat-over-swatch { background: rgba(var(--heat-rgb), .9); box-shadow: inset 0 0 0 2px #d63939; border-color: transparent; }
.heatmap-wrap { overflow-x: auto; }
.heatmap { border-collapse: separate; border-spacing: 3px; margin: 10px 12px 12px; font-size: 12px; }
.heatmap th { font-weight: 500; color: var(--tblr-secondary); text-align: center; padding: 2px 0 6px; line-height: 1.2; min-width: 46px; }
.heatmap thead th span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.heatmap thead th.is-today { color: var(--brand-green-dark); font-weight: 700; }
.heatmap th.heat-name { text-align: left; color: var(--tblr-body-color); font-weight: 500; white-space: nowrap; padding-right: 12px; min-width: 150px; }
.heatmap th.heat-name .dot { margin-right: 8px; }
.heatmap td { padding: 0; }
.heat-cell {
  display: block; width: 100%; min-width: 46px; height: 34px; border: 0; border-radius: 6px; cursor: pointer;
  background: rgba(var(--heat-rgb), var(--a)); color: var(--tblr-body-color); font-size: 11.5px; font-weight: 600;
  font-variant-numeric: tabular-nums; transition: transform .08s ease, box-shadow .12s ease;
}
.heat-cell.ink-light { color: #fff; }
:root[data-theme="dark"] .heat-cell.ink-light { color: #0b1220; }
.heat-cell:hover { box-shadow: 0 0 0 2px var(--tblr-primary); }
.heat-cell.over { box-shadow: inset 0 0 0 2px #d63939; }
.heat-cell.over::after { content: " !"; }
.heatmap .heat-total { color: var(--tblr-body-color); font-weight: 600; text-align: right; padding-left: 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Upcoming list */
.dash-upcoming .dash-up-row {
  display: flex; align-items: center; gap: 14px; text-align: left; border-left: 0; border-right: 0;
  background: transparent; color: var(--tblr-body-color); padding: 10px 18px;
}
.dash-up-when { flex: none; width: 92px; font-size: 12px; color: var(--tblr-secondary); font-weight: 500; }
.dash-up-when.live { color: var(--brand-green-dark); font-weight: 700; }
.dash-up-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dash-up-title { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-up-title .dot { margin-right: 7px; }
.dash-up-meta { font-size: 12px; color: var(--tblr-secondary); }
.dash-status {
  flex: none; font-weight: 600; font-size: 11px; color: var(--tblr-body-color);
  background: color-mix(in srgb, var(--status) 16%, transparent); border: 1px solid color-mix(in srgb, var(--status) 45%, transparent);
}
.dash-status::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--status); margin-right: 5px; vertical-align: 0; }

/* ApexCharts tooltip in Night mode */
:root[data-theme="dark"] .apexcharts-tooltip.apexcharts-theme-dark { background: #111827; border-color: #2c3440; }


/* ---------- 5. User Dashboard ---------- */
#view-me { overflow-y: auto; padding: 20px 0 32px; margin: 0; }
.sidebar-user { cursor: pointer; border-radius: 8px; padding: 4px; margin: -4px; }
.sidebar-user:hover { background: rgba(var(--tblr-primary-rgb), .06); }
.me-profile-head { padding-top: 28px; padding-bottom: 18px; border-bottom: 1px solid var(--tblr-border-color); }
.me-avatar { width: 88px; height: 88px; font-size: 30px; font-weight: 600; background-size: cover; background-position: center; box-shadow: 0 0 0 4px var(--tblr-bg-surface), 0 0 0 6px var(--flow); }
.me-avatar-initials { background-color: rgba(var(--tblr-primary-rgb), .12); color: var(--tblr-primary-text-emphasis); }
.me-facts { display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.me-fact { display: grid; grid-template-columns: 20px 120px minmax(0, 1fr); align-items: center; gap: 6px; }
.me-fact .ti { color: var(--tblr-secondary); font-size: 17px; }
.me-fact-label { color: var(--tblr-secondary); }
.me-fact-value { font-weight: 500; min-width: 0; }
.me-fact-value .dot { margin-right: 6px; }
.me-roles { display: flex; flex-wrap: wrap; gap: 6px; }
.me-roles .badge { font-size: 12px; font-weight: 500; padding: 5px 8px; text-transform: none; }
.me-roles .badge .ti { font-size: 13px; margin-right: 4px; }
.me-role-off { opacity: .65; }
.me-can { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.me-can li { display: flex; gap: 8px; align-items: flex-start; }
.me-can li .ti { font-size: 17px; flex: none; }
.me-can li.yes .ti { color: var(--brand-green-dark); }
.me-can li.no { color: var(--tblr-secondary); }
.me-status-row + .me-status-row { margin-top: 14px; }
.me-status-row .dot { margin-right: 6px; }
.me-agenda { max-height: 460px; overflow-y: auto; padding-bottom: 6px; }
.me-agenda-note { display: flex; align-items: center; gap: 6px; margin: 12px 18px 0; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; color: var(--tblr-secondary); background: rgba(var(--tblr-primary-rgb), .05); }
.me-agenda-day { padding: 14px 18px 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--tblr-secondary); }
.me-agenda-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 18px; border: 0; background: none;
  text-align: left; color: var(--tblr-body-color); text-decoration: none; cursor: pointer;
}
.me-agenda-row:hover { background: rgba(var(--tblr-primary-rgb), .05); color: var(--tblr-body-color); }
.me-agenda-time { flex: none; width: 132px; white-space: nowrap; font-size: 12px; color: var(--tblr-secondary); font-variant-numeric: tabular-nums; }
.me-agenda-bar { flex: none; width: 4px; align-self: stretch; border-radius: 2px; background: var(--tblr-border-color); }
.me-agenda-row.outlook .me-agenda-bar { background: repeating-linear-gradient(180deg, var(--tblr-secondary) 0 4px, transparent 4px 7px); }
.me-agenda-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.me-agenda-title { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-agenda-meta { font-size: 12px; color: var(--tblr-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-agenda-meta .ti { font-size: 13px; vertical-align: -2px; }


/* ---------- 6. Timesheets (BC-style time sheet) ---------- */
#view-timesheets { overflow-y: auto; padding: 20px 0 32px; margin: 0; }
.ts-local-note { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; padding: 10px 14px; }
.ts-local-note > .ti { font-size: 22px; flex: none; }
.ts-local-note > div:first-of-type { flex: 1 1 320px; }
.ts-note-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ts-note-actions .btn { background: var(--tblr-bg-surface); }
.ts-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ts-fields { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-end; }
.ts-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ts-field > label { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--tblr-secondary); }
.ts-field #ts-resource { min-width: 210px; }
.ts-field.ts-num strong, .ts-field.ts-num span { font-size: 20px; font-weight: 700; line-height: 30px; font-variant-numeric: tabular-nums; }
.ts-field.ts-num span { font-weight: 500; color: var(--tblr-secondary); }
.ts-period { font-weight: 600; min-width: 220px; }
.ts-sheet-status { font-size: 12.5px; padding: 6px 10px; line-height: 18px; }
.ts-tabs .btn.active, .ts-actions .btn-group .btn.active { background: var(--tblr-primary); border-color: var(--tblr-primary); color: #fff; }
.ts-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--tblr-border-color); }
.ts-actions .btn:not(.btn-primary) { background: var(--tblr-bg-surface); }
.ts-actions-sep { width: 1px; height: 22px; background: var(--tblr-border-color); margin: 0 4px; }

.ts-grid { margin: 0; font-size: 13px; min-width: 1100px; }
.ts-grid th { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--tblr-secondary); white-space: nowrap; background: var(--tblr-bg-surface-secondary, transparent); }
.ts-grid td, .ts-grid th { padding: 6px 8px; vertical-align: middle; }
.ts-grid .ts-type { width: 150px; }
.ts-grid .ts-title { width: 24%; max-width: 340px; }
.ts-grid .ts-bctype { width: 136px; }
.ts-grid .ts-lineno { width: 84px; text-align: right; color: var(--tblr-secondary); font-variant-numeric: tabular-nums; }
.ts-bctype-select { min-width: 124px; font-size: 12.5px; padding-top: 4px; padding-bottom: 4px; }
.ts-bctype-select:disabled { background-image: none; border-color: transparent; background-color: transparent; opacity: .8; }
.ts-grid tbody tr { cursor: context-menu; }
.ts-context-menu .context-menu-item { display: flex; align-items: center; gap: 8px; }
.ts-context-menu .context-menu-item .ti { font-size: 16px; color: var(--tblr-secondary); }
.ts-context-menu .context-menu-item.danger, .ts-context-menu .context-menu-item.danger .ti { color: #d63939; }
.ts-context-menu .context-menu-heading { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: none; font-size: 12px; font-weight: 600; }
.ts-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1100;
  background: #111827; color: #f3f4f6; padding: 9px 16px; border-radius: 8px; font-size: 13px;
  box-shadow: var(--shadow-md); transition: opacity .3s ease;
}
.ts-toast.hide { opacity: 0; }
.ts-grid .ts-desc { width: 18%; }
.ts-grid .ts-day, .ts-grid .ts-cell, .ts-grid .ts-cell-total, .ts-grid .ts-planned { width: 74px; text-align: center; }
.ts-grid td.ts-cell { padding: 4px; }
.ts-grid th.ts-day span { display: block; font-size: 11px; }
.ts-grid th.ts-day.is-today { color: var(--brand-green-dark); }
.ts-grid .nonwork { background: rgba(var(--tblr-primary-rgb), .035); }
.ts-grid .ts-total { width: 70px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.ts-grid .ts-status { width: 110px; }
.ts-grid .ts-row-actions { width: 44px; text-align: center; }
.ts-title-text { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; }
.ts-type-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; padding: 2px 8px 2px 6px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--src) 40%, transparent); background: color-mix(in srgb, var(--src) 10%, transparent); white-space: nowrap; }
.ts-type-chip .ti { font-size: 14px; color: var(--src); }
.ts-input, .ts-desc-input {
  width: 100%; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--tblr-body-color);
  padding: 5px 6px; font: inherit; font-variant-numeric: tabular-nums; transition: border-color .12s, background-color .12s, box-shadow .2s;
}
.ts-input { text-align: right; -moz-appearance: textfield; padding: 5px 8px; min-width: 0; }
.ts-input::-webkit-outer-spin-button, .ts-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ts-grid tbody tr:hover .ts-input:not(:disabled), .ts-grid tbody tr:hover .ts-desc-input:not(:disabled) { border-color: var(--tblr-border-color); background: var(--tblr-bg-surface); }
.ts-input:focus, .ts-desc-input:focus { outline: none; border-color: var(--tblr-primary); background: var(--tblr-bg-surface); box-shadow: 0 0 0 3px rgba(var(--tblr-primary-rgb), .15); }
.ts-input:disabled, .ts-desc-input:disabled { color: var(--tblr-body-color); opacity: .75; cursor: not-allowed; border-color: transparent !important; background: transparent !important; }
.ts-desc-input:disabled::placeholder { color: transparent; }
.ts-input.ts-saved { box-shadow: 0 0 0 2px rgba(90, 148, 41, .55); }
.ts-grid tfoot th { text-align: left; }
.ts-grid tfoot td, .ts-grid tfoot th { border-bottom: 0; }
.ts-foot-total td, .ts-foot-total th { font-weight: 700; color: var(--tblr-body-color); border-top: 2px solid var(--tblr-border-color); font-variant-numeric: tabular-nums; }
.ts-cell-total.over { color: #d63939; }
.ts-foot-planned td, .ts-foot-planned th { color: var(--tblr-secondary); font-weight: 500; font-variant-numeric: tabular-nums; }
.ts-foot-planned .ts-total { font-weight: 500; }
.ts-entries { margin: 0; font-size: 13px; }
.ts-entries th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--tblr-secondary); white-space: nowrap; }
.ts-entries .dot { margin-right: 6px; }
.ts-entries-title { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-entries-desc { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tblr-secondary); }
.ts-modal { width: 520px; max-width: calc(100vw - 32px); }
.ts-modal #tsl-item { width: 100%; height: auto; }

/* ---------- Collapsed sidebar (header toggle, js/ui/shell.js) — an icon rail ---------- */
/* Narrowing --tblr-sidebar-width moves Tabler's own sidebar width and the
   main column's margin together; --shell-left follows via syncShellLeft. */
@media (min-width: 992px) {
  html[data-sidebar="collapsed"] { --tblr-sidebar-width: 64px; }
  html[data-sidebar="collapsed"] .app-sidebar .container-fluid { padding-inline: 0; }
  html[data-sidebar="collapsed"] .app-brand { align-items: center; padding: 14px 6px 10px; }
  html[data-sidebar="collapsed"] .app-brand .brand-logo { display: none !important; }
  html[data-sidebar="collapsed"] .app-brand .brand-mark { display: block; width: 34px; height: 34px; }
  html[data-sidebar="collapsed"] .brand-lines i { width: 6px; }
  /* Section labels become thin dividers */
  html[data-sidebar="collapsed"] .app-sidebar .nav-label { font-size: 0; padding: 0; margin: 10px 14px; border-top: 1px solid var(--tblr-border-color); }
  html[data-sidebar="collapsed"] .app-sidebar .nav-link { justify-content: center; padding: 9px 0; }
  html[data-sidebar="collapsed"] .app-sidebar .nav-link .nav-link-icon { margin: 0; }
  html[data-sidebar="collapsed"] .app-sidebar .nav-link-title { display: none; }
  html[data-sidebar="collapsed"] #nav-backlog-count { position: absolute; top: 2px; right: 6px; padding: 1px 4px; font-size: 10px; }
  /* Footer: connection pill shrinks to a coloured dot, user block to its avatar */
  html[data-sidebar="collapsed"] .sidebar-footer { padding: 12px 6px 14px; align-items: center; }
  /* .sidebar-footer in the selector so these outrank the Night-mode #status-pill colours */
  html[data-sidebar="collapsed"] .sidebar-footer #status-pill { font-size: 0; width: 10px; height: 10px; padding: 0; align-self: center; background: #e0b252; border-color: transparent; }
  html[data-sidebar="collapsed"] .sidebar-footer #status-pill.ok { background: #7fbd41; }
  html[data-sidebar="collapsed"] .sidebar-footer #status-pill.err { background: #d63939; }
  html[data-sidebar="collapsed"] .sidebar-user { margin: 0; }
  html[data-sidebar="collapsed"] .sidebar-user-text { display: none; }
  html[data-sidebar="collapsed"] .sidebar-user-actions .btn { font-size: 0; width: auto; padding-inline: 8px; }
  html[data-sidebar="collapsed"] .sidebar-user-actions .btn .ti { margin: 0; }
}

/* ---------- Mobile / tablet: Tabler turns the sidebar into a top bar ---------- */
@media (max-width: 991.98px) {
  .app-sidebar-toggle { display: none; }
  .app-sidebar .navbar-collapse .sidebar-footer { padding-bottom: 8px; }
  .app-main { height: calc(100vh - 56px); }
  .app-header { padding: 10px 16px; }
  .topbar { padding: 8px 16px; }
  .sch-legend { display: none; }
  .side-panel { top: 0; }
  body.panel-open .app-main, body.setup-open .app-main, body.planned-open .app-main { padding-left: 0; }
}
@media (max-width: 575.98px) {
  .app-header-actions .btn:not(.btn-icon) .ti { margin-right: 0; }
  #view-dashboard { padding-top: 14px; }
  .dash-toolbar .btn-group { width: 100%; overflow-x: auto; }
}

/* ---------- 7. Login page (js/ui/login.js) ---------- */
/* While the session is being checked or nobody is signed in, the app
   itself isn't rendered at all — only the login screen: the animated
   TalosFlow mark above one small, centred sign-in card. */
body.auth-pending .page, body.auth-locked .page,
body.auth-pending .side-panel, body.auth-locked .side-panel,
body.auth-pending .bottom-panel, body.auth-locked .bottom-panel,
body.auth-pending .debug-panel, body.auth-locked .debug-panel,
body.auth-pending .panel-resize-handle, body.auth-locked .panel-resize-handle { display: none !important; }

/* Always light, on white — whatever Day/Night mode the app is in. The element
   carries data-bs-theme="light" so Tabler's own light variables apply inside it;
   that also resets Tabler's primary, so Flow purple is set again here. */
.login-screen {
  --tblr-primary: #8944AB;
  --tblr-primary-rgb: 137, 68, 171;
  --tblr-primary-text-emphasis: #6E3590;
  --tblr-link-color: #7A3B9C;
  --tblr-link-color-rgb: 122, 59, 156;
  position: fixed; inset: 0; z-index: 3000; display: flex; padding: 40px 16px;
  background: #fff; color: var(--tblr-body-color); color-scheme: light; overflow-y: auto;
}
.login-screen[hidden] { display: none; }
.login-center { margin: auto; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 30px; }

/* Animated mark: one line draws in, splits into the four Talos lines, which
   then settle as the bars under the TalosFlow logo (SMIL, see index.html).
   Click it to replay. */
.flow-mark { width: 260px; max-width: 100%; height: auto; display: block; overflow: visible; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.flow-mark .fm-single, .flow-mark .fm-line { fill: none; stroke-width: 5; stroke-linecap: round; }
.flow-mark .fm-single { stroke: var(--tblr-body-color); }
.flow-mark .fm-by-text { font-size: 14px; fill: var(--tblr-secondary); font-family: var(--tblr-font-sans-serif); }

.login-card {
  width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--tblr-border-color);
  border-radius: 22px; padding: 30px 32px; box-shadow: 0 8px 30px rgba(0, 0, 0, .08);
}
.login-card h1 { font-size: 21px; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; margin: 0; }
.login-sub { color: var(--tblr-secondary); font-size: 15px; margin: 2px 0 22px; }
.login-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 48px; font-size: 16px; font-weight: 600; border-radius: 999px;
}
.login-error { font-size: 13px; margin-bottom: 16px; }

.login-checking { display: none; align-items: center; justify-content: center; gap: 12px; min-height: 48px; color: var(--tblr-secondary); font-size: 14px; }
.login-screen[data-mode="checking"] .login-checking { display: flex; }
.login-screen[data-mode="checking"] .login-ready { display: none; }

@media (max-width: 575.98px) {
  .login-card { padding: 26px 22px; border-radius: 18px; }
}
