/* ========== EXTENSI ERP — DESIGN TOKENS ========== */
:root {
  --bg-base: #0A0F1F;
  --bg-1: #0D1426;
  --bg-2: #111A30;
  --bg-3: #15203B;
  --bg-elev: rgba(255,255,255,0.03);
  --bg-elev-2: rgba(255,255,255,0.05);
  --bg-elev-hi: rgba(255,255,255,0.08);

  --stroke: rgba(255,255,255,0.06);
  --stroke-2: rgba(255,255,255,0.10);
  --stroke-hi: rgba(255,255,255,0.16);

  --text: #E8ECF5;
  --text-2: #A6AFC4;
  --text-3: #6B7693;
  --text-4: #4A546E;

  --brand: #2D6BFF;
  --brand-2: #5B8BFF;
  --brand-soft: rgba(45,107,255,0.14);
  --brand-soft-2: rgba(45,107,255,0.22);

  --accent: #E25822;
  --accent-2: #FF7A45;
  --accent-soft: rgba(226,88,34,0.16);

  --green: #2EC27E;
  --green-soft: rgba(46,194,126,0.16);
  --amber: #F0B429;
  --amber-soft: rgba(240,180,41,0.14);
  --red: #F0455A;
  --red-soft: rgba(240,69,90,0.16);
  --violet: #8B6CFF;
  --violet-soft: rgba(139,108,255,0.16);

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  --font-sans: 'Inter', system-ui, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --shadow-pop: 0 30px 60px -20px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.06);
  --shadow-soft: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 24px -12px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; }
html, body, #root { margin: 0; padding: 0; height: 100%; background: var(--bg-base); color: var(--text); }
body {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
  overflow: hidden;
}

/* ========== GRADIENT MESH BG ========== */
.app-bg {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(900px 600px at 12% -10%, rgba(45,107,255,0.18), transparent 60%),
    radial-gradient(700px 500px at 92% 8%, rgba(226,88,34,0.10), transparent 55%),
    radial-gradient(1000px 700px at 70% 110%, rgba(139,108,255,0.10), transparent 60%),
    linear-gradient(180deg, #0A0F1F 0%, #070B17 100%);
}
.app-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 30%, transparent 80%);
}

/* ========== GLASS PRIMITIVES ========== */
.glass {
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.015));
  border: 1px solid var(--stroke);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-radius: var(--r-lg);
}
.glass-2 {
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border: 1px solid var(--stroke-2);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-radius: var(--r-lg);
}

.mono { font-family: var(--font-mono); font-feature-settings: "ss01","cv11"; }
.serif-i { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }

/* ========== APP LAYOUT ========== */
.app {
  display: grid;
  grid-template-columns: 232px 1fr;
  grid-template-rows: 52px 1fr;
  height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  grid-row: 1 / 3;
  border-right: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(13,20,38,0.6), rgba(10,15,31,0.4));
  backdrop-filter: blur(18px);
  display: flex; flex-direction: column;
  padding: 14px 10px;
  gap: 4px;
}
.sb-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 14px;
  border-bottom: 1px solid var(--stroke);
  margin-bottom: 10px;
}
.sb-logo {
  width: 28px; height: 28px; border-radius: 8px;
  background: conic-gradient(from 210deg, #2D6BFF, #8B6CFF, #E25822, #2D6BFF);
  position: relative;
}
.sb-logo::after {
  content: ""; position: absolute; inset: 4px;
  background: var(--bg-base); border-radius: 5px;
}
.sb-logo::before {
  content: "E"; position: absolute; inset: 0;
  display: grid; place-items: center; z-index: 2;
  font-family: var(--font-serif); font-style: italic; font-size: 16px; color: var(--text);
}
.sb-brand-name { font-weight: 600; font-size: 13px; letter-spacing: -0.01em; }
.sb-brand-sub { font-size: 10px; color: var(--text-3); font-family: var(--font-mono); letter-spacing: 0.04em; }

.sb-section {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text-4); padding: 12px 10px 4px;
  font-weight: 500;
}
.sb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; border-radius: 8px;
  color: var(--text-2); cursor: pointer;
  font-size: 12.5px;
  user-select: none;
  position: relative;
}
.sb-item:hover { background: var(--bg-elev); color: var(--text); }
.sb-item.active {
  background: var(--brand-soft);
  color: var(--text);
}
.sb-item.active::before {
  content: ""; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 2px;
  background: var(--brand); border-radius: 0 2px 2px 0;
}
.sb-item .badge {
  margin-left: auto;
  font-size: 10px; padding: 1px 6px; border-radius: 99px;
  background: var(--bg-elev-hi); color: var(--text-2);
  font-family: var(--font-mono);
}
.sb-item.active .badge { background: var(--brand); color: white; }
.sb-sub {
  display: flex; flex-direction: column; gap: 1px;
  margin-left: 22px; padding-left: 10px;
  border-left: 1px solid var(--stroke);
  margin-top: 2px; margin-bottom: 4px;
}
.sb-sub .sb-item { padding: 4px 8px; font-size: 12px; }
.sb-sub .sb-item.active::before { display: none; }
.sb-sub .sb-item.active {
  background: linear-gradient(90deg, var(--brand-soft), transparent);
  color: var(--text);
  font-weight: 500;
}
.sb-sub .sb-item.active .dot { background: var(--brand); }
.sb-sub .sb-item .dot {
  width: 5px; height: 5px; border-radius: 99px; background: var(--text-4);
}
.sb-icon {
  width: 16px; height: 16px; flex-shrink: 0; opacity: 0.85;
}

