/* Tempus — shared design tokens & primitives. Clean neutral enterprise SaaS. */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  /* accent (blue direction) */
  --accent: #2a6fdb;
  --accent-700: #1f55ad;
  --accent-600: #2563cf;
  --accent-50: #eef4fd;
  --accent-100: #dbe8fb;

  /* neutrals — slate */
  --ink: #14181f;
  --ink-2: #38404d;
  --ink-3: #5b6573;
  --ink-4: #8a93a3;
  --line: #e4e7ec;
  --line-2: #eef0f3;
  --line-strong: #cfd4dc;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --surface-3: #f2f4f7;

  /* semantic */
  --plan: #6b7585;        /* plan = muted */
  --plan-bg: #f4f5f7;
  --fact: #14181f;        /* fact = strong */
  --good: #16a34a;
  --good-bg: #e9f7ee;
  --warn: #d97706;
  --warn-bg: #fef3c7;
  --bad: #dc2626;
  --bad-bg: #fde9e9;
  --over: #c2410c;        /* over-budget tint */
  --over-bg: #fdf0e8;

  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.04);
  --shadow-md: 0 4px 12px rgba(16,24,40,.08), 0 2px 4px rgba(16,24,40,.04);
  --shadow-lg: 0 16px 40px rgba(16,24,40,.16), 0 4px 12px rgba(16,24,40,.08);

  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;

  --row-h: 34px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.mono { font-family: var(--mono); font-feature-settings: "tnum" 1; }
.num  { font-family: var(--mono); font-variant-numeric: tabular-nums; }

a { color: inherit; }
::selection { background: var(--accent-100); }

/* scrollbars */
*::-webkit-scrollbar { height: 11px; width: 11px; }
*::-webkit-scrollbar-thumb { background: #c8cdd6; border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #aab1bd; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---- shared primitives ---- */
.t-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap;
}
.t-chip .dot { width: 7px; height: 7px; border-radius: 50%; }

.t-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 15px; border-radius: var(--radius-sm);
  font-family: var(--sans); font-size: 13.5px; font-weight: 600;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2);
  cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s;
}
.t-btn:hover { background: var(--surface-3); }
.t-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.t-btn.primary:hover { background: var(--accent-600); }
.t-btn.ghost { border-color: transparent; background: transparent; }
.t-btn.ghost:hover { background: var(--surface-3); }
.t-btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.t-btn.danger { color: var(--bad); border-color: #f0c9c9; background: #fff; }
.t-btn.danger:hover { background: var(--bad-bg); }

.t-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink-3);
}
.t-icon-btn:hover { background: var(--surface-3); color: var(--ink); }

.t-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.t-label { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-4); }

/* tooltip */
[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: #14181f; color: #fff; font-size: 11.5px; font-weight: 500; font-family: var(--sans);
  padding: 6px 9px; border-radius: 6px; white-space: nowrap; z-index: 80; pointer-events: none;
  box-shadow: var(--shadow-md); letter-spacing: 0; text-transform: none;
}

/* segmented control */
.t-seg { display: inline-flex; background: var(--surface-3); border-radius: 8px; padding: 3px; gap: 2px; }
.t-seg button {
  border: 0; background: transparent; font-family: var(--sans); font-weight: 600; font-size: 13px;
  color: var(--ink-3); padding: 6px 13px; border-radius: 6px; cursor: pointer;
}
.t-seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* variance pill helpers */
.var-pos { color: var(--good); }
.var-neg { color: var(--bad); }
.var-zero { color: var(--ink-4); }

