:root {
    --bg: #edf4ef;
    --surface: #ffffff;
    --surface-soft: #f8fbf9;
    --border: #dbe7df;
    --text: #0f172a;
    --muted: #64748b;
    --green-900: #0d4732;
    --green-800: #146c43;
    --green-700: #1f8a54;
    --green-100: #e8f5ec;
    --shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --sidebar-width: 280px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    color: var(--text);
    font-family: Inter, Segoe UI, Arial, sans-serif;
    background: radial-gradient(circle at top left, rgba(57,166,85,.1), transparent 24%), linear-gradient(to bottom, #f7faf8, var(--bg));
}

a { color: inherit; text-decoration: none; }
p, h1, h2, h3 { margin: 0; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    background: var(--green-900);
    color: #fff;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.brand-block { display: flex; gap: 12px; align-items: center; padding: 4px 8px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-icon {
    width: 48px; height: 48px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.1); font-weight: 700; font-size: 1.2rem;
}
.brand-title { font-size: 1.35rem; font-weight: 700; }
.brand-subtitle, .workspace-subtitle, .profile-subtitle { color: rgba(220,252,231,.75); font-size: .9rem; }
.section-overline { color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .16em; margin-bottom: 10px; }
.section-overline-dark { color: rgba(220,252,231,.65); }
.section-overline-green { color: var(--green-700); }
.workspace-card, .profile-box {
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius-md); padding: 14px;
}
.workspace-title, .profile-title { font-size: .95rem; font-weight: 600; }
.profile-main { margin-top: 10px; font-weight: 600; }
.nav-list { display: flex; flex-direction: column; gap: 6px; }
.nav-item {
    color: rgba(236,253,245,.88); padding: 13px 14px; border-radius: 16px; transition: .2s ease; font-weight: 500;
}
.nav-item:hover { background: rgba(255,255,255,.08); }
.nav-item.active { background: #fff; color: var(--green-900); box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.content-shell { flex: 1; min-width: 0; margin-left: var(--sidebar-width); }
.topbar {
    position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.85); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border); padding: 20px 32px; display: flex; justify-content: space-between; gap: 24px; align-items: center;
}
.topbar h1 { font-size: 1.25rem; font-weight: 700; }
.topbar p { margin-top: 4px; color: var(--muted); }
.topbar-actions { display: flex; gap: 12px; align-items: center; }
.demo-mode-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.topbar-user { font-size: .85rem; font-weight: 600; color: var(--text); white-space: nowrap; }
.topbar-logout { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.topbar-logout:hover { color: var(--danger, #e53e3e); border-color: var(--danger, #e53e3e); }
.demo-start-btn { white-space: nowrap; }
.search-box {
    width: 320px; max-width: 40vw; border: 1px solid var(--border); background: var(--surface-soft); color: var(--text);
    border-radius: 16px; padding: 12px 14px; outline: none;
}
.icon-button {
    width: 44px; height: 44px; border-radius: 16px; border: 1px solid var(--border); background: #fff; cursor: pointer;
}
.stats-grid, .main-grid { padding: 24px 32px 0; }
.stats-grid {
    display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px;
}
.main-grid {
    display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr); gap: 24px; padding-bottom: 32px;
}
.left-column, .right-column, .two-panels { display: flex; flex-direction: column; gap: 24px; }
.two-panels { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
.panel {
    background: rgba(255,255,255,.94); border: 1px solid rgba(255,255,255,.7); border-radius: var(--radius-xl); box-shadow: var(--shadow);
    overflow: hidden;
}
.panel-header {
    padding: 24px; display: flex; justify-content: space-between; gap: 20px; align-items: flex-start;
}
.panel-header-green {
    background: linear-gradient(90deg, var(--green-900), var(--green-800)); color: #fff; border-bottom: 1px solid rgba(255,255,255,.08);
}
.panel-header h2, .panel-header-simple h3 { font-size: 1.15rem; font-weight: 700; }
.panel-header p, .panel-header-simple p { margin-top: 6px; color: rgba(240,253,244,.85); }
.panel-header-simple p { color: var(--muted); }
.panel-header-simple {
    display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; padding: 22px 24px 0;
}
.panel-header-simple.border-bottom { padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.panel-body { padding: 24px; }
.pill {
    display: inline-flex; align-items: center; border-radius: 999px; padding: 8px 12px; font-size: .78rem; font-weight: 600;
}
.pill-glass { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); }
.stat-card { padding: 20px; }
.stat-title { color: var(--muted); font-size: .95rem; font-weight: 500; }
.stat-value { margin-top: 10px; font-size: 2rem; font-weight: 700; }
.stat-subtitle { margin-top: 6px; color: var(--muted); font-size: .95rem; }
.filters-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.field-card {
    background: var(--surface-soft); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px;
}
.field-card label, .field-header label { display: block; margin-bottom: 10px; font-weight: 600; font-size: .92rem; }
.field-card select {
    width: 100%; border: 1px solid var(--border); background: #fff; border-radius: 16px; padding: 12px 14px; outline: none;
}
.composer-grid { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(280px,.8fr); gap: 16px; margin-top: 16px; }
.field-header { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 10px; }
.text-link { color: var(--green-700); font-weight: 600; }
.note-area {
    width: 100%; min-height: 240px; resize: vertical; border-radius: var(--radius-md); border: 1px solid var(--border);
    background: var(--surface-soft); padding: 16px; line-height: 1.75; outline: none; font: inherit; color: var(--text);
}
.side-box {
    background: var(--surface-soft); border: 1px solid var(--border); border-radius: 24px; padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.toggle-card, .quick-info {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px;
}
.toggle-card { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.toggle-title { font-weight: 600; }
.toggle-subtitle, .quick-info span, .list-subtitle, .list-time, .raw-ref p, .preview-box p { color: var(--muted); }
.quick-info strong { display: block; margin-top: 6px; }
.hint-box {
    background: #f4fbf6; border: 1px solid #d6eadc; border-radius: var(--radius-md); padding: 14px 16px;
}
.button-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.button-row.two { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
.btn {
    border: 1px solid var(--border); border-radius: 18px; padding: 14px 18px; background: #fff; color: var(--text);
    font: inherit; font-weight: 600; cursor: pointer;
}
.btn.small { padding: 10px 14px; }
.btn-primary { background: var(--green-900); color: #fff; border-color: var(--green-900); }
.btn-secondary { background: #fff; }
.list-stack { padding: 0 24px 24px; display: flex; flex-direction: column; gap: 12px; }
.list-card, .activity-card {
    background: var(--surface-soft); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px;
}
.list-card-top, .activity-card { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.activity-card { justify-content: flex-start; }
.list-title { font-weight: 700; font-size: .95rem; }
.list-subtitle { margin-top: 6px; font-size: .92rem; }
.list-subtitle.multiline { line-height: 1.6; }
.tag-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.tag-list.compact { margin-top: 0; }
.tag, .model-chip, .status-badge {
    display: inline-flex; align-items: center; border-radius: 999px; font-size: .78rem; font-weight: 600;
}
.tag { border: 1px solid var(--border); background: #fff; color: #334155; padding: 7px 10px; }
.tag.muted { background: #f1f5f9; }
.model-chip { border: 1px solid var(--border); background: #fff; color: #475569; padding: 8px 12px; margin-top: 12px; }
.status-badge { padding: 8px 11px; }
.status-badge.success { background: var(--green-100); color: #166534; }
.status-badge.info { background: #e0f2fe; color: #0369a1; }
.status-badge.warning { background: #fef3c7; color: #b45309; }
.status-badge.muted { background: #f1f5f9; color: #475569; }
.status-badge.dark { background: #0f172a; color: #fff; }
.status-badge.error { background: #fee2e2; color: #991b1b; }

@keyframes status-changed-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
    50%  { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}
.status-changed {
    animation: status-changed-pulse 1.5s ease-out forwards;
}
@keyframes forge-spin {
    to { transform: rotate(360deg); }
}
.forge-spinner {
    display: inline-block;
    width: 0.85em;
    height: 0.85em;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: forge-spin 0.75s linear infinite;
    vertical-align: middle;
    margin-right: 0.35em;
    flex-shrink: 0;
}
.table-wrapper { padding: 0 24px 24px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: 18px; overflow: hidden; }
thead { background: var(--surface-soft); color: var(--muted); }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
.repo-routing-cards { display: none; flex-direction: column; gap: 12px; padding: 0 24px 24px; }
.mobile-cards { display: none; flex-direction: column; gap: 12px; }
.repo-card {
    background: var(--surface-soft); border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 14px 16px; display: flex; flex-direction: column; gap: 8px;
}
.repo-card-row { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.repo-card-label { font-size: .8rem; font-weight: 600; color: var(--muted); min-width: 80px; padding-top: 1px; }
.repo-card-value { font-size: .9rem; color: var(--text); flex: 1; min-width: 0; }
.preview-body { display: flex; flex-direction: column; gap: 18px; }
.highlight-box {
    background: #f4fbf6; border: 1px solid #d6eadc; border-radius: var(--radius-md); padding: 16px;
}
.preview-title { font-size: 1.15rem; font-weight: 700; }
.preview-section { display: flex; flex-direction: column; gap: 10px; }
.preview-box {
    border: 1px solid var(--border); background: #fff; border-radius: var(--radius-md); padding: 16px;
}
.bullet-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 10px; }
.sticky-panel { position: sticky; top: 104px; }
.activity-icon {
    width: 32px; height: 32px; border-radius: 12px; background: #fff; border: 1px solid var(--border); color: var(--green-700);
    display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0;
}
.switch { position: relative; display: inline-block; width: 52px; height: 30px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; inset: 0; background: #cbd5e1; border-radius: 999px; transition: .2s ease;
}
.slider:before {
    content: ""; position: absolute; width: 22px; height: 22px; left: 4px; top: 4px; background: #fff; border-radius: 50%; transition: .2s ease;
}
.switch input:checked + .slider { background: var(--green-700); }
.switch input:checked + .slider:before { transform: translateX(22px); }

/* ── Issues filter bar ──────────────────────────────────────── */
.issues-filter-bar {
    display: flex; align-items: center; gap: 12px; margin-bottom: 1.5rem; flex-wrap: wrap;
}
.issues-filter-bar label { font-weight: 600; font-size: .88rem; white-space: nowrap; }
.issues-filter-bar select {
    flex: 1; min-width: 220px; padding: 0.5rem 0.75rem;
    border: 1px solid var(--border); border-radius: 8px;
    font-size: .9rem; background: #fff; color: var(--text);
}
.issues-filter-bar .filter-clear { font-size: .88rem; color: var(--muted); white-space: nowrap; }

/* ── Workflow phase tracker ─────────────────────────────────── */
.workflow-phase-tracker {
    display: flex; align-items: center; gap: 8px; padding: 0 0 20px; flex-wrap: wrap;
}
.phase-step {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 14px; border-radius: 999px;
    font-size: .82rem; font-weight: 600;
    border: 1px solid var(--border);
    background: var(--surface-soft); color: var(--muted);
}
.phase-step.done {
    background: var(--green-100); color: #166534; border-color: #bbf7d0;
}
.phase-step.active {
    background: var(--green-900); color: #fff; border-color: var(--green-900);
}
.phase-step-number {
    width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .72rem; font-weight: 700;
    background: rgba(100,116,139,.14);
}
.phase-step.done  .phase-step-number { background: rgba(22,101,52,.16); }
.phase-step.active .phase-step-number { background: rgba(255,255,255,.22); }
.phase-connector { color: var(--muted); font-size: .8rem; line-height: 1; padding: 0 2px; }
.phase-connector.passed { color: #166534; }

/* ── Notification panel ─────────────────────────────────────── */
.notif-wrapper { position: relative; }
.notif-trigger { position: relative; font-size: 1.1rem; }
.notif-badge {
    position: absolute; top: -5px; right: -5px;
    min-width: 18px; height: 18px; border-radius: 999px;
    background: #e53e3e; color: #fff; font-size: .7rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center; padding: 0 4px;
    pointer-events: none; line-height: 1;
}
.notif-panel {
    display: none; position: absolute; right: 0; top: calc(100% + 8px);
    width: 340px; max-height: 460px; overflow-y: auto;
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow); z-index: 300;
    flex-direction: column;
}
.notif-panel.open { display: flex; }
.notif-panel-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 16px; border-bottom: 1px solid var(--border);
    position: sticky; top: 0; background: #fff; z-index: 1;
    flex-shrink: 0;
}
.notif-panel-title { font-weight: 700; font-size: .95rem; }
.notif-mark-all {
    font-size: .8rem; font-weight: 600; color: var(--green-700);
    background: none; border: none; cursor: pointer; padding: 0;
}
.notif-mark-all:hover { text-decoration: underline; }
.notif-list { display: flex; flex-direction: column; }
.notif-item {
    display: flex; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--border);
    align-items: flex-start;
}
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: var(--green-100); }
.notif-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px;
}
.notif-dot.success { background: var(--green-700); }
.notif-dot.info { background: #0369a1; }
.notif-dot.warning { background: #b45309; }
.notif-dot.error { background: #991b1b; }
.notif-body { flex: 1; min-width: 0; }
.notif-msg { font-size: .88rem; line-height: 1.5; color: var(--text); }
.notif-time { font-size: .76rem; color: var(--muted); margin-top: 3px; }
.notif-dismiss {
    background: none; border: none; cursor: pointer; color: var(--muted);
    font-size: .8rem; padding: 0; flex-shrink: 0; line-height: 1; margin-top: 2px;
}
.notif-dismiss:hover { color: #e53e3e; }
.notif-empty { padding: 24px 16px; text-align: center; color: var(--muted); font-size: .9rem; margin: 0; }

/* ── Guided demo overlay ─────────────────────────────────────── */
.demo-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: none;
}
.demo-overlay.open { display: block; }
.demo-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .55);
}
.demo-overlay-panel {
    position: absolute;
    right: 24px;
    bottom: 24px;
    width: min(440px, calc(100vw - 32px));
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.demo-overlay-branding {
    display: flex;
    align-items: center;
    gap: 8px;
}
.demo-overlay-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--green-100);
    color: var(--green-900);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.demo-overlay-brand {
    font-size: .78rem;
    font-weight: 700;
    color: var(--text);
}
.demo-overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.demo-overlay-counter {
    font-size: .82rem;
    font-weight: 700;
    color: var(--muted);
}
.demo-overlay-title {
    font-size: 1.05rem;
    font-weight: 700;
}
.demo-overlay-description {
    color: #334155;
    line-height: 1.55;
}
.demo-overlay-summary {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafc;
    padding: 12px;
}
.demo-overlay-summary-title {
    margin: 0 0 8px;
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--muted);
}
.demo-overlay-summary-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 4px;
    color: #1e293b;
}
.demo-overlay-summary-value {
    margin: 10px 0 0;
    font-size: .86rem;
    color: #0f172a;
}
.demo-overlay-target-note {
    min-height: 1.2rem;
    margin: 0;
    font-size: .84rem;
    color: #b45309;
}
.demo-overlay-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 8px;
}
.demo-overlay-actions-main {
    display: flex;
    gap: 8px;
}
.demo-overlay-exit {
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.demo-overlay-exit:hover { color: #0f172a; }
.demo-highlight-target {
    position: relative !important;
    z-index: 510 !important;
    border-radius: 12px;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, .7), 0 16px 30px rgba(15, 23, 42, .22);
}

/* ── Mobile navigation ──────────────────────────────────────── */
.mobile-nav-toggle {
    display: none;
    width: 44px; height: 44px; border-radius: 16px; border: 1px solid var(--border);
    background: #fff; cursor: pointer; font-size: 1.1rem; line-height: 1;
    align-items: center; justify-content: center; flex-shrink: 0;
}
.sidebar-backdrop {
    display: none; position: fixed; inset: 0; z-index: 150; background: rgba(0,0,0,.35);
}
.sidebar-backdrop.open { display: block; }

/* ── Admin Dashboard ────────────────────────────────────────── */
.admin-main-grid {
    padding: 24px 32px;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr);
    gap: 24px;
    padding-bottom: 32px;
}
.admin-left-col, .admin-right-col {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.admin-stat-green { color: var(--green-700); }
.admin-stat-risk { color: #dc2626; }
.admin-stat-risk-card.has-risk {
    border-color: #fca5a5;
    background: #fef2f2;
}

/* Flow health bar */
.flow-bar-stack {
    display: flex;
    width: 100%;
    height: 32px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--border);
}
.flow-bar-segment {
    transition: width .3s ease;
}
.flow-bar-published { background: var(--green-700); }
.flow-bar-pending { background: #3b82f6; }
.flow-bar-working { background: #f59e0b; }
.flow-bar-error { background: #ef4444; }

.flow-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}
.flow-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .88rem;
}
.flow-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}
.flow-dot-published { background: var(--green-700); }
.flow-dot-pending { background: #3b82f6; }
.flow-dot-working { background: #f59e0b; }
.flow-dot-error { background: #ef4444; }
.flow-legend-label {
    flex: 1;
    color: var(--text);
}
.flow-legend-count {
    font-weight: 700;
    color: var(--text);
}
.flow-legend-pct {
    color: var(--muted);
    min-width: 48px;
    text-align: right;
}

/* Admin metrics */
.admin-metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
}
.admin-metric-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.admin-metric-label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
}
.admin-metric-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
}
.admin-metric-sub {
    font-size: .85rem;
    color: var(--muted);
}

/* Admin split bars */
.admin-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: .82rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 8px;
}
.admin-split-bar {
    display: flex;
    width: 100%;
    height: 24px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--border);
}
.admin-split-seg {
    transition: width .3s ease;
}
.admin-split-ai { background: var(--green-700); }
.admin-split-manual { background: #64748b; }
.admin-split-legend {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    font-size: .85rem;
    color: var(--muted);
}
.admin-split-ai-dot { background: var(--green-700); }
.admin-split-manual-dot { background: #64748b; }

/* Bottleneck detection */
.bottleneck-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.bottleneck-row:last-of-type {
    border-bottom: none;
}
.bottleneck-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.bottleneck-ok {
    background: var(--green-100);
}
.bottleneck-warn {
    background: #fef3c7;
}
.bottleneck-error {
    background: #fee2e2;
}
.bottleneck-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.bottleneck-title {
    font-size: .92rem;
    font-weight: 700;
    color: var(--text);
}
.bottleneck-desc {
    font-size: .82rem;
    color: var(--muted);
}
.bottleneck-count {
    font-size: 1.25rem;
    font-weight: 800;
    flex-shrink: 0;
    min-width: 40px;
    text-align: right;
}
.bottleneck-count-ok {
    color: var(--green-700);
}
.bottleneck-count-warn {
    color: #d97706;
}
.bottleneck-count-error {
    color: #dc2626;
}

/* Admin quick actions */
.admin-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.admin-action-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: background .2s ease, border-color .2s ease;
}
.admin-action-card:hover {
    background: #fff;
    border-color: var(--green-700);
}
.admin-action-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}
.admin-action-title {
    font-size: .92rem;
    font-weight: 700;
    color: var(--text);
}
.admin-action-desc {
    font-size: .8rem;
    color: var(--muted);
    margin-top: 2px;
}

/* Admin table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}
.admin-table thead {
    background: var(--surface-soft);
    color: var(--muted);
}
.admin-table th,
.admin-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}
.admin-table tbody tr:last-child td {
    border-bottom: none;
}
.admin-table tbody tr:hover {
    background: var(--surface-soft);
}

/* Team activity */
.team-member-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}
.team-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--green-700);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    flex-shrink: 0;
}
.team-avatar-ai {
    background: #3b82f6;
}
.team-name {
    font-weight: 600;
    color: var(--text);
}

/* ── Responsive form grids ──────────────────────────────────── */
.form-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 1rem; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin-bottom: 1rem; }
.form-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin-bottom: 1rem; }
.form-grid-2-auto { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: flex-end; margin-bottom: 1rem; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

@media (max-width: 1360px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .main-grid { grid-template-columns: 1fr; }
    .admin-main-grid { grid-template-columns: 1fr; }
    .sticky-panel { position: static; }
}

@media (max-width: 1100px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .25s ease;
        z-index: 200;
    }
    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 4px 0 32px rgba(0,0,0,.25);
    }
    .content-shell { margin-left: 0; }
    .mobile-nav-toggle { display: flex; }
    .filters-grid, .composer-grid, .two-panels { grid-template-columns: 1fr; }
    .topbar, .stats-grid, .main-grid, .admin-main-grid { padding-left: 20px; padding-right: 20px; }
    .form-grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .form-grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .admin-metrics-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-quick-actions { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .stats-grid { grid-template-columns: 1fr; }
    .button-row.two { grid-template-columns: 1fr; }
    .topbar { flex-direction: column; align-items: stretch; gap: 12px; }
    .topbar-actions { flex-wrap: wrap; gap: 8px; }
    .search-box { width: 100%; max-width: 100%; }
    .topbar, .stats-grid, .main-grid, .admin-main-grid { padding-left: 16px; padding-right: 16px; }
    .form-grid-4, .form-grid-3, .form-grid-2 { grid-template-columns: 1fr; }
    .form-grid-2-auto { grid-template-columns: 1fr; }
    .list-card-top { flex-wrap: wrap; }
    .panel-header { flex-wrap: wrap; }
    .panel-header-simple { flex-wrap: wrap; }
    .topbar-user { display: none; }
    table { font-size: .82rem; }
    th, td { padding: 8px 10px; }
    .panel-body { padding: 20px 16px; }
    .list-stack { padding: 0 0 16px; }
    .repo-routing-table { display: none; }
    .repo-routing-cards { display: flex; }
    .mobile-table { display: none; }
    .mobile-cards { display: flex; }
    .notif-panel {
        position: fixed;
        left: 16px;
        right: 16px;
        width: auto;
        max-height: calc(100svh - 96px);
    }
    .demo-overlay-panel {
        right: 12px;
        left: 12px;
        bottom: 12px;
        width: auto;
    }
    .admin-metrics-row { grid-template-columns: 1fr; }
    .admin-quick-actions { grid-template-columns: 1fr; }
}

/* ── Landing page ───────────────────────────────────────────── */
.landing-body {
    background: radial-gradient(circle at top left, rgba(57,166,85,.12), transparent 28%),
                linear-gradient(160deg, #f0f8f2, var(--bg) 60%);
}

.landing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: rgba(255,255,255,.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.landing-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.landing-hero {
    max-width: 1100px;
    margin: 0 auto;
    padding: 72px 40px 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 64px;
}

.landing-hero-inner {
    text-align: center;
    max-width: 700px;
}

.landing-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--green-800);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 8px 16px;
    margin-bottom: 28px;
}

.landing-headline {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.02em;
    color: var(--text);
    margin-bottom: 24px;
}

.landing-subtext {
    font-size: 1.1rem;
    line-height: 1.75;
    color: var(--muted);
    margin-bottom: 40px;
}

.landing-actions { display: flex; justify-content: center; }

.auth-login-shell {
    max-width: 520px;
    margin: 0 auto;
    padding: 64px 20px;
}

.auth-login-card {
    background: rgba(255,255,255,.95);
    border: 1px solid rgba(255,255,255,.7);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: 32px;
}

.auth-login-title {
    font-size: 1.9rem;
    margin-bottom: 10px;
}

.auth-login-subtitle {
    color: var(--muted);
    margin-bottom: 22px;
}

.auth-login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-login-form label {
    font-weight: 600;
    font-size: .92rem;
}

.auth-login-form input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    font: inherit;
    background: var(--surface-soft);
    margin-bottom: 4px;
}

.auth-login-error {
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 10px 12px;
}

.auth-login-divider {
    margin: 18px 0;
    text-align: center;
    color: var(--muted);
}

.auth-login-full {
    width: 100%;
}

.auth-login-alt-action {
    margin-top: 18px;
    font-size: .92rem;
    color: var(--muted);
    text-align: center;
}

.btn-landing {
    padding: 16px 32px;
    font-size: 1rem;
    border-radius: 20px;
}

.landing-features {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.landing-feature-card {
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(255,255,255,.7);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.landing-feature-icon {
    font-size: 1.75rem;
    line-height: 1;
}

.landing-feature-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.landing-feature-desc {
    font-size: .92rem;
    line-height: 1.65;
    color: var(--muted);
}

@media (max-width: 900px) {
    .landing-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .landing-hero { padding: 48px 24px 60px; }
}

@media (max-width: 560px) {
    .landing-features { grid-template-columns: 1fr; }
    .landing-header { padding: 16px 20px; }
    .landing-hero { padding: 40px 20px 48px; }
}

/* ── Pricing section ────────────────────────────────────────── */
.landing-pricing {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.landing-pricing-header {
    text-align: center;
    max-width: 560px;
}

.landing-pricing-title {
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--text);
    margin-bottom: 12px;
}

.landing-pricing-subtitle {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--muted);
}

.pricing-currency-toggle {
    display: flex;
    gap: 4px;
    background: rgba(0,0,0,.06);
    border-radius: 999px;
    padding: 4px;
    align-self: center;
}

.pricing-currency-btn {
    padding: 6px 18px;
    border: none;
    background: transparent;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: background .15s, color .15s;
}

.pricing-currency-btn:hover {
    color: var(--text);
}

.pricing-currency-btn-active {
    background: #fff;
    color: var(--green-700);
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
}

.landing-pricing-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
}

.pricing-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pricing-card {
    position: relative;
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(255,255,255,.7);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.pricing-card-featured {
    background: var(--green-900);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 20px 60px rgba(13, 71, 50, 0.35);
}

.pricing-popular-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--green-700);
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 6px 16px;
    border-radius: 999px;
    white-space: nowrap;
}

.pricing-card-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pricing-plan-name {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--green-700);
}

.pricing-card-featured .pricing-plan-name {
    color: rgba(220, 252, 231, .85);
}

.pricing-amount {
    font-size: 2.75rem;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1;
    display: flex;
    align-items: flex-start;
    gap: 2px;
}

.pricing-amount-custom {
    font-size: 2rem;
    align-items: center;
}

.pricing-currency {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 8px;
}

.pricing-period {
    font-size: 1rem;
    font-weight: 500;
    color: var(--muted);
    align-self: flex-end;
    margin-bottom: 6px;
}

.pricing-card-featured .pricing-period {
    color: rgba(220, 252, 231, .7);
}

.pricing-tagline {
    font-size: .92rem;
    line-height: 1.6;
    color: var(--muted);
}

.pricing-card-featured .pricing-tagline {
    color: rgba(220, 252, 231, .75);
}

.pricing-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: .92rem;
    line-height: 1.5;
    flex: 1;
}

.pricing-features li {
    color: var(--text);
}

.pricing-card-featured .pricing-features li {
    color: rgba(236, 253, 245, .9);
}

.btn-pricing {
    width: 100%;
    text-align: center;
    justify-content: center;
    padding: 14px 20px;
    border-radius: 18px;
}

.pricing-card-featured .btn-primary {
    background: #fff;
    color: var(--green-900);
    border-color: #fff;
}

@media (max-width: 900px) {
    .landing-pricing-grid { grid-template-columns: 1fr; max-width: 420px; }
    .pricing-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 100%; }
}

@media (max-width: 560px) {
    .landing-pricing-grid { max-width: 100%; }
    .pricing-grid-4 { grid-template-columns: 1fr; }
}
/* ── Landing header nav ──────────────────────────────────── */
.landing-nav {
    display: flex;
    gap: 4px;
}

.landing-nav-link {
    padding: 10px 18px;
    border-radius: 14px;
    font-size: .9rem;
    font-weight: 500;
    color: var(--text);
    transition: background .15s ease, color .15s ease;
}

.landing-nav-link:hover {
    background: var(--green-100);
    color: var(--green-800);
}

/* ── How It Works page ───────────────────────────────────── */
.hiw-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 72px 40px 80px;
    display: flex;
    flex-direction: column;
    gap: 80px;
}

