/* ==========================================================
 IMPACTOS COMMAND CENTER — PREMIUM DARK EDITION
 Production-ready styles for all 6 engines + UI components
 Version: 5.0 Final (Dec 2024)
========================================================== */




/* ----------------- FONTS ----------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');




/* ----------------- CSS VARIABLES ----------------- */
:root {
/* Background layers */
--bg-base: #050814;
--bg-elevated: #0d1222;
--bg-card: rgba(15, 23, 42, 0.75);
--bg-glass: rgba(255, 255, 255, 0.04);
 /* Borders */
--border: rgba(148, 163, 184, 0.25);
--border-soft: rgba(148, 163, 184, 0.12);
 /* Text colors */
--text: #e5ebff;
--text-dim: #9ca3c4;
--text-muted: #6b7285;
 /* Brand colors */
--brand: #4aa8ff;
--brand-hover: #6cbdff;
--brand-soft: rgba(74, 168, 255, 0.26);
 /* Status colors */
--success: #22c55e;
--danger: #ff4a4a;
--warning: #f59e0b;
 /* Radius */
--radius-lg: 16px;
--radius: 12px;
--radius-sm: 8px;
 /* Shadows */
--shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.55);
--shadow-hard: 0 8px 25px rgba(0, 0, 0, 0.75);
 /* Transitions */
--trans-fast: 0.15s ease-out;
--trans-med: 0.25s ease-out;
}




/* ----------------- RESET ----------------- */
*, *::before, *::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}




html, body {
height: 100%;
overflow-x: hidden;
}




body {
font-family: 'Inter', system-ui, -apple-system, sans-serif;
background: radial-gradient(
  circle at top,
  #050814 0%,
  #020510 38%,
  #02030a 100%
);
color: var(--text);
line-height: 1.5;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}




html {
scroll-behavior: smooth;
}




button, input, textarea, select {
font: inherit;
color: inherit;
border: none;
outline: none;
background: none;
}




/* Scrollbar styling */
::-webkit-scrollbar {
width: 8px;
height: 8px;
}




::-webkit-scrollbar-thumb {
background: rgba(148, 163, 184, 0.4);
border-radius: 999px;
}




::-webkit-scrollbar-track {
background: transparent;
}




/* ----------------- BACKGROUND GLOW ----------------- */
body::before {
content: "";
position: fixed;
inset: 0;
z-index: -2;
background:
  radial-gradient(circle at 10% 10%, rgba(74, 168, 255, 0.18), transparent 60%),
  radial-gradient(circle at 88% 80%, rgba(74, 222, 128, 0.14), transparent 55%);
filter: blur(70px);
opacity: 0.9;
pointer-events: none;
animation: floatGlow 14s ease-in-out infinite alternate;
}




@keyframes floatGlow {
from {
  transform: translateY(0);
  opacity: 0.7;
}
to {
  transform: translateY(-26px);
  opacity: 1;
}
}




/* ----------------- APP SHELL ----------------- */
.app-shell {
display: grid;
grid-template-columns: 260px minmax(0, 1fr);
gap: 0;
min-height: 100vh;
position: relative;
}




/* ----------------- SIDEBAR ----------------- */
.sidebar {
background: rgba(15, 23, 42, 0.92);
border-right: 1px solid rgba(148, 163, 184, 0.35);
box-shadow: var(--shadow-soft);
padding: 20px 14px;
position: sticky;
top: 0;
height: 100vh;
display: flex;
flex-direction: column;
overflow-y: auto;
z-index: 100;
}




.sidebar-header {
margin-bottom: 24px;
}




.brand-lockup {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 16px;
}




.brand-mark {
width: 32px;
height: 32px;
border-radius: 8px;
background: radial-gradient(circle at 30% 10%, #ffffff, var(--brand));
box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.7),
            0 0 22px rgba(74, 168, 255, 0.7);
display: flex;
align-items: center;
justify-content: center;
font-weight: 700;
font-size: 14px;
color: #020617;
}




.brand-text {
display: flex;
flex-direction: column;
}




.brand-title {
font-weight: 650;
letter-spacing: 0.04em;
font-size: 0.92rem;
color: var(--text);
}




.brand-subtitle {
font-size: 0.76rem;
color: var(--text-dim);
}




#theme-toggle-btn {
padding: 6px 10px;
border-radius: var(--radius-sm);
background: rgba(15, 23, 42, 0.8);
border: 1px solid var(--border-soft);
color: var(--text-dim);
font-size: 0.78rem;
cursor: pointer;
transition: all var(--trans-fast);
}




#theme-toggle-btn:hover {
background: rgba(15, 23, 42, 1);
border-color: var(--border);
}




/* Navigation */
.sidebar-nav {
flex: 1;
overflow-y: auto;
}




.nav-item {
width: 100%;
text-align: left;
border-radius: var(--radius);
padding: 0.65rem 0.8rem;
margin-bottom: 4px;
background: transparent;
border: 1px solid transparent;
color: var(--text-dim);
font-size: 0.9rem;
cursor: pointer;
display: flex;
justify-content: space-between;
align-items: center;
transition: all var(--trans-fast);
}




.nav-item:hover {
background: rgba(15, 23, 42, 0.9);
border-color: rgba(148, 163, 184, 0.55);
transform: translateY(-1px);
}




.nav-item.active {
background: radial-gradient(
  circle at top left,
  rgba(74, 168, 255, 0.45),
  rgba(15, 23, 42, 1)
);
border-color: rgba(148, 163, 184, 0.75);
color: #f9fafb;
}




.nav-label {
pointer-events: none;
}




/* Sidebar footer */
.sidebar-footer {
margin-top: auto;
padding-top: 16px;
border-top: 1px solid var(--border-soft);
}




.edition-switcher {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
}




.edition-label {
font-size: 0.82rem;
color: var(--text-dim);
}




#edition-toggle-btn {
padding: 4px 8px;
font-size: 0.75rem;
border-radius: var(--radius-sm);
background: rgba(15, 23, 42, 0.8);
border: 1px solid var(--border-soft);
color: var(--text-dim);
cursor: pointer;
}




.sidebar-secondary-btn {
width: 100%;
padding: 8px;
margin-bottom: 8px;
border-radius: var(--radius-sm);
background: rgba(15, 23, 42, 0.8);
border: 1px solid var(--border-soft);
color: var(--text-dim);
font-size: 0.85rem;
cursor: pointer;
transition: all var(--trans-fast);
}




.sidebar-secondary-btn:hover {
background: rgba(15, 23, 42, 1);
border-color: var(--border);
}




.sidebar-meta {
margin-top: 12px;
}




.credits-pill {
padding: 6px 12px;
border-radius: 999px;
border: 1px solid rgba(148, 163, 184, 0.45);
background: rgba(15, 23, 42, 0.75);
font-size: 0.78rem;
color: var(--text-dim);
text-align: center;
display: block;
}




/* ----------------- MAIN CONTENT ----------------- */
.main-content {
padding: 0;
background: var(--bg-base);
min-height: 100vh;
overflow-y: auto;
}