.sb-footer {
  margin-top: auto;
  border-top: 1px solid var(--stroke);
  padding: 10px 6px 4px;
  display: flex; align-items: center; gap: 8px;
}
.sb-avatar {
  width: 26px; height: 26px; border-radius: 99px;
  background: linear-gradient(135deg, #2D6BFF, #8B6CFF);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600; color: white;
}
.sb-user-name { font-size: 12px; font-weight: 500; }
.sb-user-role { font-size: 10px; color: var(--text-3); }

/* ===== TOPBAR ===== */
.topbar {
  display: flex; align-items: center;
  padding: 0 18px;
  border-bottom: 1px solid var(--stroke);
  background: rgba(10,15,31,0.55);
  backdrop-filter: blur(20px);
  gap: 14px;
}
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.crumbs .sep { color: var(--text-4); }
.crumbs .last { color: var(--text); font-weight: 500; }
.tb-spacer { flex: 1; }
.tb-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-elev); border: 1px solid var(--stroke);
  border-radius: 8px; padding: 5px 10px; min-width: 280px;
  font-size: 12px; color: var(--text-3);
}
.tb-search kbd {
  font-family: var(--font-mono); font-size: 10px;
  background: var(--bg-elev-hi); padding: 1px 5px; border-radius: 4px;
  border: 1px solid var(--stroke-2);
}
.tb-btn {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--bg-elev); border: 1px solid var(--stroke);
  cursor: pointer; color: var(--text-2);
  position: relative;
}
.tb-btn:hover { background: var(--bg-elev-2); color: var(--text); }
.tb-btn .ping {
  position: absolute; top: 5px; right: 5px;
  width: 6px; height: 6px; border-radius: 99px;
  background: var(--accent); box-shadow: 0 0 0 2px var(--bg-base);
}

