:root {
  --ecp-shell-bg: #f8f6fa;
  --ecp-shell-text: #25002d;
  --ecp-shell-muted: #796a80;
  --ecp-shell-border: #eee9f2;
  --ecp-shell-primary: #6b0080;
  --ecp-shell-primary-hover: #4b005a;
  --ecp-shell-active: #f4e7fa;
}

.admin-app[hidden] { display: none !important; }
.admin-app { min-height: 100vh; background: var(--ecp-shell-bg); color: var(--ecp-shell-text); }
.admin-sidebar {
  position: fixed; z-index: 4; inset: 0 auto 0 0; width: 72px; padding: 16px 8px;
  background: #fff; border-right: 1px solid var(--ecp-shell-border); display: flex;
  flex-direction: column; align-items: center;
}
.admin-sidebar-brand { display: grid; place-items: center; width: 56px; min-height: 52px; color: var(--ecp-shell-primary); text-decoration: none; }
.admin-brand-icon { display: block; width: 40px; height: 40px; flex: none; }
.admin-sidebar-label, .admin-sidebar-note { display: none; }
.admin-sidebar-nav { width: 100%; margin-top: 24px; display: grid; gap: 7px; }
.admin-sidebar-nav a { position: relative; display: grid; place-items: center; width: 56px; height: 48px; border-radius: 10px; color: #8c8091; text-decoration: none; transition: background .16s ease, color .16s ease; }
.admin-sidebar-nav a:hover, .admin-sidebar-nav a.active { background: var(--ecp-shell-active); color: var(--ecp-shell-primary); }
.admin-sidebar-nav a.active::before { content: ""; position: absolute; left: -8px; top: 12px; width: 3px; height: 24px; border-radius: 0 3px 3px 0; background: var(--ecp-shell-primary); }
.admin-nav-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.admin-workspace { min-height: 100vh; margin-left: 72px; }
.admin-environment-strip { height: 34px; margin: 0; display: grid; place-items: center; background: #f5edfb; border-bottom: 1px solid #eee4f4; color: var(--ecp-shell-muted); font-size: 12px; letter-spacing: .01em; }
.admin-topbar { min-height: 70px; padding: 0 34px 0 42px; display: flex; align-items: center; justify-content: space-between; gap: 28px; background: #fff; border-bottom: 1px solid var(--ecp-shell-border); }
.admin-topbar-start, .admin-toolbar { display: flex; align-items: center; gap: 18px; min-width: 0; }
.admin-sidebar-toggle { display: inline-flex; align-items: center; gap: 9px; padding: 8px 0; border: 0; background: transparent; color: #796a80; font: inherit; cursor: pointer; }
.admin-sidebar-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.admin-sidebar-toggle span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.admin-command-search { width: min(420px, 38vw); height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 1px solid #e4dce8; border-radius: 8px; background: #fff; color: #94879a; }
.admin-command-search svg { flex: 0 0 auto; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.admin-command-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ecp-shell-text); font: inherit; font-size: 13px; }
.admin-command-search input::placeholder { color: #94879a; }
.admin-command-search kbd { padding: 3px 7px; border: 1px solid #e4dce8; border-radius: 5px; background: #faf8fb; color: #94879a; font: 11px/1.2 inherit; white-space: nowrap; }
.admin-round-action { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid #e4dce8; border-radius: 50%; background: #fff; color: #796a80; cursor: pointer; }
.admin-round-action:hover { color: var(--ecp-shell-primary); border-color: #d5b8df; }
.admin-round-action svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.admin-account-trigger { display: inline-flex; align-items: center; gap: 10px; min-height: 42px; padding: 4px 9px 4px 5px; border: 1px solid #e4dce8; border-radius: 22px; background: #fff; color: var(--ecp-shell-text); cursor: pointer; }
.admin-user-chip { display: inline-flex; align-items: center; gap: 9px; }
.admin-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--ecp-shell-primary); color: #fff; font-size: 11px; font-weight: 700; }
.admin-identity { font-size: 13px; font-weight: 600; white-space: nowrap; }
.admin-menu-chevron { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.admin-app-content { max-width: 1320px; margin: 0 auto; padding: 30px 42px 42px; }
.admin-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; margin-bottom: 24px; }
.admin-page-head h1 { margin: 4px 0 8px; color: var(--ecp-shell-text); font-size: clamp(28px, 3vw, 38px); line-height: 1.08; letter-spacing: -.035em; }
.admin-page-head .subtitle { max-width: 680px; margin: 0; color: #796a80; font-size: 15px; line-height: 1.55; }
.admin-page-head .eyebrow { margin: 0; color: var(--ecp-shell-primary); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.hero-grid, .content-grid { gap: 20px; }
.hero-card, .profile-card, .panel { border-color: #ebe5ef !important; background: #fff !important; box-shadow: 0 12px 30px rgba(54, 31, 66, .06); }
.panel { border-radius: 12px !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 900px) {
  .admin-topbar { padding: 0 20px; }
  .admin-app-content { padding: 24px 20px 32px; }
  .admin-page-head { flex-direction: column; gap: 16px; }
  .admin-command-search { width: min(360px, 44vw); }
  .admin-identity { display: none; }
}

@media (max-width: 640px) {
  .admin-sidebar { width: 60px; padding-inline: 6px; }
  .admin-sidebar-nav a { width: 48px; }
  .admin-sidebar-nav a.active::before { left: -6px; }
  .admin-workspace { margin-left: 60px; }
  .admin-environment-strip { min-height: 34px; height: auto; padding: 8px 12px; text-align: center; }
  .admin-topbar { min-height: 62px; padding: 0 12px; gap: 10px; }
  .admin-topbar-start { gap: 10px; }
  .admin-command-search { width: auto; flex: 1; }
  .admin-command-search kbd { display: none; }
  .admin-toolbar { gap: 6px; }
  .admin-round-action { width: 34px; height: 34px; }
  .admin-account-trigger { padding-right: 5px; }
  .admin-menu-chevron { display: none; }
  .admin-app-content { padding: 20px 12px 28px; }
}

.admin-sidebar-expanded .admin-sidebar { width: 236px; align-items: stretch; padding-inline: 14px; }
.admin-sidebar-expanded .admin-sidebar-brand { width: 100%; justify-content: start; gap: 10px; padding-inline: 8px; }
.admin-sidebar-expanded .admin-sidebar-label, .admin-sidebar-expanded .admin-sidebar-note { display: block; color: var(--ecp-shell-muted); font-size: 10px; }
.admin-sidebar-expanded .admin-sidebar-label { margin: 22px 8px 10px; letter-spacing: .1em; font-weight: 700; }
.admin-sidebar-expanded .admin-sidebar-note { margin: auto 8px 8px; }
.admin-sidebar-expanded .admin-sidebar-nav a { width: 100%; display: flex; justify-content: flex-start; gap: 12px; padding: 0 14px; font-size: 13px; }
.admin-sidebar-expanded .admin-sidebar-nav a.active::before { left: -14px; }
.admin-sidebar-expanded .admin-workspace { margin-left: 236px; }
.admin-account-trigger:hover { border-color: #d5b8df; color: var(--ecp-shell-primary); }
#projects-list [hidden], #ideas-list [hidden] { display: none !important; }

html[data-theme="dark"] body { background: #141119; color: #eee8f1; }
html[data-theme="dark"] .admin-app { background: #141119; color: #eee8f1; }
html[data-theme="dark"] .admin-sidebar, html[data-theme="dark"] .admin-topbar { background: #201b26; border-color: #3c3344; }
html[data-theme="dark"] .admin-avatar { background: #853a9c; }
html[data-theme="dark"] .admin-sidebar-nav a { color: #c1b7c8; }
html[data-theme="dark"] .admin-sidebar-nav a:hover, html[data-theme="dark"] .admin-sidebar-nav a.active { background: #392543; color: #d897ed; }
html[data-theme="dark"] .admin-sidebar-nav a.active::before { background: #d897ed; }
html[data-theme="dark"] .admin-environment-strip { background: #261d2f; border-color: #3c3344; color: #c1b7c8; }
html[data-theme="dark"] .admin-sidebar-toggle, html[data-theme="dark"] .admin-sidebar-label, html[data-theme="dark"] .admin-sidebar-note { color: #c1b7c8; }
html[data-theme="dark"] .admin-command-search, html[data-theme="dark"] .admin-round-action, html[data-theme="dark"] .admin-account-trigger { background: #29222f; border-color: #4b3d55; color: #eee8f1; }
html[data-theme="dark"] .admin-command-search input { color: #eee8f1; }
html[data-theme="dark"] .admin-command-search input::placeholder, html[data-theme="dark"] .admin-command-search kbd { color: #a79aaf; }
html[data-theme="dark"] .admin-command-search kbd { background: #201b26; border-color: #4b3d55; }
html[data-theme="dark"] .admin-page-head h1, html[data-theme="dark"] .panel h3, html[data-theme="dark"] .hero-content h2, html[data-theme="dark"] .profile-row strong, html[data-theme="dark"] .project-item strong, html[data-theme="dark"] .idea-title strong, html[data-theme="dark"] .setup-row strong, html[data-theme="dark"] .readiness-row strong { color: #eee8f1; }
html[data-theme="dark"] .admin-page-head .subtitle, html[data-theme="dark"] .hero-content p, html[data-theme="dark"] .profile-row small, html[data-theme="dark"] .muted-note, html[data-theme="dark"] .idea-item p, html[data-theme="dark"] .project-item p, html[data-theme="dark"] .setup-row small, html[data-theme="dark"] .readiness-row small, html[data-theme="dark"] .activity-row .event, html[data-theme="dark"] footer { color: #c1b7c8; }
html[data-theme="dark"] .hero-card, html[data-theme="dark"] .profile-card, html[data-theme="dark"] .panel, html[data-theme="dark"] .metric { background: #201b26 !important; border-color: #3c3344 !important; box-shadow: 0 12px 30px rgba(0, 0, 0, .22); }
html[data-theme="dark"] .idea-form, html[data-theme="dark"] .disclaimer { background: #29222f; border-color: #3c3344; color: #c1b7c8; }
html[data-theme="dark"] .idea-form input, html[data-theme="dark"] .idea-form textarea, html[data-theme="dark"] .idea-form select, html[data-theme="dark"] .project-create input { background: #29222f; border-color: #4b3d55; color: #eee8f1; }
html[data-theme="dark"] .idea-actions button, html[data-theme="dark"] .ghost, html[data-theme="dark"] .outline, html[data-theme="dark"] .icon-button { background: #29222f; border-color: #4b3d55; color: #d897ed; }
html[data-theme="dark"] .profile-row, html[data-theme="dark"] .idea-item, html[data-theme="dark"] .project-item, html[data-theme="dark"] .setup-row, html[data-theme="dark"] .readiness-row, html[data-theme="dark"] .activity-row { border-color: #3c3344; }
html[data-theme="dark"] .profile-icon.violet { background: #392543; color: #d897ed; }
html[data-theme="dark"] .profile-icon.blue { background: #262c44; color: #aab7ff; }
html[data-theme="dark"] .profile-icon.orange { background: #40351e; color: #f1ce7e; }
html[data-theme="dark"] .tag, html[data-theme="dark"] .count, html[data-theme="dark"] .status-badge { background: #392543; border-color: #563461; color: #d897ed; }
html[data-theme="dark"] .status-badge.amber { background: #40351e; border-color: #635333; color: #f1ce7e; }
html[data-theme="dark"] .pill.green { color: #83dfbc; background: #203b32; }
html[data-theme="dark"] .risk { color: #f1ce7e; border-color: #635333; }
html[data-theme="dark"] .metric .label, html[data-theme="dark"] .metric .delta { color: #c1b7c8; }
html[data-theme="dark"] .toast { background: #3b2c46; border-color: #563461; color: #f8effd; }
html[data-theme="dark"] :focus-visible { outline-color: #d897ed; }

.budget-summary { margin: 0 0 12px; border: 1px solid #eee8f1; border-radius: 8px; padding: 12px; background: #fbfafd; color: #746c79; font-size: 12px; }
.budget-summary strong { color: #24152f; }
.budget-summary small { display: block; margin-top: 4px; color: #746c79; }
html[data-theme="dark"] .budget-summary { border-color: #3c3344; background: #29222f; color: #c1b7c8; }
html[data-theme="dark"] .budget-summary strong, html[data-theme="dark"] .budget-summary small { color: #eee8f1; }

.project-repo-bind { display: grid; gap: 7px; margin-top: 18px; padding-top: 16px; border-top: 1px solid #eee8f1; }
.project-repo-bind h4 { margin: 0 0 3px; color: #7627a0; font-size: 13px; }
.project-repo-bind label { color: #5c5262; font-size: 11px; font-weight: 650; }
.project-repo-bind input, .project-repo-bind select { width: 100%; min-width: 0; border: 1px solid #e6dfe9; border-radius: 6px; padding: 9px; background: #fff; color: #24152f; font: inherit; }
.project-repo-bind .muted-note { margin: 0; line-height: 1.45; }
.project-repo-state { margin-top: 7px; overflow-wrap: anywhere; }
.project-policy-state { display: grid; justify-items: start; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #eee8f1; }
.project-policy-state > strong { color: #7627a0; font-size: 12px; }
.project-policy-state p { margin: 0; line-height: 1.45; }
.project-policy-state button { margin-top: 2px; }
html[data-theme="dark"] .project-repo-bind { border-color: #3c3344; }
html[data-theme="dark"] .project-repo-bind h4 { color: #d897ed; }
html[data-theme="dark"] .project-repo-bind label { color: #c1b7c8; }
html[data-theme="dark"] .project-repo-bind input, html[data-theme="dark"] .project-repo-bind select { border-color: #4b3d55; background: #29222f; color: #eee8f1; }
html[data-theme="dark"] .project-policy-state { border-color: #3c3344; }
html[data-theme="dark"] .project-policy-state > strong { color: #d897ed; }

@media (max-width: 640px) {
  .admin-sidebar-expanded .admin-sidebar { width: min(236px, calc(100vw - 60px)); box-shadow: 14px 0 35px rgba(37, 0, 45, .15); }
  .admin-sidebar-expanded .admin-workspace { margin-left: 60px; }
  .admin-sidebar-expanded .admin-sidebar-nav a { width: 100%; }
}

.scope-dialog { width: min(760px, calc(100% - 28px)); max-height: min(90vh, 900px); overflow: auto; border: 1px solid #e7deeb; border-radius: 16px; padding: 24px; color: #24152f; background: #fff; box-shadow: 0 28px 90px rgba(29, 12, 37, .26); }
.scope-dialog::backdrop { background: rgba(27, 17, 34, .58); backdrop-filter: blur(3px); }
.scope-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.scope-dialog-head h2 { margin: 0 0 8px; color: #24152f; font-size: 22px; }
.scope-dialog-head p:last-child { max-width: 600px; margin: 0 0 18px; color: #726b78; font-size: 13px; line-height: 1.55; }
.scope-close, .scope-remove { border: 0; background: transparent; color: #7627a0; cursor: pointer; }
.scope-close { font-size: 25px; line-height: 1; }
.scope-item { margin: 12px 0; padding: 16px; border: 1px solid #ebe4ef; border-radius: 10px; background: #fcfafd; }
.scope-item-head, .scope-dialog-actions, .scope-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.scope-item-head { margin-bottom: 12px; color: #7627a0; font-size: 12px; }
.scope-remove { font-size: 11px; text-decoration: underline; }
.scope-label { display: grid; gap: 6px; margin: 10px 0; color: #5c5262; font-size: 11px; font-weight: 650; }
.scope-input, .scope-textarea { width: 100%; min-width: 0; border: 1px solid #e3dbe8; border-radius: 7px; padding: 10px 11px; color: #24152f; background: #fff; font: inherit; font-size: 13px; }
.scope-textarea { min-height: 62px; resize: vertical; }
.scope-weight-row { display: grid; grid-template-columns: minmax(100px, .35fr) 1fr; gap: 12px; }
.scope-weight-total { color: #7627a0; font-size: 11px; font-weight: 700; }
.scope-footer { justify-content: flex-end; margin-top: 18px; }
.scope-caveat { margin: 14px 0 0; color: #746c79; font-size: 10px; line-height: 1.5; }
.scope-form-error { color: #b34b59; font-size: 12px; }
.run-progress { margin: 10px 0 12px; padding: 10px; border-radius: 8px; background: #f8f4fa; }
.run-progress-head { display: flex; justify-content: space-between; gap: 10px; color: #5f5266; font-size: 11px; }
.run-progress-track { height: 7px; margin: 8px 0 5px; overflow: hidden; border-radius: 99px; background: #e8e0eb; }
.run-progress-fill { height: 100%; border-radius: inherit; background: #7627a0; transition: width .2s ease; }
.run-progress-note { color: #817686; font-size: 10px; line-height: 1.45; }
.run-deliverables { display: grid; gap: 8px; margin-top: 10px; }
.run-deliverable { padding: 10px; border: 1px solid #eee7f1; border-radius: 8px; }
.run-deliverable-title { display: flex; justify-content: space-between; gap: 8px; color: #302438; font-size: 11px; font-weight: 700; }
.run-deliverable p { margin: 6px 0; color: #726b78; font-size: 10px; line-height: 1.45; }
.run-deliverable-meta { color: #817686; font-size: 9px; }
.run-deliverable-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.run-deliverable-actions button { border: 1px solid #e0d6e7; border-radius: 6px; padding: 5px 8px; background: #fff; color: #7627a0; cursor: pointer; font-size: 10px; }
html[data-theme="dark"] .scope-dialog { border-color: #4b3d55; color: #eee8f1; background: #211a26; }
html[data-theme="dark"] .scope-dialog-head h2, html[data-theme="dark"] .run-deliverable-title { color: #eee8f1; }
html[data-theme="dark"] .scope-dialog-head p:last-child, html[data-theme="dark"] .scope-caveat, html[data-theme="dark"] .run-progress-note, html[data-theme="dark"] .run-deliverable p { color: #c1b7c8; }
html[data-theme="dark"] .scope-item, html[data-theme="dark"] .run-progress { border-color: #44364d; background: #2b2331; }
html[data-theme="dark"] .scope-input, html[data-theme="dark"] .scope-textarea { border-color: #514359; color: #f1eaf4; background: #211a26; }
html[data-theme="dark"] .run-progress-track { background: #4a3c51; }
html[data-theme="dark"] .run-progress-head, html[data-theme="dark"] .run-deliverable-meta { color: #c1b7c8; }
html[data-theme="dark"] .run-deliverable, html[data-theme="dark"] .run-deliverable-actions button { border-color: #4b3d55; background: #29222f; color: #d897ed; }
.operational-alerts-button { position: relative; }
.operational-alerts-count { position: absolute; top: -4px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 99px; background: #d82b58; color: #fff; font-size: 9px; font-weight: 700; line-height: 1; }
.operational-alerts-count[hidden] { display: none; }
.operational-alerts-dialog { width: min(620px, calc(100% - 28px)); }
.operational-alerts-list { display: grid; gap: 10px; }
.operational-notice { padding: 12px 14px; border: 1px solid #eee3ef; border-left: 3px solid #d39822; border-radius: 9px; background: #fcfafd; }
.operational-notice.critical { border-left-color: #d82b58; }
.operational-notice-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: #302438; font-size: 12px; }
.operational-notice-head span { color: #827889; font-size: 10px; text-align: right; }
.operational-notice p { margin: 6px 0 0; color: #726b78; font-size: 12px; line-height: 1.5; }
.operational-notice.is-read { opacity: .76; }
.notice-mark-read { margin-top: 10px; padding: 5px 9px; border: 1px solid #e0d6e7; border-radius: 6px; background: #fff; color: #7627a0; font: inherit; font-size: 11px; cursor: pointer; }
.notice-read-state { display: inline-block; margin-top: 9px; color: #68766e; font-size: 10px; }
html[data-theme="dark"] .operational-alerts-count { border-color: #29222f; }
html[data-theme="dark"] .operational-notice { border-color: #4b3d55; border-left-color: #d39822; background: #2b2331; }
html[data-theme="dark"] .operational-notice.critical { border-left-color: #e65a77; }
html[data-theme="dark"] .operational-notice-head { color: #eee8f1; }
html[data-theme="dark"] .operational-notice-head span, html[data-theme="dark"] .operational-notice p { color: #c1b7c8; }
html[data-theme="dark"] .notice-mark-read { border-color: #5b4c64; background: #302737; color: #dfb5f0; }
html[data-theme="dark"] .notice-read-state { color: #b4c9bb; }
@media(max-width:560px){.scope-dialog{padding:16px}.scope-weight-row{grid-template-columns:1fr}.scope-dialog-actions{align-items:flex-start;flex-direction:column}}