/* Credits banner */
.credits-banner {
background: linear-gradient(135deg, #ff4a4a, #ff6b6b);
color: white;
padding: 12px 20px;
text-align: center;
font-weight: 600;
font-size: 0.9rem;
box-shadow: 0 4px 12px rgba(255, 74, 74, 0.3);
}




/* Hero strip */
.hero-strip {
padding: 40px 32px;
border-bottom: 1px solid var(--border-soft);
background: linear-gradient(
  to bottom,
  rgba(15, 23, 42, 0.5),
  transparent
);
}




.hero-left {
max-width: 900px;
}




.hero-title {
font-size: clamp(1.8rem, 3vw, 2.4rem);
font-weight: 700;
margin-bottom: 8px;
color: var(--text);
}




.hero-subtitle {
color: var(--text-dim);
font-size: 1rem;
max-width: 640px;
}




.hero-meta-row {
margin-top: 24px;
display: flex;
gap: 20px;
align-items: center;
}




.hero-health {
background: rgba(15, 23, 42, 0.8);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 16px;
display: flex;
align-items: center;
gap: 12px;
}




.hero-health-dot {
width: 10px;
height: 10px;
border-radius: 50%;
background: var(--success);
}




.hero-health-label {
font-size: 0.9rem;
font-weight: 600;
}




.hero-health-meta {
font-size: 0.75rem;
color: var(--text-muted);
margin-left: auto;
}




.hero-health-spark {
margin-left: 12px;
}




.hero-plan-box {
background: rgba(15, 23, 42, 0.8);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 16px;
}




.hero-plan-open-btn {
margin-top: 8px;
padding: 6px 12px;
border-radius: var(--radius-sm);
background: var(--brand);
color: white;
font-size: 0.8rem;
font-weight: 600;
cursor: pointer;
transition: all var(--trans-fast);
}




.hero-plan-open-btn:hover {
background: var(--brand-hover);
}




/* ----------------- PANELS ----------------- */
.panel {
display: none;
padding: 40px 32px;
}




.panel-active {
display: block;
animation: fadeInUp 0.25s ease-out;
}




@keyframes fadeInUp {
from {
  opacity: 0;
  transform: translateY(6px);
}
to {
  opacity: 1;
  transform: translateY(0);
}
}




.panel-header {
margin-bottom: 24px;
}




.panel-header h2 {
font-size: 1.6rem;
font-weight: 650;
margin-bottom: 6px;
color: var(--text);
}




.panel-header p {
color: var(--text-dim);
font-size: 0.94rem;
}




.panel-header-actions {
display: flex;
gap: 12px;
align-items: center;
margin-top: 12px;
}




/* Output toggles */
.output-toggle {
display: flex;
gap: 6px;
}




.output-mode-btn {
padding: 6px 12px;
border-radius: 999px;
border: 1px solid var(--border-soft);
background: rgba(15, 23, 42, 0.9);
color: var(--text-dim);
font-size: 0.8rem;
cursor: pointer;
transition: all var(--trans-fast);
}




.output-mode-btn:hover {
background: rgba(15, 23, 42, 1);
border-color: var(--border);
}




.output-mode-btn.active {
background: radial-gradient(
  circle at top,
  var(--brand-soft),
  rgba(15, 23, 42, 1)
);
border-color: rgba(148, 163, 184, 0.75);
color: #f9fafb;
}




/* Export menu */
.export-menu {
position: relative;
}




.export-trigger {
padding: 6px 12px;
border-radius: var(--radius-sm);
border: 1px solid var(--border-soft);
background: rgba(15, 23, 42, 0.9);
color: var(--text-dim);
font-size: 0.8rem;
cursor: pointer;
}




.export-menu-items {
display: none;
position: absolute;
top: 100%;
right: 0;
margin-top: 4px;
background: rgba(15, 23, 42, 0.98);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
box-shadow: var(--shadow-hard);
min-width: 140px;
z-index: 10;
}




.export-menu:hover .export-menu-items {
display: block;
}




.export-item {
width: 100%;
text-align: left;
padding: 8px 12px;
color: var(--text-dim);
font-size: 0.85rem;
cursor: pointer;
transition: all var(--trans-fast);
}




.export-item:hover {
background: rgba(255, 255, 255, 0.05);
color: var(--text);
}




/* ----------------- BUTTONS ----------------- */
.btn-primary {
padding: 10px 18px;
border-radius: var(--radius);
background: linear-gradient(135deg, var(--brand), var(--success));
color: #020617;
font-weight: 600;
border: none;
box-shadow: 0 12px 30px rgba(15, 23, 42, 0.72);
cursor: pointer;
transition: all var(--trans-fast);
}




.btn-primary:hover {
transform: translateY(-1px);
filter: brightness(1.08);
box-shadow: 0 16px 40px rgba(15, 23, 42, 0.82);
}




.btn-secondary {
padding: 8px 16px;
border-radius: var(--radius);
border: 1px solid var(--border);
background: rgba(15, 23, 42, 0.85);
color: var(--text);
font-weight: 500;
cursor: pointer;
transition: all var(--trans-fast);
}




.btn-secondary:hover {
background: rgba(15, 23, 42, 1);
transform: translateY(-1px);
}




.btn-tertiary {
padding: 6px 12px;
border-radius: var(--radius-sm);
border: 1px solid var(--border-soft);
background: transparent;
color: var(--text-dim);
font-size: 0.85rem;
cursor: pointer;
}




.btn-ghost {
padding: 8px 16px;
border-radius: var(--radius);
border: 1px solid rgba(148, 163, 184, 0.35);
background: rgba(15, 23, 42, 0.85);
color: var(--text);
cursor: pointer;
font-weight: 500;
transition: all var(--trans-fast);
}




.btn-ghost:hover {
background: rgba(15, 23, 42, 1);
transform: translateY(-1px);
}




.small-btn {
padding: 4px 10px;
font-size: 0.8rem;
border-radius: 999px;
}




/* ----------------- FORMS ----------------- */
.field-label {
display: block;
font-size: 0.85rem;
font-weight: 600;
margin-bottom: 6px;
color: var(--text-dim);
}




input[type="text"],
input[type="number"],
select,
textarea {
width: 100%;
padding: 10px 12px;
border-radius: var(--radius-sm);
border: 1px solid var(--border-soft);
background: rgba(15, 23, 42, 0.96);
color: var(--text);
font-size: 0.9rem;
transition: all var(--trans-fast);
}




input:focus,
select:focus,
textarea:focus {
outline: none;
border-color: var(--brand);
box-shadow: 0 0 0 2px var(--brand-soft);
}




textarea {
resize: vertical;
line-height: 1.5;
}




/* ----------------- PROMPT STUDIO ----------------- */
.prompt-layout {
display: grid;
grid-template-columns: 1fr 1.5fr;
gap: 24px;
}




.prompt-col-left,
.prompt-col-right {
display: flex;
flex-direction: column;
gap: 16px;
}




.prompt-form {
background: var(--bg-card);
border: 1px solid var(--border-soft);
border-radius: var(--radius-lg);
padding: 20px;
backdrop-filter: blur(18px);
}




.prompt-form textarea {
min-height: 150px;
}




.prompt-form-footer {
display: flex;
gap: 10px;
margin-top: 12px;
}




.prompt-summary {
background: var(--bg-card);
border: 1px solid var(--border-soft);
border-radius: var(--radius-lg);
padding: 16px;
}




.prompt-summary h3 {
font-size: 0.9rem;
margin-bottom: 12px;
color: var(--text-dim);
}




.prompt-summary-row {
display: flex;
justify-content: space-between;
padding: 8px 0;
border-bottom: 1px solid var(--border-soft);
}




.prompt-summary-row:last-child {
border-bottom: none;
}




.summary-label {
font-size: 0.85rem;
color: var(--text-muted);
}




.summary-value {
font-size: 0.85rem;
font-weight: 600;
color: var(--text);
}




.prompt-smart-output,
.prompt-raw-output {
background: var(--bg-card);
border: 1px solid var(--border-soft);
border-radius: var(--radius-lg);
padding: 20px;
min-height: 300px;
}




.prompt-smart-body {
font-size: 0.95rem;
line-height: 1.6;
color: var(--text);
}




.prompt-raw-output {
background: #020617;
color: #e5e7eb;
font-family: ui-monospace, monospace;
font-size: 0.85rem;
white-space: pre-wrap;
overflow-x: auto;
}




.placeholder-text {
color: var(--text-muted);
font-style: italic;
}




.prompt-followup-shell {
background: var(--bg-card);
border: 1px solid var(--border-soft);
border-radius: var(--radius-lg);
padding: 16px;
}




.prompt-followup-shell h3 {
font-size: 0.9rem;
margin-bottom: 10px;
color: var(--text-dim);
}




.prompt-followup-panel {
min-height: 100px;
}




.prompt-followup-empty {
color: var(--text-muted);
font-size: 0.85rem;
}




/* ----------------- BUSINESS HEALTH ----------------- */
.bizhealth-layout {
display: grid;
grid-template-columns: 1fr 1.3fr;
gap: 24px;
}




.bizhealth-form {
background: var(--bg-card);
border: 1px solid var(--border-soft);
border-radius: var(--radius-lg);
padding: 20px;
}




.field-group {
margin-bottom: 16px;
}




.biz-kpi-table {
display: flex;
flex-direction: column;
gap: 8px;
}




.biz-kpi-row {
display: grid;
grid-template-columns: 2fr 1fr 1fr 1.2fr;
gap: 8px;
}




.kpi-name,
.kpi-current,
.kpi-goal,
.kpi-status {
padding: 8px 10px;
border-radius: var(--radius-sm);
border: 1px solid var(--border-soft);
background: rgba(15, 23, 42, 0.96);
font-size: 0.85rem;
}




.reserves-row {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 12px;
}




.form-footer {
margin-top: 16px;
display: flex;
gap: 10px;
}




.bizhealth-thermo-shell {
margin-top: 20px;
padding: 16px;
background: var(--bg-card);
border: 1px solid var(--border-soft);
border-radius: var(--radius-lg);
}




.thermo-label {
font-size: 0.85rem;
margin-bottom: 8px;
color: var(--text-dim);
}




.thermo {
display: flex;
gap: 6px;
height: 12px;
}




.thermo-segment {
flex: 1;
border-radius: 4px;
background: rgba(148, 163, 184, 0.2);
transition: all var(--trans-med);
}




.thermo-segment.active {
background: var(--brand);
}




.bizhealth-smart-output,
.bizhealth-raw-output {
background: var(--bg-card);
border: 1px solid var(--border-soft);
border-radius: var(--radius-lg);
padding: 20px;
}




.bizhealth-metrics-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 16px;
margin-top: 16px;
}




.metric-block {
background: rgba(15, 23, 42, 0.9);
padding: 12px;
border-radius: var(--radius);
}




.metric-label {
font-size: 0.8rem;
color: var(--text-muted);
margin-bottom: 6px;
}




.metric-bar {
width: 100%;
height: 6px;
background: rgba(148, 163, 184, 0.2);
border-radius: 999px;
overflow: hidden;
}




.metric-bar-fill {
height: 100%;
background: var(--brand);
transition: width 0.5s ease;
}




.metric-text {
font-size: 0.8rem;
margin-top: 4px;
color: var(--text-dim);
}




.bizhealth-drilldowns {
margin-top: 16px;
}




/* History drawer */
.bizhistory-drawer {
position: fixed;
top: 0;
right: -400px;
width: 380px;
height: 100vh;
background: var(--bg-elevated);
border-left: 1px solid var(--border);
box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
padding: 24px;
overflow-y: auto;
transition: right 0.35s ease;
z-index: 200;
}




.bizhistory-drawer.active {
right: 0;
}




.bizhistory-drawer h3 {
margin-bottom: 16px;
font-size: 1.2rem;
}




.bizhistory-list {
display: flex;
flex-direction: column;
gap: 12px;
}




/* ----------------- DEPARTMENT BUILDER ----------------- */
.dept-layout {
display: grid;
grid-template-columns: 1fr 1.5fr;
gap: 24px;
}




.dept-form {
background: var(--bg-card);
border: 1px solid var(--border-soft);
border-radius: var(--radius-lg);
padding: 20px;
}




.dept-cost-grid,
.dept-scale-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 10px;
}




.dept-summary-card {
margin-top: 20px;
background: var(--bg-card);
border: 1px solid var(--border-soft);
border-radius: var(--radius-lg);
padding: 16px;
}




.dept-summary-card h3 {
font-size: 0.9rem;
margin-bottom: 12px;
color: var(--text-dim);
}




.dept-summary-row {
display: flex;
justify-content: space-between;
padding: 8px 0;
border-bottom: 1px solid var(--border-soft);
}




.dept-summary-row:last-child {
border-bottom: none;
}




.dept-output-shell {
background: var(--bg-card);
border: 1px solid var(--border-soft);
border-radius: var(--radius-lg);
padding: 20px;
}




.dept-output-section {
margin-bottom: 20px;
}




.dept-output-section h3 {
font-size: 1rem;
margin-bottom: 10px;
color: var(--text-dim);
}




.dept-smart-body,
.dept-phasing-body {
font-size: 0.95rem;
line-height: 1.6;
}




.dept-raw-output,
.dept-diagram-output {
background: #020617;
color: #e5e7eb;
font-family: ui-monospace, monospace;
font-size: 0.85rem;
padding: 16px;
border-radius: var(--radius);
white-space: pre-wrap;
overflow-x: auto;
}




.dept-history-shell {
margin-top: 20px;
}




.history-count {
font-size: 0.8rem;
color: var(--text-muted);
margin-left: 8px;
}




.history-empty {
color: var(--text-muted);
font-size: 0.85rem;
padding: 12px;
text-align: center;
}




.history-list {
display: flex;
flex-direction: column;
gap: 10px;
}




/* ----------------- ORG ARCHITECTURE ----------------- */
.org-layout-shell {
display: grid;
grid-template-columns: 1fr 1.5fr;
gap: 24px;
}




.org-form {
background: var(--bg-card);
border: 1px solid var(--border-soft);
border-radius: var(--radius-lg);
padding: 20px;
}




.org-metrics-row {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 12px;
}




.org-dept-table {
display: flex;
flex-direction: column;
gap: 8px;
}




.org-dept-row {
display: grid;
grid-template-columns: 2fr 1fr 1fr 1fr;
gap: 8px;
}




.org-dept-name,
.org-dept-headcount,
.org-dept-type,
.org-dept-health {
padding: 8px 10px;
border-radius: var(--radius-sm);
border: 1px solid var(--border-soft);
background: rgba(15, 23, 42, 0.96);
font-size: 0.85rem;
}




.org-metrics-panel {
margin-top: 20px;
background: var(--bg-card);
border: 1px solid var(--border-soft);
border-radius: var(--radius-lg);
padding: 16px;
}




.org-metrics-panel h3 {
font-size: 0.9rem;
margin-bottom: 12px;
color: var(--text-dim);
}




.org-meter-row {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 10px;
}




.org-meter-row span:first-child {
min-width: 60px;
font-size: 0.85rem;
color: var(--text-muted);
}




.org-meter-main {
margin-top: 16px;
padding-top: 16px;
border-top: 1px solid var(--border-soft);
}




.org-output-shell {
background: var(--bg-card);
border: 1px solid var(--border-soft);
border-radius: var(--radius-lg);
padding: 20px;
}




.org-output-section {
margin-bottom: 20px;
}




.org-summary-body,
.org-smart-body {
font-size: 0.95rem;
line-height: 1.6;
}




.org-raw-output,
.org-diagram-output {
background: #020617;
color: #e5e7eb;
font-family: ui-monospace, monospace;
font-size: 0.85rem;
padding: 16px;
border-radius: var(--radius);
white-space: pre-wrap;
overflow-x: auto;
}




