/* ==========================================================================
   Anantam Operations — timeline, calendar, critical path, charts, sign-in
   ========================================================================== */

/* ── sign in ───────────────────────────────────────────────────────────── */
.signin { display: grid; place-items: center; min-height: 100dvh; padding: 24px; overflow-y: auto; }
.signin .box { width: min(460px, 100%); text-align: center; }
.signin .brand { justify-content: center; margin-bottom: 26px; }
.signin .brand .mark { font-size: 2rem; }
.signin h1 { font-size: 1.9rem; margin-bottom: 12px; }
.signin p { color: var(--ink-mute); font-size: .95rem; line-height: 1.6; }
.signin .panel { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 28px; margin-top: 26px; text-align: left; }
.signin .google { display: flex; align-items: center; justify-content: center; gap: 11px; width: 100%; padding: 14px; border-radius: var(--r); background: #fff; color: #1a1a1a; font-weight: 600; font-size: .96rem; border: 0; }
.signin .google:hover { background: #ececec; }
.signin .or { display: flex; align-items: center; gap: 14px; margin: 22px 0; color: var(--ink-faint); font-size: .82rem; }
.signin .or::before, .signin .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.signin .roles { display: grid; gap: 10px; margin-top: 20px; }
.signin .role { display: flex; gap: 12px; align-items: flex-start; font-size: .86rem; color: var(--ink-mute); }
.signin .role b { color: var(--ink); display: block; font-size: .9rem; }
.signin .fine { font-size: .82rem; color: var(--ink-faint); margin-top: 22px; line-height: 1.6; }
.signin .err { background: var(--danger-dim); border: 1px solid rgba(255,107,107,.3); border-radius: var(--r); padding: 13px 15px; font-size: .88rem; color: #ffc9c9; margin-bottom: 18px; text-align: left; }

/* ── timeline ──────────────────────────────────────────────────────────── */
.gantt { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg-1); overflow: hidden; }
.gantt-scroll { overflow: auto; }
.gantt-inner { position: relative; }

.gantt .r { display: flex; align-items: stretch; }
.gantt .lab {
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 0 14px; display: flex; align-items: center; gap: 9px;
  position: sticky; left: 0; z-index: 3; background: var(--bg-1);
}
.gantt .gantt-head-row { position: sticky; top: 0; z-index: 5; }
.gantt .gantt-head-row .lab { z-index: 6; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.gantt .head-track { background: var(--bg-2); border-bottom: 1px solid var(--line); }
.gantt .lab .name { font-size: .88rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt .r.crit .lab .name { color: #fff; font-weight: 500; }

.gantt .track {
  position: relative; border-bottom: 1px solid var(--line); flex: 0 0 auto;
  background-image: repeating-linear-gradient(90deg, rgba(255,251,248,.03) 0 1px, transparent 1px var(--gantt-day));
}
.gantt .row-group .lab, .gantt .row-group .track { background: var(--bg-3); }
.gantt .row-group .lab { font-size: .85rem; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.gantt .r:not(.row-group):not(.gantt-head-row):hover .lab,
.gantt .r:not(.row-group):not(.gantt-head-row):hover .track { background: var(--bg-2); }
.gantt .r.sel .lab, .gantt .r.sel .track { background: var(--red-dim); }
.gantt .r:not(.row-group):not(.gantt-head-row) { cursor: pointer; }

.gantt .scale { display: flex; }
.gantt .scale .mo { border-right: 1px solid var(--line); padding: 4px 9px; font-size: .78rem; font-weight: 600; color: var(--ink-mute); white-space: nowrap; overflow: hidden; }
.gantt .scale2 { display: flex; flex: 1; align-items: stretch; }
.gantt .scale2 .d { text-align: center; font-size: .62rem; color: var(--ink-faint); line-height: 16px; font-variant-numeric: tabular-nums; }
.gantt .scale2 .d.we { color: var(--ink-ghost); background: rgba(255,255,255,.02); }
.gantt .scale2 .d.today { background: var(--red); color: #fff; font-weight: 700; }

.gantt .bar-b, .gantt .bar-a { position: absolute; height: 9px; border-radius: 3px; }
.gantt .bar-b { background: #4d4d55; top: 6px; }
.gantt .bar-a { background: var(--red); top: 19px; }
.gantt .bar-a.good { background: var(--ok); }
.gantt .bar-a.fc { background: repeating-linear-gradient(90deg, var(--red) 0 5px, rgba(212,0,0,.3) 5px 10px); }
.gantt .r.single-line .bar-b { top: 11px; opacity: .6; }
.gantt .ms { position: absolute; width: 12px; height: 12px; top: 11px; background: var(--red); transform: rotate(45deg); border-radius: 2px; }
.gantt .todayline { position: absolute; width: 2px; background: var(--red); opacity: .8; z-index: 2; pointer-events: none; }

.gantt-legend { display: flex; gap: 18px; flex-wrap: wrap; padding: 13px 18px; border-top: 1px solid var(--line); background: var(--bg-2); font-size: .82rem; color: var(--ink-mute); align-items: center; }
.gantt-legend i { width: 18px; height: 7px; border-radius: 3px; display: block; }
.gantt-legend span { display: inline-flex; align-items: center; gap: 7px; }

/* ── calendar ──────────────────────────────────────────────────────────── */
.cal { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--bg-1); }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--bg-2); border-bottom: 1px solid var(--line); }
.cal-head div { padding: 10px; text-align: center; font-size: .8rem; font-weight: 600; color: var(--ink-faint); }
.cal-body { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-cell { min-height: 118px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.out { background: rgba(0,0,0,.28); }
.cal-cell.out .dnum { color: var(--ink-ghost); }
.cal-cell.today { background: rgba(212,0,0,.08); box-shadow: inset 0 0 0 1px var(--line-red); }
.cal-cell .dnum { font-size: .82rem; font-weight: 600; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.cal-cell.today .dnum { color: var(--red-bright); }
.cal-ev { font-size: .76rem; padding: 3px 7px; border-radius: 5px; background: var(--bg-3); border-left: 3px solid var(--ink-ghost); color: var(--ink-soft); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev:hover { background: var(--bg-4); }
.cal-ev.critical { border-left-color: var(--red); color: #fff; background: rgba(212,0,0,.2); }
.cal-ev.bad { border-left-color: var(--danger); color: #ffc9c9; }
.cal-ev.official { border-left-color: var(--warn); color: #ffe6b0; }
.cal-ev.info { border-left-color: var(--info); }
.cal-more { font-size: .72rem; color: var(--ink-faint); padding-left: 7px; }

.agenda { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.agenda .day { background: var(--bg-1); padding: 14px 18px; display: grid; grid-template-columns: 116px 1fr; gap: 18px; align-items: start; }
.agenda .day.is-today { background: rgba(212,0,0,.08); }
.agenda .day .d { font-size: .85rem; font-weight: 600; color: var(--ink-mute); }
.agenda .day.is-today .d { color: var(--red-bright); }
.agenda .items { display: grid; gap: 8px; }
.agenda .item { display: flex; gap: 11px; align-items: center; font-size: .9rem; cursor: pointer; }
.agenda .item .t { color: var(--ink-soft); }
.agenda .item:hover .t { color: #fff; }

/* ── critical path chain ───────────────────────────────────────────────── */
.chain { display: grid; gap: 0; }
.chain-node {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 16px; align-items: center;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--bg-1); cursor: pointer;
}
.chain-node.crit { border-color: var(--line-red); }
.chain-node:hover { border-color: var(--line-strong); background: var(--bg-2); }
.chain-node .idx { font-family: var(--font-ui); font-weight: 700; font-size: .85rem; color: var(--red-bright); text-align: center; }
.chain-node .nm { font-size: 1rem; font-weight: 600; color: #fff; }
.chain-node .meta { font-size: .85rem; color: var(--ink-mute); margin-top: 4px; }
.chain-node .nums { display: flex; gap: 22px; align-items: center; }
.chain-arrow { justify-self: center; padding: 5px 0; color: var(--red); font-size: .9rem; line-height: 1; }

.metric { text-align: center; min-width: 62px; }
.metric .l { font-size: .74rem; color: var(--ink-faint); }
.metric .v { font-family: var(--font-ui); font-weight: 700; font-size: 1rem; font-variant-numeric: tabular-nums; color: #fff; margin-top: 2px; }

.dep-list { display: grid; gap: 8px; }
.dep { display: flex; gap: 11px; align-items: center; padding: 10px 13px; border-radius: var(--r); background: var(--bg-2); font-size: .88rem; cursor: pointer; }
.dep:hover { background: var(--bg-3); }
.dep .ty { font-size: .72rem; font-weight: 700; color: var(--red-bright); flex: 0 0 24px; }

/* ── charts ────────────────────────────────────────────────────────────── */
.hbars { display: grid; gap: 12px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 175px) 1fr auto; gap: 14px; align-items: center; font-size: .86rem; }
.hbar .n { color: var(--ink-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { height: 20px; background: var(--bg-3); border-radius: 4px; position: relative; overflow: hidden; }
.hbar .track i { position: absolute; left: 0; top: 0; height: 10px; border-radius: 3px; background: var(--red); }
.hbar .track i.b { top: 10px; background: #4d4d55; }
.hbar .v { font-weight: 600; font-variant-numeric: tabular-nums; color: #fff; white-space: nowrap; font-size: .85rem; }

.spark { display: flex; align-items: flex-end; gap: 4px; height: 52px; }
.spark i { flex: 1; background: var(--bg-4); border-radius: 2px 2px 0 0; min-height: 3px; }

.matrix { border-collapse: collapse; font-size: .82rem; width: 100%; }
.matrix th, .matrix td { padding: 9px 6px; text-align: center; border: 1px solid var(--bg); font-variant-numeric: tabular-nums; font-weight: 600; }
.matrix th { background: var(--bg-2); color: var(--ink-faint); font-size: .78rem; }
.matrix td.low { background: rgba(60,110,60,.55); color: #d9f0d9; }
.matrix td.med { background: rgba(190,150,35,.6); color: #1a1600; }
.matrix td.high { background: rgba(180,35,35,.75); color: #fff; }
.matrix td.zero { background: var(--bg-2); color: var(--ink-ghost); }

.raci-tbl td { text-align: center; font-weight: 700; font-size: .85rem; border: 1px solid var(--bg); }
.raci-tbl td.R { background: rgba(212,0,0,.85); color: #fff; }
.raci-tbl td.A { background: var(--cream); color: #000; }
.raci-tbl td.C { background: rgba(164,0,0,.5); color: #fff; }
.raci-tbl td.I { background: rgba(113,0,0,.42); color: rgba(255,255,255,.8); }
.raci-tbl td.none { color: var(--ink-ghost); }

.donut { --v: 0; width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--red) calc(var(--v) * 1%), var(--bg-3) 0); position: relative; flex: 0 0 auto; }
.donut::after { content: ''; position: absolute; inset: 13px; border-radius: 50%; background: var(--bg-1); }
.donut .t { position: relative; z-index: 1; font-family: var(--font-ui); font-weight: 700; font-size: 1.15rem; color: #fff; }

/* ── people ────────────────────────────────────────────────────────────── */
.person { display: flex; gap: 16px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg-1); cursor: pointer; transition: border-color .14s; }
.person:hover { border-color: var(--line-red); }
.person .who { min-width: 0; flex: 1; }
.person .nm { font-size: 1.02rem; font-weight: 600; color: #fff; }
.person .ti { font-size: .84rem; color: var(--red-bright); margin-top: 2px; }
.person .stats { display: flex; gap: 20px; margin-top: 14px; flex-wrap: wrap; }
.person .stats .v { font-family: var(--font-ui); font-weight: 700; font-size: 1.15rem; color: #fff; font-variant-numeric: tabular-nums; }
.person .stats .l { font-size: .75rem; color: var(--ink-faint); }

/* ── milestone road ────────────────────────────────────────────────────── */
.road { display: grid; gap: 12px; }
.road-row { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.road-row:last-child { border-bottom: 0; }
.road-row .nm { font-size: .94rem; font-weight: 500; color: var(--ink-soft); }
.road-row .dates { font-size: .84rem; color: var(--ink-faint); margin-top: 3px; }

/* ── activity feed ─────────────────────────────────────────────────────── */
.feed { display: grid; gap: 0; }
.feed .ev { display: grid; grid-template-columns: 78px 14px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); align-items: start; font-size: .89rem; }
.feed .ev:last-child { border-bottom: 0; }
.feed .ev .when { font-size: .8rem; color: var(--ink-faint); padding-top: 2px; }
.feed .ev .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-ghost); margin: 6px auto 0; }
.feed .ev.overrun .dot, .feed .ev.review-rejected .dot, .feed .ev.strike .dot { background: var(--danger); }
.feed .ev.ahead .dot, .feed .ev.complete .dot, .feed .ev.review-approved .dot { background: var(--ok); }
.feed .ev.start .dot, .feed .ev.evidence .dot { background: var(--info); }
.feed .ev.report .dot, .feed .ev.change-approved .dot { background: var(--red); }
.feed .ev .txt { color: var(--ink-soft); line-height: 1.5; }
.feed .ev .txt b { color: #fff; font-weight: 600; }

/* ── comparison table ──────────────────────────────────────────────────── */
.scen { width: 100%; border-collapse: collapse; font-size: .9rem; }
.scen th { text-align: right; padding: 11px 14px; font-size: .82rem; font-weight: 600; color: var(--ink-faint); border-bottom: 1px solid var(--line); }
.scen th:first-child { text-align: left; }
.scen td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.scen td:first-child { text-align: left; font-weight: 400; color: var(--ink-soft); }
.scen tr:last-child td { border-bottom: 0; }
