/* ============================================================
   ProjectTelemetry — Complete App Stylesheet v12
   assets/app.css
   ============================================================ */

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body { height: 100%; font-family: 'Raleway', system-ui, sans-serif; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { display: block; max-width: 100%; }
ul { list-style: none; }
input, select, textarea { font-family: inherit; }

/* Theme: Minimal / Light */
:root, [data-theme="light"] {
  --bg: #FFFFFF; --bg2: #F6F6F6; --bd: #E8E8E8;
  --ink: #111111; --ink-soft: #666666; --ink-faint: #AAAAAA;
  --white: #FFFFFF; --accent: #4F46E5; --accent-bg: #EEF2FF; --accent-ink: #FFFFFF;
  --nav-bg: #FFFFFF; --nav-w: 224px; --hdr-h: 52px; --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08); --shadow-md: 0 4px 16px rgba(0,0,0,.10);
}

/* Theme: Blueprint */
[data-theme="blueprint"] {
  --bg: #EFF3F8; --bg2: #E2EAF3; --bd: #C8D6E5;
  --ink: #152035; --ink-soft: #3D5470; --ink-faint: #8AA2BC;
  --white: #FFFFFF; --accent: #0369A1; --accent-bg: #E0F2FE; --accent-ink: #FFFFFF;
  --nav-bg: #E2EAF3;
}
body { background: var(--bg); color: var(--ink); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn-ghost { background: transparent; border: 1.5px solid var(--bd); color: var(--ink-soft); padding: 7px 16px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; }
.btn-ghost:hover { border-color: var(--ink-soft); color: var(--ink); }
.btn-dark { background: var(--ink); color: #fff; padding: 7px 18px; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-dark:hover { opacity: .88; }
.btn-dark:disabled { opacity: .45; cursor: not-allowed; }
.btn-dark-lg { background: var(--ink); color: #fff; padding: 12px 28px; border-radius: 7px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-dark-lg:hover { opacity: .88; }
.btn-outline-lg { background: transparent; color: var(--ink); border: 1.5px solid var(--bd); padding: 11px 22px; border-radius: 7px; font-size: 13px; font-weight: 500; cursor: pointer; }
.btn-outline-lg:hover { border-color: var(--ink-soft); }
.btn-accent { background: var(--accent); color: var(--accent-ink); padding: 8px 18px; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-accent:hover { opacity: .9; }
.btn-accent:disabled { opacity: .45; cursor: not-allowed; }
.btn-full { width: 100%; padding: 11px; font-size: 14px; border-radius: 7px; }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 5px; }
.btn-icon { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--ink-soft); font-size: 16px; }
.btn-icon:hover { background: var(--bg2); color: var(--ink); }

/* ── Forms ───────────────────────────────────────────────── */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); margin-bottom: 5px; }
.field input, .field select, .field textarea { width: 100%; padding: 9px 12px; border: 1.5px solid var(--bd); border-radius: 6px; font-size: 14px; color: var(--ink); background: var(--bg); transition: border-color .15s; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field textarea { min-height: 80px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-hint { font-size: 11px; color: var(--ink-faint); margin-top: 4px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 40px; }
.pw-eye { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); font-size: 16px; cursor: pointer; display: flex; align-items: center; }
.pw-eye:hover { color: var(--ink-soft); }
.check-label { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--ink-soft); cursor: pointer; line-height: 1.5; }
.check-label input[type="checkbox"] { margin-top: 2px; accent-color: var(--accent); }
.check-label a { color: var(--accent); text-decoration: underline; }

/* ── Theme toggle ────────────────────────────────────────── */
.theme-toggle-wrap { display: flex; align-items: center; gap: 6px; color: var(--ink-faint); font-size: 15px; }
.theme-toggle { position: relative; width: 38px; height: 22px; background: var(--bd); border-radius: 11px; cursor: pointer; transition: background .2s; flex-shrink: 0; }
[data-theme="blueprint"] .theme-toggle { background: var(--accent); }
.toggle-knob { position: absolute; top: 4px; left: 4px; width: 14px; height: 14px; background: #fff; border-radius: 50%; transition: transform .2s; pointer-events: none; }
[data-theme="blueprint"] .toggle-knob { transform: translateX(16px); }

/* ── Landing ─────────────────────────────────────────────── */
#landing { min-height: 100vh; display: flex; flex-direction: column; }
.land-nav { display: flex; align-items: center; justify-content: space-between; padding: 15px 40px; background: var(--bg2); border-bottom: 1px solid var(--bd); }
.land-logo { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.land-logo span { color: var(--accent); }
.land-nav-r { display: flex; align-items: center; gap: 12px; }
.land-hero { text-align: center; padding: 70px 40px 64px; max-width: 680px; margin: 0 auto; }
.land-eyebrow { display: inline-block; font-size: 11px; letter-spacing: .13em; text-transform: uppercase; font-weight: 600; color: var(--accent); margin-bottom: 22px; }
.land-h1 { font-size: 42px; font-weight: 700; line-height: 1.13; letter-spacing: -.025em; margin-bottom: 18px; }
.land-h1 span { color: var(--accent); }
.land-sub { font-size: 15px; color: var(--ink-soft); line-height: 1.72; max-width: 480px; margin: 0 auto 32px; }
.land-ctas { display: flex; gap: 12px; justify-content: center; margin-bottom: 14px; }
.land-note { font-size: 11px; color: var(--ink-faint); }
.land-feats-bg { background: var(--bg2); border-top: 1px solid var(--bd); border-bottom: 1px solid var(--bd); }
.land-feats { display: grid; grid-template-columns: repeat(3,1fr); gap: 40px; padding: 52px 40px; max-width: 860px; margin: 0 auto; }
.land-feat { text-align: center; }
.land-feat i { font-size: 24px; color: var(--accent); display: block; margin-bottom: 14px; }
.land-feat h3 { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.land-feat p { font-size: 12px; color: var(--ink-soft); line-height: 1.65; }
.land-footer { padding: 20px 40px; font-size: 11px; color: var(--ink-faint); display: flex; gap: 16px; justify-content: center; align-items: center; border-top: 1px solid var(--bd); background: var(--bg2); margin-top: auto; }
.land-footer a { color: var(--ink-soft); }
.land-footer a:hover { color: var(--ink); }

/* ── Auth modal ──────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.hidden { display: none; }
.auth-card { background: var(--white); border-radius: 12px; width: 100%; max-width: 460px; box-shadow: var(--shadow-md); display: flex; flex-direction: column; max-height: calc(100vh - 40px); overflow: hidden; }
.auth-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 0; }
.auth-logo { font-size: 15px; font-weight: 700; }
.auth-logo span { color: var(--accent); }
.auth-close { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--ink-faint); font-size: 18px; }
.auth-close:hover { background: var(--bg2); color: var(--ink); }
.auth-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.auth-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.auth-sub { font-size: 13px; color: var(--ink-soft); margin-bottom: 20px; }
.auth-panel { display: none; }
.auth-panel.active { display: block; }
.auth-error { background: #FEF2F2; border: 1px solid #FCA5A5; color: #7F1D1D; border-radius: 6px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; display: none; }
.auth-error.visible { display: block; }
.auth-footer { padding: 16px 24px 20px; border-top: 1px solid var(--bd); display: flex; flex-direction: column; gap: 10px; }
.auth-switch { text-align: center; font-size: 13px; color: var(--ink-soft); }
.auth-switch a { color: var(--accent); font-weight: 600; cursor: pointer; }
.auth-divider { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--ink-faint); }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--bd); }

/* ── Legal gate ──────────────────────────────────────────── */
#legal-gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 24px; }
.gate-card { background: var(--white); border: 1px solid var(--bd); border-radius: 12px; padding: 40px; max-width: 580px; width: 100%; }
.gate-logo { font-size: 16px; font-weight: 700; margin-bottom: 24px; display: block; }
.gate-logo span { color: var(--accent); }
.gate-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.gate-sub { font-size: 13px; color: var(--ink-soft); margin-bottom: 20px; }
.gate-content { max-height: 300px; overflow-y: auto; border: 1px solid var(--bd); border-radius: 6px; padding: 16px; font-size: 13px; color: var(--ink-soft); line-height: 1.7; margin-bottom: 24px; background: var(--bg2); }
.gate-form { margin-bottom: 10px; }
.gate-btn { width: 100%; padding: 12px; font-size: 14px; }
.gate-form-decline { text-align: center; }
.gate-decline-btn { font-size: 12px; color: var(--ink-faint); cursor: pointer; text-decoration: underline; }

/* ── Toasts ──────────────────────────────────────────────── */
#pt-toasts { position: fixed; bottom: 24px; right: 24px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.pt-toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: 8px; min-width: 280px; max-width: 380px; font-size: 13px; font-weight: 500; pointer-events: all; background: var(--ink); color: #fff; box-shadow: var(--shadow-md); transform: translateY(8px); opacity: 0; transition: transform .25s, opacity .25s; }
.pt-toast.show { transform: translateY(0); opacity: 1; }
.pt-toast.success { background: #166534; }
.pt-toast.error { background: #991B1B; }
.pt-toast.warning { background: #92400E; }
.pt-toast i { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

/* ── Notification panel ──────────────────────────────────── */
#notif-panel { position: fixed; top: var(--hdr-h); right: 0; bottom: 0; width: 360px; max-width: 100vw; background: var(--white); border-left: 1px solid var(--bd); z-index: 500; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .25s; }
#notif-panel.open { transform: translateX(0); }
.notif-panel-hdr { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--bd); background: var(--bg2); }
.notif-panel-title { font-size: 14px; font-weight: 600; }
.notif-panel-actions { display: flex; align-items: center; gap: 8px; }
.notif-mark-all { font-size: 11px; color: var(--accent); cursor: pointer; font-weight: 600; }
.notif-mark-all:hover { text-decoration: underline; }
.notif-close-btn { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--ink-faint); font-size: 18px; }
.notif-close-btn:hover { background: var(--bg); color: var(--ink); }
.notif-list { flex: 1; overflow-y: auto; }
.notif-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--bd); cursor: pointer; transition: background .1s; }
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: var(--accent-bg); }
.notif-severity { width: 3px; border-radius: 2px; flex-shrink: 0; align-self: stretch; }
.sev-info { background: var(--bd); }
.sev-yellow { background: #F59E0B; }
.sev-orange { background: #F97316; }
.sev-red { background: #EF4444; }
.sev-black { background: #111111; }
.notif-content { flex: 1; min-width: 0; }
.notif-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.notif-msg { font-size: 12px; color: var(--ink-soft); line-height: 1.5; }
.notif-time { font-size: 11px; color: var(--ink-faint); margin-top: 4px; }
.notif-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; color: var(--ink-faint); text-align: center; }
.notif-empty i { font-size: 32px; margin-bottom: 12px; }
.notif-empty p { font-size: 13px; }

/* ── App shell ───────────────────────────────────────────── */
#pt-app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
#pt-header { height: var(--hdr-h); flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 20px 0 12px; background: var(--nav-bg); border-bottom: 1px solid var(--bd); z-index: 100; }
.pt-header-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pt-header-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.pt-logo { display: flex; align-items: center; }
.logo-pt, .logo-vmb { font-size: 16px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.logo-pt span, .logo-vmb span { color: var(--accent); }
.hdr-org-name { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-soft); background: var(--bg); border: 1px solid var(--bd); border-radius: 4px; padding: 3px 8px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hdr-icon-btn { background: transparent; color: var(--ink-soft); width: 34px; height: 34px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.hdr-icon-btn:hover { background: var(--bg2); color: var(--ink); }
.save-status { font-size: 11px; color: var(--ink-faint); min-width: 60px; text-align: right; }
.notif-btn { position: relative; }
.notif-badge { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; background: #c8553d; color: #fff; border-radius: 8px; font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 3px; pointer-events: none; }
.user-menu-wrap { position: relative; }
.user-avatar-btn { display: flex; align-items: center; gap: 6px; background: transparent; border: 1px solid var(--bd); border-radius: 6px; padding: 4px 10px 4px 4px; color: var(--ink); }
.user-avatar-btn:hover { background: var(--bg2); }
.user-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.user-name-label { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; }
.user-menu { position: absolute; top: calc(100% + 6px); right: 0; background: var(--white); border: 1px solid var(--bd); border-radius: 8px; min-width: 200px; z-index: 200; overflow: hidden; box-shadow: var(--shadow); }
.user-menu[hidden] { display: none; }
.user-menu-header { padding: 12px 14px; background: var(--bg2); }
.um-name { display: block; font-size: 13px; font-weight: 600; }
.um-role { display: block; font-size: 11px; color: var(--ink-soft); margin-top: 1px; }
.um-org { display: block; font-size: 11px; color: var(--ink-faint); }
.user-menu-divider { height: 1px; background: var(--bd); }
.um-item { display: flex; align-items: center; gap: 8px; padding: 9px 14px; font-size: 13px; color: var(--ink); background: transparent; width: 100%; text-align: left; cursor: pointer; }
.um-item:hover { background: var(--bg2); }
.um-item i { font-size: 15px; color: var(--ink-soft); }
.um-logout { color: #c8553d; }
.um-logout i { color: #c8553d; }
#pt-body { flex: 1; display: flex; overflow: hidden; }
#pt-sidebar { width: var(--nav-w); flex-shrink: 0; background: var(--nav-bg); border-right: 1px solid var(--bd); display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; transition: width .2s; }
#pt-sidebar.collapsed { width: 52px; }
#pt-sidebar.collapsed .nav-section-label, #pt-sidebar.collapsed .nav-badge-soon { display: none; }
#pt-main { flex: 1; overflow-y: auto; padding: 28px; background: var(--bg); }

/* ── Navigation ──────────────────────────────────────────── */
.nav-section-label { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); font-weight: 600; padding: 14px 14px 4px; pointer-events: none; }
.nav-list { flex: 1; padding: 6px 8px; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 8px 8px; border-radius: 6px; font-size: 13px; color: var(--ink-soft); font-weight: 500; white-space: nowrap; overflow: hidden; transition: background .1s, color .1s; cursor: pointer; }
.nav-item:hover { background: var(--bg2); color: var(--ink); }
.nav-item i { font-size: 17px; flex-shrink: 0; }
.nav-active { background: var(--bg2) !important; color: var(--ink) !important; font-weight: 600; }
.nav-active i { color: var(--accent); }
.nav-soon { opacity: .45; pointer-events: none; }
.nav-badge-soon { margin-left: auto; font-size: 9px; padding: 1px 5px; border-radius: 3px; background: var(--bd); color: var(--ink-faint); font-weight: 600; flex-shrink: 0; }
.nav-footer { padding: 8px; border-top: 1px solid var(--bd); margin-top: auto; }
.nav-suite-link { color: var(--accent) !important; }

/* ── Health badges ───────────────────────────────────────── */
.health-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: .04em; flex-shrink: 0; }
.health-green  { background: #DCFCE7; color: #166534; }
.health-yellow { background: #FEF9C3; color: #854D0E; }
.health-orange { background: #FFEDD5; color: #9A3412; }
.health-red    { background: #FEE2E2; color: #991B1B; }
.health-black  { background: #F3F4F6; color: #111827; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; }
.delta-up { color: #16A34A; }
.delta-down { color: #DC2626; }
.delta-flat { color: var(--ink-faint); }

/* ── Status pills ────────────────────────────────────────── */
.status-pill { display: inline-block; font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 10px; }
.status-active   { background: #DCFCE7; color: #166534; }
.status-planning { background: #EEF2FF; color: #4F46E5; }
.status-pursuit  { background: #EDE9FE; color: #5B21B6; }
.status-on_hold  { background: #FEF9C3; color: #854D0E; }
.status-closed   { background: #F6F6F6; color: #666666; }
.status-archived { background: #F6F6F6; color: #AAAAAA; }

/* ── Dashboard ───────────────────────────────────────────── */
.dash-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.dash-search { display: flex; align-items: center; gap: 8px; background: var(--white); border: 1.5px solid var(--bd); border-radius: 6px; padding: 0 12px; flex: 1; min-width: 200px; max-width: 340px; }
.dash-search i { color: var(--ink-faint); font-size: 15px; flex-shrink: 0; }
.dash-search input { border: none; background: transparent; font-size: 13px; color: var(--ink); padding: 8px 0; width: 100%; outline: none; }
.dash-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-btn { padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 500; border: 1.5px solid var(--bd); color: var(--ink-soft); background: var(--white); cursor: pointer; transition: all .15s; }
.filter-btn:hover { border-color: var(--ink-soft); color: var(--ink); }
.filter-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.dash-sort { display: flex; align-items: center; gap: 6px; margin-left: auto; font-size: 12px; color: var(--ink-soft); }
.dash-sort select { border: 1.5px solid var(--bd); border-radius: 6px; padding: 6px 10px; font-size: 12px; background: var(--white); color: var(--ink); cursor: pointer; }
.dash-section { margin-bottom: 28px; }
.dash-section-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dash-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); }
.dash-count { font-size: 11px; color: var(--ink-faint); }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.project-card { background: var(--white); border: 1.5px solid var(--bd); border-radius: var(--radius); padding: 16px 18px; cursor: pointer; transition: border-color .15s, box-shadow .15s; display: flex; flex-direction: column; gap: 10px; }
.project-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.pc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.pc-name { font-size: 14px; font-weight: 600; line-height: 1.35; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pc-fav { font-size: 16px; color: var(--bd); flex-shrink: 0; padding: 0; line-height: 1; }
.pc-fav.active { color: #F59E0B; }
.pc-fav:hover { color: #F59E0B; }
.pc-health-row { display: flex; align-items: center; gap: 8px; }
.pc-bar-bg { height: 3px; background: var(--bd); border-radius: 2px; overflow: hidden; }
.pc-bar-fill { height: 3px; background: var(--accent); border-radius: 2px; transition: width .3s; }
.pc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pc-meta { font-size: 11px; color: var(--ink-faint); }
.recents-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.recent-card { background: var(--white); border: 1.5px solid var(--bd); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; flex-shrink: 0; width: 200px; transition: border-color .15s; }
.recent-card:hover { border-color: var(--accent); }
.rc-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 6px; }
.rc-meta { font-size: 11px; color: var(--ink-faint); }

/* ── Project detail ──────────────────────────────────────── */
.pd-back { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-faint); margin-bottom: 6px; cursor: pointer; background: none; border: none; }
.pd-back:hover { color: var(--accent); }
.pd-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.pd-title-block { flex: 1; min-width: 0; }
.pd-name { font-size: 22px; font-weight: 700; line-height: 1.2; margin-bottom: 8px; }
.pd-meta-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pd-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.pd-health-panel { display: flex; align-items: center; gap: 20px; background: var(--bg2); border: 1px solid var(--bd); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 20px; flex-wrap: wrap; }
.pd-health-score { text-align: center; flex-shrink: 0; min-width: 60px; }
.pd-health-number { font-size: 32px; font-weight: 700; line-height: 1; }
.pd-health-label { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); margin-top: 2px; }
.pd-health-dims { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; flex: 1; }
.pd-dim { text-align: center; }
.pd-dim-score { font-size: 17px; font-weight: 700; }
.pd-dim-label { font-size: 10px; color: var(--ink-faint); margin-top: 2px; }
.pd-dim-weight { font-size: 9px; color: var(--ink-faint); }
.project-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--bd); margin-bottom: 20px; overflow-x: auto; }
.tab-btn { padding: 9px 16px; font-size: 13px; font-weight: 500; color: var(--ink-soft); border-bottom: 2px solid transparent; white-space: nowrap; cursor: pointer; background: none; border-top: none; border-left: none; border-right: none; transition: color .15s, border-color .15s; }
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
#tab-content { min-height: 200px; }
.curve-list { display: flex; flex-direction: column; gap: 10px; }
.curve-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--white); border: 1px solid var(--bd); border-radius: 6px; cursor: pointer; transition: border-color .15s; }
.curve-row:hover { border-color: var(--accent); }
.curve-row-name { font-size: 14px; font-weight: 600; flex: 1; }
.curve-row-meta { font-size: 12px; color: var(--ink-soft); }
.curve-baseline-badge { font-size: 10px; background: var(--accent-bg); color: var(--accent); padding: 2px 6px; border-radius: 3px; font-weight: 600; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); font-weight: 600; padding: 6px 12px; text-align: left; border-bottom: 1px solid var(--bd); }
.data-table td { padding: 9px 12px; border-bottom: 1px solid var(--bg2); }
.data-table tr:hover td { background: var(--bg2); }
.progress-mini-wrap { display: flex; align-items: center; gap: 8px; }
.progress-mini { width: 80px; height: 4px; background: var(--bd); border-radius: 2px; overflow: hidden; flex-shrink: 0; }
.progress-mini-fill { height: 4px; background: var(--accent); border-radius: 2px; }
.team-list { display: flex; flex-direction: column; gap: 8px; }
.team-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--white); border: 1px solid var(--bd); border-radius: 6px; }
.team-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.team-name { font-size: 13px; font-weight: 600; flex: 1; }
.team-role { font-size: 12px; color: var(--ink-soft); }

/* ── Create project modal ────────────────────────────────── */
.cp-modal { background: var(--white); border-radius: 12px; width: 100%; max-width: 520px; box-shadow: var(--shadow-md); display: flex; flex-direction: column; max-height: calc(100vh - 40px); overflow: hidden; }
.cp-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--bd); }
.cp-title { font-size: 16px; font-weight: 700; }
.cp-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.cp-footer { padding: 16px 24px; border-top: 1px solid var(--bd); display: flex; gap: 10px; justify-content: flex-end; }

/* ── Health history bars ─────────────────────────────────── */
.health-history-wrap { display: flex; align-items: flex-end; gap: 3px; height: 48px; padding-top: 8px; }
.hh-bar { flex: 1; border-radius: 2px 2px 0 0; min-width: 6px; cursor: pointer; transition: opacity .15s; }
.hh-bar:hover { opacity: .75; }
.hh-date-row { display: flex; justify-content: space-between; font-size: 9px; color: var(--ink-faint); margin-top: 4px; }

/* ── Empty state ─────────────────────────────────────────── */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 24px; text-align: center; }
.empty-state i { font-size: 36px; color: var(--bd); margin-bottom: 16px; }
.empty-state h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.empty-state p { font-size: 13px; color: var(--ink-soft); max-width: 320px; line-height: 1.6; }
.empty-state .empty-cta { margin-top: 20px; }

/* ── Skeleton ────────────────────────────────────────────── */
@keyframes shimmer { 0%{background-position:-600px 0} 100%{background-position:600px 0} }
.sk-line { height: 14px; border-radius: 6px; margin-bottom: 10px; background: linear-gradient(90deg, var(--bd) 25%, var(--bg2) 50%, var(--bd) 75%); background-size: 1200px 100%; animation: shimmer 1.5s infinite; }
.sk-w80{width:80%} .sk-w60{width:60%} .sk-w40{width:40%}
.sk-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-top: 20px; }
.sk-card { height: 130px; border-radius: 8px; background: linear-gradient(90deg, var(--bd) 25%, var(--bg2) 50%, var(--bd) 75%); background-size: 1200px 100%; animation: shimmer 1.5s infinite; }

/* ── Page header + card ──────────────────────────────────── */
.page-hdr { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.page-title { font-size: 20px; font-weight: 700; }
.page-sub { font-size: 13px; color: var(--ink-soft); margin-top: 3px; }
.pt-card { background: var(--white); border: 1px solid var(--bd); border-radius: var(--radius); padding: 18px 20px; }

/* ── Impersonation banner ────────────────────────────────── */
#impersonationBanner { position: fixed; top: 0; left: 0; right: 0; z-index: 9999; background: #c8553d; color: #fff; text-align: center; font-size: 13px; font-weight: 600; padding: 7px 14px; }
#impersonationBanner a { color: #fff; text-decoration: underline; margin-left: 10px; }
body:has(#impersonationBanner) #pt-app { padding-top: 32px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width:1024px) { :root{--nav-w:200px} #pt-main{padding:16px} .hdr-org-name{display:none} .pd-health-dims{grid-template-columns:repeat(2,1fr)} .sk-cards{grid-template-columns:1fr 1fr} .land-feats{grid-template-columns:1fr 1fr;gap:24px;padding:36px 24px} }
@media (max-width:768px) { #pt-sidebar{display:none} #pt-sidebar.mobile-open{display:flex;position:fixed;top:var(--hdr-h);left:0;bottom:0;z-index:90;width:var(--nav-w)} .land-feats{grid-template-columns:1fr} .land-h1{font-size:30px} .land-nav{padding:12px 20px} .field-row{grid-template-columns:1fr} .project-grid{grid-template-columns:1fr} .pd-health-dims{grid-template-columns:repeat(2,1fr)} }

/* ── Utility ─────────────────────────────────────────────── */
.hidden{display:none!important} .muted{color:var(--ink-soft)} .faint{color:var(--ink-faint)} .accent{color:var(--accent)} .text-sm{font-size:12px} .text-xs{font-size:11px} .fw-600{font-weight:600} .mt-8{margin-top:8px} .mt-16{margin-top:16px} .mt-24{margin-top:24px} .mb-8{margin-bottom:8px} .mb-16{margin-bottom:16px} .flex{display:flex} .items-center{align-items:center} .gap-8{gap:8px} .gap-12{gap:12px}

@keyframes spin { to { transform: rotate(360deg) } }
