/* Canary TaskPulse — styles (ported verbatim from CanaryTaskPulse.tsx, section 17).
   One spacing scale everywhere: 4 · 8 · 12 · 16 · 24 · 32 · 48 */

.tp-root {
  --navy-900: #0F1F3D;
  --navy-800: #15284B;
  --navy-700: #1F3765;
  --side-text: #B3BCCB;
  --side-active: rgba(255, 255, 255, 0.15);
  --side-hover: rgba(255, 255, 255, 0.07);
  --bg: #F5F6F8;
  --header-bg: #F8F8F9;
  --surface: #FFFFFF;
  --surface-2: #F9FAFB;
  --head-bg: #F2F4F7;
  --border: #E4E7EC;
  --border-soft: #EEF0F3;
  --border-strong: #D0D5DD;
  --day-line: #D0D5DD;
  --text: #101828;
  --text-2: #475467;
  --text-3: #667085;
  --focus: #3B5BDB;
  --good: #067647;
  --good-soft: #DCFAE6;
  --bad: #B42318;
  --bad-soft: #FEE4E2;
  --warn: #B54708;
  --warn-soft: #FEF0C7;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.05);
  --shadow-pop: 0 16px 40px rgba(16, 24, 40, 0.16), 0 2px 6px rgba(16, 24, 40, 0.06);
  --page-x: 16px;
  --page-y: 16px;
  --gap-section: 16px;
  --gap-grid: 16px;
  --pad-card: 16px;
  --rail-w: 64px;
  font-family: 'Creato Display', 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--navy-900);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