.org-history-shell {
margin-top: 20px;
}




/* ----------------- PEI ----------------- */
.pei-layout {
display: grid;
grid-template-columns: 1fr 1.5fr;
gap: 24px;
}




.pei-form {
background: var(--bg-card);
border: 1px solid var(--border-soft);
border-radius: var(--radius-lg);
padding: 20px;
}




.pei-metrics-row {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 12px;
}




.pei-score-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 10px;
}




.pei-score-block {
display: flex;
flex-direction: column;
gap: 6px;
}




.pei-score-block label {
font-size: 0.8rem;
color: var(--text-muted);
}




.pei-score {
padding: 8px;
border-radius: var(--radius-sm);
border: 1px solid var(--border-soft);
background: rgba(15, 23, 42, 0.96);
}




.pei-meter-shell {
margin-top: 20px;
background: var(--bg-card);
border: 1px solid var(--border-soft);
border-radius: var(--radius-lg);
padding: 16px;
}




.pei-meter-label {
font-size: 0.85rem;
margin-bottom: 8px;
color: var(--text-dim);
}




.pei-meter {
display: flex;
gap: 6px;
height: 12px;
margin-bottom: 16px;
}




.pei-meter-seg {
flex: 1;
border-radius: 4px;
background: rgba(148, 163, 184, 0.2);
}




.pei-meter-seg.active {
background: var(--brand);
}




.pei-bars {
display: flex;
flex-direction: column;
gap: 10px;
}




.pei-bar-row {
display: flex;
align-items: center;
gap: 10px;
}




.pei-bar-row span:first-child {
min-width: 80px;
font-size: 0.85rem;
color: var(--text-muted);
}




.pei-smart-output,
.pei-raw-output {
background: var(--bg-card);
border: 1px solid var(--border-soft);
border-radius: var(--radius-lg);
padding: 20px;
}




.pei-smart-body {
font-size: 0.95rem;
line-height: 1.6;
}




.peihistory-shell {
margin-top: 20px;
}




/* ----------------- TEMPLATES ----------------- */
.template-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 24px;
margin-top: 24px;
}




.template-group {
background: var(--bg-card);
border: 1px solid var(--border-soft);
border-radius: var(--radius-lg);
padding: 20px;
}




.template-group h3 {
font-size: 1rem;
margin-bottom: 14px;
color: var(--text-dim);
}




.template-item {
width: 100%;
text-align: left;
padding: 10px 14px;
margin-bottom: 8px;
border-radius: var(--radius);
background: rgba(15, 23, 42, 0.9);
border: 1px solid var(--border-soft);
color: var(--text);
font-size: 0.9rem;
cursor: pointer;
transition: all var(--trans-fast);
}




.template-item:hover {
background: rgba(15, 23, 42, 1);
border-color: var(--brand);
transform: translateY(-1px);
}




.template-note {
margin-top: 24px;
padding: 16px;
background: rgba(255, 193, 7, 0.1);
border: 1px solid rgba(255, 193, 7, 0.3);
border-radius: var(--radius);
font-size: 0.85rem;
color: var(--text-dim);
}




/* ----------------- MY PLAN ----------------- */
.myplan-container {
max-width: 800px;
}




.myplan-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 24px;
}




.myplan-card {
background: var(--bg-card);
border: 1px solid var(--border-soft);
border-radius: var(--radius-lg);
padding: 24px;
}




.myplan-card h3 {
font-size: 1.1rem;
margin-bottom: 16px;
color: var(--text);
}




.myplan-row {
display: flex;
justify-content: space-between;
padding: 10px 0;
border-bottom: 1px solid var(--border-soft);
}




.myplan-row:last-child {
border-bottom: none;
}




.myplan-actions {
margin-top: 20px;
display: flex;
flex-direction: column;
gap: 10px;
}




.myplan-list {
list-style: disc;
padding-left: 20px;
color: var(--text-dim);
font-size: 0.9rem;
}




.myplan-list li {
margin-bottom: 8px;
}




.myplan-note {
margin-top: 12px;
font-size: 0.85rem;
color: var(--text-muted);
}




/* ----------------- PRICING ----------------- */
.pricing-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 28px;
margin-top: 32px;
}




.pricing-grid-medium {
max-width: 1000px;
margin-left: auto;
margin-right: auto;
}




.pricing-card {
background: var(--bg-card);
border: 1px solid var(--border-soft);
border-radius: var(--radius-lg);
padding: 28px;
box-shadow: var(--shadow-soft);
transition: all var(--trans-med);
}




.pricing-card:hover {
transform: translateY(-4px);
box-shadow: 0 24px 55px rgba(0, 0, 0, 0.65);
}




.pricing-card-featured {
border-color: var(--brand);
box-shadow: 0 0 0 1px var(--brand-soft);
}




.pricing-card-header h3 {
font-size: 1.4rem;
margin-bottom: 8px;
}




.pricing-price {
font-size: 2rem;
font-weight: 700;
color: var(--brand);
margin: 12px 0;
}




.pricing-tagline {
font-size: 0.9rem;
color: var(--text-dim);
margin-bottom: 20px;
}




.pricing-features {
list-style: none;
margin: 20px 0;
}




.pricing-features li {
padding: 8px 0;
padding-left: 24px;
position: relative;
font-size: 0.9rem;
color: var(--text-dim);
}




.pricing-features li::before {
content: "✓";
position: absolute;
left: 0;
color: var(--success);
font-weight: 700;
}




.pricing-meta {
margin-top: 16px;
padding-top: 16px;
border-top: 1px solid var(--border-soft);
}




.pricing-credits {
font-size: 0.85rem;
color: var(--text-muted);
}




.pricing-footer-note {
margin-top: 40px;
padding: 20px;
background: rgba(255, 193, 7, 0.1);
border: 1px solid rgba(255, 193, 7, 0.3);
border-radius: var(--radius);
}




.pricing-footer-note p {
font-size: 0.9rem;
color: var(--text-dim);
}




/* ----------------- FAQ ----------------- */
.faq-grid {
display: flex;
flex-direction: column;
gap: 16px;
max-width: 900px;
}




.faq-item {
background: var(--bg-card);
border: 1px solid var(--border-soft);
border-radius: var(--radius);
padding: 16px;
}




.faq-question {
font-size: 1rem;
font-weight: 600;
cursor: pointer;
color: var(--text);
}




.faq-answer {
margin-top: 12px;
padding-top: 12px;
border-top: 1px solid var(--border-soft);
color: var(--text-dim);
font-size: 0.9rem;
line-height: 1.6;
}




.faq-answer ul {
padding-left: 20px;
margin: 12px 0;
}




.faq-answer li {
margin-bottom: 6px;
}




/* ----------------- KNOWLEDGE DRAWER ----------------- */
.drawer-overlay {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.5);
opacity: 0;
pointer-events: none;
transition: opacity var(--trans-med);
z-index: 199;
}




.drawer-overlay.visible {
opacity: 1;
pointer-events: auto;
}




.drawer {
position: fixed;
top: 0;
right: -420px;
width: 400px;
height: 100vh;
background: var(--bg-elevated);
border-left: 1px solid var(--border);
box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
overflow-y: auto;
transition: right 0.35s ease;
z-index: 200;
}




.drawer.drawer-open {
right: 0;
}




.drawer-header {
padding: 20px 24px;
border-bottom: 1px solid var(--border-soft);
display: flex;
justify-content: space-between;
align-items: center;
}




.drawer-header h3 {
font-size: 1.2rem;
color: var(--text);
}




.drawer-close {
background: none;
border: none;
color: var(--text-dim);
font-size: 1.5rem;
cursor: pointer;
transition: color var(--trans-fast);
}




.drawer-close:hover {
color: var(--text);
}




.drawer-body {
padding: 24px;
}




.drawer-section {
margin-bottom: 28px;
}




.drawer-section h4 {
font-size: 0.95rem;
margin-bottom: 12px;
color: var(--text-dim);
}




.drawer-status {
margin-top: 10px;
padding: 8px;
border-radius: var(--radius-sm);
font-size: 0.85rem;
text-align: center;
}




.knowledge-list,
.usage-list {
display: flex;
flex-direction: column;
gap: 10px;
}




.knowledge-item {
background: rgba(15, 23, 42, 0.9);
border: 1px solid var(--border-soft);
border-radius: var(--radius);
padding: 12px;
}




.knowledge-meta {
font-size: 0.75rem;
color: var(--text-muted);
margin-bottom: 6px;
}




.knowledge-text {
font-size: 0.85rem;
color: var(--text-dim);
}




/* ----------------- FOOTER ----------------- */
.site-footer {
border-top: 1px solid var(--border-soft);
padding: 32px 24px;
margin-top: 80px;
background: rgba(15, 23, 42, 0.5);
}




.footer-main {
display: flex;
justify-content: space-between;
margin-bottom: 12px;
color: var(--text-dim);
font-size: 0.85rem;
}




.footer-meta {
font-size: 0.75rem;
color: var(--text-muted);
}




/* ----------------- RESPONSIVE ----------------- */
@media (max-width: 1200px) {
.prompt-layout,
.bizhealth-layout,
.dept-layout,
.org-layout-shell,
.pei-layout {
  grid-template-columns: 1fr;
}
 .myplan-grid {
  grid-template-columns: 1fr;
}
}




@media (max-width: 900px) {
.app-shell {
  grid-template-columns: 1fr;
}
 .sidebar {
  position: static;
  height: auto;
  border-right: none;
  border-bottom: 1px solid var(--border-soft);
}
}




@media (max-width: 640px) {
.hero-strip,
.panel {
  padding: 24px 16px;
}
 .biz-kpi-row,
.org-dept-row {
  grid-template-columns: 1fr;
}
 .pricing-grid {
  grid-template-columns: 1fr;
}
}




/* ----------------- UTILITY CLASSES ----------------- */
.hidden {
display: none !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-width: 0;
}




/* ==========================================================
 EXECUTIVE CONSULTING OUTPUT STYLES
 Add this to the END of your styles.css
========================================================== */




/* Consulting-grade headers */
.consult-h3 {
font-size: 1.15rem;
font-weight: 700;
margin: 24px 0 12px;
padding-left: 12px;
border-left: 4px solid var(--brand);
color: #e5ebff;
letter-spacing: 0.02em;
text-transform: uppercase;
}




.consult-h4 {
font-size: 1.05rem;
font-weight: 600;
margin: 20px 0 10px;
color: #d1d5db;
letter-spacing: 0.01em;
}




/* Executive paragraphs */
.consult-p {
font-size: 0.95rem;
line-height: 1.6;
margin: 10px 0;
color: #c9d1e0;
font-weight: 400;
}




.consult-p strong {
color: #e5ebff;
font-weight: 600;
}




/* Consulting-grade lists */
.consult-ul,
.consult-ol {
margin: 12px 0 20px 20px;
padding-left: 8px;
color: #c9d1e0;
}




.consult-ul li,
.consult-ol li {
margin-bottom: 8px;
line-height: 1.55;
padding-left: 4px;
font-size: 0.93rem;
}




.consult-ul li::marker {
color: var(--brand);
font-weight: 700;
}




.consult-ol li::marker {
color: var(--brand);
font-weight: 700;
}




/* Sub-bullets (nested lists) */
.consult-ul ul,
.consult-ol ul {
margin: 8px 0 8px 16px;
}




