/* ============================================================
   KRIYADOCS ENGINEERING PMO — Klarion Design System
   Brand: Navy #1B2B5E · Teal #00A896 · Coral #E8452C
   ============================================================ */

:root {
  --sb: #1B2B5E;
  --sb-w: 210px;
  --navy: #1B2B5E;
  --navy2: #243572;
  --teal: #00A896;
  --teal-dk: #00826E;
  --purple: #7c3aed;
  --coral: #E8452C;
  --bg: #f4f6fb;
  --white: #fff;
  --border: #e2e6f0;
  --border-dk: #c8d0e4;
  --text: #1a1040;
  --mid: #4b5568;
  --lt: #94a3b8;
  --green: #22c55e;
  --amber: #f59e0b;
  --blue: #3b82f6;
  --red: #ef4444;
  --r: 10px;
  --rs: 6px;
  --sh: 0 1px 3px rgba(27,43,94,.07), 0 4px 16px rgba(27,43,94,.05);
  --shm: 0 4px 24px rgba(27,43,94,.10);
  --shl: 0 8px 40px rgba(27,43,94,.16);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; display: flex; min-height: 100vh; overflow-x: hidden; }

/* ── SIDEBAR ── */
#sidebar { width: var(--sb-w); min-height: 100vh; background: var(--sb); position: fixed; top: 0; left: 0; display: flex; flex-direction: column; z-index: 100; }

.sb-logo { padding: 14px 14px 12px; border-bottom: 1px solid rgba(255,255,255,.07); display: flex; align-items: center; gap: 9px; text-decoration: none; }
.sb-logo-icon { width: 34px; height: 34px; flex-shrink: 0; }
.sb-logo-text { font-size: 14px; font-weight: 800; color: #fff; letter-spacing: -.3px; line-height: 1.2; }
.sb-logo-sub { font-size: 9px; color: rgba(255,255,255,.35); font-weight: 400; display: block; margin-top: 1px; }

.nav-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 6px 0; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent; }
.nav-scroll::-webkit-scrollbar { width: 3px; }
.nav-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 2px; }

.nav-group { padding: 10px 0 2px; }
.nav-group-lbl { font-size: 9px; font-weight: 700; color: rgba(255,255,255,.28); text-transform: uppercase; letter-spacing: 1px; padding: 0 14px 4px; }