.tp-root *, .tp-root *::before, .tp-root *::after { box-sizing: border-box; }
.tp-root :where(button, input, select, textarea) { font: inherit; color: inherit; }
.tp-root :where(h1, h2, h3, p, dl, dd, figure) { margin: 0; }
.tp-root :where(ul) { list-style: none; margin: 0; padding: 0; }
.tp-root :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.tp-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tp-icon { flex-shrink: 0; }
.tp-mono { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.tp-muted { color: var(--text-3); font-size: 14px; }
.tp-muted-dash { color: var(--text-3); padding: 0 10px; }
.tp-mt { margin-top: 16px; }
.tp-nowrap { white-space: nowrap; }
.tp-text-danger { color: var(--bad); font-size: 13px; }
.tp-link { border: 0; background: none; padding: 0; color: var(--navy-800); font-weight: 500; cursor: pointer; text-align: left; }
.tp-link:hover { text-decoration: underline; }

/* ── Shell ───────────────────────────────────────────────────────────── */
.tp-shell { display: flex; min-height: 100vh; background: var(--navy-900); }
.tp-sidebar { width: var(--rail-w); flex-shrink: 0; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 14px 8px; color: var(--side-text); z-index: 40; background: var(--navy-900); }
.tp-sidebar-brand { display: grid; place-items: center; margin-bottom: 20px; min-height: 40px; }
.tp-brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.tp-nav { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tp-nav-item { position: relative; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--side-text); cursor: pointer; transition: background 0.12s, color 0.12s; }
.tp-nav-item:hover { background: var(--side-hover); color: #fff; }
.tp-nav-item.is-active { background: var(--side-active); color: #fff; }
.tp-logout { margin-top: auto; }
/* Icon names show beside the rail on hover / keyboard focus. */
.tp-nav-item::after { content: attr(data-label); display: none; position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%); background: #101828; color: #fff; font-size: 13px; font-weight: 500; white-space: nowrap; padding: 6px 10px; border-radius: 6px; box-shadow: var(--shadow-pop); pointer-events: none; z-index: 70; animation: tp-tip-in 0.12s ease-out; }
@media (hover: hover) { .tp-nav-item:hover::after { display: block; } }
.tp-nav-item:focus-visible::after { display: block; }

.tp-panel { flex: 1; min-width: 0; margin-top: 8px; background: var(--bg); border-top-left-radius: 16px; min-height: calc(100vh - 8px); display: flex; flex-direction: column; }
.tp-header { position: sticky; top: 8px; z-index: 30; box-shadow: -24px -24px 0 0 var(--navy-900), 0 -24px 0 0 var(--navy-900); display: flex; align-items: center; gap: 16px; padding: 10px var(--page-x); background: var(--header-bg); border-bottom: 1px solid var(--border); border-top-left-radius: 16px; }
/* Navy top bar, continuous with the sidebar. */
.tp-header { background: var(--navy-900); border-bottom-color: rgba(255, 255, 255, 0.08); }
.tp-header .tp-welcome-title { color: #fff; }
.tp-header .tp-welcome-sub { color: var(--side-text); }
/* The navy rail and top bar meet in one rounded inner corner over the page. */
.tp-header { border-bottom: 0; }
.tp-header::after { content: ""; position: absolute; left: 0; top: 100%; width: 20px; height: 20px; background: radial-gradient(circle at 100% 100%, transparent 19.5px, var(--navy-900) 20px); pointer-events: none; }
.tp-welcome { min-width: 0; flex: 1; }
.tp-welcome-title { font-size: 19px; font-weight: 500; color: var(--text); line-height: 1.3; }
.tp-welcome-sub { font-size: 14px; color: var(--text-2); margin-top: 1px; }
.tp-header-right { display: flex; align-items: center; gap: 16px; }
.tp-main { flex: 1; padding: var(--page-y) var(--page-x); }
.tp-page { display: flex; flex-direction: column; gap: var(--gap-section); width: 100%; max-width: 1760px; margin: 0 auto; }

.tp-save { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); white-space: nowrap; }
.tp-save.is-dark { color: var(--side-text); }
.tp-save .tp-icon { color: var(--good); }
.tp-save-state { display: inline-flex; align-items: center; gap: 6px; }
.tp-save-badge { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--good-soft); color: var(--good); animation: tp-save-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.tp-save.is-dark .tp-save-badge { background: rgba(18, 183, 106, 0.22); color: #6CE9A6; }
.tp-save-tick { stroke-dasharray: 1; stroke-dashoffset: 1; animation: tp-save-draw 0.6s ease-out 0.3s forwards; }
.tp-save-text { animation: tp-save-text 0.5s ease-out 0.55s both; }
@keyframes tp-save-pop { 0% { transform: scale(0); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes tp-save-draw { to { stroke-dashoffset: 0; } }
@keyframes tp-save-text { from { opacity: 0; transform: translateX(-4px); } to { opacity: 1; transform: translateX(0); } }
.tp-user { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.tp-user-text { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; min-width: 0; }
.tp-user-name { font-size: 15.5px; font-weight: 500; color: var(--text); white-space: nowrap; }
.tp-user-role { font-size: 12.5px; color: var(--navy-800); white-space: nowrap; }
.tp-user.is-dark .tp-user-name { color: #fff; }
.tp-user.is-dark .tp-user-role { color: var(--side-text); }
.tp-viewas { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); border-radius: 8px; padding: 0 4px 0 10px; min-height: 36px; background: var(--surface); color: var(--text-2); font-size: 13.5px; }
.tp-viewas select { border: 0; background: transparent; padding: 6px 4px; cursor: pointer; max-width: 170px; font-size: 13.5px; }
.tp-viewas select:focus { outline: none; }
.tp-viewas.is-dark { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.18); color: var(--side-text); }
.tp-viewas.is-dark select { color: #fff; }
.tp-viewas.is-dark select option { color: var(--text); }
.tp-viewas.is-active { background: var(--warn-soft); border-color: #F7D196; color: var(--warn); padding-right: 4px; }
.tp-viewas-text { font-weight: 500; white-space: nowrap; }
.tp-viewas-exit { border: 0; background: var(--warn); color: #fff; border-radius: 6px; padding: 5px 10px; font-size: 12.5px; font-weight: 500; cursor: pointer; }

/* ── Page header & sections ──────────────────────────────────────────── */
.tp-page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.tp-page-titles { min-width: 0; flex: 1 1 360px; }
.tp-page-title { font-size: 24px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.25; color: var(--text); }
.tp-page-subtitle { font-size: 15px; color: var(--text-2); margin-top: 4px; max-width: 760px; }
.tp-page-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.tp-page-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.tp-page-meta { font-size: 14px; color: var(--text-2); }
.tp-section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: calc(var(--gap-section) * -0.5); }
.tp-section-title { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; }
.tp-section-subtitle { font-size: 15px; color: var(--text-2); margin-top: 4px; }
.tp-kpis { display: flex; gap: 12px; flex-wrap: wrap; }
.tp-kpi { display: flex; flex-direction: column; align-items: flex-start; padding: 10px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; min-width: 112px; }
.tp-kpi-value { font-size: 20px; font-weight: 500; line-height: 1.2; }
.tp-kpi-label { font-size: 12.5px; color: var(--text-3); }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.tp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 8px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background 0.12s, border-color 0.12s, color 0.12s; text-decoration: none; }
.tp-btn-md { min-height: 44px; padding: 0 20px; font-size: 15.5px; }
.tp-btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.tp-btn-icon-only.tp-btn-sm { width: 36px; padding: 0; }
.tp-btn-icon-only.tp-btn-md { width: 44px; padding: 0; }
.tp-btn-primary { background: var(--navy-800); color: #fff; }
.tp-btn-primary:hover:not(:disabled) { background: var(--navy-700); }
.tp-btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.tp-btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: #B9C0CB; }
.tp-btn-ghost { background: transparent; color: var(--text-2); }
.tp-btn-ghost:hover:not(:disabled) { background: #EDEFF3; color: var(--text); }
.tp-btn-danger { background: var(--bad); color: #fff; }
.tp-btn-danger:hover:not(:disabled) { background: #912018; }
.tp-btn:disabled { cursor: not-allowed; opacity: 0.5; }
.tp-btn-block { width: 100%; }
.tp-icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; flex-shrink: 0; }
.tp-icon-btn:hover { background: #EDEFF3; color: var(--text); }
.tp-icon-sm { width: 32px; height: 32px; }
.tp-icon-danger:hover { background: var(--bad-soft); color: var(--bad); }
.tp-spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: tp-spin 0.7s linear infinite; display: inline-block; }
@keyframes tp-spin { to { transform: rotate(360deg); } }

/* ── Tooltip ─────────────────────────────────────────────────────────── */
.tp-tip { position: relative; display: inline-flex; }
.tp-tip > button:disabled, .tp-tip > label input:disabled { pointer-events: none; }
/* Tooltips stay out of the layout until shown (display:none), so a hidden tip near
   the screen edge never widens the page. Hover only where a real pointer exists;
   keyboard focus shows them everywhere. */
.tp-tip::after { content: attr(data-tip); display: none; position: absolute; bottom: calc(100% + 8px); background: #101828; color: #fff; font-size: 12.5px; font-weight: 400; line-height: 1.45; padding: 7px 10px; border-radius: 6px; width: max-content; max-width: min(260px, calc(100vw - 32px)); white-space: normal; text-align: left; z-index: 60; pointer-events: none; animation: tp-tip-in 0.12s ease-out; }
@keyframes tp-tip-in { from { opacity: 0; } to { opacity: 1; } }
.tp-tip-center::after { left: 50%; transform: translateX(-50%); }
.tp-tip-end::after { right: 0; }
.tp-tip-start::after { left: 0; }
@media (hover: hover) { .tp-tip:hover::after { display: block; } }
.tp-tip:focus-visible::after { display: block; }
.tp-tip:has(:focus-visible)::after { display: block; }
.tp-tip[data-tip=""]::after { display: none !important; }

/* ── Chips & tones ───────────────────────────────────────────────────── */
.tp-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px; border-radius: 999px; font-size: 13px; font-weight: 500; line-height: 1.35; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tp-chip-strong { font-weight: 600; }
.tp-chip-empty { background: #ECEEF2; color: var(--text-3); padding: 2px 11px; font-weight: 600; }
.tp-tone-blue { background: #D6E8FB; color: #1B4F86; }
.tp-tone-green { background: #D3F0DA; color: #1D6A36; }
.tp-tone-purple { background: #EBDDF8; color: #5A2D90; }
.tp-tone-teal { background: #CDE1E5; color: #1D5560; }
.tp-tone-sand { background: #F6ECE2; color: #6B4A2F; }
.tp-tone-amber { background: #FDE8AE; color: #7A5200; }
.tp-tone-red { background: #FBD8D5; color: #9A1D1D; }
.tp-tone-cyan { background: #D5F2F6; color: #145E6D; }
.tp-tone-lime { background: #ECF5C8; color: #4F5E12; }
.tp-tone-indigo { background: #DCE1FB; color: #2D3A8C; }
.tp-tone-pink { background: #FADEEA; color: #8A1F54; }
.tp-tone-orange { background: #FDDDC6; color: #8A3B0B; }
.tp-tone-slate { background: #E4E7EC; color: #344054; }
.tp-tone-neutral { background: #F2F4F7; color: #475467; }
.tp-tone-success { background: var(--good-soft); color: var(--good); }
.tp-tone-danger { background: var(--bad-soft); color: var(--bad); }
.tp-tone-warning { background: var(--warn-soft); color: var(--warn); }
.tp-tone-navy { background: #E3E9F4; color: var(--navy-800); }
.tp-trend { display: inline-flex; align-items: center; gap: 3px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.tp-trend.is-good { background: var(--good-soft); color: var(--good); }
.tp-trend.is-bad { background: var(--bad-soft); color: var(--bad); }
.tp-trend.is-flat { background: #F2F4F7; color: #475467; }
.tp-lead-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; background: #E3E9F4; color: var(--navy-800); font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; }
.tp-access { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.tp-access-positive { background: var(--good-soft); color: var(--good); }
.tp-access-info { background: #E3E9F4; color: var(--navy-800); }
.tp-access-locked { background: #F2F4F7; color: #475467; }

.tp-avatar { display: inline-grid; place-items: center; border-radius: 50%; font-weight: 600; flex-shrink: 0; letter-spacing: 0.02em; }
.tp-avatar-0 { background: #E3E9F4; color: #1F3765; }
.tp-avatar-1 { background: #DDF1E4; color: #1D6A36; }
.tp-avatar-2 { background: #F6E9DB; color: #7A4313; }
.tp-avatar-3 { background: #ECE6F8; color: #4A3787; }
.tp-avatar-4 { background: #DCEFF3; color: #145E6D; }
.tp-avatar-muted { background: #ECEEF2 !important; color: #8A94A6 !important; }
.tp-avatar { overflow: hidden; }
.tp-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tp-avatar-muted img { filter: grayscale(1); opacity: 0.6; }
.tp-user-avatar .tp-avatar { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9); }

/* ── Cards, stats, progress ─────────────────────────────────────────── */
.tp-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap-grid); }
.tp-stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tp-stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-card); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tp-stat-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 8px; min-height: 26px; }
.tp-stat-label { font-size: 16px; color: var(--text-2); min-width: 0; white-space: nowrap; }
.tp-stat-top > .tp-trend { flex-shrink: 0; }
.tp-stat-value { font-size: 32px; font-weight: 500; line-height: 1.1; letter-spacing: -0.01em; }
.tp-stat-caption { font-size: 14px; color: var(--navy-800); }
.tp-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-card); min-width: 0; }
.tp-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: var(--pad-card) var(--pad-card) 0; flex-wrap: wrap; }
.tp-card-titles { min-width: 0; }
.tp-card-title { font-size: 20px; font-weight: 500; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tp-card-subtitle { font-size: 14px; color: var(--text-2); margin-top: 4px; }
.tp-card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tp-card-body { padding: 12px var(--pad-card) var(--pad-card); }
.tp-card-body-flush { padding-top: 12px; }
.tp-card-foot { border-top: 1px solid var(--border); padding: 16px var(--pad-card); }
.tp-grid-2 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--gap-grid); align-items: start; }
.tp-progress { width: 100%; background: #DCE7F7; border-radius: 999px; overflow: hidden; }
.tp-progress-md { height: 8px; }
.tp-progress-sm { height: 6px; }
.tp-progress-fill { height: 100%; background: #2a78d6; border-radius: 999px; }
.tp-inline-progress { display: flex; align-items: center; gap: 12px; min-width: 140px; }
.tp-inline-progress span { font-size: 13.5px; font-weight: 500; min-width: 38px; text-align: right; font-variant-numeric: tabular-nums; }

/* ── Inputs, fields, pills ──────────────────────────────────────────── */
.tp-input { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); font-size: 15px; color: var(--text); transition: border-color 0.12s, box-shadow 0.12s; }
.tp-input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(59, 91, 219, 0.14); }
.tp-input::placeholder { color: #98A2B3; }
.tp-input-inline { width: auto; min-width: 150px; min-height: 38px; padding: 7px 12px; font-size: 14px; }
select.tp-input { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; cursor: pointer; }
.tp-textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.tp-search { position: relative; display: flex; align-items: center; width: 300px; max-width: 100%; color: var(--text-3); }
.tp-search .tp-icon { position: absolute; left: 12px; pointer-events: none; }
.tp-search .tp-input { padding-left: 38px; min-height: 40px; font-size: 14px; }
.tp-form { display: flex; flex-direction: column; gap: 18px; }
.tp-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tp-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tp-label { font-size: 14px; font-weight: 500; color: var(--text); }
.tp-required { color: var(--bad); }
.tp-field-hint { font-size: 13px; color: var(--text-3); }
.tp-field-error { font-size: 13px; color: var(--bad); font-weight: 500; }
.tp-field.has-error .tp-input { border-color: var(--bad); }
.tp-pills { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.tp-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 16px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 14.5px; cursor: pointer; white-space: nowrap; }
.tp-pill:hover { background: var(--surface-2); }
.tp-pill.is-active { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.tp-pill-count { font-size: 12px; padding: 1px 7px; border-radius: 999px; background: #EEF0F3; color: var(--text-2); }
.tp-pill.is-active .tp-pill-count { background: rgba(255, 255, 255, 0.18); color: #fff; }

/* ── Banner, empty, skeleton ────────────────────────────────────────── */
.tp-banner { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: 10px; border: 1px solid; font-size: 14px; }
.tp-banner .tp-icon { margin-top: 2px; }
.tp-banner-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tp-banner-info { background: #EEF2FA; border-color: #D3DCEE; color: var(--navy-800); }
.tp-banner-locked { background: #F2F4F7; border-color: var(--border); color: var(--text-2); }
.tp-banner-warning { background: #FFFAEB; border-color: #FEDF89; color: #93370D; }
.tp-banner-positive { background: #ECFDF3; border-color: #ABEFC6; color: var(--good); }
.tp-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 48px 24px; gap: 6px; }
.tp-empty-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: #F2F4F7; color: var(--text-3); margin-bottom: 8px; }
.tp-empty-title { font-size: 16px; font-weight: 500; color: var(--text); }
.tp-empty-message { font-size: 14px; color: var(--text-3); max-width: 380px; }
.tp-empty-action { margin-top: 12px; }
.tp-skeleton { display: block; border-radius: 6px; background: linear-gradient(90deg, #ECEEF2 0%, #F5F6F8 50%, #ECEEF2 100%); background-size: 200% 100%; animation: tp-shimmer 1.3s ease-in-out infinite; }
.tp-skeleton-stack { display: flex; flex-direction: column; gap: 12px; }
@keyframes tp-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── Tables (reference list style) ──────────────────────────────────── */
.tp-table-card { overflow: hidden; }
.tp-table-card .tp-card-body-flush { padding-top: 0; }
.tp-table-toolbar { display: flex; align-items: center; gap: 16px; padding: 16px; flex-wrap: wrap; }
.tp-table-toolbar-sub { padding-top: 0; gap: 12px; }
.tp-toolbar-count { margin-left: auto; font-size: 15px; color: var(--text); white-space: nowrap; }
.tp-table-wrap { width: 100%; overflow-x: auto; }
.tp-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tp-table th { background: var(--head-bg); text-align: left; font-size: 12.5px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.03em; color: #344054; padding: 16px 20px; white-space: nowrap; }
.tp-table td { padding: 16px 20px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.tp-table tbody tr:last-child td { border-bottom: 0; }
.tp-table tbody tr:hover td { background: #FCFCFD; }
.tp-table tr.is-inactive td { color: var(--text-3); }
.tp-table tr.is-readonly td { background: #FCFCFD; }
.tp-table-compact th, .tp-table-compact td { padding: 10px 14px; }
.tp-num { text-align: right !important; font-variant-numeric: tabular-nums; }
.tp-actions-col { text-align: right !important; }
.tp-row-buttons { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.tp-cell-person { display: inline-flex; align-items: center; gap: 10px; }
.tp-cell-person-name { font-weight: 500; }
.tp-cell-email { color: var(--text-2); }
.tp-cell-task { min-width: 240px; }
.tp-cell-task-title { display: block; font-weight: 500; }
.tp-cell-task-id { display: block; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; margin-top: 2px; }
.tp-icon-btn:disabled { opacity: 0.4; cursor: not-allowed; background: transparent !important; }
.tp-datepick { position: relative; display: inline-flex; }
.tp-datepick-input { position: absolute; left: 0; bottom: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.tp-table-more { display: flex; justify-content: center; padding: 16px; border-top: 1px solid var(--border-soft); }
.tp-person-link { display: inline-flex; align-items: center; gap: 10px; border: 0; background: none; padding: 0; cursor: pointer; text-align: left; }
.tp-person-link > span { display: flex; flex-direction: column; line-height: 1.25; }
.tp-person-link-name { font-weight: 500; color: var(--text); }
.tp-person-link-code { font-size: 12px; color: var(--text-3); }
.tp-person-link:hover .tp-person-link-name { text-decoration: underline; }
.tp-signed-icon { color: var(--good); margin-left: 6px; vertical-align: -2px; }
.tp-check-static { display: inline-flex; }
.tp-list { display: flex; flex-direction: column; }
.tp-list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border-soft); }
.tp-list-row:first-child { border-top: 0; padding-top: 0; }
.tp-list-body { flex: 1; min-width: 0; }
.tp-list-title { font-weight: 500; overflow-wrap: anywhere; }
.tp-list-sub { font-size: 13.5px; color: var(--text-3); }
.tp-dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tp-dl > div { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.tp-dl dt { font-size: 13px; color: var(--text-3); }
.tp-dl dd { font-size: 18px; font-weight: 500; }
.tp-dl-wide { grid-column: 1 / -1; }
.tp-dl-wide dd { font-size: 15px; font-weight: 400; }

/* ── Tasks page ──────────────────────────────────────────────────────── */
.tp-person-bar { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; margin: -2px -2px calc(var(--gap-section) * -0.5); scrollbar-width: thin; }
.tp-person-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px 0 8px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 14.5px; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.tp-person-pill:hover { background: var(--surface-2); }
.tp-person-pill.is-active { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.tp-person-pill-icon { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #E3E9F4; color: var(--navy-800); }
.tp-person-pill.is-active .tp-person-pill-icon { background: rgba(255, 255, 255, 0.18); color: #fff; }
.tp-person-pill-count { font-size: 12px; font-weight: 500; padding: 1px 7px; border-radius: 999px; background: #EEF0F3; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tp-person-pill.is-active .tp-person-pill-count { background: rgba(255, 255, 255, 0.18); color: #fff; }
.tp-person-pill.is-active .tp-avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5); }
.tp-sheet-card { overflow: visible; }
.tp-sheet-card .tp-card-body-flush { padding-top: 20px; }
.tp-sheet-more { text-align: center; padding: 6px 0 8px; border-top: 1px solid var(--border-soft); }
.tp-more-link { border: 0; background: none; padding: 4px 8px; font-size: 12px; color: var(--text-3); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.tp-more-link:hover { color: var(--navy-800); }
.tp-more-end { font-size: 11.5px; color: #98A2B3; }
.tp-day-tags .tp-chip { padding: 1px 8px; font-size: 11.5px; }
.tp-day-tags .tp-access { padding: 1px 6px; font-size: 11px; }
.tp-row-add .tp-btn-sm { min-height: 32px; }
.tp-plan { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text-2); font-size: 14px; cursor: pointer; }
.tp-plan input { border: 0; background: transparent; font-size: 13.5px; color: var(--text); padding: 4px 0; cursor: pointer; }
.tp-plan input:focus { outline: none; }
.tp-plan:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(59, 91, 219, 0.14); }
.tp-plan-icon { padding: 0 8px; }
.tp-daynav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.tp-sheet { border-top: 1px solid var(--border); container-type: inline-size; container-name: sheet; }
.tp-sheet-head, .tp-day { display: grid; grid-template-columns: 124px minmax(0, 1fr) 150px; }
.tp-sheet-head { background: var(--head-bg); color: #344054; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.tp-sheet-head > span, .tp-sheet-head-row > span { padding: 8px 10px; white-space: nowrap; }
.tp-sheet-head > span:first-child { padding-left: var(--pad-card); }
.tp-sheet-head-row > span:first-child { text-align: center; padding: 8px 0; }
.tp-sheet-head-row, .tp-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) 88px 156px minmax(150px, 0.75fr) 72px; align-items: center; }
.tp-day { border-top: 1px solid var(--day-line); }
.tp-sheet-head + .tp-day, .tp-sheet-head + .tp-day-slim, .tp-sheet-head + .tp-month-divider { border-top: 0; }
.tp-day-head { padding: 8px 10px 8px var(--pad-card); border-right: 1px solid var(--border-soft); display: flex; flex-direction: column; align-items: flex-start; gap: 3px; background: #FCFCFD; min-width: 0; }
.tp-day.is-today .tp-day-head { background: #EEF2F9; box-shadow: inset 3px 0 0 var(--navy-800); }
.tp-day-date { display: flex; flex-direction: row; align-items: baseline; gap: 6px; line-height: 1.2; }
.tp-day-weekday { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); }
.tp-day-num { font-size: 15.5px; font-weight: 500; letter-spacing: -0.01em; color: var(--text); }
.tp-day-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tp-day-count { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tp-day-person { display: flex; align-items: center; gap: 8px; max-width: 100%; border: 0; background: none; padding: 0; cursor: pointer; text-align: left; min-width: 0; }
.tp-day-person-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.tp-day-person-name { font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-day-person-code { font-size: 12px; color: var(--text-3); }
.tp-day-person:hover .tp-day-person-name { text-decoration: underline; }
.tp-day-rows { min-width: 0; display: flex; flex-direction: column; }
.tp-day-empty { padding: 8px 10px; color: var(--text-3); font-size: 14px; }
.tp-day-side { border-left: 1px solid var(--border-soft); padding: 8px 12px; display: flex; align-items: flex-start; min-width: 0; }
.tp-day.is-locked .tp-day-rows { background: #FDFDFD; }
.tp-day-slim { display: flex; align-items: center; gap: 16px; padding: 5px var(--pad-card); font-size: 12.5px; border-top: 1px solid var(--day-line); background: #FCFCFD; color: var(--text-3); font-size: 13.5px; }
.tp-day-slim-date { font-weight: 500; color: var(--text-2); min-width: 120px; }
.tp-month-divider { padding: 6px var(--pad-card); border-top: 1px solid var(--day-line); background: var(--head-bg); color: var(--text-2); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }

.tp-row { border-bottom: 1px solid var(--border-soft); min-height: 40px; }
.tp-day-rows > .tp-row:last-child { border-bottom: 0; }
.tp-row-check { display: grid; place-items: center; align-self: stretch; cursor: pointer; }
.tp-row.is-readonly .tp-row-check { cursor: not-allowed; }
/* Disabled controls let the click reach the row, which explains the lock. */
.tp-row.is-readonly { cursor: not-allowed; }
.tp-row.is-readonly input:disabled { pointer-events: none; }
.tp-row.is-readonly button:not(:disabled) { cursor: pointer; }
.tp-day-slim { cursor: not-allowed; }
.tp-row-title { min-width: 0; padding: 3px 8px 3px 0; display: flex; flex-direction: column; gap: 4px; }
.tp-row-priority, .tp-row-project { padding: 3px 6px; min-width: 0; }
.tp-row-reason { padding: 3px 8px; min-width: 0; }
.tp-row-actions { display: flex; justify-content: flex-end; gap: 2px; padding-right: 8px; }
.tp-row-meta { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 10px; }
.tp-cell { display: block; width: 100%; resize: none; overflow: hidden; border: 1px solid transparent; border-radius: 6px; background: transparent; padding: 5px 8px; font-size: 14.5px; line-height: 1.4; color: var(--text); min-height: 32px; }
.tp-cell:hover { border-color: var(--border); background: var(--surface); }
.tp-cell:focus { outline: none; border-color: var(--focus); background: var(--surface); box-shadow: 0 0 0 3px rgba(59, 91, 219, 0.14); }
.tp-cell::placeholder { color: #98A2B3; }
.tp-cell.is-invalid { border-color: #F4B4AE; background: #FFF6F5; }
.tp-cell.is-invalid::placeholder { color: var(--bad); }
.tp-row-reason .tp-cell { font-size: 14px; }
.tp-cell-add { border: 1px dashed var(--border-strong); background: var(--surface); }
.tp-row-text { display: block; padding: 7px 10px; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.tp-row.is-done .tp-row-title .tp-cell, .tp-row.is-done .tp-row-text { color: var(--text-3); text-decoration: line-through; text-decoration-color: #B8BEC8; }
.tp-row-add { background: #FBFCFE; }
.tp-add-icon { color: var(--text-3); }
.tp-add-btn { width: 100%; max-width: 132px; }
.tp-row-add .tp-field-error { padding: 0 10px; }
.tp-reason-text { display: block; padding: 7px 10px; font-size: 14px; color: var(--warn); overflow-wrap: anywhere; }
.tp-reason-missing { display: inline-flex; align-items: center; gap: 5px; color: var(--bad); font-size: 13.5px; font-weight: 500; padding: 7px 10px; }
.tp-done-at { display: inline-flex; align-items: center; gap: 5px; color: var(--good); font-size: 13.5px; font-weight: 500; padding: 7px 10px; }
.tp-lock { display: inline-grid; place-items: center; width: 32px; height: 32px; color: #A4ACB9; }

.tp-checkbox { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin: 0; border: 1.5px solid #98A2B3; border-radius: 5px; background: var(--surface); display: inline-grid; place-items: center; cursor: pointer; flex-shrink: 0; transition: background 0.12s, border-color 0.12s; }
.tp-checkbox:hover:not(:disabled) { border-color: var(--navy-800); }
.tp-checkbox:checked { background: var(--navy-800); border-color: var(--navy-800); }
.tp-checkbox:checked::after { content: ""; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.tp-checkbox:disabled { cursor: not-allowed; background: #F2F4F7; border-color: #D0D5DD; }
.tp-checkbox:disabled:checked { background: #98A2B3; border-color: #98A2B3; }

.tp-signoff { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: 100%; }
.tp-signoff.is-empty { align-self: center; }
.tp-signoff-box { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); font-size: 14px; font-weight: 500; cursor: pointer; }
.tp-signoff-box:hover:not(.is-disabled) { border-color: var(--navy-800); }
.tp-signoff-box.is-disabled { cursor: not-allowed; color: var(--text-3); background: var(--surface-2); }
.tp-signoff.is-signed .tp-signoff-box { background: #ECFDF3; border-color: #ABEFC6; color: var(--good); }
.tp-signoff.is-signed .tp-checkbox:checked { background: #079455; border-color: #079455; }
.tp-signoff-state { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--text-2); }
.tp-signoff-state.is-signed { color: var(--good); }
.tp-signoff-meta { font-size: 12.5px; color: var(--text-3); line-height: 1.4; }
.tp-signoff-meta.is-warning { color: var(--bad); font-weight: 500; }
/* Day rating — lead's 1–5 stars under the sign-off, and read-only stars in Performance */
.tp-stars { display: inline-flex; flex-wrap: nowrap; align-items: center; gap: 2px; white-space: nowrap; }
.tp-root .tp-star { display: inline-grid; place-items: center; width: 20px; height: 20px; padding: 0; margin: 0; border: 0; border-radius: 4px; background: none; box-shadow: none; appearance: none; -webkit-appearance: none; color: #D0D5DD; cursor: pointer; transition: color 0.1s, transform 0.1s; }
.tp-star svg { fill: currentColor; }
.tp-root .tp-star.is-on { color: #FFC107; }
.tp-stars:not(.is-locked) .tp-star:hover { transform: scale(1.18); }
.tp-stars.is-locked .tp-star { cursor: default; }
.tp-root .tp-stars.is-locked .tp-star.is-on { color: #FFC107; }
.tp-starsview { position: relative; display: inline-block; line-height: 1; letter-spacing: 1px; white-space: nowrap; }
.tp-starsview-base { color: #E4E7EC; }
.tp-starsview-fill { position: absolute; left: 0; top: 0; overflow: hidden; color: #FFC107; }
.tp-rating-quarter { align-items: flex-start; }
.tp-rating { display: grid; grid-template-columns: minmax(180px, 220px) minmax(0, 1fr); gap: 24px; align-items: start; }
.tp-rating-summary { display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.tp-rating-big { display: flex; align-items: baseline; gap: 6px; }
.tp-rating-value { font-size: 40px; font-weight: 500; line-height: 1; letter-spacing: -0.02em; }
.tp-rating-of { font-size: 16px; color: var(--text-3); }
.tp-rating-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; color: var(--text-2); }
.tp-rating-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 24px; }
.tp-rating-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border-soft); font-size: 14px; }
.tp-rating-day { color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-rating-day strong { color: var(--text); font-weight: 500; }
.tp-rating-cell { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 720px) { .tp-rating { grid-template-columns: minmax(0, 1fr); gap: 12px; } }

/* ── Chip dropdown ──────────────────────────────────────────────────── */
.tp-chipselect { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 3px 6px 3px 3px; border: 1px solid transparent; border-radius: 999px; background: transparent; cursor: pointer; }
.tp-chipselect:hover, .tp-chipselect.is-open, .tp-chipselect:focus-visible { border-color: var(--border-strong); background: var(--surface); }
.tp-chipselect .tp-chip { min-width: 0; }
.tp-chipselect-caret { color: var(--text-3); opacity: 0; transition: opacity 0.12s; }
.tp-chipselect:hover .tp-chipselect-caret, .tp-chipselect.is-open .tp-chipselect-caret, .tp-chipselect:focus-visible .tp-chipselect-caret { opacity: 1; }
@media (hover: none) { .tp-chipselect-caret { opacity: 1; } }
.tp-pop { position: fixed; z-index: 300; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-pop); overflow: hidden; }
.tp-pop.is-above { transform: translateY(-100%); }
.tp-pop-search { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text-3); }
.tp-pop-search input { flex: 1; border: 0; background: transparent; font-size: 14.5px; color: var(--text); padding: 2px 0; min-width: 0; }
.tp-pop-search input:focus { outline: none; }
.tp-pop-list { padding: 6px; overflow-y: auto; outline: none; }
.tp-pop-item { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.tp-pop-item.is-active { background: #F2F4F7; }
.tp-pop-item.is-create { color: var(--navy-800); font-size: 14px; }
.tp-pop-hint { font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-pop-check { margin-left: auto; color: var(--navy-800); }
.tp-pop-empty { padding: 10px; font-size: 13.5px; color: var(--text-3); }
.tp-pop-foot { border-top: 1px solid var(--border); padding: 6px; display: flex; justify-content: flex-end; }
.tp-pop-link { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--text-2); font-size: 13.5px; padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.tp-pop-link:hover { background: #F2F4F7; color: var(--text); }

/* ── Calendar ────────────────────────────────────────────────────────── */
.tp-monthnav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tp-monthnav-label { font-size: 17px; font-weight: 500; min-width: 150px; text-align: center; }
.tp-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.tp-legend-label { font-weight: 500; color: var(--text); }
.tp-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.tp-legend-sep { width: 1px; height: 16px; background: var(--border); }
.tp-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(16, 24, 40, 0.06); }
.tp-level-0 { background: transparent; color: var(--text-3); }
.tp-level-1 { background: #E9F1FC; color: #1B4F86; }
.tp-level-2 { background: #B7D3F6; color: #10305A; }
.tp-level-3 { background: #6DA7EC; color: #0B1F3A; }
.tp-level-4 { background: #256ABF; color: #fff; }
.tp-mark { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; font-size: 9.5px; font-weight: 700; line-height: 1; }
.tp-mark-signed { background: #079455; color: #fff; }
.tp-mark-missing { background: #D92D20; color: #fff; }
.tp-matrix-wrap { overflow-x: auto; border-top: 1px solid var(--border); }
.tp-matrix { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 860px; table-layout: fixed; font-size: 12px; }
.tp-matrix col.tp-col-name { width: 132px; }
.tp-matrix col.tp-col-total { width: 64px; }
.tp-matrix th, .tp-matrix td { padding: 2px 1px; text-align: center; }
.tp-matrix thead th { background: var(--head-bg); color: var(--text-3); font-weight: 500; padding: 6px 0; position: sticky; top: 0; z-index: 2; }
.tp-matrix-wd { display: block; font-size: 10.5px; letter-spacing: 0.04em; }
.tp-matrix-dn { display: block; font-size: 13px; color: var(--text); }
.tp-matrix .is-sunday { background: #FAFAFB; }
.tp-matrix thead th.is-sunday { background: #ECEEF2; }
.tp-matrix .is-today { background: #EEF2F9; }
.tp-matrix thead th.is-today { background: #DCE4F3; }
.tp-matrix thead th.is-today .tp-matrix-dn { font-weight: 700; color: var(--navy-800); }
.tp-matrix-name { position: sticky; left: 0; z-index: 3; background: var(--surface) !important; text-align: left !important; padding: 4px 6px 4px 12px !important; border-right: 1px solid var(--border-soft); overflow: hidden; }
.tp-matrix thead .tp-matrix-name { background: var(--head-bg) !important; z-index: 4; text-transform: uppercase; font-size: 12px; letter-spacing: 0.04em; color: #344054; }
.tp-matrix tbody tr + tr > * { border-top: 1px solid var(--border-soft); }
.tp-matrix tfoot td, .tp-matrix tfoot th { border-top: 1px solid var(--border); color: var(--text-3); font-size: 11.5px; padding: 10px 2px; font-variant-numeric: tabular-nums; }
.tp-matrix tfoot .tp-matrix-name { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.tp-matrix-person { display: flex; align-items: center; gap: 8px; }
.tp-matrix-person-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.tp-matrix-person-name { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 84px; }
.tp-matrix-person-code { font-size: 11.5px; color: var(--text-3); font-weight: 400; }
.tp-matrix-total { font-weight: 500; color: var(--text); padding: 2px 4px !important; font-variant-numeric: tabular-nums; }
.tp-matrix-signed { line-height: 1.15; }
.tp-signed-pct { display: block; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.tp-signed-pct.is-good { color: var(--good); }
.tp-signed-pct.is-mid { color: var(--warn); }
.tp-signed-pct.is-low { color: var(--bad); }
.tp-signed-count { display: block; font-size: 11px; font-weight: 400; color: var(--text-3); }
.tp-mx-cell { position: relative; width: 100%; min-width: 0; height: 30px; border: 0; border-radius: 6px; display: grid; place-items: center; font-size: 10.5px; font-weight: 500; font-variant-numeric: tabular-nums; cursor: pointer; padding: 0; }
.tp-mx-cell:hover { box-shadow: 0 0 0 1px #98A2B3; }
.tp-mx-cell.is-selected { box-shadow: 0 0 0 2px var(--navy-800); }
.tp-mx-cell.is-planned { background: transparent; border: 1px dashed #B5C0D0; color: var(--text-3); }
.tp-mx-dot { width: 4px; height: 4px; border-radius: 50%; background: #D0D5DD; }
.tp-mx-cell .tp-mark { position: absolute; width: 12px; height: 12px; box-shadow: 0 0 0 2px var(--surface); }
.tp-mx-cell .tp-mark-signed { right: -2px; bottom: -2px; }
.tp-mx-cell .tp-mark-missing { right: -2px; top: -2px; }
.tp-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.tp-month-wd { padding: 8px 12px; background: var(--head-bg); color: #344054; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.tp-month-cell { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 56px; padding: 5px 10px 7px; border: 0; border-top: 1px solid var(--border-soft); border-right: 1px solid var(--border-soft); background: var(--surface); cursor: pointer; text-align: left; }
.tp-month-cell:nth-child(7n) { border-right: 0; }
.tp-month-cell:hover { background: #FAFBFC; }
.tp-month-cell.is-outside { background: #FAFAFB; cursor: default; }
.tp-month-cell.is-outside:hover { background: #FAFAFB; }
.tp-month-cell.is-today .tp-month-day { background: var(--navy-800); color: #fff; }
.tp-month-cell.is-selected { box-shadow: inset 0 0 0 2px var(--navy-800); }
.tp-scroll-target { scroll-margin-top: calc(var(--header-h, 64px) + 16px); }
.tp-month-day { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 999px; font-size: 13px; font-weight: 500; }
.tp-month-progress { display: flex; flex-direction: column; gap: 3px; width: 100%; }
.tp-month-progress-text { font-size: 12px; line-height: 1.3; font-weight: 500; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tp-month-bar { display: block; width: 100%; height: 5px; border-radius: 999px; background: #DCE7F7; overflow: hidden; }
.tp-month-bar-fill { display: block; height: 100%; border-radius: 999px; background: #2a78d6; }
.tp-month-bar-fill.is-full { background: #256ABF; }
.tp-month-progress.is-planned .tp-month-progress-text { color: var(--text-3); }
.tp-month-progress.is-planned .tp-month-bar { background: transparent; border: 1px dashed #B5C0D0; height: 6px; }
.tp-legend-bar { display: inline-block; width: 28px; height: 6px; border-radius: 999px; background: #DCE7F7; overflow: hidden; }
.tp-legend-bar > span { display: block; width: 60%; height: 100%; background: #2a78d6; border-radius: 999px; }
.tp-month-marks { position: absolute; top: 8px; right: 10px; display: flex; gap: 4px; }

/* ── Chart ───────────────────────────────────────────────────────────── */
.tp-chart-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.tp-chart-plot { position: relative; width: 100%; overflow: hidden; }
.tp-chart-plot[hidden] { display: none; }
.tp-chart-plot svg { display: block; overflow: visible; }
.tp-grid-line { stroke: #EAECF0; stroke-width: 1; }
.tp-axis-line { stroke: #D0D5DD; stroke-width: 1; }
.tp-axis-text { fill: var(--text-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.tp-axis-text.is-strong { fill: var(--text); font-weight: 600; }
.tp-bar { outline: none; }
.tp-bar.is-hover path, .tp-bar.is-hover rect + rect { opacity: 0.85; }
.tp-bar:focus-visible > rect:first-child { stroke: var(--focus); stroke-width: 2; }
.tp-bar-value { fill: var(--text); font-size: 12px; font-weight: 600; }
.tp-tooltip { position: absolute; width: 190px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-pop); font-size: 13px; pointer-events: none; z-index: 5; }
.tp-tooltip-title { font-weight: 600; margin-bottom: 6px; }
.tp-tooltip-row { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.tp-tooltip-row strong { color: var(--text); min-width: 20px; }
.tp-tooltip-key { width: 12px; height: 3px; border-radius: 2px; flex-shrink: 0; }

/* ── Modal, toasts ──────────────────────────────────────────────────── */
.tp-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(15, 31, 61, 0.45); display: flex; align-items: center; justify-content: center; padding: 24px; animation: tp-fade 0.15s ease; }
@keyframes tp-fade { from { opacity: 0; } to { opacity: 1; } }
.tp-modal { width: 100%; max-height: calc(100vh - 48px); display: flex; flex-direction: column; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-pop); overflow: hidden; }
.tp-modal-sm { max-width: 460px; }
.tp-modal-md { max-width: 620px; }
.tp-modal-lg { max-width: 800px; }
.tp-modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px var(--pad-card); border-bottom: 1px solid var(--border); }
.tp-modal-titles { flex: 1; min-width: 0; }
.tp-modal-title { font-size: 19px; font-weight: 500; }
.tp-modal-subtitle { font-size: 14px; color: var(--text-3); margin-top: 2px; }
.tp-modal-body { padding: var(--pad-card); overflow-y: auto; flex: 1; }
.tp-modal-foot { display: flex; justify-content: flex-end; gap: 12px; padding: 16px var(--pad-card); border-top: 1px solid var(--border); background: var(--surface-2); }
.tp-confirm-text { color: var(--text-2); }
.tp-color-field { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.tp-color-options { display: flex; gap: 8px; flex-wrap: wrap; }
.tp-color-option { position: relative; display: inline-flex; border-radius: 999px; padding: 3px; border: 2px solid transparent; cursor: pointer; }
.tp-color-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tp-color-option.is-selected { border-color: var(--navy-800); }
.tp-color-option:focus-within { box-shadow: 0 0 0 3px rgba(59, 91, 219, 0.2); }
.tp-color-chip { min-width: 40px; justify-content: center; }
.tp-preview-row { display: flex; align-items: center; gap: 12px; }
.tp-toasts { position: fixed; right: 24px; bottom: 24px; z-index: 400; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.tp-toast { display: flex; align-items: center; gap: 10px; padding: 12px 10px 12px 16px; border-radius: 10px; background: var(--navy-900); color: #fff; box-shadow: var(--shadow-pop); font-size: 14px; animation: tp-toast-in 0.18s ease; }
.tp-toast-text { flex: 1; }
.tp-toast-success .tp-icon:first-child { color: #75E0A7; }
.tp-toast-error { background: #7A271A; }
.tp-toast-error .tp-icon:first-child { color: #FDA29B; }
.tp-toast-info .tp-icon:first-child { color: #A4BCFD; }
.tp-toast-action { border: 0; background: rgba(255, 255, 255, 0.16); color: #fff; font-weight: 600; font-size: 13px; padding: 6px 12px; border-radius: 6px; cursor: pointer; }
.tp-toast-action:hover { background: rgba(255, 255, 255, 0.26); }
.tp-toast-close { width: 28px; height: 28px; color: rgba(255, 255, 255, 0.7); }
.tp-toast-close:hover { background: rgba(255, 255, 255, 0.1) !important; color: #fff !important; }
@keyframes tp-toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Sign-in ─────────────────────────────────────────────────────────── */
.tp-login { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: var(--navy-900); }
.tp-login-card { width: 100%; max-width: 500px; display: flex; flex-direction: column; gap: 20px; padding: 36px; background: var(--surface); border-radius: 18px; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28); }
.tp-login-brand { display: flex; align-items: center; gap: 14px; }
.tp-login-brand > span { display: flex; flex-direction: column; line-height: 1.2; }
.tp-login-name { font-size: 20px; font-weight: 500; }
.tp-login-org { font-size: 13.5px; color: var(--text-3); }
.tp-login-title { font-size: 26px; font-weight: 500; letter-spacing: -0.01em; }
.tp-login-accounts { display: flex; flex-direction: column; gap: 16px; max-height: 360px; overflow-y: auto; padding-right: 4px; }
.tp-login-group { display: flex; flex-direction: column; gap: 6px; }
.tp-login-group-title { font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.tp-login-account { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; text-align: left; color: var(--text-3); }
.tp-login-account:hover { border-color: #B9C3D6; background: var(--surface-2); }
.tp-login-account-text { flex: 1; display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.tp-login-account-name { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 500; }
.tp-login-account-mail { font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .tp-root *, .tp-root *::before, .tp-root *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .tp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tp-stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tp-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .tp-save { display: none; }
}
@media (max-width: 1024px) {
  .tp-root { --page-x: 12px; --page-y: 12px; --gap-section: 12px; --gap-grid: 12px; --pad-card: 14px; }
  .tp-welcome-sub { display: none; }
  .tp-user-text { display: none; }
  .tp-header { padding: 8px var(--page-x); }
}
@media (max-width: 767px) {
  .tp-root { --rail-w: 52px; }
  .tp-sidebar { padding: 10px 4px; }
  .tp-nav-item { width: 40px; height: 40px; }
  .tp-panel { margin-top: 0; border-radius: 0; }
  .tp-header { border-radius: 0; }
}
@media (max-width: 720px) {
  .tp-root { --page-x: 8px; --page-y: 10px; --gap-section: 12px; --gap-grid: 8px; --pad-card: 12px; font-size: 14.5px; }
  .tp-page-title { font-size: 22px; }
  .tp-page-subtitle { font-size: 14.5px; }
  .tp-page-side { align-items: stretch; width: 100%; }
  .tp-page-actions { justify-content: flex-start; }
  .tp-stats, .tp-stats-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap-grid); }
  .tp-stat { padding: 12px; gap: 4px; }
  .tp-stat-label { font-size: 14px; white-space: normal; }
  .tp-stat-value { font-size: 26px; }
  .tp-stat-caption { font-size: 12.5px; }
  .tp-stat-top { flex-wrap: wrap; }
  .tp-kpis { width: 100%; }
  .tp-kpi { flex: 1; min-width: 0; padding: 8px 12px; }
  .tp-kpi-value { font-size: 17px; }
  .tp-btn-collapse .tp-btn-label { display: none; }
  .tp-form-row { grid-template-columns: minmax(0, 1fr); }
  .tp-search { width: 100%; }
  .tp-toolbar-count { margin-left: 0; }
  .tp-dl { grid-template-columns: minmax(0, 1fr); }
  .tp-viewas-text { display: none; }
  .tp-viewas select { max-width: 90px; }
  .tp-header-right { gap: 8px; }
  .tp-overlay { padding: 0; align-items: flex-end; }
  .tp-modal { max-height: 94vh; border-radius: 16px 16px 0 0; max-width: none !important; }
  .tp-modal-foot .tp-btn { flex: 1; }
  .tp-month-cell { min-height: 54px; padding: 4px 5px 6px; gap: 2px; }
  .tp-month-progress-text { font-size: 11px; }
  .tp-month-bar { height: 5px; }
  .tp-month-marks { top: 5px; right: 4px; }
  .tp-month-wd { padding: 8px 6px; text-align: center; }
  .tp-legend { gap: 10px; font-size: 12px; }
  /* Tables become cards */
  .tp-table-cards thead { display: none; }
  .tp-table-cards, .tp-table-cards tbody, .tp-table-cards tr, .tp-table-cards td { display: block; width: 100%; }
  .tp-table-cards tr { padding: 12px 16px; border-bottom: 1px solid var(--border-soft); }
  .tp-table-cards tbody tr:last-child { border-bottom: 0; }
  .tp-table-cards td { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0; border: 0 !important; text-align: right !important; }
  .tp-table-cards td::before { content: attr(data-label); flex-shrink: 0; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-3); text-align: left; }
  .tp-table-cards td[data-label="#"] { display: none; }
  .tp-table-cards td[data-label="Actions"]::before { display: none; }
  .tp-table-cards td[data-label="Actions"] > * { width: 100%; justify-content: flex-start; }
  .tp-cell-task { min-width: 0; }
}
/* ── Sticky header + docked cards ───────────────────────────────────── */
.tp-card-dock { display: flex; flex-direction: column; max-height: calc(100vh - 8px - var(--header-h, 64px) - var(--page-y) * 2); }
.tp-card-dock > .tp-card-head, .tp-card-dock > .tp-card-foot { flex-shrink: 0; }
.tp-card-dock > .tp-card-body-flush, .tp-card-dock > .tp-card-body { flex: 1 1 auto; min-height: 0; overflow: auto; scrollbar-width: none; -ms-overflow-style: none; }
.tp-card-dock > .tp-card-body-flush::-webkit-scrollbar, .tp-card-dock > .tp-card-body::-webkit-scrollbar { display: none; }
.tp-card-dock > .tp-card-body-flush { padding-top: 0; }
.tp-card-dock .tp-card-head { padding: 12px var(--pad-card) 10px; align-items: center; }
.tp-sheet-card .tp-card-title { font-size: 18px; }
.tp-card-dock .tp-sheet-head { position: sticky; top: 0; z-index: 5; }
.tp-card-dock .tp-matrix-wrap { overflow: visible; }
.tp-matrix-card > .tp-card-body-flush { scrollbar-width: thin; }
.tp-matrix-card > .tp-card-body-flush::-webkit-scrollbar { display: block; height: 8px; }
@media (max-width: 767px), (max-height: 520px) {
  .tp-header { top: 0; }
  .tp-card-dock { max-height: none; }
  .tp-card-dock > .tp-card-body-flush, .tp-card-dock > .tp-card-body { overflow: visible; }
  .tp-card-dock .tp-matrix-wrap { overflow-x: auto; }
  .tp-card-dock .tp-sheet-head { position: static; }
}

/* ── Analytics ──────────────────────────────────────────────────────── */
.tp-analytics-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tp-analytics-toolbar select { min-width: 220px; }
.tp-section-rule { height: 1px; background: var(--border); margin: 8px 0 0; }
.tp-grid-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tp-hbars { display: flex; flex-direction: column; gap: 10px; }
.tp-hbar-row { display: grid; grid-template-columns: minmax(96px, 128px) minmax(0, 1fr) 96px; align-items: center; gap: 12px; }
.tp-hbar-label { min-width: 0; overflow: hidden; }
.tp-hbar-track { height: 16px; }
.tp-hbar-fill { display: flex; gap: 2px; height: 100%; min-width: 4px; }
.tp-hbar-seg { display: block; height: 100%; min-width: 3px; }
.tp-hbar-seg:last-child { border-radius: 0 4px 4px 0; }
.tp-hbar-value { display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tp-hbar-value strong { font-size: 14.5px; font-weight: 600; color: var(--text); }
.tp-crosshair { stroke: #98A2B3; stroke-width: 1; stroke-dasharray: 3 3; }
.tp-swatch-line { height: 3px; width: 16px; border: 0; border-radius: 2px; }
.tp-reasons { display: flex; flex-direction: column; gap: 10px; }
.tp-reason-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(80px, 1fr) 40px; align-items: center; gap: 12px; font-size: 14px; }
.tp-reason-label { color: var(--text); overflow-wrap: anywhere; }
.tp-reason-track { height: 8px; border-radius: 999px; background: #F2F4F7; overflow: hidden; }
.tp-reason-fill { display: block; height: 100%; background: #eb6834; border-radius: 999px; }
.tp-reason-count { text-align: right; color: var(--text-2); font-weight: 500; font-variant-numeric: tabular-nums; }
@media (max-width: 1200px) { .tp-grid-even { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) {
  .tp-hbar-row { grid-template-columns: minmax(72px, 96px) minmax(0, 1fr) 70px; gap: 8px; }
  .tp-hbar-value span { display: none; }
  .tp-reason-row { grid-template-columns: minmax(0, 1fr) 60px 32px; gap: 8px; font-size: 13px; }
}
/* ── Quarter label & employee dashboard ─────────────────────────────── */
.tp-quarter { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: #EEF2F9; border: 1px solid #D5DEEE; color: var(--navy-800); font-size: 12.5px; white-space: nowrap; cursor: default; user-select: none; }
.tp-quarter strong { font-weight: 700; }
.tp-quarter.is-dark { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.18); color: #fff; }
.tp-quarter.is-dark span { color: var(--side-text); }
.tp-quarter span { color: var(--text-2); }
.tp-analytics-period { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tp-dot-state { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--border-strong); flex-shrink: 0; color: #fff; }
.tp-dot-state.is-done { background: var(--navy-800); border-color: var(--navy-800); }
.tp-dot-state.is-not_done { border-color: #eb6834; background: #FDEBE3; }
.tp-list-title.is-done { color: var(--text-3); text-decoration: line-through; }
@media (max-width: 1024px) { .tp-header .tp-quarter span { display: none; } }
@media (max-width: 720px) { .tp-monthnav-label { min-width: 0; font-size: 16px; } }
@media (max-width: 420px) { .tp-header .tp-quarter { display: none; } .tp-monthnav .tp-quarter span { display: none; } }
/* ── Compact, Excel-style sheet: one line per task ──────────────────── */
.tp-sheet-head { display: grid; grid-template-columns: 112px minmax(0, 1fr) 216px 124px; }
.tp-day { display: grid; grid-template-columns: 112px minmax(0, 1fr) 216px 124px; grid-template-areas: "head rows pend side"; }
.tp-day-head { grid-area: head; padding: 5px 8px 5px var(--pad-card); gap: 2px; }
.tp-day-rows { grid-area: rows; }
.tp-day-pending { grid-area: pend; border-left: 1px solid var(--border-soft); padding: 3px 8px; min-width: 0; }
.tp-day-side { grid-area: side; padding: 4px 8px; }
.tp-sheet-head > span, .tp-sheet-head-row > span { padding: 6px 8px; font-size: 11.5px; }
.tp-sheet-head-row > span:first-child { padding: 6px 0; }
.tp-h-narrow { display: none; }
.tp-sheet-head-row, .tp-row { grid-template-columns: 36px minmax(0, 1fr) 60px 132px minmax(140px, 0.55fr) 58px; }
.tp-day-date { gap: 5px; }
.tp-day-weekday { font-size: 10.5px; }
.tp-day-num { font-size: 14.5px; }
.tp-day-count { font-size: 11.5px; }
.tp-day-tags .tp-chip { padding: 0 7px; font-size: 11px; }
.tp-day-empty { padding: 5px 8px; font-size: 13px; }
.tp-day-slim { padding: 3px var(--pad-card); font-size: 12.5px; }
.tp-month-divider { padding: 4px var(--pad-card); font-size: 11.5px; }
.tp-row { min-height: 30px; }
.tp-row-title { padding: 1px 6px 1px 0; gap: 0; }
.tp-row-priority, .tp-row-project { padding: 1px 3px; }
.tp-row-reason { padding: 1px 6px; }
.tp-row-actions { padding-right: 6px; gap: 0; }
.tp-row-meta { padding: 0 6px 3px; gap: 4px; }
.tp-row-meta .tp-chip { font-size: 11px; padding: 0 7px; }
.tp-sheet .tp-cell { padding: 3px 6px; font-size: 14px; line-height: 1.35; min-height: 26px; }
.tp-sheet .tp-row-reason .tp-cell { font-size: 13px; }
.tp-sheet .tp-row-text { padding: 3px 6px; font-size: 14px; line-height: 1.35; }
.tp-sheet .tp-reason-text, .tp-sheet .tp-reason-missing, .tp-sheet .tp-done-at { padding: 3px 6px; font-size: 12.5px; line-height: 1.35; }
.tp-sheet .tp-done-at { white-space: nowrap; }
.tp-sheet .tp-muted-dash { padding: 0 6px; }
.tp-sheet .tp-checkbox { width: 17px; height: 17px; border-radius: 4px; }
.tp-sheet .tp-checkbox:checked::after { width: 4px; height: 9px; }
.tp-sheet .tp-chip { padding: 1px 9px; font-size: 12.5px; }
.tp-sheet .tp-chipselect { padding: 1px 4px 1px 1px; }
.tp-sheet .tp-icon-sm, .tp-sheet .tp-lock { width: 26px; height: 26px; }
.tp-icon-xs { width: 22px; height: 22px; border-radius: 6px; }
.tp-sheet .tp-row-add .tp-btn-sm { min-height: 26px; padding: 0 10px; font-size: 13px; }
.tp-sheet .tp-add-btn { max-width: 96px; }
.tp-sheet .tp-row-add .tp-field-error { padding: 0 6px; font-size: 12px; }
@media (hover: hover) {
  .tp-row:not(:hover):not(:focus-within) .tp-row-actions .tp-icon-danger,
  .tp-pending-item:not(:hover):not(:focus-within) .tp-icon-danger { opacity: 0; }
}
.tp-signoff { gap: 3px; }
.tp-signoff-box { min-height: 28px; padding: 0 8px; font-size: 13px; gap: 6px; }
.tp-signoff-state { font-size: 13px; }
.tp-signoff-meta { font-size: 11.5px; line-height: 1.3; }

/* Pending tasks (team lead) */
.tp-pending { display: flex; flex-direction: column; gap: 2px; width: 100%; min-width: 0; }
.tp-pending-list { display: flex; flex-direction: column; }
.tp-pending-item { display: flex; align-items: flex-start; gap: 6px; padding: 3px 0; font-size: 13px; line-height: 1.35; }
.tp-pending-flag { color: #E8590C; margin-top: 3px; }
.tp-pending-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tp-pending-text { font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
.tp-pending-item.is-added .tp-pending-text { font-weight: 400; color: var(--text-3); text-decoration: line-through; text-decoration-color: #B8BEC8; }
.tp-pending-item.is-added .tp-pending-flag { color: #A4ACB9; }
.tp-pending-added { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--good); font-weight: 500; }
.tp-pending-actions { display: flex; flex-shrink: 0; margin: -2px -4px 0 0; }
.tp-pending-add { display: flex; flex-direction: column; gap: 2px; }
.tp-sheet .tp-cell-pending { font-size: 13px; min-height: 26px; border: 1px dashed var(--border); background: transparent; }
.tp-day-pending > .tp-muted-dash { display: block; padding: 3px 0; }

/* The sheet adapts to its own width (sidebar open or not), not just the screen. */
@container sheet (max-width: 1240px) {
  .tp-sheet-head { grid-template-columns: 104px minmax(0, 1fr) 196px; }
  .tp-h-signoff, .tp-h-wide { display: none; }
  .tp-h-narrow { display: inline; }
  .tp-day { grid-template-columns: 104px minmax(0, 1fr) 196px; grid-template-areas: "head rows pend" "head rows side"; grid-template-rows: auto 1fr; }
  .tp-day-side { border-left: 1px solid var(--border-soft); border-top: 1px dashed var(--border-soft); }
  .tp-day-pending:has(> .tp-muted-dash:only-child) { display: none; }
  .tp-day-pending:has(> .tp-muted-dash:only-child) + .tp-day-side { border-top: 0; grid-row: 1 / span 2; }
  .tp-sheet-head-row, .tp-row { grid-template-columns: 34px minmax(0, 1fr) 56px 122px minmax(112px, 0.5fr) 52px; }
}
@container sheet (max-width: 900px) {
  .tp-sheet-head-row { grid-template-columns: 34px minmax(0, 1fr) 56px 122px 52px; }
  .tp-sheet-head-row > span:nth-child(5) { display: none; }
  .tp-row { grid-template-columns: 34px minmax(0, 1fr) 56px 122px 52px; grid-template-areas: "check title prio proj actions" "check reason reason reason actions"; }
  .tp-row-check { grid-area: check; align-self: start; padding-top: 6px; }
  .tp-row-title { grid-area: title; }
  .tp-row-priority { grid-area: prio; }
  .tp-row-project { grid-area: proj; }
  .tp-row-actions { grid-area: actions; align-self: start; padding-top: 2px; }
  .tp-row-reason { grid-area: reason; padding: 0 6px 3px 0; }
  .tp-row-reason:has(> .tp-muted-dash:only-child) { display: none; }
  .tp-row-add .tp-row-reason { justify-self: end; padding-bottom: 4px; }
}
@container sheet (max-width: 640px) {
  .tp-sheet-head { display: none; }
  .tp-day { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "rows" "pend" "side"; grid-template-rows: none; }
  .tp-day + .tp-day { border-top: 6px solid var(--bg); }
  .tp-day-head { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 10px; border-right: 0; border-bottom: 1px solid var(--border-soft); padding: 6px var(--pad-card); }
  .tp-day.is-today .tp-day-head { box-shadow: inset 0 3px 0 var(--navy-800); }
  .tp-day-num { font-size: 16px; }
  .tp-day-count { margin-left: auto; }
  .tp-day-pending { border-left: 0; border-top: 1px solid var(--border-soft); padding: 4px var(--pad-card); }
  .tp-day-side { grid-row: auto !important; border-left: 0; border-top: 1px solid var(--border-soft); padding: 6px var(--pad-card); }
  .tp-day-side:has(.tp-signoff.is-empty) { display: none; }
  .tp-signoff { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
  .tp-row { grid-template-columns: 36px auto minmax(0, 1fr) auto; grid-template-areas: "check title title actions" ". prio proj ." ". reason reason reason"; padding: 4px 0; row-gap: 2px; }
  .tp-row-title { padding-right: 0; }
  .tp-row-priority { justify-self: start; padding: 0 4px 0 0; }
  .tp-row-project { justify-self: start; padding: 0; }
  .tp-row-add { grid-template-areas: "check title title title" ". prio proj reason"; }
  .tp-row-add .tp-row-reason { justify-self: stretch; padding: 0 8px 0 0; }
  .tp-row-add .tp-row-actions { display: none; }
  .tp-row-add .tp-row-title { padding-right: var(--pad-card); }
  .tp-sheet .tp-add-btn { max-width: none; }
}

/* Office holidays (Sundays, 2nd & 4th Saturdays) in the member calendar */
.tp-month-cell.is-off { background: var(--surface-2); color: var(--text-3); }
.tp-month-off { font-size: 11px; color: var(--text-3); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
