/* People timeline (Planner > Overview > People). See js/views/scurve/resource-timeline.js */

.rt-modes {
    display: inline-flex; gap: 2px; padding: 3px; margin: 0 0 12px;
    background: var(--color-bg-tertiary); border-radius: 8px;
}
.rt-mode {
    padding: 6px 16px; border: 0; border-radius: 6px; background: transparent;
    font-size: 0.8rem; font-weight: 700; color: var(--color-text-secondary); cursor: pointer;
}
.rt-mode.is-active {
    background: var(--color-bg-card); color: var(--color-primary);
    box-shadow: 0 1px 4px -1px rgba(20, 30, 60, .25);
}
.rt-mode:focus-visible, .rt-btn:focus-visible, .rt-zoom:focus-visible, .rt-bar:focus-visible {
    outline: 2px solid var(--color-primary); outline-offset: 1px;
}

.rt {
    --rt-over: #dc2626;
    --rt-over-bg: rgba(220, 38, 38, .07);
    --rt-full: #b45309;
    --rt-free: #15803d;
    --rt-hatch: rgba(100, 116, 139, .30);
    --rt-weekend: rgba(100, 116, 139, .07);
    --rt-line: rgba(100, 116, 139, .16);
    --rt-line-strong: rgba(100, 116, 139, .34);
    /* Shaded bars on a project's Demand / Assign stage: the rest of a person. */
    --rt-ctx-bg: rgba(100, 116, 139, .14);
    --rt-ctx-stripe: rgba(100, 116, 139, .24);
    --rt-ctx-edge: rgba(100, 116, 139, .55);
    --rt-ctx-text: #475569;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    margin-bottom: 16px;
    min-width: 0;
}
[data-theme-mode="dark"] .rt {
    --rt-over: #f87171;
    --rt-over-bg: rgba(248, 113, 113, .10);
    --rt-full: #fbbf24;
    --rt-free: #4ade80;
    --rt-hatch: rgba(148, 163, 184, .30);
    --rt-weekend: rgba(148, 163, 184, .07);
    --rt-line: rgba(148, 163, 184, .13);
    --rt-line-strong: rgba(148, 163, 184, .30);
    --rt-ctx-bg: rgba(148, 163, 184, .12);
    --rt-ctx-stripe: rgba(148, 163, 184, .22);
    --rt-ctx-edge: rgba(148, 163, 184, .50);
    --rt-ctx-text: #cbd5e1;
}

/* toolbar */
.rt-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
    padding: 10px 12px; border-bottom: 1px solid var(--color-border);
}
.rt-nav { display: inline-flex; align-items: center; gap: 6px; }
.rt-btn, .rt-select {
    height: 30px; padding: 0 10px; border: 1px solid var(--color-border); border-radius: 6px;
    background: var(--color-bg-primary); color: var(--color-text-primary);
    font-size: 0.78rem; font-weight: 600; cursor: pointer;
}
.rt-btn:hover { border-color: var(--color-border-strong); background: var(--color-bg-hover, var(--color-bg-tertiary)); }
.rt-select { font-weight: 500; max-width: 170px; }
.rt-range { margin-left: 6px; font-size: 0.86rem; font-weight: 700; color: var(--color-text-primary); white-space: nowrap; }
.rt-zooms { display: inline-flex; gap: 2px; padding: 3px; background: var(--color-bg-tertiary); border-radius: 7px; }
.rt-zoom {
    padding: 4px 12px; border: 0; border-radius: 5px; background: transparent;
    font-size: 0.76rem; font-weight: 700; color: var(--color-text-secondary); cursor: pointer;
}
.rt-zoom.is-active { background: var(--color-primary); color: #fff; }
.rt-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: auto; }
/* The app styles every bare <label> as an uppercase form caption; this one is a checkbox. */
.rt-check {
    display: inline-flex; align-items: center; gap: 5px; font-size: 0.78rem; color: var(--color-text-secondary); cursor: pointer;
    text-transform: none; letter-spacing: normal;
}