/* ---- shared app shell: rail + topbar ---- */
.t-app { display: flex; height: 100vh; overflow: hidden; }
.t-rail {
  width: 210px; flex: none; background: #11151c; display: flex; flex-direction: column;
  align-items: stretch; padding: 14px 12px; gap: 6px; z-index: 40; overflow-y: auto;
}
.t-rail-logo {
  display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 4px 6px; margin-bottom: 8px;
}
.t-rail-logo svg { width: 26px; height: 26px; border-radius: 8px; background: var(--accent); padding: 4px; box-sizing: border-box; flex: none; }
.t-rail-logo .lg-txt { color: #fff; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.t-rail-home {
  display: flex; align-items: center; gap: 9px; color: #8b94a4; text-decoration: none;
  font-size: 13px; font-weight: 600; padding: 8px 10px; border-radius: 8px; transition: background .12s, color .12s; margin-bottom: 6px;
}
.t-rail-home:hover { background: #1c2430; color: #d7dce3; }
.t-rail-home.on { background: #1c2430; color: #fff; }
.t-rail-groups { display: flex; flex-direction: column; gap: 12px; }
.t-rail-grp { display: flex; flex-direction: column; gap: 2px; }
.t-rail-grp-h {
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: #5b6575; padding: 4px 10px 3px;
}
.t-rail-sub {
  display: block; color: #aab2c0; text-decoration: none; font-size: 13px; font-weight: 500;
  padding: 7px 10px 7px 16px; border-radius: 7px; transition: background .12s, color .12s; position: relative;
}
.t-rail-sub:hover { background: #1c2430; color: #eef1f5; }
.t-rail-sub.on { background: var(--accent); color: #fff; font-weight: 600; }

.t-main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }

.t-topbar {
  height: 62px; flex: none; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 20px; gap: 16px; z-index: 30;
}
.t-topbar-l { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; overflow: hidden; }
.t-topbar-title { font-size: 16px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-topbar-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; white-space: nowrap; }
.t-topbar-r { display: flex; align-items: center; gap: 10px; }

.t-meta { display: flex; align-items: center; gap: 8px; }
.t-meta-emp {
  display: flex; align-items: center; gap: 9px; padding: 5px 10px 5px 5px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
}
.t-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg,#2a6fdb,#5a4fcf);
  color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none;
}
.t-emp-name { font-size: 13px; font-weight: 600; line-height: 1.05; }
.t-emp-sub { font-size: 11px; color: var(--ink-4); }

/* ---- shared: AI summary card ---- */
.ai-card { background: linear-gradient(180deg, #f7f5fe, #fbfaff); border: 1px solid #e6e0fa; border-radius: var(--radius); padding: 14px 16px; }
.ai-card.compact { padding: 12px 14px; margin-top: 14px; }
.ai-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.ai-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; color: #6d28d9; background: #efe9fb; padding: 4px 9px; border-radius: 999px; }
.ai-meta { font-size: 11px; color: var(--ink-4); }
.ai-text { margin: 0; font-size: 13px; line-height: 1.55; color: var(--ink-2); }

/* ---- shared: personalizable widget board ---- */
.wb-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding: 9px 13px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.wb-bar-r { display: flex; align-items: center; gap: 10px; }
.wb-togglebtn { height: 32px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.wb-togglebtn:hover { background: var(--surface-3); }
.wb-togglebtn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.wb-hint { font-size: 12px; color: var(--ink-4); font-weight: 600; display: inline-flex; align-items: center; gap: 7px; }
.wb-add-wrap { position: relative; }
.wb-addbtn { height: 32px; padding: 0 13px; border: 1px solid var(--accent); border-radius: var(--radius-sm); background: var(--accent-50); color: var(--accent-700); font-weight: 600; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.wb-addbtn:hover { background: var(--accent-100); }
.wb-menu { position: absolute; top: 38px; right: 0; width: 280px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 30; padding: 6px; }
.wb-menu-h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-4); padding: 6px 9px; }
.wb-menu-item { display: flex; align-items: center; gap: 8px; padding: 8px 9px; border-radius: 7px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--ink-2); }
.wb-menu-item:hover { background: var(--accent-50); color: var(--accent-700); }
.wb-menu-empty { padding: 10px 9px; font-size: 12.5px; color: var(--ink-4); }
.wb-grid { display: grid; gap: 14px; }
.wb-item { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; transition: box-shadow .12s, opacity .12s; }
.wb-item.dragging { opacity: .5; }
.wb-item.over { box-shadow: 0 0 0 2px var(--accent); }
.wb-handle { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line-2); background: var(--surface-2); cursor: grab; color: var(--ink-4); }
.wb-handle:active { cursor: grabbing; }
.wb-title { font-size: 12px; font-weight: 700; color: var(--ink-2); flex: 1; text-transform: uppercase; letter-spacing: .02em; }
.wb-x { width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-4); cursor: pointer; display: grid; place-items: center; }
.wb-x:hover { background: var(--bad-bg); color: var(--bad); }
.wb-gear { width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-4); cursor: pointer; display: grid; place-items: center; }
.wb-gear:hover { background: var(--accent-50); color: var(--accent-700); }
.wb-cfg { position: absolute; top: 30px; right: 0; width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 40; padding: 12px; }
.wb-cfg-h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-4); margin-bottom: 9px; }
.wb-cfg-lbl { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink-3); margin-bottom: 5px; }
.wb-cfg-in { width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 7px 9px; font-size: 13px; font-family: var(--sans); color: var(--ink); }
.wb-cfg-in:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-50); }
.wb-cfg-row { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--ink-2); margin-top: 11px; cursor: pointer; line-height: 1.4; }
.wb-cfg-row input { margin-top: 1px; flex: none; }
.wb-cfg-reset { margin-top: 11px; width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); padding: 7px; font-size: 12px; font-weight: 600; color: var(--ink-3); cursor: pointer; }
.wb-cfg-reset:hover { background: var(--surface-3); }
.wb-hidesub .ai-meta, .wb-hidesub .sub, .wb-hidesub .mr-mnote, .wb-hidesub .cr-itemperiod, .wb-hidesub h2 span, .wb-hidesub h3 .sub { display: none !important; }
.wb-body { padding: 4px; }
.wb-body > .mr-card, .wb-body > .sp-card, .wb-body > .ur-card, .wb-body > .cr-card, .wb-body > .ai-card { margin: 0; border: 0; box-shadow: none; }