/* ===== MAIN CONTENT ===== */
.main {
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  height: 100%;
}
.pane { overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.pane-scroll { overflow-y: auto; min-height: 0; flex: 1; }
.pane-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.pane-scroll::-webkit-scrollbar-thumb { background: var(--stroke-2); border-radius: 99px; }
.pane-scroll::-webkit-scrollbar-track { background: transparent; }

/* ===== PROJECT HEADER ===== */
.proj-head { padding: 18px 20px 14px; border-bottom: 1px solid var(--stroke); }
.proj-code-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.code-chip {
  font-family: var(--font-mono); font-size: 11px;
  padding: 3px 8px; border-radius: 6px;
  background: var(--bg-elev-hi); border: 1px solid var(--stroke-2);
  color: var(--text); letter-spacing: 0.02em;
}
.proj-name {
  font-family: var(--font-serif); font-style: italic; font-weight: 400;
  font-size: 38px; line-height: 1.05; letter-spacing: -0.02em;
  color: var(--text); margin: 0;
}
.proj-sub { color: var(--text-3); font-size: 12px; margin-top: 6px; display: flex; gap: 14px; }
.proj-sub b { color: var(--text-2); font-weight: 500; }

.status-row { display: flex; align-items: center; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 99px;
  font-size: 11px; font-weight: 500;
  border: 1px solid transparent;
}
.chip-green { background: var(--green-soft); color: #6FE0AC; border-color: rgba(46,194,126,0.25); }
.chip-blue { background: var(--brand-soft); color: var(--brand-2); border-color: rgba(45,107,255,0.3); }
.chip-amber { background: var(--amber-soft); color: #FFD071; border-color: rgba(240,180,41,0.25); }
.chip-red { background: var(--red-soft); color: #FF8095; border-color: rgba(240,69,90,0.3); }
.chip-grey { background: var(--bg-elev-hi); color: var(--text-2); border-color: var(--stroke-2); }
.chip .dot { width: 6px; height: 6px; border-radius: 99px; background: currentColor; }

.progress-wrap { display: flex; align-items: center; gap: 10px; }
.progress-label { font-size: 11px; color: var(--text-3); }
.progress-label b { color: var(--text); font-weight: 600; font-family: var(--font-mono); }
.progress {
  width: 160px; height: 5px; border-radius: 99px;
  background: var(--bg-elev-hi); overflow: hidden; position: relative;
}
.progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--brand), #6FA0FF);
  border-radius: 99px;
}

/* ===== KPI TILES ===== */
.kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; padding: 14px 20px 6px;
}
.kpi {
  padding: 12px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  position: relative; overflow: hidden;
}
.kpi-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-4); margin-bottom: 8px; font-weight: 500;
}
.kpi-main {
  font-size: 18px; font-weight: 600; letter-spacing: -0.02em;
  color: var(--text); font-family: var(--font-mono);
  display: flex; align-items: baseline; gap: 4px;
}
.kpi-main .unit { font-size: 11px; color: var(--text-3); font-weight: 400; }
.kpi-sub { font-size: 11px; color: var(--text-3); margin-top: 6px; line-height: 1.3; }
.kpi-sub b { color: var(--text-2); font-weight: 500; }
.kpi-sub .pos { color: #6FE0AC; }
.kpi-sub .neg { color: #FF8095; }
.kpi-mini {
  position: absolute; top: 12px; right: 12px;
  font-size: 10px; padding: 1px 5px; border-radius: 4px;
  background: var(--bg-elev-hi); color: var(--text-2);
  font-family: var(--font-mono);
}

/* ===== TABS ===== */
.tabs {
  display: flex; align-items: center; gap: 2px;
  padding: 4px 18px 0; border-bottom: 1px solid var(--stroke);
  overflow-x: auto;
}
.tab {
  padding: 9px 12px; font-size: 11.5px; font-weight: 500;
  color: var(--text-3); cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent;
  text-transform: uppercase; letter-spacing: 0.06em;
  display: flex; align-items: center; gap: 6px;
}
.tab:hover { color: var(--text-2); }
.tab.active { color: var(--text); border-bottom-color: var(--brand); }
.tab .count {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0;
  background: var(--bg-elev-hi); padding: 0 5px; border-radius: 4px;
  color: var(--text-2); text-transform: none;
}

/* ===== GANTT ===== */
.gantt-wrap { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.gantt-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--stroke);
}
.seg {
  display: flex; background: var(--bg-elev); border: 1px solid var(--stroke);
  border-radius: 8px; padding: 2px;
}
.seg button {
  background: transparent; border: 0; color: var(--text-3);
  padding: 4px 10px; font-size: 11px; border-radius: 6px;
  cursor: pointer; font-weight: 500;
  font-family: inherit;
}
.seg button.on { background: var(--bg-elev-hi); color: var(--text); }
.seg button:hover:not(.on) { color: var(--text-2); }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 8px; font-size: 12px; font-weight: 500;
  cursor: pointer; border: 1px solid var(--stroke); background: var(--bg-elev);
  color: var(--text); font-family: inherit;
}
.btn:hover { background: var(--bg-elev-2); }
.btn-primary {
  background: linear-gradient(180deg, #3F7DFF, #2459DB);
  border-color: rgba(255,255,255,0.18);
  color: white;
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 4px 14px -4px rgba(45,107,255,0.5);
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; border-color: var(--stroke); color: var(--text-2); }

.gantt-body {
  flex: 1; overflow: auto; min-height: 0;
  display: grid;
  grid-template-columns: 320px 1fr;
}
.gantt-body::-webkit-scrollbar { height: 10px; width: 10px; }
.gantt-body::-webkit-scrollbar-thumb { background: var(--stroke-2); border-radius: 99px; }
.gantt-body::-webkit-scrollbar-corner { background: transparent; }

.g-left { border-right: 1px solid var(--stroke); background: rgba(10,15,31,0.4); position: sticky; left: 0; z-index: 3; }
.g-left-head, .g-right-head {
  position: sticky; top: 0; z-index: 4;
  background: rgba(13,20,38,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--stroke);
  height: 56px;
}
.g-left-head { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 0 14px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-4); font-weight: 500; }