.consult-ul ul li,
.consult-ol ul li {
font-size: 0.88rem;
color: #b4bac8;
margin-bottom: 6px;
}




/* Risk mitigation styling */
.consult-p:has(strong:contains("Risk")),
.consult-p:has(strong:contains("Critical")) {
background: rgba(255, 74, 74, 0.08);
border-left: 3px solid rgba(255, 74, 74, 0.5);
padding: 10px 12px;
border-radius: 6px;
margin: 12px 0;
}




/* Success metrics styling */
.consult-p:has(strong:contains("Success")),
.consult-p:has(strong:contains("Metrics")) {
background: rgba(34, 197, 94, 0.08);
border-left: 3px solid rgba(34, 197, 94, 0.5);
padding: 10px 12px;
border-radius: 6px;
margin: 12px 0;
}




/* Decision criteria styling */
.consult-p:has(strong:contains("Go/No-Go")),
.consult-p:has(strong:contains("Green")),
.consult-p:has(strong:contains("Yellow")),
.consult-p:has(strong:contains("Red")) {
background: rgba(74, 168, 255, 0.08);
border-left: 3px solid rgba(74, 168, 255, 0.5);
padding: 10px 12px;
border-radius: 6px;
margin: 12px 0;
}




/* Phase dividers */
.consult-h4::before {
content: "";
display: block;
width: 40px;
height: 2px;
background: linear-gradient(90deg, var(--brand), transparent);
margin-bottom: 8px;
}




/* Horizontal rule between major sections */
.consult-h3 + .consult-p {
margin-top: 16px;
}




/* Executive summary box */
.consult-h3:contains("EXECUTIVE SUMMARY") + * {
background: rgba(74, 168, 255, 0.08);
padding: 16px;
border-radius: var(--radius);
border: 1px solid rgba(74, 168, 255, 0.2);
margin: 16px 0;
}




/* Follow-up questions styling */
.consult-h3:contains("FOLLOW-UP") ~ .consult-ol {
background: rgba(255, 193, 7, 0.08);
padding: 16px 16px 16px 36px;
border-radius: var(--radius);
border-left: 3px solid rgba(255, 193, 7, 0.5);
margin: 16px 0;
}




/* Placeholder text */
.placeholder-text {
color: var(--text-muted);
font-style: italic;
text-align: center;
padding: 40px 20px;
opacity: 0.7;
}




/* Timeline indicators */
.consult-h4:contains("Weeks"),
.consult-h4:contains("Phase") {
background: linear-gradient(
  90deg,
  rgba(74, 168, 255, 0.15),
  transparent
);
padding: 8px 12px;
border-radius: 6px;
border-left: 3px solid var(--brand);
margin: 20px 0 12px;
}




/* Action items with arrows */
.consult-ul li:has([→]) {
position: relative;
padding-left: 8px;
}




/* Improve readability */
.prompt-smart-body {
max-height: 600px;
overflow-y: auto;
padding-right: 12px;
}




.prompt-smart-body::-webkit-scrollbar {
width: 6px;
}




.prompt-smart-body::-webkit-scrollbar-thumb {
background: rgba(148, 163, 184, 0.4);
border-radius: 999px;
}




.prompt-smart-body::-webkit-scrollbar-track {
background: transparent;
}




/* ==================== DEPARTMENT BUILDER - SUMMARY FIX ==================== */




/* Summary body container (NEW - was missing) */
.dept-summary-body {
margin-top: 12px;
}




.dept-summary-body p {
margin: 8px 0;
font-size: 0.95rem;
line-height: 1.6;
color: var(--text-dim);
}




.dept-summary-body p strong {
color: var(--text);
font-weight: 600;
font-size: 1rem;
}




.dept-summary-body .placeholder-text {
color: var(--text-muted);
font-style: italic;
font-size: 0.9rem;
}




/* Ensure dept-summary-card has proper spacing */
.dept-summary-card {
background: var(--bg-card);
border: 1px solid var(--border-soft);
border-radius: var(--radius-lg);
padding: 20px;
margin-bottom: 16px;
}




.dept-summary-card h3 {
font-size: 0.95rem;
font-weight: 600;
color: var(--text-dim);
margin-bottom: 12px;
text-transform: uppercase;
letter-spacing: 0.5px;
}




/* Existing dept-summary-row styles (keep as-is) */
.dept-summary-row {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 0;
border-bottom: 1px solid var(--border-soft);
}




.dept-summary-row:last-child {
border-bottom: none;
}




.dept-summary-row span:first-child {
color: var(--text-muted);
font-size: 0.85rem;
}




.dept-summary-row span:last-child {
color: var(--text);
font-weight: 600;
font-size: 0.95rem;
}




/* ==================== STATIC PANELS (PRICING & FAQ) ==================== */




/* Static panels are always visible (not controlled by router) */
.panel-static {
display: block !important;
padding: 40px 32px;
background: transparent;
}




/* Pricing Grid */
.pricing-grid {
display: grid;
gap: 24px;
margin: 32px 0;
}




.pricing-grid-medium {
grid-template-columns: repeat(3, 1fr);
}




.pricing-card {
background: var(--bg-card);
border: 1px solid var(--border-soft);
border-radius: var(--radius-lg);
padding: 24px;
transition: all var(--trans-med);
}




.pricing-card:hover {
border-color: var(--brand);
box-shadow: 0 4px 20px rgba(74, 168, 255, 0.15);
}




.pricing-card-featured {
border-color: var(--brand);
background: linear-gradient(135deg, rgba(74, 168, 255, 0.05) 0%, var(--bg-card) 100%);
position: relative;
}




.pricing-card-featured::before {
content: "Most Popular";
position: absolute;
top: -12px;
right: 24px;
background: var(--brand);
color: #fff;
font-size: 0.75rem;
font-weight: 700;
padding: 4px 12px;
border-radius: 12px;
text-transform: uppercase;
letter-spacing: 0.5px;
}




.pricing-card-header {
margin-bottom: 20px;
padding-bottom: 20px;
border-bottom: 1px solid var(--border-soft);
}




.pricing-card-header h3 {
font-size: 1.5rem;
font-weight: 700;
color: var(--text);
margin-bottom: 8px;
}




.pricing-price {
font-size: 2rem;
font-weight: 700;
color: var(--brand);
margin: 12px 0;
}




.pricing-tagline {
font-size: 0.9rem;
color: var(--text-dim);
line-height: 1.5;
}




.pricing-features {
list-style: none;
margin: 20px 0;
padding: 0;
}




.pricing-features li {
position: relative;
padding-left: 24px;
margin: 12px 0;
font-size: 0.95rem;
line-height: 1.6;
color: var(--text-dim);
}




.pricing-features li::before {
content: "✓";
position: absolute;
left: 0;
color: var(--success);
font-weight: 700;
font-size: 1.1rem;
}




.pricing-meta {
margin-top: 20px;
padding-top: 20px;
border-top: 1px solid var(--border-soft);
}




.pricing-credits {
font-size: 0.85rem;
color: var(--text-muted);
font-style: italic;
}




.pricing-footer-note {
background: rgba(74, 168, 255, 0.08);
border: 1px solid rgba(74, 168, 255, 0.2);
border-radius: var(--radius);
padding: 20px;
margin-top: 32px;
text-align: center;
}




.pricing-footer-note p {
margin: 0;
font-size: 0.95rem;
color: var(--text-dim);
line-height: 1.6;
}




.pricing-footer-note strong {
color: var(--brand);
font-weight: 600;
}




/* FAQ Grid */
.faq-grid {
display: flex;
flex-direction: column;
gap: 16px;
margin-top: 24px;
}




.faq-item {
background: var(--bg-card);
border: 1px solid var(--border-soft);
border-radius: var(--radius-lg);
padding: 20px;
transition: all var(--trans-med);
}




.faq-item[open] {
border-color: var(--brand);
box-shadow: 0 2px 12px rgba(74, 168, 255, 0.1);
}




.faq-question {
font-size: 1.05rem;
font-weight: 600;
color: var(--text);
cursor: pointer;
list-style: none;
position: relative;
padding-right: 24px;
transition: color var(--trans-med);
}




.faq-question:hover {
color: var(--brand);
}




.faq-question::after {
content: "+";
position: absolute;
right: 0;
top: 0;
font-size: 1.5rem;
font-weight: 700;
color: var(--brand);
transition: transform var(--trans-med);
}




.faq-item[open] .faq-question::after {
content: "−";
transform: rotate(180deg);
}




.faq-answer {
margin-top: 16px;
padding-top: 16px;
border-top: 1px solid var(--border-soft);
}




.faq-answer p {
margin: 12px 0;
font-size: 0.95rem;
line-height: 1.7;
color: var(--text-dim);
}




.faq-answer ul {
margin: 12px 0;
padding-left: 24px;
}




.faq-answer li {
margin: 8px 0;
line-height: 1.6;
color: var(--text-dim);
}




/* Responsive */
@media (max-width: 1024px) {
.pricing-grid-medium {
  grid-template-columns: 1fr;
}
}




@media (max-width: 768px) {
.panel-static {
  padding: 24px 16px;
}




.pricing-card-header h3 {
  font-size: 1.25rem;
}




.pricing-price {
  font-size: 1.75rem;
}
}






/* =============================================================
   ORG ARCHITECTURE ENGINE - SAFE DROP-IN CSS v2.0
   
   SAFE TO APPEND TO YOUR EXISTING styles.css
   - All styles scoped to #section-orgchart
   - Won't affect other sections
   - Uses unique class names
   - No conflicts guaranteed
   ============================================================= */

/* === ORG SECTION LAYOUT === */
#section-orgchart .org-layout-shell {
  display: grid;
  grid-template-columns: 480px 1fr;
  gap: 24px;
  margin-top: 24px;
}

#section-orgchart .org-layout-left {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

#section-orgchart .org-layout-right {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 600px;
}

/* === PREMIUM FORM STYLES === */
#section-orgchart .premium-form {
  background: var(--card-bg, #1E293B);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--border, #334155);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

#section-orgchart .form-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-light, #1E293B);
}

#section-orgchart .form-section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

#section-orgchart .form-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #E2E8F0);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}

#section-orgchart .section-icon {
  font-size: 18px;
}