.hiw-hero {
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.hiw-hero .landing-actions {
    gap: 12px;
}

/* Steps */
.hiw-steps {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.hiw-steps-header {
    text-align: center;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hiw-steps-list {
    width: 100%;
    max-width: 760px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.hiw-step {
    width: 100%;
    display: flex;
    gap: 24px;
    align-items: flex-start;
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(255,255,255,.7);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: 32px;
}

.hiw-step-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--green-800);
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hiw-step-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.hiw-step-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.hiw-step-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
}

.hiw-step-desc {
    font-size: .95rem;
    line-height: 1.7;
    color: var(--muted);
    margin: 0;
}

.hiw-step-connector {
    font-size: 1.5rem;
    color: var(--green-700);
    padding: 8px 0;
    line-height: 1;
}

/* Example boxes */
.hiw-step-example {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.hiw-example-label {
    font-size: .76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
}

.hiw-example-content {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    font-size: .9rem;
    line-height: 1.65;
    color: var(--text);
    font-style: italic;
}

.hiw-example-issue {
    font-style: normal;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hiw-issue-title {
    font-weight: 700;
    font-size: .95rem;
}

.hiw-issue-section {
    font-size: .88rem;
    color: var(--muted);
    line-height: 1.6;
}

.hiw-issue-section ul {
    margin: 4px 0 0 1.25rem;
    padding: 0;
}

.hiw-issue-label {
    font-weight: 700;
    color: var(--text);
    margin-right: 6px;
}

.hiw-issue-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.hiw-tag {
    background: var(--green-100);
    color: var(--green-800);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: .78rem;
    font-weight: 600;
}

.hiw-example-result {
    display: flex;
    align-items: center;
    gap: 10px;
    font-style: normal;
}

.hiw-result-icon {
    font-size: 1.2rem;
}

/* Capabilities grid */
.hiw-capabilities {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.hiw-caps-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.hiw-cap-card {
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(255,255,255,.7);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hiw-cap-icon {
    font-size: 1.75rem;
    line-height: 1;
}

.hiw-cap-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.hiw-cap-desc {
    font-size: .92rem;
    line-height: 1.65;
    color: var(--muted);
    margin: 0;
}

/* CTA */
.hiw-cta {
    display: flex;
    justify-content: center;
}

.hiw-cta-inner {
    text-align: center;
    background: var(--green-900);
    border-radius: var(--radius-xl);
    padding: 56px 40px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.hiw-cta-title {
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -.02em;
    color: #fff;
    margin: 0;
}

.hiw-cta-subtitle {
    font-size: 1rem;
    color: rgba(220,252,231,.8);
    line-height: 1.7;
    max-width: 480px;
    margin: 0;
}

.hiw-cta-inner .btn-primary {
    background: #fff;
    color: var(--green-900);
    border-color: #fff;
}

.hiw-cta-inner .btn-primary:hover {
    background: var(--green-100);
    border-color: var(--green-100);
}

@media (max-width: 900px) {
    .hiw-caps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hiw-page { padding: 48px 24px 60px; gap: 60px; }
}

@media (max-width: 560px) {
    .hiw-caps-grid { grid-template-columns: 1fr; }
    .hiw-page { padding: 40px 20px 48px; gap: 48px; }
    .hiw-step { flex-direction: column; gap: 16px; }
    .hiw-cta-inner { padding: 40px 24px; }
    .landing-nav { display: none; }
}

/* ── Pricing page ───────────────────────────────────────────── */
.pricing-page {
    padding-bottom: 80px;
}

.pricing-hero-inner {
    max-width: 640px;
}

.pricing-comparison {
    width: 100%;
    max-width: 960px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 24px;
}

.pricing-comparison-title {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--text);
    text-align: center;
}

.pricing-table-wrapper {
    overflow-x: auto;
}

.pricing-comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

.pricing-comparison-table th,
.pricing-comparison-table td {
    padding: 12px 16px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.pricing-comparison-table th {
    font-weight: 700;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--green-700);
    background: var(--surface-soft);
}

.pricing-feature-col {
    text-align: left !important;
    min-width: 200px;
}

.pricing-feature-label {
    text-align: left !important;
    color: var(--text);
    font-weight: 500;
}

.pricing-col-featured {
    background: rgba(13, 71, 50, .04);
    font-weight: 600;
    color: var(--green-900);
}

.pricing-cta-row td {
    padding-top: 20px;
    padding-bottom: 20px;
    border-bottom: none;
}

.btn-pricing-sm {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: .85rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

/* ── Enterprise card accent ─────────────────────────────────── */
.pricing-card-enterprise {
    border-color: var(--green-700);
    box-shadow: 0 0 0 1px var(--green-700), var(--shadow);
}

/* ── Roadmap badge (inline) ─────────────────────────────────── */
.pricing-roadmap-badge {
    display: inline-block;
    background: var(--green-100);
    color: var(--green-800);
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    padding: 2px 8px;
    border-radius: 999px;
    vertical-align: middle;
    margin-left: 4px;
}

/* ── Add-ons section ─────────────────────────────────────────── */
.pricing-addons {
    width: 100%;
    max-width: 960px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 24px;
}

.pricing-addons-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.pricing-addons-subtitle {
    font-size: .95rem;
    color: var(--muted);
    line-height: 1.6;
    text-align: center;
    max-width: 600px;
}

.pricing-addons-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.pricing-addon-card {
    background: rgba(255,255,255,.92);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pricing-addon-card-sso {
    border-style: dashed;
    opacity: .85;
}

.pricing-addon-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.pricing-addon-name {
    font-size: .92rem;
    font-weight: 700;
    color: var(--text);
}

.pricing-addon-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--green-800);
    letter-spacing: -.02em;
}

.pricing-addon-price span {
    font-size: .85rem;
    font-weight: 500;
    color: var(--muted);
}

.pricing-addon-desc {
    font-size: .88rem;
    color: var(--muted);
    line-height: 1.6;
}

.pricing-addons-note {
    font-size: .88rem;
    color: var(--muted);
    text-align: center;
}

/* ── Why Enterprise section ─────────────────────────────────── */
.pricing-why-enterprise {
    width: 100%;
    max-width: 960px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 24px;
}

.pricing-why-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.pricing-why-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.pricing-why-card {
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(255,255,255,.7);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pricing-why-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.pricing-why-title {
    font-size: .95rem;
    font-weight: 700;
    margin: 0;
    color: var(--text);
}

.pricing-why-desc {
    font-size: .88rem;
    color: var(--muted);
    line-height: 1.65;
    margin: 0;
}

@media (max-width: 900px) {
    .pricing-addons-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pricing-why-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .pricing-addons-grid { grid-template-columns: 1fr; }
    .pricing-why-grid { grid-template-columns: 1fr; }
}

/* ── Subscription management page ───────────────────────────── */
.subscription-current-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    flex-wrap: wrap;
}

.subscription-plan-badge {
    padding: 6px 16px;
    background: var(--green-900);
    color: #fff;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    white-space: nowrap;
}

.subscription-plan-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.subscription-plan-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.subscription-price-amount {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
}

.subscription-price-period {
    font-size: .9rem;
    color: var(--muted);
}

.subscription-status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.subscription-limits-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.subscription-limit-card {
    padding: 16px 20px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.subscription-limit-icon {
    font-size: 1.25rem;
}

.subscription-limit-label {
    font-size: .85rem;
    color: var(--muted);
    font-weight: 500;
}

.subscription-limit-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.subscription-limit-max {
    font-size: .9rem;
    font-weight: 400;
    color: var(--muted);
}

.subscription-usage-bar {
    height: 6px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 4px;
}

.subscription-usage-fill {
    height: 100%;
    background: var(--green-700);
    border-radius: 999px;
    transition: width .3s ease;
}

.subscription-usage-warn { background: #d97706; }
.subscription-usage-danger { background: #dc2626; }

.subscription-plans-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.subscription-plan-option {
    padding: 24px 20px;
    background: var(--surface-soft);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.subscription-plan-option-featured {
    background: var(--green-900);
    border-color: var(--green-900);
    color: #fff;
}

.subscription-plan-current {
    border-color: var(--green-700);
    background: var(--green-100);
}

.subscription-plan-option-featured.subscription-plan-current {
    background: var(--green-900);
    border-color: #fff;
}

.subscription-plan-option-name {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--green-700);
}

.subscription-plan-option-featured .subscription-plan-option-name {
    color: rgba(220, 252, 231, .85);
}

.subscription-plan-option-price {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1;
    color: var(--text);
}

.subscription-plan-option-price span {
    font-size: 1rem;
    font-weight: 500;
    color: var(--muted);
}

.subscription-plan-option-featured .subscription-plan-option-price {
    color: #fff;
}

.subscription-plan-option-featured .subscription-plan-option-price span {
    color: rgba(220, 252, 231, .7);
}

.subscription-plan-option-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: .88rem;
    flex: 1;
}

.subscription-plan-option-features li::before {
    content: "✓ ";
    color: var(--green-700);
    font-weight: 700;
}

.subscription-plan-option-featured .subscription-plan-option-features li::before {
    color: rgba(220, 252, 231, .85);
}

@media (max-width: 900px) {
    .subscription-plans-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .subscription-limits-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pricing-comparison { max-width: 100%; padding: 0 4px; }
}

@media (max-width: 560px) {
    .subscription-plans-grid { grid-template-columns: 1fr; }
    .subscription-limits-grid { grid-template-columns: 1fr; }
}