.rt-note {
    margin: 0; padding: 8px 12px; font-size: 0.8rem; color: var(--color-text-secondary);
    background: var(--color-bg-tertiary); border-bottom: 1px solid var(--color-border);
}
.rt-note--error { color: var(--rt-over); }
.rt-empty { margin: 0; padding: 28px 16px; text-align: center; font-size: 0.86rem; color: var(--color-text-muted); }

/* chart */
.rt-scroll { overflow: auto; max-height: calc(100vh - 250px); min-height: 180px; position: relative; }
.rt-head {
    display: flex; position: sticky; top: 0; z-index: 6;
    background: var(--color-bg-card); border-bottom: 1px solid var(--color-border-strong, var(--color-border));
}
.rt-corner {
    flex: 0 0 264px; width: 264px; position: sticky; left: 0; z-index: 7;
    display: flex; align-items: flex-end; padding: 0 12px 6px;
    background: var(--color-bg-card); border-right: 1px solid var(--color-border);
    font-size: 0.68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--color-text-muted);
}
.rt-scale { position: relative; height: 46px; flex: 0 0 auto; }
.rt-scale--single { height: 26px; }
.rt-months, .rt-days { position: relative; }
.rt-months { height: 20px; }
.rt-days { height: 26px; }
.rt-month {
    position: absolute; top: 0; height: 20px; padding: 3px 6px 0; overflow: hidden; white-space: nowrap;
    font-size: 0.68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: var(--color-text-secondary); border-left: 1px solid var(--rt-line-strong);
}
.rt-month:first-child { border-left: 0; }
.rt-day {
    position: absolute; top: 0; height: 26px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    line-height: 1; color: var(--color-text-secondary); font-variant-numeric: tabular-nums;
}
.rt-day i { font-style: normal; font-size: 0.56rem; color: var(--color-text-muted); margin-bottom: 2px; }
.rt-day b { font-size: 0.7rem; font-weight: 600; }
.rt-day--week { align-items: flex-start; padding-left: 4px; border-left: 1px solid var(--rt-line); }
.rt-day.is-weekend, .rt-day.is-holiday { color: var(--color-text-muted); }
.rt-day.is-holiday b { text-decoration: line-through; }
.rt-day.is-today b {
    min-width: 18px; padding: 2px 3px; border-radius: 9px; text-align: center;
    background: var(--rt-over); color: #fff;
}

.rt-body { position: relative; }
.rt-backdrop { position: absolute; top: 0; bottom: 0; pointer-events: none; }
.rt-bg { position: absolute; top: 0; bottom: 0; }
.rt-bg--weekend { background: var(--rt-weekend); }
.rt-bg--off {
    background: repeating-linear-gradient(135deg, var(--rt-hatch) 0 2px, transparent 2px 6px);
}
.rt-line { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--rt-line); }
.rt-line--strong { background: var(--rt-line-strong); }
.rt-today {
    position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px;
    background: var(--rt-over); pointer-events: none; z-index: 3;
}