.g-row {
  display: contents;
}
.g-cell-left {
  padding: 0 14px;
  display: flex; align-items: center; gap: 8px;
  height: 36px;
  border-bottom: 1px solid var(--stroke);
  font-size: 12px;
  position: relative;
}
.g-cell-right {
  position: relative;
  height: 36px;
  border-bottom: 1px solid var(--stroke);
}

.g-section .g-cell-left {
  background: rgba(255,255,255,0.025);
  font-weight: 600; text-transform: uppercase;
  font-size: 10.5px; letter-spacing: 0.08em; color: var(--text);
}
.g-section .g-cell-right { background: rgba(255,255,255,0.015); }

.g-row .g-cell-left .lvl { width: 0; }
.g-row.lvl-1 .g-cell-left { padding-left: 26px; }
.g-row.lvl-2 .g-cell-left { padding-left: 38px; }

.g-code {
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--text-3); background: var(--bg-elev);
  padding: 1px 6px; border-radius: 4px; border: 1px solid var(--stroke);
  flex-shrink: 0;
}
.g-name { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.g-row.selected .g-cell-left { background: linear-gradient(90deg, var(--brand-soft), transparent 80%); }
.g-row.selected .g-cell-left::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--brand);
}
.g-row .g-cell-left:hover { background: var(--bg-elev); cursor: pointer; }

.g-assignee {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; color: var(--text-2);
  background: var(--bg-elev); padding: 1px 7px 1px 2px;
  border-radius: 99px; border: 1px solid var(--stroke);
  flex-shrink: 0;
}
.g-assignee .av {
  width: 16px; height: 16px; border-radius: 99px;
  display: grid; place-items: center;
  font-size: 9px; font-weight: 600; color: white;
}

.g-right {
  position: relative;
}
.g-right-head { display: grid; }
.month-head {
  border-right: 1px solid var(--stroke);
  padding: 8px 8px 4px;
  display: flex; flex-direction: column; gap: 2px;
}
.month-head:last-child { border-right: none; }
.month-name { font-size: 11px; font-weight: 600; color: var(--text); text-transform: uppercase; letter-spacing: 0.06em; }
.month-year { font-size: 10px; color: var(--text-4); font-family: var(--font-mono); }
.month-head.q-end { border-right: 1px solid var(--stroke-hi); }

.timeline-grid {
  position: absolute; inset: 56px 0 0 0;
  background-image: linear-gradient(90deg, var(--stroke) 1px, transparent 1px);
  pointer-events: none;
}

.today-line {
  position: absolute; top: 0; bottom: 0;
  width: 2px; background: var(--accent);
  z-index: 5; pointer-events: none;
  box-shadow: 0 0 12px rgba(226,88,34,0.5);
}
.today-line::before {
  content: "Сегодня 04.05.26";
  position: absolute; top: 6px; left: 6px; white-space: nowrap;
  font-size: 10px; font-weight: 600; color: white;
  background: var(--accent); padding: 2px 7px; border-radius: 4px;
  font-family: var(--font-mono); letter-spacing: 0;
  box-shadow: 0 4px 14px rgba(226,88,34,0.4);
}