/* === PREMIUM INPUT STYLES === */
#section-orgchart .premium-input,
#section-orgchart .premium-select,
#section-orgchart .premium-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--input-bg, #0F172A);
  border: 1px solid var(--border, #334155);
  border-radius: 8px;
  color: var(--text, #E2E8F0);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
}

#section-orgchart .premium-input:focus,
#section-orgchart .premium-select:focus,
#section-orgchart .premium-textarea:focus {
  outline: none;
  border-color: var(--primary, #0EA5E9);
  background: var(--bg, #0F172A);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

#section-orgchart .premium-input::placeholder,
#section-orgchart .premium-textarea::placeholder {
  color: var(--text-muted, #64748B);
}

#section-orgchart .premium-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

#section-orgchart .field-hint {
  font-size: 12px;
  color: var(--text-muted, #64748B);
  margin-top: 4px;
  display: block;
}

#section-orgchart .panel-subtitle {
  font-size: 14px;
  color: var(--text-secondary, #94A3B8);
  margin-top: 8px;
}

/* === ORG METRICS GRID === */
#section-orgchart .org-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* === DEPARTMENT TABLE === */
#section-orgchart .org-dept-table {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--input-bg, #0F172A);
  border-radius: 8px;
  border: 1px solid var(--border, #334155);
  overflow: hidden;
}

#section-orgchart .org-dept-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr 1.5fr 40px;
  gap: 12px;
  padding: 12px 16px;
  background: var(--card-bg, #1E293B);
  border-bottom: 1px solid var(--border, #334155);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, #64748B);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#section-orgchart .org-dept-body {
  display: flex;
  flex-direction: column;
}

#section-orgchart .org-dept-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr 1.5fr 40px;
  gap: 12px;
  padding: 12px 16px;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s ease;
}

#section-orgchart .org-dept-row:last-child {
  border-bottom: none;
}

#section-orgchart .org-dept-row:hover {
  background: var(--hover-bg, #334155);
}

#section-orgchart .org-dept-row input,
#section-orgchart .org-dept-row select {
  margin: 0;
  padding: 8px 10px;
  font-size: 13px;
  background: var(--bg, #0F172A);
  border: 1px solid var(--border, #334155);
  border-radius: 6px;
  color: var(--text, #E2E8F0);
}

#section-orgchart .btn-add-dept {
  padding: 6px 12px;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid var(--primary, #0EA5E9);
  border-radius: 6px;
  color: var(--primary, #0EA5E9);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

#section-orgchart .btn-add-dept:hover {
  background: var(--primary, #0EA5E9);
  color: white;
}

#section-orgchart .btn-remove-dept {
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border, #334155);
  border-radius: 6px;
  color: var(--text-muted, #64748B);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

#section-orgchart .btn-remove-dept:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--error, #EF4444);
  color: var(--error, #EF4444);
}

#section-orgchart .btn-generate {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--primary, #0EA5E9), var(--accent, #10B981));
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#section-orgchart .btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(14, 165, 233, 0.3);
}

#section-orgchart .btn-icon {
  font-size: 18px;
}

/* === PREMIUM METRICS PANEL === */
#section-orgchart .premium-metrics {
  background: var(--card-bg, #1E293B);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--border, #334155);
}

#section-orgchart .metrics-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #E2E8F0);
  margin: 0 0 20px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

#section-orgchart .metrics-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#section-orgchart .metric-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#section-orgchart .metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#section-orgchart .metric-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary, #94A3B8);
}

#section-orgchart .metric-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary, #0EA5E9);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
}

#section-orgchart .metric-bar {
  height: 8px;
  background: var(--input-bg, #0F172A);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

#section-orgchart .metric-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary, #0EA5E9), var(--accent, #10B981));
  border-radius: 4px;
  transition: width 0.8s ease, background 0.3s ease;
  position: relative;
}

#section-orgchart .metric-bar-fill.risk-bar {
  background: linear-gradient(90deg, var(--success, #10B981), var(--warning, #F59E0B), var(--error, #EF4444));
}

#section-orgchart .metric-bar-large {
  height: 12px;
}

#section-orgchart .metric-description {
  font-size: 12px;
  color: var(--text-muted, #64748B);
  margin: 0;
}

#section-orgchart .metric-item.metric-main {
  padding-top: 16px;
  border-top: 1px solid var(--border, #334155);
}

#section-orgchart .metric-level {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent, #10B981);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
}

/* === PREMIUM OUTPUT STYLES === */
#section-orgchart .premium-output {
  background: var(--card-bg, #1E293B);
  border-radius: 12px;
  border: 1px solid var(--border, #334155);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 400px;
}

#section-orgchart .org-output-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#section-orgchart .section-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border, #334155);
}

#section-orgchart .section-header-flex h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #E2E8F0);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

#section-orgchart .section-badge {
  padding: 4px 10px;
  background: rgba(14, 165, 233, 0.1);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary, #0EA5E9);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Summary Section */
#section-orgchart .summary-section {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border, #334155);
}

#section-orgchart .org-summary-body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary, #94A3B8);
}

#section-orgchart .org-summary-body p {
  margin: 0 0 12px 0;
}

#section-orgchart .org-summary-body p:last-child {
  margin-bottom: 0;
}

#section-orgchart .org-summary-body strong {
  color: var(--text, #E2E8F0);
  font-weight: 600;
}

/* Smart Layout */
#section-orgchart .org-smart-body {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary, #94A3B8);
}

#section-orgchart .org-smart-body h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text, #E2E8F0);
  margin: 24px 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#section-orgchart .org-smart-body h2:first-child {
  margin-top: 0;
}

#section-orgchart .org-smart-body h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #E2E8F0);
  margin: 20px 0 10px 0;
}

#section-orgchart .org-smart-body h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary, #0EA5E9);
  margin: 16px 0 8px 0;
}

#section-orgchart .org-smart-body p {
  margin: 0 0 12px 0;
}

#section-orgchart .org-smart-body ul {
  margin: 0 0 16px 0;
  padding-left: 24px;
}

#section-orgchart .org-smart-body li {
  margin-bottom: 6px;
  line-height: 1.6;
}

#section-orgchart .org-smart-body strong {
  color: var(--text, #E2E8F0);
  font-weight: 600;
}

/* Raw Output */
#section-orgchart .org-raw-output {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary, #94A3B8);
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0;
  padding: 20px;
  background: var(--input-bg, #0F172A);
  border-radius: 8px;
  border: 1px solid var(--border, #334155);
  max-height: 600px;
  overflow-y: auto;
}

/* Diagram Output */
#section-orgchart .org-diagram-output {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text, #E2E8F0);
  white-space: pre;
  margin: 0;
  padding: 20px;
  background: var(--input-bg, #0F172A);
  border-radius: 8px;
  border: 1px solid var(--border, #334155);
  overflow-x: auto;
  overflow-y: auto;
  max-height: 600px;
}

/* === PLACEHOLDER STATES === */
#section-orgchart .placeholder-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 40px;
  background: var(--input-bg, #0F172A);
  border-radius: 8px;
  border: 1px dashed var(--border, #334155);
}

#section-orgchart .placeholder-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

#section-orgchart .placeholder-text {
  font-size: 14px;
  color: var(--text-muted, #64748B);
  line-height: 1.6;
  margin: 0 0 16px 0;
  max-width: 500px;
}

#section-orgchart .placeholder-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

#section-orgchart .placeholder-features li {
  font-size: 13px;
  color: var(--text-secondary, #94A3B8);
  padding-left: 0;
}

/* === PREMIUM HISTORY === */
#section-orgchart .premium-history {
  background: var(--card-bg, #1E293B);
  border-radius: 12px;
  border: 1px solid var(--border, #334155);
  padding: 24px;
  max-height: 600px;
  overflow-y: auto;
}

#section-orgchart .history-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border, #334155);
}

#section-orgchart .history-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #E2E8F0);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

#section-orgchart .history-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  background: rgba(14, 165, 233, 0.1);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary, #0EA5E9);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
}

#section-orgchart .history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  background: var(--input-bg, #0F172A);
  border-radius: 8px;
  border: 1px dashed var(--border, #334155);
}

#section-orgchart .empty-state-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.5;
}

#section-orgchart .history-empty p {
  font-size: 13px;
  color: var(--text-muted, #64748B);
  line-height: 1.5;
  margin: 0;
}

#section-orgchart .history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#section-orgchart .history-item {
  background: var(--input-bg, #0F172A);
  border: 1px solid var(--border, #334155);
  border-radius: 8px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#section-orgchart .history-item:hover {
  background: var(--hover-bg, #334155);
  border-color: var(--primary, #0EA5E9);
  transform: translateX(2px);
}

#section-orgchart .history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

#section-orgchart .history-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #E2E8F0);
}

#section-orgchart .history-item-time {
  font-size: 11px;
  color: var(--text-muted, #64748B);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
}

#section-orgchart .history-item-preview {
  font-size: 12px;
  color: var(--text-secondary, #94A3B8);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#section-orgchart .history-item-meta {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

#section-orgchart .history-badge {
  padding: 2px 8px;
  background: rgba(14, 165, 233, 0.1);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  color: var(--primary, #0EA5E9);
  text-transform: uppercase;
}

/* === RESPONSIVE === */
@media (max-width: 1200px) {
  #section-orgchart .org-layout-shell {
    grid-template-columns: 1fr;
  }
  
  #section-orgchart .org-layout-left {
    order: 1;
  }
  
  #section-orgchart .org-layout-right {
    order: 2;
  }
}

@media (max-width: 768px) {
  #section-orgchart .org-metrics-grid {
    grid-template-columns: 1fr;
  }
  
  #section-orgchart .org-dept-header {
    display: none;
  }
  
  #section-orgchart .org-dept-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 16px;
  }
  
  #section-orgchart .btn-remove-dept {
    justify-self: end;
  }
  
  #section-orgchart .premium-form,
  #section-orgchart .premium-metrics,
  #section-orgchart .premium-output,
  #section-orgchart .premium-history {
    padding: 16px;
  }
  
  #section-orgchart .placeholder-state {
    padding: 40px 20px;
  }
}

/* === LOADING STATES === */
#section-orgchart .org-form.loading {
  opacity: 0.6;
  pointer-events: none;
}

#section-orgchart .btn-generate.loading {
  position: relative;
  color: transparent;
}

#section-orgchart .btn-generate.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: orgSpinner 0.6s linear infinite;
}

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

/* === ANIMATIONS === */
@keyframes orgSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#section-orgchart .org-output-section {
  animation: orgSlideIn 0.3s ease;
}

#section-orgchart .history-item {
  animation: orgSlideIn 0.3s ease;
}

/* === SCROLLBAR STYLING === */
#section-orgchart .premium-history::-webkit-scrollbar,
#section-orgchart .org-raw-output::-webkit-scrollbar,
#section-orgchart .org-diagram-output::-webkit-scrollbar {
  width: 8px;
}

#section-orgchart .premium-history::-webkit-scrollbar-track,
#section-orgchart .org-raw-output::-webkit-scrollbar-track,
#section-orgchart .org-diagram-output::-webkit-scrollbar-track {
  background: var(--input-bg, #0F172A);
  border-radius: 4px;
}

#section-orgchart .premium-history::-webkit-scrollbar-thumb,
#section-orgchart .org-raw-output::-webkit-scrollbar-thumb,
#section-orgchart .org-diagram-output::-webkit-scrollbar-thumb {
  background: var(--border, #334155);
  border-radius: 4px;
}

#section-orgchart .premium-history::-webkit-scrollbar-thumb:hover,
#section-orgchart .org-raw-output::-webkit-scrollbar-thumb:hover,
#section-orgchart .org-diagram-output::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted, #64748B);
}

/* === END ORG ARCHITECTURE PREMIUM STYLES === */

/* =============================================================
   DEPARTMENT BUILDER PREMIUM v2.0 - ENTERPRISE CSS
   Safe drop-in: All styles scoped to #section-department
   ============================================================= */

/* === PREMIUM LAYOUT SYSTEM === */
#section-department .dept-premium-layout {
  display: grid;
  grid-template-columns: 420px 1fr 380px;
  gap: 24px;
  margin-top: 24px;
  min-height: 600px;
}

/* === COLUMN STYLES === */
#section-department .dept-col-input {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

#section-department .dept-col-output {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 600px;
}

#section-department .dept-col-history {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* === PREMIUM FORM STYLES === */
#section-department .premium-form {
  background: var(--card-bg, #1E293B);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--border, #334155);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

#section-department .form-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light, #1E293B);
}

#section-department .form-section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

#section-department .form-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #E2E8F0);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

#section-department .section-icon {
  font-size: 18px;
}