.rt-row { display: flex; position: relative; border-bottom: 1px solid var(--color-border); }
.rt-row.is-over { background: var(--rt-over-bg); }
.rt-who {
    flex: 0 0 264px; width: 264px; position: sticky; left: 0; z-index: 4;
    display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 10px 0 12px;
    background: var(--color-bg-card); border-right: 1px solid var(--color-border);
}
.rt-row.is-over .rt-who { background: linear-gradient(var(--rt-over-bg), var(--rt-over-bg)), var(--color-bg-card); }
.rt-who-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rt-name { font-size: 0.84rem; font-weight: 700; color: var(--color-text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-sub { font-size: 0.7rem; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-who-load { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.rt-pill {
    padding: 2px 7px; border-radius: 9px; font-size: 0.66rem; font-weight: 700; white-space: nowrap;
    border: 1px solid currentColor; background: var(--color-bg-card);
}
.rt-pill--free { color: var(--rt-free); }
.rt-pill--part { color: var(--color-text-secondary); }
.rt-pill--open { color: var(--color-text-muted); border-style: dashed; }
.rt-pill--full { color: var(--rt-full); }
.rt-pill--over { color: #fff; background: var(--rt-over); border-color: var(--rt-over); }
.rt-spark { display: inline-flex; align-items: flex-end; gap: 1px; height: 16px; }
.rt-spark i { width: 4px; border-radius: 1px; background: var(--color-border-strong, var(--color-border)); }
.rt-spark i.rt-spark-part { background: var(--color-primary); opacity: .7; }
.rt-spark i.rt-spark-full { background: var(--rt-full); }
.rt-spark i.rt-spark-over { background: var(--rt-over); }

.rt-track { position: relative; flex: 0 0 auto; }
.rt-leave { z-index: 1; }
.rt-leave em {
    position: absolute; left: 4px; bottom: 2px; font-style: normal; font-size: 0.58rem; font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-muted);
}
.rt-bar {
    --rt-c: #64748b;
    position: absolute; z-index: 2; height: 24px; padding: 0 7px; margin: 0 1px;
    display: flex; align-items: center; border: 0; border-radius: 5px;
    background: var(--rt-c); color: #fff; font: inherit; font-size: 0.72rem; font-weight: 600;
    text-align: left; overflow: hidden; cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .18);
}
.rt-bar > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button.rt-bar:hover { filter: brightness(1.1); }
.rt-bar--masked { background: var(--color-text-muted); cursor: default; }
.rt-bar--open {
    background: color-mix(in srgb, var(--rt-c) 16%, var(--color-bg-card));
    color: var(--color-text-primary); box-shadow: inset 0 0 0 1.5px var(--rt-c);
    background-image: none; border: 0; outline-offset: 2px;
}
.rt-bar.is-dim { opacity: .32; }
.rt-bar.is-cut-start { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.rt-bar.is-cut-end { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.rt[data-zoom="month"] .rt-bar, .rt[data-zoom="week"] .rt-bar { padding: 0 5px; }

.rt-legend {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 8px 12px;
    border-top: 1px solid var(--color-border); font-size: 0.72rem; color: var(--color-text-muted);
}
.rt-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.rt-legend-count { margin-left: auto; font-weight: 600; }
.rt-key { display: inline-block; width: 18px; height: 10px; border-radius: 3px; }
.rt-key--bar { background: #4f6bed; }
.rt-key--open { box-shadow: inset 0 0 0 1.5px #4f6bed; background: color-mix(in srgb, #4f6bed 16%, transparent); }
.rt-key--off { background: repeating-linear-gradient(135deg, var(--rt-hatch) 0 2px, transparent 2px 6px); border: 1px solid var(--rt-line-strong); }
.rt-key--over { background: var(--rt-over-bg); border: 1px solid var(--rt-over); }

@media (max-width: 900px) {
    .rt-filters { margin-left: 0; }
    .rt-scroll { max-height: none; }
}

/* Focused on one project (Demand / Assign). Solid bars are the thing being
   staffed; a shaded bar is the rest of that person - other projects, or on a
   sub-project tab the whole project and its other packages. Muted and hatched
   so it reads as context, not as more of this job. */
.rt-bar--context {
    background: repeating-linear-gradient(135deg, var(--rt-ctx-stripe) 0 3px, var(--rt-ctx-bg) 3px 8px);
    color: var(--rt-ctx-text); box-shadow: inset 0 0 0 1px var(--rt-ctx-edge); font-weight: 500;
}
.rt-bar--context.rt-bar--open { background: var(--rt-ctx-bg); }
/* Another package of this project: a thin edge in the project's colour says
   whose it is without making it read as solid. */
.rt-bar--context.rt-bar--pkg { box-shadow: inset 0 0 0 1px var(--rt-ctx-edge), inset 3px 0 0 var(--rt-c); }
.rt-bar--context.rt-bar--masked { background: repeating-linear-gradient(135deg, var(--rt-ctx-stripe) 0 3px, var(--rt-ctx-bg) 3px 8px); }
button.rt-bar--context:hover { filter: none; box-shadow: inset 0 0 0 1.5px var(--rt-ctx-edge); }
.rt-key--context { background: repeating-linear-gradient(135deg, var(--rt-ctx-stripe) 0 3px, var(--rt-ctx-bg) 3px 8px); box-shadow: inset 0 0 0 1px var(--rt-ctx-edge); }
.sc-stage-people .rt { margin-bottom: 0; }