/* Bars */
.bar {
  position: absolute; top: 8px; height: 20px;
  border-radius: 5px;
  display: flex; align-items: center;
  font-size: 10px; font-weight: 500;
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
  overflow: hidden;
}
.bar:hover { filter: brightness(1.1); transform: translateY(-1px); }
.bar-done {
  background: linear-gradient(180deg, #34D592, #229E66);
  color: #04140C;
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 2px 6px rgba(46,194,126,0.25);
}
.bar-progress {
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.16) 0 6px, transparent 6px 12px),
    linear-gradient(180deg, #4F8AFF, #2D6BFF);
  color: white;
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 2px 6px rgba(45,107,255,0.3);
  position: relative;
}
.bar-progress .fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(180deg, #4F8AFF, #2D6BFF);
  border-radius: 5px 0 0 5px;
}
.bar-progress .pct {
  position: relative; z-index: 2;
  padding: 0 8px;
  font-family: var(--font-mono);
}
.bar-progress .label-text { position: relative; z-index: 2; padding: 0 8px; }
.bar-todo {
  background: rgba(255,255,255,0.04);
  border: 1px dashed var(--stroke-hi);
  color: var(--text-3);
}
.bar-overdue {
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.1) 0 5px, transparent 5px 10px),
    linear-gradient(180deg, #F0455A, #C0303F);
  color: white;
  border: 1px solid #FF8095;
  box-shadow: 0 0 0 2px rgba(240,69,90,0.2), 0 2px 8px rgba(240,69,90,0.4);
  animation: pulse-red 2.4s ease-in-out infinite;
}
@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 2px rgba(240,69,90,0.18), 0 2px 8px rgba(240,69,90,0.3); }
  50% { box-shadow: 0 0 0 4px rgba(240,69,90,0.28), 0 2px 14px rgba(240,69,90,0.5); }
}
.bar-section {
  height: 6px; top: 15px; border-radius: 99px;
  background: linear-gradient(90deg, rgba(45,107,255,0.6), rgba(139,108,255,0.4));
  border: 1px solid rgba(255,255,255,0.1);
}
.bar-section.done {
  background: linear-gradient(90deg, rgba(46,194,126,0.6), rgba(46,194,126,0.3));
}
.bar-label-out {
  position: absolute; top: 10px;
  font-size: 10px; color: var(--text-3); white-space: nowrap;
  pointer-events: none; padding: 0 6px;
}

.milestone {
  position: absolute; top: 9px;
  width: 18px; height: 18px;
  background: linear-gradient(135deg, #FFD071, #E2A622);
  transform: rotate(45deg);
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow: 0 2px 8px rgba(240,180,41,0.4);
  z-index: 4;
}
.milestone::after {
  content: ""; position: absolute; inset: 4px;
  background: var(--bg-base); transform: rotate(0);
}
.milestone.done {
  background: linear-gradient(135deg, #6FE0AC, #2EC27E);
  box-shadow: 0 2px 8px rgba(46,194,126,0.4);
}

.dep-svg { position: absolute; inset: 56px 0 0 0; pointer-events: none; z-index: 2; }

.bar-warning {
  position: absolute; right: -22px; top: 2px;
  width: 16px; height: 16px; border-radius: 99px;
  background: var(--red);
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700; color: white;
  box-shadow: 0 0 0 2px var(--bg-base);
}

/* Hover popover */
.popover {
  position: absolute; z-index: 50;
  min-width: 260px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(17,26,48,0.96);
  backdrop-filter: blur(20px);
  border: 1px solid var(--stroke-hi);
  box-shadow: var(--shadow-pop);
  pointer-events: none;
  font-size: 11.5px;
}
.pop-title { font-weight: 600; color: var(--text); font-size: 13px; margin-bottom: 2px; letter-spacing: -0.01em; }
.pop-sub { color: var(--text-3); font-family: var(--font-mono); font-size: 10.5px; margin-bottom: 8px; }
.pop-row { display: flex; justify-content: space-between; padding: 3px 0; border-top: 1px solid var(--stroke); color: var(--text-2); }
.pop-row:first-of-type { border-top: 0; }
.pop-row b { color: var(--text); font-weight: 500; }

/* ===== RIGHT PANEL ===== */
.rp-section { padding: 16px 18px; border-bottom: 1px solid var(--stroke); }
.rp-title {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text-4); font-weight: 500; margin-bottom: 10px;
}
.rp-title-row { display: flex; align-items: center; justify-content: space-between; }

/* Donut */
.donut-row { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: center; }
.donut { position: relative; width: 120px; height: 120px; }
.donut-center {
  position: absolute; inset: 0; display: grid; place-items: center;
  flex-direction: column; text-align: center;
}
.donut-num { font-size: 26px; font-weight: 600; font-family: var(--font-mono); letter-spacing: -0.02em; color: var(--text); line-height: 1; }
.donut-lbl { font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-4); margin-top: 3px; }
.legend { display: flex; flex-direction: column; gap: 4px; }
.legend-row { display: grid; grid-template-columns: 8px 1fr auto auto; align-items: center; gap: 8px; font-size: 11.5px; }
.legend-dot { width: 8px; height: 8px; border-radius: 2px; }
.legend-name { color: var(--text-2); }
.legend-pct { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); width: 36px; text-align: right; }
.legend-bar { width: 60px; height: 4px; background: var(--bg-elev-hi); border-radius: 99px; overflow: hidden; }
.legend-bar > i { display: block; height: 100%; border-radius: 99px; }