/* ---- shared: ineligible-cost risk card ---- */
.cr-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px; box-shadow: var(--shadow-sm); margin-bottom: 14px; }
.cr-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cr-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.cr-scope { font-size: 11.5px; color: var(--ink-4); }
.cr-count { margin-left: auto; font-size: 11.5px; color: var(--ink-4); font-weight: 600; }
.cr-ok { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
.cr-period { font-size: 11.5px; color: var(--ink-3); background: var(--surface-2); border-radius: 7px; padding: 6px 10px; margin-bottom: 12px; display: inline-flex; align-items: center; gap: 6px; }
.cr-period b { color: var(--ink); }
.cr-itemperiod { font-size: 11px; color: var(--ink-4); margin-top: 6px; display: inline-flex; align-items: center; gap: 5px; font-style: italic; }
.cr-itemperiod b { color: var(--ink-3); font-style: normal; }
.cr-list { display: flex; flex-direction: column; gap: 12px; }
.cr-item { display: flex; gap: 11px; align-items: flex-start; }
.cr-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; margin-top: 5px; }
.cr-body { flex: 1; min-width: 0; }
.cr-t { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.cr-sev { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; padding: 1px 6px; border-radius: 4px; }
.cr-d { font-size: 12px; color: var(--ink-3); margin-top: 3px; line-height: 1.45; }
.cr-fix { font-size: 12px; color: var(--ink-2); margin-top: 6px; line-height: 1.45; display: flex; gap: 7px; align-items: baseline; }
.cr-fix-ic { width: 18px; height: 18px; border-radius: 5px; display: inline-grid; place-items: center; flex: none; transform: translateY(3px); }
.cr-amt { text-align: right; flex: none; }
.cr-amt .v { font-family: var(--mono); font-weight: 700; font-size: 15px; color: var(--bad); }
.cr-amt .l { font-size: 10px; color: var(--ink-4); }

/* ---- shared: person reported-hours calendar popup ---- */
.pc-ov { position: fixed; inset: 0; background: rgba(16,24,40,.42); z-index: 70; display: grid; place-items: center; padding: 24px; }
.pc-modal { width: 720px; max-width: 100%; max-height: 90vh; overflow-y: auto; background: var(--surface); border-radius: 16px; padding: 20px 22px; box-shadow: var(--shadow-lg); }
.pc-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.pc-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--ink-3); font-weight: 600; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.pc-lg { display: inline-flex; align-items: center; gap: 6px; }
.pc-sw { width: 11px; height: 11px; border-radius: 3px; }
.pc-ic { width: 17px; height: 17px; border-radius: 5px; display: inline-grid; place-items: center; }
.pc-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.pc-dow div { text-align: center; font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--ink-4); }
.pc-dow div.we { color: #c2410c; }
.pc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.pc-cell { min-height: 56px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 7px; display: flex; flex-direction: column; background: var(--surface); }
.pc-cell.empty { border: 0; background: transparent; }
.pc-cell.we { background: var(--surface-2); }
.pc-cell.hol { background: #fdf6ee; border-color: #f4ddc4; }
.pc-cell.vac { background: #f3eefb; border-color: #e2d8f5; }
.pc-cell.sick { background: #fdf0e8; border-color: #f6d8c4; }
.pc-cell.trip { background: #eaf5f6; border-color: #c9e6e8; }
.pc-cell.over { box-shadow: inset 0 0 0 1.5px var(--warn); }
.pc-top { display: flex; align-items: center; justify-content: space-between; }
.pc-n { font-size: 11.5px; font-weight: 700; font-family: var(--mono); color: var(--ink-3); }
.pc-flag { display: inline-flex; }
.pc-v { margin-top: auto; font-family: var(--mono); font-weight: 700; font-size: 14px; color: var(--ink); }
.pc-v.zero { color: #c8cdd6; font-weight: 500; }
.pc-v.over { color: var(--warn); }