/* === INPUT STYLES === */
#section-department .premium-input,
#section-department .premium-select,
#section-department .premium-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--input-bg, #0F172A);
  border: 1px solid var(--border, #334155);
  border-radius: 8px;
  color: var(--text, #E2E8F0);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
}

#section-department .premium-input:focus,
#section-department .premium-select:focus,
#section-department .premium-textarea:focus {
  outline: none;
  border-color: var(--primary, #0EA5E9);
  background: var(--bg, #0F172A);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

#section-department .premium-input::placeholder,
#section-department .premium-textarea::placeholder {
  color: var(--text-muted, #64748B);
}

#section-department .premium-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

#section-department .field-hint {
  font-size: 12px;
  color: var(--text-muted, #64748B);
  margin-top: 4px;
  display: block;
}

/* === GRID LAYOUTS === */
#section-department .dept-financial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

#section-department .dept-staffing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* === GENERATE BUTTON === */
#section-department .btn-generate {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--primary, #0EA5E9), var(--accent, #10B981));
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#section-department .btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(14, 165, 233, 0.3);
}

#section-department .btn-icon {
  font-size: 18px;
}

/* === PREMIUM METRICS CARD === */
#section-department .premium-metrics-card {
  background: var(--card-bg, #1E293B);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--border, #334155);
}

#section-department .metrics-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #E2E8F0);
  margin: 0 0 20px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

#section-department .metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#section-department .metric-row:last-child {
  border-bottom: none;
}

#section-department .metric-label {
  font-size: 13px;
  color: var(--text-secondary, #94A3B8);
}

#section-department .metric-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #E2E8F0);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
}

#section-department .metric-value-large {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary, #0EA5E9);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
}

#section-department .metric-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  display: inline-block;
  margin: 0 4px;
}

#section-department .metric-badge.core {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success, #10B981);
}

#section-department .metric-badge.support {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary, #0EA5E9);
}

#section-department .metric-divider {
  height: 1px;
  background: var(--border, #334155);
  margin: 12px 0;
}

/* === OUTPUT SECTIONS === */
#section-department .dept-output-section {
  background: var(--card-bg, #1E293B);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--border, #334155);
  animation: slideIn 0.3s ease;
}

#section-department .dept-summary-section {
  background: var(--card-bg, #1E293B);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--border, #334155);
}

#section-department .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border, #334155);
}

#section-department .section-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text, #E2E8F0);
  margin: 0;
}

#section-department .section-badge {
  padding: 4px 12px;
  background: rgba(14, 165, 233, 0.1);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary, #0EA5E9);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* === SMART BODY (FORMATTED HTML) === */
#section-department .dept-smart-body {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary, #94A3B8);
}

#section-department .dept-smart-body h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text, #E2E8F0);
  margin: 24px 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#section-department .dept-smart-body h2:first-child {
  margin-top: 0;
}

#section-department .dept-smart-body h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text, #E2E8F0);
  margin: 20px 0 10px 0;
}

#section-department .dept-smart-body h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary, #0EA5E9);
  margin: 16px 0 8px 0;
}

#section-department .dept-smart-body p {
  margin: 0 0 12px 0;
}

#section-department .dept-smart-body ul,
#section-department .dept-smart-body ol {
  margin: 0 0 16px 0;
  padding-left: 24px;
}

#section-department .dept-smart-body li {
  margin-bottom: 6px;
  line-height: 1.6;
}

#section-department .dept-smart-body strong {
  color: var(--text, #E2E8F0);
  font-weight: 600;
}

/* === FINANCIAL TABLE === */
#section-department .financial-table-container {
  margin-bottom: 32px;
}

#section-department .financial-table-container h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #E2E8F0);
  margin: 0 0 16px 0;
}

#section-department .financial-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--input-bg, #0F172A);
  border-radius: 8px;
  overflow: hidden;
}

#section-department .financial-table thead {
  background: var(--card-bg, #1E293B);
}

#section-department .financial-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, #64748B);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border, #334155);
}

#section-department .financial-table td {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-secondary, #94A3B8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
}

#section-department .financial-table tbody tr:last-child td {
  border-bottom: none;
}

#section-department .financial-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

#section-department .table-placeholder {
  text-align: center;
  color: var(--text-muted, #64748B);
  font-style: italic;
  padding: 40px 16px !important;
}

/* === PHASING TIMELINE === */
#section-department .phasing-timeline-container {
  margin-bottom: 32px;
}

#section-department .phasing-timeline-container h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #E2E8F0);
  margin: 0 0 16px 0;
}

#section-department .phasing-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#section-department .phase-wave {
  background: var(--input-bg, #0F172A);
  border-radius: 8px;
  padding: 16px;
  border-left: 4px solid var(--primary, #0EA5E9);
}

#section-department .phase-wave-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

#section-department .phase-wave-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #E2E8F0);
}

#section-department .phase-wave-cost {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary, #0EA5E9);
  font-family: 'JetBrains Mono', monospace;
}

#section-department .phase-wave-details {
  font-size: 13px;
  color: var(--text-secondary, #94A3B8);
  line-height: 1.6;
}

/* === FINANCIAL METRICS GRID === */
#section-department .financial-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 24px;
}

#section-department .financial-metric-card {
  background: var(--input-bg, #0F172A);
  border-radius: 8px;
  padding: 16px;
  border: 1px solid var(--border, #334155);
  text-align: center;
}

#section-department .metric-card-label {
  font-size: 12px;
  color: var(--text-muted, #64748B);
  margin-bottom: 8px;
}

#section-department .metric-card-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary, #0EA5E9);
  font-family: 'JetBrains Mono', monospace;
}

#section-department .metric-card-value.tco {
  color: var(--accent, #10B981);
}

/* === ROLES BODY === */
#section-department .dept-roles-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#section-department .role-card {
  background: var(--input-bg, #0F172A);
  border-radius: 8px;
  padding: 16px;
  border: 1px solid var(--border, #334155);
}

#section-department .role-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

#section-department .role-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #E2E8F0);
}

#section-department .role-salary {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary, #0EA5E9);
  font-family: 'JetBrains Mono', monospace;
}

#section-department .role-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

#section-department .role-meta-item {
  font-size: 12px;
  color: var(--text-muted, #64748B);
}

#section-department .role-meta-value {
  color: var(--text-secondary, #94A3B8);
  font-weight: 600;
}

#section-department .role-responsibilities {
  margin-top: 12px;
}

#section-department .role-responsibilities h5 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #E2E8F0);
  margin: 0 0 8px 0;
}

#section-department .role-responsibilities ul {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  color: var(--text-secondary, #94A3B8);
}

/* === RAW OUTPUT === */
#section-department .dept-raw-output {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary, #94A3B8);
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0;
  padding: 20px;
  background: var(--input-bg, #0F172A);
  border-radius: 8px;
  border: 1px solid var(--border, #334155);
  max-height: 600px;
  overflow-y: auto;
}

/* === DIAGRAM OUTPUT === */
#section-department .dept-diagram-output {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text, #E2E8F0);
  white-space: pre;
  margin: 0;
  padding: 20px;
  background: var(--input-bg, #0F172A);
  border-radius: 8px;
  border: 1px solid var(--border, #334155);
  overflow-x: auto;
  overflow-y: auto;
  max-height: 600px;
}

/* === PLACEHOLDER STATES === */
#section-department .placeholder-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 40px;
  background: var(--input-bg, #0F172A);
  border-radius: 8px;
  border: 1px dashed var(--border, #334155);
}

#section-department .placeholder-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

#section-department .placeholder-text {
  font-size: 14px;
  color: var(--text-muted, #64748B);
  line-height: 1.6;
  margin: 0 0 16px 0;
  max-width: 500px;
}

#section-department .placeholder-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

#section-department .placeholder-features li {
  font-size: 13px;
  color: var(--text-secondary, #94A3B8);
}

/* === HISTORY CARD === */
#section-department .premium-history-card {
  background: var(--card-bg, #1E293B);
  border-radius: 12px;
  border: 1px solid var(--border, #334155);
  padding: 24px;
  max-height: 600px;
  overflow-y: auto;
}

#section-department .history-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border, #334155);
}

#section-department .history-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #E2E8F0);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

#section-department .history-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  background: rgba(14, 165, 233, 0.1);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary, #0EA5E9);
  font-family: 'JetBrains Mono', monospace;
}

#section-department .history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  background: var(--input-bg, #0F172A);
  border-radius: 8px;
  border: 1px dashed var(--border, #334155);
}

#section-department .empty-state-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.5;
}

#section-department .history-empty p {
  font-size: 13px;
  color: var(--text-muted, #64748B);
  line-height: 1.5;
  margin: 0;
}

#section-department .history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#section-department .depthistory-item {
  background: var(--input-bg, #0F172A);
  border: 1px solid var(--border, #334155);
  border-radius: 8px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#section-department .depthistory-item:hover {
  background: var(--hover-bg, #334155);
  border-color: var(--primary, #0EA5E9);
  transform: translateX(2px);
}

#section-department .depthistory-meta {
  font-size: 11px;
  color: var(--text-muted, #64748B);
  margin-bottom: 8px;
  font-family: 'JetBrains Mono', monospace;
}

#section-department .depthistory-cost {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary, #94A3B8);
}

/* === INSIGHTS CARD === */
#section-department .insights-card {
  background: var(--card-bg, #1E293B);
  border-radius: 12px;
  border: 1px solid var(--border, #334155);
  padding: 24px;
}

#section-department .insights-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #E2E8F0);
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

#section-department .insights-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#section-department .insight-item {
  padding: 12px;
  background: var(--input-bg, #0F172A);
  border-radius: 6px;
  border-left: 3px solid var(--accent, #10B981);
  font-size: 13px;
  color: var(--text-secondary, #94A3B8);
  line-height: 1.6;
}

/* === RISK CARD === */
#section-department .risk-card {
  background: var(--card-bg, #1E293B);
  border-radius: 12px;
  border: 1px solid var(--border, #334155);
  padding: 24px;
}

#section-department .risk-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #E2E8F0);
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

#section-department .risk-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#section-department .risk-item {
  padding: 12px;
  background: var(--input-bg, #0F172A);
  border-radius: 6px;
  border-left: 3px solid var(--error, #EF4444);
}

#section-department .risk-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

#section-department .risk-category {
  font-size: 12px;
  font-weight: 600;
  color: var(--text, #E2E8F0);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#section-department .risk-impact {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

#section-department .risk-impact.high {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error, #EF4444);
}

#section-department .risk-impact.medium {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning, #F59E0B);
}

#section-department .risk-impact.low {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success, #10B981);
}

#section-department .risk-description {
  font-size: 13px;
  color: var(--text-secondary, #94A3B8);
  line-height: 1.6;
  margin-bottom: 8px;
}

#section-department .risk-mitigation {
  font-size: 12px;
  color: var(--text-muted, #64748B);
  font-style: italic;
}

/* === ANIMATIONS === */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 1400px) {
  #section-department .dept-premium-layout {
    grid-template-columns: 400px 1fr 340px;
  }
}

@media (max-width: 1200px) {
  #section-department .dept-premium-layout {
    grid-template-columns: 1fr;
  }
  
  #section-department .dept-col-input {
    order: 1;
  }
  
  #section-department .dept-col-output {
    order: 2;
  }
  
  #section-department .dept-col-history {
    order: 3;
  }
  
  #section-department .financial-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  #section-department .dept-financial-grid,
  #section-department .dept-staffing-grid {
    grid-template-columns: 1fr;
  }
  
  #section-department .financial-metrics-grid {
    grid-template-columns: 1fr;
  }
  
  #section-department .premium-form,
  #section-department .premium-metrics-card,
  #section-department .dept-output-section,
  #section-department .premium-history-card {
    padding: 16px;
  }
}