/* Work detail */
.wd-photo {
  width: 100%; height: 130px; border-radius: 10px;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.025) 0 10px, transparent 10px 20px),
    linear-gradient(135deg, rgba(45,107,255,0.18), rgba(139,108,255,0.12));
  border: 1px solid var(--stroke);
  display: grid; place-items: center;
  position: relative; overflow: hidden;
}
.wd-photo .ph-text {
  font-family: var(--font-mono); font-size: 10px; color: var(--text-3);
  letter-spacing: 0.04em;
  background: rgba(10,15,31,0.6); padding: 3px 8px; border-radius: 4px;
}
.wd-photo .ph-counter {
  position: absolute; bottom: 8px; right: 8px;
  font-size: 10px; padding: 2px 6px; border-radius: 4px;
  background: rgba(10,15,31,0.85); color: var(--text);
  font-family: var(--font-mono);
  border: 1px solid var(--stroke-2);
}

.wd-name {
  font-family: var(--font-serif); font-style: italic;
  font-size: 22px; line-height: 1.1; letter-spacing: -0.01em;
  color: var(--text); margin: 14px 0 4px;
}
.wd-codes { display: flex; gap: 6px; flex-wrap: wrap; }

.wd-fields {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--stroke); border: 1px solid var(--stroke);
  border-radius: 8px; overflow: hidden;
  margin-top: 14px;
}
.wd-field {
  padding: 9px 12px; background: rgba(10,15,31,0.4);
  display: flex; flex-direction: column; gap: 2px;
}
.wd-field-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-4); }
.wd-field-value { font-size: 12px; color: var(--text); font-weight: 500; }
.wd-field-value.mono { font-family: var(--font-mono); font-size: 11.5px; }
.wd-field-sub { font-size: 10.5px; color: var(--text-3); margin-top: 1px; font-family: var(--font-mono); }

/* Checklist */
.checklist { display: flex; flex-direction: column; gap: 0; }
.cl-item {
  display: grid; grid-template-columns: 16px 1fr auto; gap: 10px;
  align-items: center; padding: 7px 0;
  border-bottom: 1px solid var(--stroke);
  font-size: 12px;
}
.cl-item:last-child { border-bottom: 0; }
.cl-check {
  width: 16px; height: 16px; border-radius: 5px;
  border: 1.5px solid var(--stroke-hi);
  display: grid; place-items: center;
}
.cl-check.done { background: var(--green); border-color: var(--green); }
.cl-check.done svg { stroke: white; }
.cl-text { color: var(--text); }
.cl-item.done .cl-text { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--text-4); }
.cl-meta { font-size: 10px; color: var(--text-4); font-family: var(--font-mono); }

/* Linked items */
.linked-list { display: flex; flex-direction: column; gap: 6px; }
.linked-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  background: var(--bg-elev); border: 1px solid var(--stroke);
  cursor: pointer;
}
.linked-item:hover { background: var(--bg-elev-2); border-color: var(--stroke-2); }
.linked-icon {
  width: 26px; height: 26px; border-radius: 6px;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-2);
  font-size: 11px; font-family: var(--font-mono);
  border: 1px solid rgba(45,107,255,0.2);
  flex-shrink: 0;
}
.linked-title { font-size: 12px; color: var(--text); font-weight: 500; }
.linked-sub { font-size: 10.5px; color: var(--text-3); margin-top: 1px; }
.linked-date { font-size: 10px; color: var(--text-4); font-family: var(--font-mono); margin-left: auto; }

.action-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.action-row .btn { justify-content: center; }
.action-row .full { grid-column: span 2; }

/* utilities */
.h-strong { color: var(--text); font-weight: 500; }
.divider { height: 1px; background: var(--stroke); margin: 0; }