.nav-item { display: flex; align-items: center; gap: 8px; padding: 8px 14px; font-size: 12px; font-weight: 500; color: rgba(255,255,255,.55); cursor: pointer; border-left: 2px solid transparent; transition: all .12s; white-space: nowrap; user-select: none; }
.nav-item svg { flex-shrink: 0; opacity: .7; }
.nav-item:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.9); }
.nav-item.active { background: rgba(0,168,150,.15); color: #fff; font-weight: 600; border-left-color: var(--teal); }
.nav-item.active svg { opacity: 1; }

/* Execution connected group */
.nav-group-exec { position: relative; background: linear-gradient(180deg, rgba(0,168,150,.08), rgba(27,43,94,.04)); margin: 6px 6px; border-radius: 8px; padding: 8px 0 10px; }
.nav-group-exec .nav-group-lbl { padding-left: 10px; color: rgba(255,255,255,.45); }
.nav-group-exec .exec-item { margin-left: 4px; padding-left: 22px; position: relative; }
.nav-group-exec .exec-item::before { content: ''; position: absolute; left: 12px; top: -2px; bottom: -2px; width: 1.5px; background: rgba(0,168,150,.35); }
.nav-group-exec .exec-item:first-of-type::before { top: 50%; }
.nav-group-exec .exec-item:last-of-type::before { bottom: 50%; }
.nav-group-exec .exec-item::after { content: ''; position: absolute; left: 9px; top: 50%; width: 7px; height: 7px; border-radius: 50%; background: rgba(0,168,150,.6); border: 1.5px solid var(--sb); transform: translateY(-50%); z-index: 2; }
.nav-group-exec .exec-item.active::after { background: var(--teal); box-shadow: 0 0 0 2px rgba(0,168,150,.3); }
.exec-step { margin-left: auto; background: rgba(255,255,255,.1); color: rgba(255,255,255,.5); font-size: 9px; font-weight: 700; width: 16px; height: 16px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-group-exec .exec-item.active .exec-step { background: var(--teal); color: #fff; }

.sb-bottom { border-top: 1px solid rgba(255,255,255,.07); padding: 4px 0 8px; }
.sb-crumb { padding: 8px 14px 2px; font-size: 9px; color: rgba(255,255,255,.2); text-transform: uppercase; letter-spacing: .6px; }

/* ── MAIN ── */
#main { margin-left: var(--sb-w); flex: 1; min-height: 100vh; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; }

.topbar { background: var(--white); border-bottom: 1px solid var(--border); padding: 10px 24px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 4px rgba(27,43,94,.06); }
.topbar-title { font-size: 15px; font-weight: 700; color: var(--navy); }
.topbar-time { font-size: 11px; color: var(--lt); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-left { display: flex; align-items: center; gap: 8px; }

.content { padding: 22px 26px; flex: 1; max-width: 1500px; width: 100%; overflow: visible; }

/* ── VIEW HEADER ── */
.vh { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.vh-left h1 { font-size: 22px; font-weight: 800; color: var(--navy); line-height: 1.2; }
.vh-left .sub { font-size: 12px; color: var(--lt); margin-top: 2px; }
.vh-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── TAB NOTE ── */
.tab-note { display: flex; gap: 10px; align-items: flex-start; background: #f5f7ff; border: 1px solid #d8def0; border-left: 3px solid var(--teal); border-radius: var(--rs); padding: 9px 13px; margin-bottom: 14px; font-size: 11.5px; color: var(--mid); line-height: 1.5; }
.tab-note-icon { flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%; background: var(--teal); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; margin-top: 1px; }
.tab-note strong { color: var(--navy); font-weight: 700; }

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; gap: 5px; padding: 8px 16px; border-radius: 20px; font-size: 12px; font-weight: 600; font-family: 'DM Sans', sans-serif; cursor: pointer; border: none; transition: all .12s; white-space: nowrap; }
.btn-primary { background: var(--teal); color: #fff; box-shadow: 0 2px 8px rgba(0,168,150,.3); }
.btn-primary:hover { background: var(--teal-dk); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy2); }
.btn-coral { background: var(--coral); color: #fff; }
.btn-coral:hover { background: #c93520; }
.btn-ghost { background: transparent; border: 1px solid var(--border-dk); color: var(--mid); }
.btn-ghost:hover { background: var(--bg); border-color: var(--navy); color: var(--navy); }
.btn-danger { background: #fef2f2; border: 1px solid #fca5a5; color: var(--red); }
.btn-danger:hover { background: #fee2e2; }
.btn-sm { padding: 5px 12px; font-size: 11px; border-radius: 14px; }
.btn-xs { padding: 3px 8px; font-size: 10px; border-radius: 10px; }
.btn-icon { background: none; border: none; cursor: pointer; padding: 4px 6px; border-radius: 5px; font-size: 13px; color: var(--mid); font-family: 'DM Sans', sans-serif; transition: background .12s; }
.btn-icon:hover { background: var(--bg); }

/* ── FILTER ROW ── */
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: flex-end; }
.fg { display: flex; flex-direction: column; gap: 3px; }
.fg label { font-size: 9px; font-weight: 700; color: var(--lt); text-transform: uppercase; letter-spacing: .6px; }
.fg select, .fg input { padding: 6px 10px; border: 1px solid var(--border-dk); border-radius: var(--rs); font-size: 12px; font-family: 'DM Sans', sans-serif; color: var(--text); background: var(--white); min-width: 120px; }
.fg select:focus, .fg input:focus { outline: none; border-color: var(--teal); }

/* ── CARDS ── */
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; box-shadow: var(--sh); }
.card-title { font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 12px; }

/* ── STAT ROW ── */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; box-shadow: var(--sh); }
.stat-num { font-size: 30px; font-weight: 800; color: var(--navy); line-height: 1; }
.stat-lbl { font-size: 11px; color: var(--lt); margin-top: 4px; }
.stat-card.t { border-top: 3px solid var(--teal); }
.stat-card.b { border-top: 3px solid var(--blue); }
.stat-card.g { border-top: 3px solid var(--green); }
.stat-card.a { border-top: 3px solid var(--amber); }
.stat-card.r { border-top: 3px solid var(--red); }
.stat-card.p { border-top: 3px solid var(--purple); }
.stat-card.n { border-top: 3px solid var(--navy); }

/* ── TABLE ── */
.tbl-wrap { overflow-x: auto; border-radius: var(--r); }
table.dt { width: 100%; border-collapse: collapse; font-size: 12px; }
.dt th { background: var(--bg); color: var(--lt); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; padding: 9px 12px; text-align: left; border-bottom: 2px solid var(--border); white-space: nowrap; }
.dt td { padding: 11px 12px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.dt tr:last-child td { border-bottom: none; }
.dt tr.clk { cursor: pointer; }
.dt tr.clk:hover td { background: #fafbff; }
.dt tr.done td { opacity: .6; }

/* ── PROGRESS ── */
.pb { height: 6px; background: #e8eaf0; border-radius: 4px; overflow: hidden; }
.pb-fill { height: 100%; border-radius: 4px; transition: width .3s; }

/* ── FORM ── */
.form-group { margin-bottom: 13px; }
.form-label { display: block; font-size: 10px; font-weight: 700; color: var(--mid); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; }
.form-control { width: 100%; padding: 8px 11px; border: 1px solid var(--border-dk); border-radius: var(--rs); font-size: 12px; font-family: 'DM Sans', sans-serif; color: var(--text); background: var(--white); transition: border-color .12s; }
.form-control:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,168,150,.1); }
textarea.form-control { resize: vertical; min-height: 70px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.form-row-full { grid-column: 1 / -1; }

/* ── MODAL ── */
.mo { position: fixed; inset: 0; z-index: 1000; background: rgba(27,43,94,.5); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn .15s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.mo-box { background: var(--white); border-radius: var(--r); box-shadow: var(--shl); width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; animation: slideUp .2s ease; }
.mo-box.lg { max-width: 760px; }
.mo-hdr { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--white); z-index: 2; }
.mo-title { font-size: 15px; font-weight: 800; color: var(--navy); }
.mo-close { background: none; border: none; font-size: 21px; cursor: pointer; color: var(--lt); line-height: 1; }
.mo-close:hover { color: var(--navy); }
.mo-body { padding: 18px 20px; }
.mo-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; position: sticky; bottom: 0; background: var(--white); }

/* ── AVATAR ── */
.av { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #fff; flex-shrink: 0; background: var(--navy); }
.av-sm { width: 22px; height: 22px; font-size: 9px; }
.av-lg { width: 36px; height: 36px; font-size: 13px; }

/* ── BADGE ── */
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 10px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-amber { background: #fef9c3; color: #a16207; }
.badge-red { background: #fee2e2; color: #dc2626; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-teal { background: #ccfbf1; color: #0f766e; }
.badge-navy { background: #e0e7ff; color: var(--navy); }
.badge-grey { background: var(--bg); color: var(--mid); }
.badge-purple { background: #f3e8ff; color: #7e22ce; }
.badge-coral { background: #fee2e2; color: var(--coral); }

/* ── RISK SCORE ── */
.risk-score { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; font-size: 11px; font-weight: 800; }
.score-h { background: #fef2f2; color: #dc2626; }
.score-m { background: #fffbeb; color: #d97706; }
.score-l { background: #f0fdf4; color: #16a34a; }

/* ── MISC ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.empty { text-align: center; padding: 40px 20px; color: var(--lt); font-size: 13px; }
.empty-icon { font-size: 32px; margin-bottom: 8px; opacity: .5; }
.loading { padding: 60px; text-align: center; color: var(--lt); font-size: 13px; }
.section-lbl { font-size: 9px; font-weight: 700; color: var(--lt); text-transform: uppercase; letter-spacing: .7px; margin-bottom: 8px; }
.note-block { background: #fffbeb; border-left: 3px solid #fde68a; border-radius: 0 var(--rs) var(--rs) 0; padding: 8px 12px; font-size: 12px; color: var(--mid); font-style: italic; margin: 8px 0; }
.chip-row { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.tag { display: inline-flex; padding: 2px 8px; border-radius: 8px; font-size: 10px; font-weight: 600; background: var(--bg); color: var(--mid); border: 1px solid var(--border); }

/* ── GANTT ── */
.gantt-wrap { background: var(--white); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; box-shadow: var(--sh); }
.gantt-hdr { display: grid; grid-template-columns: 300px 1fr; background: #f5f6fa; border-bottom: 2px solid var(--border); position: sticky; top: 0; z-index: 10; }
.gantt-hdr-lbl { padding: 9px 14px; font-size: 9px; font-weight: 700; color: var(--lt); text-transform: uppercase; letter-spacing: .6px; border-right: 1px solid var(--border); }
.gantt-timeline { overflow: hidden; }
.gantt-q-row { display: flex; border-bottom: 1px solid var(--border); }
.gantt-q { display: flex; align-items: center; gap: 5px; padding: 6px 10px; border-right: 1px solid var(--border); font-size: 12px; }
.gantt-q-lbl { font-weight: 800; color: var(--navy); }
.now-badge { background: var(--teal); color: #fff; font-size: 8px; font-weight: 700; padding: 1px 5px; border-radius: 3px; }
.gantt-q-sub { font-size: 10px; color: var(--lt); }
.gantt-m-row { display: flex; }
.gantt-m { text-align: center; padding: 4px 0; font-size: 9px; font-weight: 700; color: var(--lt); text-transform: uppercase; border-right: 1px solid #eef0f6; }
.gantt-row { display: grid; grid-template-columns: 300px 1fr; border-bottom: 1px solid #f0f2f8; min-height: 70px; cursor: pointer; transition: background .1s; }
.gantt-row:hover { background: #fafbff; }
.gantt-seg-hdr { display: grid; grid-template-columns: 300px 1fr; background: #f7f8fb; border-bottom: 1px solid var(--border); padding: 6px 16px; align-items: center; }
.gantt-seg-name { font-size: 9px; font-weight: 800; color: var(--navy); text-transform: uppercase; letter-spacing: 1px; }
.gantt-lbl { padding: 10px 14px; border-right: 1px solid var(--border); display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.gantt-feat-name { font-size: 13px; font-weight: 700; color: var(--navy); line-height: 1.3; }
.gantt-feat-sub { font-size: 10.5px; color: var(--mid); margin-top: 1px; }
.gantt-bar-area { position: relative; overflow: visible; }
.today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: #ef4444; opacity: .2; z-index: 3; pointer-events: none; }
.g-bar { position: absolute; top: 50%; transform: translateY(-50%); height: 26px; border-radius: 4px; z-index: 4; min-width: 3px; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.g-bar-lbl { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 7px; font-size: 10px; font-weight: 700; color: rgba(255,255,255,.92); white-space: nowrap; overflow: hidden; }
.g-ms-dot { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; z-index: 6; cursor: help; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.gantt-view-tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.gvt { padding: 5px 14px; border-radius: 14px; font-size: 11px; font-weight: 600; cursor: pointer; border: 1.5px solid var(--border-dk); background: var(--white); color: var(--mid); font-family: 'DM Sans', sans-serif; transition: all .12s; }
.gvt.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.legend-bar { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; background: var(--white); border: 1px solid var(--border); border-radius: var(--rs); padding: 9px 14px; margin-bottom: 12px; font-size: 11px; color: var(--mid); }

/* ── PULSE ── */
.pulse-snap { background: var(--white); border: 1px solid var(--border); border-radius: var(--r); padding: 18px 22px; margin-bottom: 16px; box-shadow: var(--sh); }
.snap-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.snap-n { text-align: center; cursor: pointer; }
.snap-v { font-size: 36px; font-weight: 800; line-height: 1; margin-bottom: 3px; }
.snap-name { font-size: 13px; font-weight: 700; color: var(--navy); }
.snap-desc { font-size: 10px; color: var(--lt); }
.pulse-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 14px; }
.pt { padding: 7px 16px; font-size: 12px; font-weight: 600; color: var(--lt); background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px; cursor: pointer; font-family: 'DM Sans', sans-serif; transition: color .12s; }
.pt.active { color: var(--navy); border-bottom-color: var(--navy); }
.flag-card { background: var(--white); border: 1px solid var(--border); border-left: 3px solid transparent; border-radius: var(--rs); padding: 11px 13px; margin-bottom: 7px; cursor: pointer; }
.flag-card:hover { box-shadow: var(--sh); }
.flag-card.high { border-left-color: #ef4444; }
.flag-card.med { border-left-color: #f59e0b; }
.flag-type { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; padding: 1px 6px; border-radius: 4px; white-space: nowrap; }

/* ── PLEDGES ── */
.pledge-card { background: var(--white); border: 1px solid var(--border); border-left: 3px solid var(--teal); border-radius: var(--r); padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--sh); display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: flex-start; }
.pledge-card.honored { border-left-color: var(--green); opacity: .85; }
.pledge-card.broken { border-left-color: var(--red); background: #fffafa; }
.pledge-card.atrisk { border-left-color: var(--amber); }
.pledge-title { font-size: 14px; font-weight: 700; color: var(--navy); line-height: 1.3; margin-bottom: 4px; }
.pledge-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 11px; color: var(--lt); margin-bottom: 6px; }
.pledge-quote { font-size: 12px; color: var(--mid); font-style: italic; background: #fafbff; border-left: 2px solid var(--border-dk); padding: 6px 10px; border-radius: 0 4px 4px 0; margin-top: 6px; }
.countdown { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 12px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.countdown.urgent { background: #fef2f2; color: #dc2626; }
.countdown.soon { background: #fffbeb; color: #d97706; }
.countdown.fine { background: #f0fdf4; color: #16a34a; }
.countdown.past { background: #fef2f2; color: #dc2626; }
.countdown.honored { background: #f0fdf4; color: #16a34a; }

/* ── CLARITY / TRACKS ── */
.pipeline-bar { display: flex; background: var(--white); border: 1px solid var(--border); border-radius: var(--r); overflow-x: auto; margin-bottom: 14px; }
.ps { flex: 1; min-width: 110px; padding: 10px 12px; border-right: 1px solid var(--border); }
.ps:last-child { border-right: none; }
.ps-name { font-size: 11px; font-weight: 700; margin-bottom: 3px; }
.ps-desc { font-size: 10px; color: var(--lt); line-height: 1.4; }

/* ── KNOWLEDGE ── */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.doc-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--r); padding: 15px; box-shadow: var(--sh); transition: box-shadow .12s; display: flex; flex-direction: column; gap: 7px; cursor: pointer; }
.doc-card:hover { box-shadow: var(--shm); }
.doc-title { font-size: 13px; font-weight: 700; color: var(--navy); }
.doc-desc { font-size: 11px; color: var(--mid); }
.doc-meta { font-size: 10px; color: var(--lt); display: flex; gap: 8px; flex-wrap: wrap; }
.doc-tag { background: #f0f2f8; color: var(--mid); font-size: 9px; padding: 2px 7px; border-radius: 8px; }

/* ── CAPACITY ── */
.cap-table { border-collapse: collapse; font-size: 11px; min-width: 600px; width: 100%; }
.cap-table th { background: var(--bg); font-size: 9px; font-weight: 700; color: var(--lt); text-transform: uppercase; letter-spacing: .5px; padding: 8px 10px; text-align: center; border: 1px solid var(--border); white-space: nowrap; }
.cap-table th.mc { text-align: left; min-width: 150px; }
.cap-table td { padding: 9px 10px; border: 1px solid var(--border); text-align: center; vertical-align: middle; }
.cap-table td.mc { text-align: left; }
.util-badge { display: inline-block; padding: 2px 7px; border-radius: 10px; font-size: 9px; font-weight: 700; }
.util-over { background: #fef2f2; color: #dc2626; }
.util-ok { background: #f0fdf4; color: #16a34a; }
.util-under { background: #fffbeb; color: #d97706; }

/* ── DETAIL PAGE ── */
.det-layout { display: grid; grid-template-columns: 1fr 280px; gap: 16px; align-items: start; }
.det-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; margin-bottom: 12px; box-shadow: var(--sh); }
.det-title { font-size: 20px; font-weight: 800; color: var(--navy); line-height: 1.2; margin-bottom: 6px; }
.det-meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.det-meta-item .lbl { font-size: 9px; font-weight: 700; color: var(--lt); text-transform: uppercase; letter-spacing: .5px; display: block; margin-bottom: 2px; }
.det-meta-item .val { font-size: 13px; color: var(--text); }

/* ── MILESTONE & TASK ── */
.ms-list { display: flex; flex-direction: column; gap: 10px; }
.ms-item { border: 1px solid var(--border); border-radius: var(--rs); overflow: hidden; }
.ms-hdr { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--bg); cursor: pointer; user-select: none; }
.ms-hdr:hover { background: #edf0f8; }
.ms-chevron { font-size: 10px; color: var(--lt); transition: transform .2s; }
.ms-chevron.open { transform: rotate(90deg); }
.ms-title-text { font-size: 13px; font-weight: 700; color: var(--navy); flex: 1; }
.ms-body { padding: 12px; border-top: 1px solid var(--border); display: none; }
.ms-body.open { display: block; }
.task-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: var(--white); border: 1px solid var(--border); border-radius: var(--rs); margin-bottom: 6px; }
.task-check { width: 15px; height: 15px; accent-color: var(--teal); flex-shrink: 0; cursor: pointer; }
.task-name { flex: 1; font-size: 12px; color: var(--text); }
.task-name.done { text-decoration: line-through; color: var(--lt); }

/* ── ADMIN ── */
.admin-layout { display: grid; grid-template-columns: 170px 1fr; gap: 16px; align-items: start; }
.admin-nav { background: var(--white); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.admin-tab { display: block; width: 100%; text-align: left; padding: 10px 14px; font-size: 12px; font-weight: 500; color: var(--mid); background: none; border: none; border-left: 3px solid transparent; cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all .12s; border-bottom: 1px solid var(--border); }
.admin-tab:last-child { border-bottom: none; }
.admin-tab:hover { background: var(--bg); color: var(--navy); }
.admin-tab.active { background: #f0f4ff; color: var(--navy); font-weight: 700; border-left-color: var(--teal); }
.admin-panel { background: var(--white); border: 1px solid var(--border); border-radius: var(--r); padding: 22px; }
.admin-sec-title { font-size: 16px; font-weight: 800; color: var(--navy); margin-bottom: 5px; }
.admin-sec-desc { font-size: 12px; color: var(--mid); margin-bottom: 18px; }
.admin-save { background: var(--navy); color: #fff; border: none; border-radius: var(--rs); padding: 9px 18px; font-size: 12px; font-weight: 600; font-family: 'DM Sans', sans-serif; cursor: pointer; }
.admin-save:hover { background: var(--navy2); }
.admin-add { font-size: 11px; font-weight: 600; color: var(--teal); background: #ecfeff; border: 1px solid #a5f3fc; border-radius: var(--rs); padding: 6px 12px; cursor: pointer; font-family: 'DM Sans', sans-serif; margin-bottom: 14px; display: inline-block; }
.admin-remove { font-size: 10px; color: var(--red); background: #fef2f2; border: 1px solid #fca5a5; border-radius: 4px; padding: 3px 7px; cursor: pointer; font-family: 'DM Sans', sans-serif; white-space: nowrap; }
.a-input { width: 100%; padding: 7px 10px; border: 1px solid var(--border-dk); border-radius: var(--rs); font-size: 12px; font-family: 'DM Sans', sans-serif; color: var(--text); background: var(--white); }
.a-input:focus { outline: none; border-color: var(--teal); }

/* ── REPORTS ── */
.report-section { margin-bottom: 22px; }
.report-section h2 { font-size: 14px; font-weight: 700; color: var(--navy); padding-bottom: 7px; border-bottom: 2px solid var(--border); margin-bottom: 12px; }

/* ── EXEC BANNER ── */
.exec-banner { background: linear-gradient(90deg, #0a1740 0%, #1B2B5E 50%, #243572 100%); color: #fff; border-radius: var(--r); padding: 14px 18px; margin-bottom: 14px; display: flex; align-items: center; gap: 0; }
.exec-step-card { flex: 1; display: flex; align-items: center; gap: 10px; padding: 6px 14px; cursor: pointer; border-radius: var(--rs); transition: background .12s; text-decoration: none; color: #fff; }
.exec-step-card:hover { background: rgba(255,255,255,.06); }
.exec-step-card.active { background: rgba(0,168,150,.18); }
.exec-step-num { width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.12); color: rgba(255,255,255,.7); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; flex-shrink: 0; }
.exec-step-card.active .exec-step-num { background: var(--teal); color: #fff; }
.exec-step-info { flex: 1; min-width: 0; }
.exec-step-title { font-size: 12px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exec-step-desc { font-size: 10px; color: rgba(255,255,255,.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.exec-arrow { color: rgba(255,255,255,.3); font-size: 14px; flex-shrink: 0; padding: 0 2px; }

/* ── TOAST ── */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--navy); color: #fff; padding: 10px 18px; border-radius: var(--rs); font-size: 13px; font-weight: 600; box-shadow: var(--shm); z-index: 9999; animation: slideUp .2s ease; }
.toast.success { background: #15803d; }
.toast.error { background: #dc2626; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-dk); border-radius: 10px; }

/* ── WIZARD STEP INDICATOR ── */
.step-indicator { display:flex; align-items:center; justify-content:center; gap:0; padding:16px 20px 0; margin-bottom:20px; }
.step-circle { width:28px; height:28px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:800; border:2px solid var(--border-dk); color:var(--lt); background:var(--white); transition:all .2s; flex-shrink:0; }
.step-circle.active { background:var(--navy); border-color:var(--navy); color:#fff; }
.step-circle.done { background:var(--teal); border-color:var(--teal); color:#fff; }
.step-line { flex:1; height:2px; background:var(--border); max-width:60px; }
.step-line.done { background:var(--teal); }
.step-label { font-size:9px; color:var(--lt); text-align:center; margin-top:3px; font-weight:600; text-transform:uppercase; }
.pill-group { display:flex; gap:6px; flex-wrap:wrap; }
.pill-opt { padding:6px 14px; border-radius:20px; font-size:12px; font-weight:600; cursor:pointer; border:1.5px solid var(--border-dk); background:var(--white); color:var(--mid); font-family:'DM Sans',sans-serif; transition:all .15s; }
.pill-opt.selected { background:var(--navy); color:#fff; border-color:var(--navy); }
.pill-opt.sel-critical { background:#dc2626; border-color:#dc2626; color:#fff; }
.pill-opt.sel-high { background:#d97706; border-color:#d97706; color:#fff; }
.pill-opt.sel-low { background:#16a34a; border-color:#16a34a; color:#fff; }
.slider-wrap { display:flex; align-items:center; gap:12px; }
.slider-wrap input[type=range] { flex:1; accent-color:var(--teal); cursor:pointer; }
.slider-val { min-width:42px; text-align:center; font-size:16px; font-weight:800; color:var(--navy); }
.field-error { font-size:11px; color:#dc2626; margin-top:4px; display:none; }
.field-error.show { display:block; }

/* ── PROJECT LINK ── */
.proj-link { cursor:pointer; color:var(--navy); font-weight:700; }
.proj-link:hover { color:var(--teal); text-decoration:underline; }

/* ── PRINT ── */
@media print {
  #sidebar { display:none !important; }
  #main { margin-left:0 !important; }
  .no-print { display:none !important; }
  .content { padding:10px !important; }
  .mo { display:none !important; }
  body { background:#fff !important; }
  .stat-card { border:1px solid #ccc !important; box-shadow:none !important; }
}

/* ── KANBAN ── */
.kanban-board { display: grid; grid-template-columns: repeat(4, minmax(240px,1fr)); gap: 12px; overflow-x: auto; }
.kanban-lane { background: var(--bg); border-radius: var(--r); border: 1px solid var(--border); min-height: 200px; display: flex; flex-direction: column; }
.kanban-lane-hdr { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: var(--white); border-radius: var(--r) var(--r) 0 0; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 2; }
.kanban-lane-title { font-size: 12px; font-weight: 700; color: var(--navy); }
.kanban-lane-count { font-size: 11px; font-weight: 700; background: var(--bg); border-radius: 10px; padding: 1px 8px; color: var(--mid); }
.ms-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--rs); padding: 11px 12px; cursor: pointer; margin: 8px 8px 0; transition: box-shadow .12s; }
.ms-card:hover { box-shadow: var(--shm); }
.ms-card:last-child { margin-bottom: 8px; }
.ms-card-title { font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 6px; line-height: 1.3; }
.ms-card-meta { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; font-size: 11px; color: var(--lt); }
.ms-task-bar { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.ms-task-progress { flex: 1; height: 4px; background: #e8eaf0; border-radius: 2px; overflow: hidden; }
.ms-task-progress-fill { height: 100%; background: var(--teal); border-radius: 2px; }
.ms-task-count { font-size: 10px; color: var(--lt); white-space: nowrap; }
.ms-drawer { position: fixed; top: 0; right: -420px; width: 400px; height: 100vh; background: var(--white); box-shadow: var(--shl); z-index: 500; display: flex; flex-direction: column; transition: right .26s cubic-bezier(.4,0,.2,1); }
.ms-drawer.open { right: 0; }
.drawer-overlay { position: fixed; inset: 0; background: rgba(27,43,94,.3); z-index: 499; opacity: 0; transition: opacity .26s; }
.drawer-overlay.show { opacity: 1; }
.ms-drawer-hdr { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 18px 18px 14px; border-bottom: 1px solid var(--border); background: var(--white); position: sticky; top: 0; z-index: 2; }
.ms-drawer-title { font-size: 16px; font-weight: 800; color: var(--navy); line-height: 1.3; }
.ms-drawer-meta { font-size: 12px; color: var(--lt); margin-top: 3px; }
.ms-drawer-body { flex: 1; overflow-y: auto; padding: 14px 18px; }
.task-row { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.task-row:last-child { border-bottom: none; }
.task-cb { accent-color: var(--teal); margin-top: 3px; flex-shrink: 0; width: 15px; height: 15px; }
.task-info { flex: 1; min-width: 0; }
.task-name-text { font-size: 13px; color: var(--text); }
.task-name-text.done { text-decoration: line-through; color: var(--lt); }
.task-note-preview { font-size: 11px; color: var(--lt); margin-top: 2px; font-style: italic; }
.task-due { font-size: 11px; color: var(--lt); margin-top: 2px; }
.task-due.overdue { color: var(--red); }
.add-task-form { border-top: 2px solid var(--border); padding-top: 14px; margin-top: 14px; }
.member-detail-panel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 14px 16px; }
.member-detail-section { }
.member-detail-title { font-size: 10px; font-weight: 700; color: var(--lt); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }

/* ── INSIGHT CARDS ── */
.insight-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; border-left: 3px solid var(--teal); }
.insight-card.warn { border-left-color: var(--amber); }
.insight-card.danger { border-left-color: var(--coral); }
.insight-card.good { border-left-color: var(--green); }
.insight-title { font-size: 12px; font-weight: 800; color: var(--navy); margin-bottom: 6px; }
.insight-body { font-size: 12px; color: var(--mid); line-height: 1.6; }
.insight-metric { font-size: 22px; font-weight: 800; color: var(--navy); margin-bottom: 4px; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  #sidebar { display: none; }
  #main { margin-left: 0; }
  .det-layout { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .snap-nums { grid-template-columns: repeat(2, 1fr); }
}

/* ── KANBAN ── */
.kanban-board { display:grid; grid-template-columns:repeat(4,minmax(220px,1fr)); gap:14px; align-items:start; overflow-x:auto; }
.kanban-lane { background:var(--bg); border-radius:var(--r); padding:12px; min-height:200px; }
.kanban-lane-hdr { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.kanban-lane-title { font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.6px; color:var(--mid); }
.kanban-lane-count { background:var(--white); border:1px solid var(--border); border-radius:10px; padding:1px 8px; font-size:11px; font-weight:700; color:var(--mid); }
.ms-card { background:var(--white); border:1px solid var(--border); border-radius:var(--rs); padding:12px; margin-bottom:8px; cursor:pointer; transition:box-shadow .12s; border-left:3px solid var(--border); }
.ms-card:hover { box-shadow:var(--shm); }
.ms-card.overdue { border-left-color:#ef4444; }
.ms-card.atrisk { border-left-color:#f59e0b; }
.ms-card.inprog { border-left-color:#3b82f6; }
.ms-card.done { border-left-color:#22c55e; opacity:.85; }
.ms-card.yts { border-left-color:var(--border-dk); }
.ms-card-title { font-size:13px; font-weight:700; color:var(--navy); margin-bottom:5px; line-height:1.3; }
.ms-card-meta { font-size:11px; color:var(--lt); display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin-bottom:5px; }
.ms-task-bar { display:flex; align-items:center; gap:6px; margin-top:8px; padding-top:8px; border-top:1px solid var(--border); }
.ms-task-progress { flex:1; height:4px; background:var(--bg); border-radius:2px; overflow:hidden; }
.ms-task-progress-fill { height:100%; background:var(--teal); border-radius:2px; transition:width .3s; }
.ms-task-count { font-size:10px; font-weight:700; color:var(--mid); white-space:nowrap; }

/* ── DRAWER ── */
.ms-drawer { position:fixed; top:0; right:-420px; width:420px; height:100vh; background:var(--white); box-shadow:var(--shl); z-index:200; transition:right .25s ease; display:flex; flex-direction:column; }
.ms-drawer.open { right:0; }
.ms-drawer-hdr { padding:16px 18px; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; flex-shrink:0; }
.ms-drawer-title { font-size:15px; font-weight:800; color:var(--navy); flex:1; min-width:0; margin-right:8px; }
.ms-drawer-meta { padding:10px 18px; background:var(--bg); font-size:12px; color:var(--mid); border-bottom:1px solid var(--border); flex-shrink:0; display:flex; gap:10px; flex-wrap:wrap; }
.ms-drawer-body { padding:16px 18px; overflow-y:auto; flex:1; }
.drawer-overlay { position:fixed; inset:0; z-index:199; background:rgba(27,43,94,.2); display:none; }
.drawer-overlay.show { display:block; }
.task-row { display:flex; align-items:flex-start; gap:10px; padding:9px 0; border-bottom:1px solid var(--border); }
.task-row:last-child { border-bottom:none; }
.task-cb { width:16px; height:16px; accent-color:var(--teal); flex-shrink:0; margin-top:2px; cursor:pointer; }
.task-info { flex:1; min-width:0; }
.task-name-text { font-size:13px; color:var(--text); line-height:1.4; }
.task-name-text.done { text-decoration:line-through; color:var(--lt); }
.task-due { font-size:10px; color:var(--lt); margin-top:2px; }
.task-due.overdue { color:#dc2626; font-weight:600; }
.add-task-form { padding:14px; background:var(--bg); border-radius:var(--rs); margin-top:12px; }
.task-name-text { font-size:13px; color:var(--text); line-height:1.4; font-weight:500; }
.task-name-text.done { text-decoration:line-through; color:var(--lt); font-weight:400; }
.task-note-preview { font-size:11px; color:var(--lt); font-style:italic; margin-top:3px; line-height:1.4; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.alloc-input:focus { outline:none; border-color:var(--teal); box-shadow:0 0 0 2px rgba(0,168,150,.15); }
.member-detail-panel { background:var(--bg); border-radius:var(--rs); padding:14px 16px; margin:4px 0 8px; border-left:3px solid var(--teal); display:grid; grid-template-columns:1fr 1fr 1fr; gap:14px; }
.member-detail-section { }
.member-detail-title { font-size:9px; font-weight:800; color:var(--lt); text-transform:uppercase; letter-spacing:.6px; margin-bottom:8px; }

/* ── AUTH SCREEN ── */
.auth-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0a1740 0%, #1B2B5E 60%, #243572 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.auth-card {
  background: #fff;
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 80px rgba(0,0,0,.3);
  animation: slideUp .25s ease;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.auth-logo-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.auth-logo-text {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -.3px;
}

.auth-logo-sub {
  font-size: 10px;
  color: var(--lt);
  display: block;
  margin-top: 1px;
}

.auth-heading {
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 6px;
}

.auth-sub {
  font-size: 13px;
  color: var(--lt);
  margin-bottom: 24px;
  line-height: 1.5;
}

.auth-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--mid);
  text-transform: uppercase;
  letter-spacing: .5px;
  display: block;
  margin-bottom: 6px;
}

.auth-input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  outline: none;
  transition: border-color .15s;
  margin-bottom: 16px;
}

.auth-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(0,168,150,.1);
}

.auth-btn {
  width: 100%;
  padding: 13px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: background .15s;
  margin-bottom: 12px;
}

.auth-btn:hover { background: var(--navy2); }

.auth-btn.teal { background: var(--teal); }
.auth-btn.teal:hover { background: var(--teal-dk); }

.auth-link {
  font-size: 12px;
  color: var(--teal);
  cursor: pointer;
  text-decoration: underline;
  background: none;
  border: none;
  font-family: 'DM Sans', sans-serif;
  padding: 0;
}

.auth-link:hover { color: var(--teal-dk); }

.auth-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  color: #dc2626;
  margin-bottom: 14px;
  display: none;
}

.auth-error.show { display: block; }

.auth-success {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  color: #16a34a;
  margin-bottom: 14px;
  display: none;
}

.auth-success.show { display: block; }

/* PIN INPUT BOXES */
.pin-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
}

.pin-box {
  width: 60px;
  height: 64px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 28px;
  font-weight: 800;
  text-align: center;
  color: var(--navy);
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-text-security: disc;
  appearance: none;
  -moz-appearance: textfield;
}

.pin-box:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(0,168,150,.15);
}

.pin-box.filled {
  border-color: var(--navy);
  background: #f0f4ff;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  color: var(--lt);
  font-size: 11px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-denied {
  text-align: center;
  padding: 10px 0;
}

.auth-denied-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

/* USER CHIP in topbar */
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: background .12s;
}

.user-chip:hover { background: var(--border); }

.user-chip-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
}

.user-chip-role {
  font-size: 10px;
  color: var(--lt);
}

/* Hide edit elements for view-only users */
.edit-only { display: inline-flex; }

body.view-mode .edit-only { display: none !important; }
body.view-mode .btn-primary { display: none !important; }
body.view-mode .btn-danger { display: none !important; }

/* Access denied badge for view users */
.view-badge {
  display: none;
  font-size: 10px;
  background: #dbeafe;
  color: #1d4ed8;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 700;
}

body.view-mode .view-badge { display: inline-flex; }