/* === LOADING STATES === */
#section-department .premium-form.loading {
  opacity: 0.6;
  pointer-events: none;
}

#section-department .btn-generate.loading {
  position: relative;
  color: transparent;
}

#section-department .btn-generate.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: deptSpinner 0.6s linear infinite;
}

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

/* === SCROLLBAR STYLING === */
#section-department .premium-history-card::-webkit-scrollbar,
#section-department .dept-raw-output::-webkit-scrollbar,
#section-department .dept-diagram-output::-webkit-scrollbar {
  width: 8px;
}

#section-department .premium-history-card::-webkit-scrollbar-track,
#section-department .dept-raw-output::-webkit-scrollbar-track,
#section-department .dept-diagram-output::-webkit-scrollbar-track {
  background: var(--input-bg, #0F172A);
  border-radius: 4px;
}

#section-department .premium-history-card::-webkit-scrollbar-thumb,
#section-department .dept-raw-output::-webkit-scrollbar-thumb,
#section-department .dept-diagram-output::-webkit-scrollbar-thumb {
  background: var(--border, #334155);
  border-radius: 4px;
}

#section-department .premium-history-card::-webkit-scrollbar-thumb:hover,
#section-department .dept-raw-output::-webkit-scrollbar-thumb:hover,
#section-department .dept-diagram-output::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted, #64748B);
}

/* === END DEPARTMENT BUILDER PREMIUM CSS === */

/* =============================================================
   PEI v3.0 ULTRA-PREMIUM CSS
   Safe drop-in: All styles scoped to #section-pei
   Enhanced visualization, collapsible history, premium design
   ============================================================= */

/* === ENHANCED HISTORY STYLES === */
#section-pei .history-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-dim, #64748B);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

#section-pei .history-toggle-btn:hover {
  background: var(--bg-hover, #334155);
  color: var(--text, #E2E8F0);
}

#section-pei .history-container {
  max-height: 500px;
  overflow-y: auto;
}

#section-pei .peihistory-item {
  background: var(--input-bg, #0F172A);
  border: 1px solid var(--border, #334155);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#section-pei .peihistory-item:hover {
  background: var(--hover-bg, #334155);
  border-color: var(--primary, #0EA5E9);
  transform: translateX(2px);
}

#section-pei .peihistory-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

#section-pei .peihistory-date {
  font-size: 11px;
  color: var(--text-muted, #64748B);
  font-family: 'JetBrains Mono', monospace;
}

#section-pei .peihistory-level {
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#section-pei .peihistory-score {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

#section-pei .peihistory-exec-index {
  font-size: 28px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

#section-pei .peihistory-label {
  font-size: 13px;
  color: var(--text-secondary, #94A3B8);
  flex: 1;
}

#section-pei .peihistory-predictions {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 8px;
}

#section-pei .pred-risk {
  font-size: 11px;
  padding: 3px 8px;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-radius: 4px;
  font-weight: 600;
}

#section-pei .pred-success {
  font-size: 11px;
  padding: 3px 8px;
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border-radius: 4px;
  font-weight: 600;
}

#section-pei .peihistory-summary {
  font-size: 12px;
  color: var(--text-dim, #64748B);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* === ENHANCED METER STYLES === */
#section-pei .pei-meter-labels {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-top: 8px;
}

#section-pei .pei-meter-labels span {
  text-align: center;
  font-size: 10px;
  color: var(--text-dim, #64748B);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

#section-pei .pei-bar-row {
  display: grid;
  grid-template-columns: 80px 1fr 60px;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#section-pei .pei-bar-row:last-child {
  border-bottom: none;
}

#section-pei .bar-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary, #94A3B8);
}

/* === ENHANCED FORM STYLES === */
#section-pei .pei-score-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

#section-pei .pei-score-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#section-pei .pei-score-block label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #E2E8F0);
}

#section-pei .score-hint {
  font-size: 11px;
  color: var(--text-muted, #64748B);
  font-style: italic;
}

#section-pei .field-hint-inline {
  font-size: 12px;
  color: var(--text-muted, #64748B);
  font-weight: 400;
  margin-left: 8px;
}

/* === RESPONSIVE ENHANCEMENTS === */
@media (max-width: 1200px) {
  #section-pei .pei-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  #section-pei .pei-score-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  #section-pei .pei-meter-labels {
    font-size: 8px;
  }
  
  #section-pei .pei-bar-row {
    grid-template-columns: 70px 1fr 50px;
  }
}

/* === PREMIUM ANIMATIONS === */
@keyframes peiPulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

#section-pei .pei-meter-seg.active {
  animation: peiPulse 2s ease-in-out infinite;
}

/* === ENHANCED PLACEHOLDER === */
#section-pei .placeholder-features li {
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-secondary, #94A3B8);
}

/* === END PEI v3.0 ULTRA-PREMIUM CSS === */

/* ================================================================
   PREMIUM FOOTER & LEGAL MODAL STYLES
   Version: 1.0
   Safe to append to the END of your existing styles.css
   NO conflicts with existing styles
   ================================================================ */

/* ================================================================
   PREMIUM FOOTER CONTAINER
   ================================================================ */
.premium-footer {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-hover) 100%);
  border-top: 1px solid var(--border);
  margin-top: 60px;
  padding: 60px 0 0 0;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.premium-footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}

/* Mobile responsive */
@media (max-width: 968px) {
  .premium-footer-container {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 24px;
    gap: 32px;
  }
}

@media (max-width: 640px) {
  .premium-footer-container {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .premium-footer {
    margin-top: 40px;
    padding: 40px 0 0 0;
  }
}

/* ================================================================
   FOOTER COLUMNS
   ================================================================ */
.premium-footer-col {
  display: flex;
  flex-direction: column;
}

.premium-footer-heading {
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 20px 0;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ================================================================
   BRAND COLUMN
   ================================================================ */
.premium-footer-brand {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.premium-footer-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.brand-mark-footer {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: -0.5px;
}

.brand-text-footer {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}

.premium-footer-tagline {
  line-height: 1.6;
  margin: 0;
  color: var(--text-dim);
  font-size: 0.875rem;
}

/* ================================================================
   SOCIAL LINKS
   ================================================================ */
.premium-footer-social {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.footer-social-link {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  transition: all 0.2s ease;
  text-decoration: none;
}

.footer-social-link:hover {
  background: var(--bg-hover);
  border-color: var(--brand);
  color: var(--brand);
  transform: translateY(-2px);
}

.footer-social-link svg {
  width: 20px;
  height: 20px;
}

/* ================================================================
   FOOTER LINKS
   ================================================================ */
.premium-footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.premium-footer-links li {
  margin: 0;
  padding: 0;
}

.footer-link,
.footer-nav-link {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s ease, padding-left 0.2s ease;
  display: inline-block;
  font-size: 0.9rem;
}

.footer-link:hover,
.footer-nav-link:hover {
  color: var(--brand);
  padding-left: 4px;
}

/* ================================================================
   FOOTER BOTTOM BAR
   ================================================================ */
.premium-footer-bottom {
  margin-top: 48px;
  padding: 24px 0;
  border-top: 1px solid var(--border-soft);
  background: var(--bg);
}

.premium-footer-bottom-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.premium-footer-copyright {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.footer-link-inline {
  color: var(--brand);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.footer-link-inline:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.premium-footer-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.footer-version {
  background: var(--bg-card);
  padding: 4px 10px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  border: 1px solid var(--border-soft);
}

.footer-divider {
  color: var(--border);
}

.footer-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@media (max-width: 640px) {
  .premium-footer-bottom-content {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ================================================================
   LEGAL MODAL OVERLAY
   ================================================================ */
.legal-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.legal-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ================================================================
   LEGAL MODAL
   ================================================================ */
.legal-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  max-width: 900px;
  width: 90%;
  max-height: 85vh;
  background: var(--bg-card);
  border-radius: 16px;
  border: 2px solid var(--border);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.legal-modal.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* ================================================================
   MODAL HEADER
   ================================================================ */
.legal-modal-header {
  padding: 24px 32px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-hover);
  border-radius: 16px 16px 0 0;
}

.legal-modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  background: linear-gradient(135deg, var(--brand), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.legal-modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  line-height: 1;
  padding: 0;
}

.legal-modal-close:hover {
  background: var(--bg);
  color: var(--text);
  transform: rotate(90deg);
}

/* ================================================================
   MODAL CONTENT
   ================================================================ */
.legal-modal-content {
  padding: 32px;
  overflow-y: auto;
  flex: 1;
  line-height: 1.7;
}

/* Custom scrollbar for modal */
.legal-modal-content::-webkit-scrollbar {
  width: 8px;
}

.legal-modal-content::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 4px;
}

.legal-modal-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.legal-modal-content::-webkit-scrollbar-thumb:hover {
  background: var(--brand);
}

/* ================================================================
   LEGAL SECTION TYPOGRAPHY
   ================================================================ */
.legal-section h3 {
  color: var(--brand);
  font-size: 1.3rem;
  font-weight: 700;
  margin: 32px 0 16px 0;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}

.legal-section h3:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.legal-section h4 {
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 24px 0 12px 0;
}

.legal-section p {
  margin: 0 0 16px 0;
  color: var(--text);
}

.legal-section ul,
.legal-section ol {
  margin: 0 0 16px 0;
  padding-left: 24px;
  color: var(--text);
}

.legal-section li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.legal-section a {
  color: var(--brand);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.legal-section a:hover {
  border-bottom-color: var(--brand);
}

.legal-section strong {
  color: var(--text);
  font-weight: 600;
}

.legal-updated {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
  font-size: 0.85rem;
  color: var(--text-dim);
  font-style: italic;
}

/* ================================================================
   SECURITY BADGES
   ================================================================ */
.security-badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 24px 0 32px 0;
}

.security-badge {
  background: linear-gradient(135deg, 
    rgba(74, 168, 255, 0.1), 
    rgba(74, 168, 255, 0.05)
  );
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.2s ease;
}

.security-badge:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 168, 255, 0.2);
}

.security-badge-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.security-badge-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.security-badge-text {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ================================================================
   FAQ ACCORDION STYLES
   ================================================================ */
.faq-section {
  /* Container for all FAQ content */
}

.faq-category {
  margin-bottom: 32px;
}

.faq-category h3 {
  color: var(--brand);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 20px 0;
  padding: 12px 16px;
  background: linear-gradient(135deg, 
    rgba(74, 168, 255, 0.15), 
    rgba(74, 168, 255, 0.05)
  );
  border-left: 4px solid var(--brand);
  border-radius: 0 8px 8px 0;
}

.faq-item {
  margin-bottom: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.faq-item:hover {
  border-color: var(--brand);
}

.faq-question {
  padding: 16px 20px;
  background: var(--bg-hover);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
  position: relative;
}

.faq-question::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand);
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: 16px;
}

.faq-item.active .faq-question::after {
  transform: rotate(45deg);
}

.faq-question:hover {
  background: var(--bg-card);
  color: var(--brand);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  background: var(--bg);
  color: var(--text);
  padding: 0 20px;
}

.faq-item.active .faq-answer {
  max-height: 500px;
  padding: 20px;
  border-top: 1px solid var(--border-soft);
}

.faq-answer strong {
  color: var(--brand);
}

/* ================================================================
   MOBILE RESPONSIVENESS
   ================================================================ */
@media (max-width: 640px) {
  .legal-modal {
    width: 95%;
    max-height: 90vh;
  }
  
  .legal-modal-header {
    padding: 20px;
  }
  
  .legal-modal-header h2 {
    font-size: 1.25rem;
  }
  
  .legal-modal-content {
    padding: 20px;
  }
  
  .security-badge-grid {
    grid-template-columns: 1fr;
  }
  
  .legal-section h3 {
    font-size: 1.1rem;
  }
  
  .legal-section h4 {
    font-size: 1rem;
  }
}

/* ================================================================
   DARK MODE OPTIMIZATION
   ================================================================ */
.theme-dark .legal-modal {
  background: var(--bg-card);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8);
}

.theme-dark .legal-modal-overlay {
  background: rgba(0, 0, 0, 0.85);
}

/* ================================================================
   LIGHT MODE OPTIMIZATION
   ================================================================ */
.theme-light .legal-modal {
  background: #ffffff;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.theme-light .legal-modal-overlay {
  background: rgba(255, 255, 255, 0.75);
}

.theme-light .premium-footer {
  background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
}

.theme-light .footer-status-dot {
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

/* ================================================================
   ACCESSIBILITY IMPROVEMENTS
   ================================================================ */
.footer-link:focus,
.footer-nav-link:focus,
.footer-social-link:focus {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.legal-modal-close:focus {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.faq-question:focus {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

/* ================================================================
   PRINT STYLES FOR LEGAL PAGES
   ================================================================ */
@media print {
  .legal-modal-overlay,
  .legal-modal-close {
    display: none !important;
  }
  
  .legal-modal {
    position: static;
    transform: none;
    max-width: 100%;
    max-height: none;
    box-shadow: none;
    border: none;
  }
  
  .legal-modal-content {
    padding: 0;
    overflow: visible;
  }
  
  .premium-footer {
    page-break-inside: avoid;
  }
}

/* ================================================================
   SMOOTH SCROLLING FOR ANCHOR LINKS
   ================================================================ */
html {
  scroll-behavior: smooth;
}

/* ================================================================
   END OF PREMIUM FOOTER STYLES
   Total lines: ~870
   Safe to append - No conflicts with existing styles
   ================================================================ */

   /* =======================================================================
   CANCELLATION SYSTEM STYLES
   
   LOCATION: APPEND TO END OF styles.css
   These are NEW styles - don't replace anything
   Safe to append after existing styles
======================================================================== */

/* My Plan Layout */
.myplan-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  padding: 32px;
}

@media (max-width: 968px) {
  .myplan-layout {
    grid-template-columns: 1fr;
  }
}

/* Plan Card */
.plan-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 24px;
}

.plan-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-soft);
}

.plan-card-header h3 {
  margin: 0;
  font-size: 1.8rem;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.status-badge {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-active {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border: 1px solid #22c55e;
}

.status-canceling {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid #f59e0b;
}

.status-canceled {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid #ef4444;
}

.plan-metric {
  margin-bottom: 20px;
}

.plan-metric-label {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.plan-metric-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

/* Warning Banner */
.plan-warning-banner {
  background: rgba(245, 158, 11, 0.1);
  border: 2px solid #f59e0b;
  border-radius: 12px;
  padding: 20px;
  margin: 24px 0;
  display: flex;
  gap: 16px;
}

.warning-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.warning-title {
  font-weight: 700;
  color: #f59e0b;
  margin-bottom: 6px;
  font-size: 1rem;
}

.warning-text {
  color: var(--text);
  line-height: 1.6;
  font-size: 0.9rem;
}

/* Plan Actions */
.plan-card-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
}

/* Usage Stats */
.usage-stats-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.usage-stats-card h4 {
  margin: 0 0 20px 0;
  color: var(--text);
  font-size: 1.1rem;
}

.usage-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.usage-item {
  text-align: center;
}

.usage-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.usage-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--brand);
}

/* Quick Actions */
.quick-actions-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.quick-actions-card h4 {
  margin: 0 0 20px 0;
  color: var(--text);
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  background: var(--bg-hover);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.action-item:hover {
  border-color: var(--brand);
  background: var(--bg-card);
  transform: translateY(-2px);
}

.action-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.action-label {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 600;
  text-align: center;
}

/* Benefits Card */
.benefits-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.benefits-card h4 {
  margin: 0 0 16px 0;
  color: var(--text);
}

.benefits-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.benefits-list li {
  padding: 8px 0;
  padding-left: 28px;
  position: relative;
  color: var(--text);
  line-height: 1.6;
}

.benefits-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
  font-size: 1.1rem;
}

/* Danger Zone */
.danger-zone-card {
  background: rgba(239, 68, 68, 0.05);
  border: 2px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  padding: 24px;
}

.danger-zone-card h4 {
  margin: 0 0 12px 0;
  color: #ef4444;
  font-size: 1rem;
}

.danger-zone-text {
  color: var(--text);
  line-height: 1.6;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.btn-danger-discrete {
  background: transparent;
  border: 2px solid rgba(239, 68, 68, 0.5);
  color: #ef4444;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.btn-danger-discrete:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
}

.danger-zone-note {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(239, 68, 68, 0.2);
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.btn-success {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

/* Cancel Modal Overlay */
.cancel-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.cancel-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Cancel Modal */
.cancel-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--bg-card);
  border-radius: 16px;
  border: 2px solid var(--border);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  z-index: 10001;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cancel-modal.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.cancel-modal-content {
  padding: 32px;
}

.cancel-header {
  text-align: center;
  margin-bottom: 32px;
}

.cancel-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.cancel-header h3 {
  margin: 0;
  font-size: 1.8rem;
  color: var(--text);
}

.cancel-intro {
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 24px;
}

/* Consequences */
.cancel-consequences {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.consequence-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  border-radius: 8px;
  border: 2px solid;
}

.consequence-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: #f59e0b;
}

.consequence-danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
}

.consequence-info {
  background: rgba(74, 168, 255, 0.1);
  border-color: #4aa8ff;
}

.consequence-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.consequence-title {
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}

.consequence-text {
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Alternatives */
.cancel-alternatives {
  background: var(--bg-hover);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 24px;
}

.cancel-alternatives h4 {
  margin: 0 0 12px 0;
  color: var(--brand);
  font-size: 1rem;
}

.cancel-alternatives ul {
  margin: 0;
  padding-left: 20px;
}

.cancel-alternatives li {
  margin-bottom: 8px;
  color: var(--text);
  line-height: 1.6;
}

/* Footer Buttons */
.cancel-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
}

/* Confirmation Input */
.cancel-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 20px;
}

.cancel-input:focus {
  outline: none;
  border-color: var(--brand);
}

.cancel-final-warning {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid #ef4444;
  padding: 16px;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Processing State */
.cancel-processing {
  text-align: center;
  padding: 40px 20px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 24px auto;
}

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

/* Success State */
.cancel-success {
  text-align: center;
  padding: 20px;
}

.success-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.cancel-summary {
  background: var(--bg-hover);
  padding: 20px;
  border-radius: 8px;
  margin: 24px 0;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
}

.summary-label {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.summary-value {
  color: var(--text);
  font-weight: 700;
}

.cancel-feedback {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 20px;
}

.cancel-feedback a {
  color: var(--brand);
  text-decoration: none;
}

.cancel-feedback a:hover {
  text-decoration: underline;
}

/* =======================================================================
   END OF CANCELLATION STYLES
======================================================================== */

/* =======================================================================
   ORBITAL LOGO INTEGRATION FOR IMPACTOS
   
   INSTRUCTIONS:
   1. Add this CSS to the END of your styles.css
   2. Replace the brand-mark HTML in index.html (see below)
   
   This won't affect any existing styles - it's completely self-contained
======================================================================== */

/* === ORBITAL LOGO CONTAINER === */
.brand-mark-orbital {
  width: 48px;
  height: 48px;
  position: relative;
  flex-shrink: 0;
}

.brand-mark-orbital svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* === SPINNING ANIMATION === */
/* Orbital rings rotate continuously */
.orbital-ring-1 {
  animation: orbitSpin 20s linear infinite;
  transform-origin: center;
}

.orbital-ring-2 {
  animation: orbitSpin 15s linear infinite reverse;
  transform-origin: center;
}

.orbital-ring-3 {
  animation: orbitSpin 25s linear infinite;
  transform-origin: center;
}

@keyframes orbitSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Data nodes orbit around center */
.orbital-node-1 {
  animation: nodeOrbit1 8s linear infinite;
  transform-origin: 20px 20px; /* Center of 40x40 viewBox */
}

.orbital-node-2 {
  animation: nodeOrbit2 8s linear infinite;
  transform-origin: 20px 20px;
}

.orbital-node-3 {
  animation: nodeOrbit3 8s linear infinite;
  transform-origin: 20px 20px;
}

@keyframes nodeOrbit1 {
  from {
    transform: rotate(0deg) translateX(12px) rotate(0deg);
  }
  to {
    transform: rotate(360deg) translateX(12px) rotate(-360deg);
  }
}

@keyframes nodeOrbit2 {
  from {
    transform: rotate(120deg) translateX(12px) rotate(-120deg);
  }
  to {
    transform: rotate(480deg) translateX(12px) rotate(-480deg);
  }
}

@keyframes nodeOrbit3 {
  from {
    transform: rotate(240deg) translateX(12px) rotate(-240deg);
  }
  to {
    transform: rotate(600deg) translateX(12px) rotate(-600deg);
  }
}

/* Pulsing glow effect on central core */
.orbital-core {
  animation: corePulse 3s ease-in-out infinite;
}

@keyframes corePulse {
  0%, 100% {
    opacity: 1;
    filter: drop-shadow(0 0 3px rgba(37, 99, 235, 0.8));
  }
  50% {
    opacity: 0.7;
    filter: drop-shadow(0 0 6px rgba(37, 99, 235, 1));
  }
}

/* Impact ripples pulse outward */
.impact-ripple-1 {
  animation: ripplePulse 3s ease-out infinite;
  transform-origin: center;
}

.impact-ripple-2 {
  animation: ripplePulse 3s ease-out infinite 1.5s;
  transform-origin: center;
}

@keyframes ripplePulse {
  0% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  50% {
    opacity: 0.15;
    transform: scale(1.2);
  }
  100% {
    opacity: 0;
    transform: scale(1.5);
  }
}

/* Hover effect - speed up animations */
.brand-mark-orbital:hover .orbital-ring-1 {
  animation-duration: 10s;
}

.brand-mark-orbital:hover .orbital-ring-2 {
  animation-duration: 8s;
}

.brand-mark-orbital:hover .orbital-ring-3 {
  animation-duration: 12s;
}

.brand-mark-orbital:hover .orbital-node-1,
.brand-mark-orbital:hover .orbital-node-2,
.brand-mark-orbital:hover .orbital-node-3 {
  animation-duration: 4s;
}

/* Responsive - slightly smaller on mobile */
@media (max-width: 768px) {
  .brand-mark-orbital {
    width: 40px;
    height: 40px;
  }
}

/* =======================================================================
   END OF ORBITAL LOGO STYLES
======================================================================== */