:root {
    --pi-green: #06462f;
    --pi-green-deep: #033522;
    --pi-green-black: #02281b;
    --pi-green-card: #075038;
    --pi-orange: #f58220;
    --pi-orange-soft: rgba(245,130,32,.13);
    --pi-white: #f5fbf8;
    --pi-muted: #b7ccc2;
    --pi-line: rgba(255,255,255,.12);
    --pi-shadow: 0 16px 44px rgba(0,0,0,.15);
}

body.dashboard-page,
body.secure-admin-page,
body.group-workspace-page,
body.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 92% 3%, rgba(245,130,32,.08), transparent 28rem),
        linear-gradient(180deg,var(--pi-green) 0%,var(--pi-green-deep) 64%,var(--pi-green-black) 100%) !important;
    color: var(--pi-white) !important;
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
}

.topbar,
.secure-admin-topbar,
.group-workspace-topbar,
.compact-secure-topbar {
    border-bottom: 1px solid rgba(245,130,32,.65) !important;
    background: rgba(3,48,32,.98) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,.13) !important;
    color: #fff !important;
}

.brand-lockup strong,
.topbar .user-name {
    color: #fff !important;
}

.brand-lockup small,
.topbar .user-role {
    color: #b9d0c4 !important;
}

.ghost-button,
.ghost-link,
.nav-toggle,
.compact-menu-button {
    border-color: rgba(255,255,255,.16) !important;
    background: rgba(255,255,255,.06) !important;
    color: #fff !important;
}

.ghost-button:hover,
.ghost-link:hover,
.nav-toggle:hover,
.compact-menu-button:hover {
    border-color: rgba(245,130,32,.55) !important;
    background: rgba(245,130,32,.12) !important;
}

.eyebrow {
    color: var(--pi-orange) !important;
}

.system-status,
.status-pill,
.secure-pill,
.baseline-pill,
.module-state,
.membership-config-pill {
    border: 1px solid rgba(255,255,255,.1) !important;
    background: rgba(255,255,255,.06) !important;
    color: #d7e9df !important;
}

.main-content,
.operations-shell,
.membership-main,
.registry-main,
.registry-shell,
.group-workspace-main,
.access-admin-main,
.compact-secure-main {
    background: transparent !important;
    color: var(--pi-white) !important;
}

.page-heading,
.simple-page-heading,
.compact-secure-heading,
.workspace-hero,
.secure-admin-section,
.panel,
.ops-panel,
.membership-module,
.workspace-panel,
.group-access-governance,
.simple-access-panel,
.compact-work-panel,
.compact-technology-tools {
    border-color: var(--pi-line) !important;
    background:
        linear-gradient(155deg,rgba(7,79,54,.92),rgba(3,52,35,.96)) !important;
    box-shadow: var(--pi-shadow) !important;
    color: var(--pi-white) !important;
}

.page-heading h1,
.page-heading h2,
.simple-page-heading h1,
.simple-page-heading h2,
.compact-secure-heading h1,
.workspace-hero h1,
.panel h2,
.ops-panel h2,
.membership-module h2,
.workspace-panel h2,
.secure-admin-section h2,
.simple-access-panel strong,
.compact-work-panel h2 {
    color: #fff !important;
}

.page-heading p:not(.eyebrow),
.simple-page-heading p:not(.eyebrow),
.compact-secure-heading p:not(.eyebrow),
.workspace-hero p:not(.eyebrow),
.panel p:not(.eyebrow),
.ops-panel p:not(.eyebrow),
.membership-module p:not(.eyebrow),
.workspace-panel p:not(.eyebrow),
.simple-access-panel small,
.compact-work-panel small {
    color: var(--pi-muted) !important;
}

.metric-card,
.secure-metric-card,
.workspace-metrics article,
.compact-metric-strip a,
.simple-action-card {
    border-color: var(--pi-line) !important;
    background: rgba(255,255,255,.055) !important;
    box-shadow: 0 8px 24px rgba(0,0,0,.08) !important;
    color: #fff !important;
}

.metric-card:nth-child(odd),
.secure-metric-card:nth-child(odd),
.compact-metric-strip a:nth-child(odd) {
    border-top-color: var(--pi-orange) !important;
}

.metric-card:nth-child(even),
.secure-metric-card:nth-child(even),
.compact-metric-strip a:nth-child(even) {
    border-top-color: #43a978 !important;
}

.metric-label,
.metric-card small,
.secure-metric-card span,
.secure-metric-card small,
.workspace-metrics span,
.workspace-metrics small,
.compact-metric-strip span,
.compact-metric-strip small {
    color: var(--pi-muted) !important;
}

.metric-value,
.secure-metric-card strong,
.workspace-metrics strong,
.compact-metric-strip strong {
    color: #fff !important;
}

input,
select,
textarea,
.search-box input,
.ops-toolbar input,
.ops-toolbar select,
.task-form input,
.task-form select,
.task-form textarea,
.access-form input,
.access-form select,
.group-access-form select {
    border-color: rgba(255,255,255,.14) !important;
    background: rgba(255,255,255,.07) !important;
    color: #fff !important;
}

select option {
    color: #17251e !important;
    background: #fff !important;
}

input::placeholder,
textarea::placeholder {
    color: #98b5a6 !important;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--pi-orange) !important;
    box-shadow: 0 0 0 3px rgba(245,130,32,.12) !important;
}

.primary-button,
.task-submit,
.inline-role-form button,
.inline-status-form button,
.access-table button {
    border-color: #ff9a43 !important;
    background: var(--pi-orange) !important;
    color: #122319 !important;
    font-weight: 850 !important;
}

.operations-tabs {
    border-color: var(--pi-line) !important;
    background: rgba(2,41,27,.7) !important;
}

.ops-tab {
    color: #c6dacf !important;
}

.ops-tab.active,
.ops-tab:hover {
    background: rgba(245,130,32,.14) !important;
    color: #fff !important;
}

.record-list,
.detail-pane,
.task-list,
.workspace-record,
.workspace-empty,
.group-assignment-register,
.access-table-wrap {
    border-color: var(--pi-line) !important;
    background: rgba(255,255,255,.045) !important;
    color: #fff !important;
}

.record-list article,
.task-list article,
.workspace-record {
    border-color: rgba(255,255,255,.09) !important;
    background: rgba(255,255,255,.035) !important;
}

.record-list strong,
.task-list strong,
.workspace-record strong,
.detail-pane h3 {
    color: #fff !important;
}

.record-list small,
.task-list small,
.workspace-record small,
.detail-pane p {
    color: var(--pi-muted) !important;
}

table,
.access-table,
.registry-table {
    color: #eef8f3 !important;
}

table th,
.access-table th,
.registry-table th {
    background: rgba(2,39,26,.97) !important;
    color: #b9d0c4 !important;
    border-bottom-color: rgba(255,255,255,.1) !important;
}

table td,
.access-table td,
.registry-table td {
    border-bottom-color: rgba(255,255,255,.08) !important;
    color: #e8f3ed !important;
}

.sidebar,
.group-workspace-sidebar,
.secure-admin-sidebar,
.secure-admin-drawer {
    border-color: rgba(255,255,255,.1) !important;
    background:
        linear-gradient(180deg,#043a27 0%,#032f20 68%,#022419 100%) !important;
    color: #fff !important;
}

.nav-links a,
.group-workspace-nav > a,
.group-workspace-nav summary,
.secure-admin-nav > a,
.secure-admin-nav summary,
.secure-drawer-nav > a,
.secure-drawer-nav summary,
.secure-drawer-nav details > a {
    color: rgba(255,255,255,.8) !important;
}

.nav-links a.active,
.nav-links a:hover,
.group-workspace-nav > a.active,
.group-workspace-nav > a:hover,
.secure-admin-nav > a.active,
.secure-admin-nav > a:hover,
.secure-drawer-nav > a.active,
.secure-drawer-nav > a:hover,
.secure-drawer-nav details > a:hover {
    border-left-color: var(--pi-orange) !important;
    background: rgba(255,255,255,.1) !important;
    color: #fff !important;
}

.nav-group,
.secure-drawer-nav details {
    border-color: rgba(255,255,255,.09) !important;
    background: rgba(255,255,255,.035) !important;
}

.compact-workspace-grid {
    gap: 10px !important;
}

.compact-action-list a {
    border-color: rgba(255,255,255,.09) !important;
    background: rgba(255,255,255,.035) !important;
    color: #fff !important;
}

.compact-action-list a:hover {
    border-color: rgba(245,130,32,.35) !important;
    background: rgba(245,130,32,.08) !important;
}

.compact-action-list strong {
    color: #fff !important;
}

.compact-action-list b {
    color: #ffab62 !important;
}

.simple-access-panel[open] summary {
    border-bottom-color: rgba(255,255,255,.1) !important;
    background: rgba(245,130,32,.08) !important;
}

.simple-access-panel summary strong {
    color: #fff !important;
}

.simple-access-panel summary small {
    color: var(--pi-muted) !important;
}

.role-badge,
.protected-label,
.status-live,
.status-off {
    border-color: rgba(255,255,255,.1) !important;
    background: rgba(255,255,255,.07) !important;
    color: #dceee5 !important;
}

.login-shell {
    min-height: 100vh !important;
    background: transparent !important;
}

.login-brand,
.login-card {
    border-color: var(--pi-line) !important;
    background:
        linear-gradient(155deg,rgba(7,79,54,.94),rgba(3,52,35,.98)) !important;
    box-shadow: var(--pi-shadow) !important;
    color: #fff !important;
}

.login-brand h1,
.login-card h2 {
    color: #fff !important;
}

.login-intro,
.security-note {
    color: var(--pi-muted) !important;
}

.login-card label {
    color: #dcece4 !important;
}

.login-card input {
    border-color: rgba(255,255,255,.14) !important;
    background: rgba(255,255,255,.07) !important;
    color: #fff !important;
}

.alert {
    border-color: rgba(255,120,120,.25) !important;
    background: rgba(150,30,30,.16) !important;
    color: #ffd5d5 !important;
}

.map-panel,
.map-hero,
.map-info-rail,
.state-panel {
    border-color: var(--pi-line) !important;
    background:
        linear-gradient(155deg,rgba(7,79,54,.94),rgba(3,52,35,.97)) !important;
    color: #fff !important;
}

.map-hero-overlay h1,
.state-panel h3,
.map-panel h2 {
    color: #fff !important;
}

.map-hero-overlay p,
.state-panel p,
.map-baseline,
.map-key {
    color: var(--pi-muted) !important;
}

.map-stage {
    border-color: rgba(255,255,255,.1) !important;
    background:
        radial-gradient(circle at 50% 45%,rgba(245,130,32,.11),transparent 25rem),
        linear-gradient(180deg,#e6f0eb,#d4e3db) !important;
}

.group-card,
.support-card {
    border-color: rgba(255,255,255,.1) !important;
    background: rgba(255,255,255,.045) !important;
    color: #fff !important;
}

.group-card strong,
.support-card strong {
    color: #fff !important;
}

.group-card small,
.support-card small {
    color: var(--pi-muted) !important;
}

.workspace-authority {
    border-color: rgba(245,130,32,.28) !important;
    background: rgba(245,130,32,.08) !important;
}

.workspace-authority span,
.workspace-authority small {
    color: var(--pi-muted) !important;
}

.workspace-authority strong {
    color: #fff !important;
}

/* Unified type hierarchy */
.dashboard-page h1,
.secure-admin-page h1,
.group-workspace-page h1,
.login-page h1 {
    color: #fff !important;
    font-size: clamp(2rem,3.4vw,3.15rem) !important;
    font-weight: 780 !important;
    line-height: .98 !important;
    letter-spacing: -.045em !important;
}

.dashboard-page h2,
.secure-admin-page h2,
.group-workspace-page h2,
.login-page h2 {
    color: #fff !important;
    font-size: clamp(1.22rem,2vw,1.72rem) !important;
    font-weight: 760 !important;
    line-height: 1.08 !important;
    letter-spacing: -.025em !important;
}

.dashboard-page h3,
.secure-admin-page h3,
.group-workspace-page h3 {
    color: #fff !important;
    font-size: clamp(.88rem,1.2vw,1.08rem) !important;
    font-weight: 750 !important;
    line-height: 1.16 !important;
}

.dashboard-page .eyebrow,
.secure-admin-page .eyebrow,
.group-workspace-page .eyebrow,
.login-page .eyebrow {
    color: var(--pi-orange) !important;
    font-size: .62rem !important;
    font-weight: 900 !important;
    letter-spacing: .11em !important;
}

@media (max-width: 760px) {
    .topbar,
    .secure-admin-topbar,
    .group-workspace-topbar {
        min-height: 58px;
        padding: 6px 9px !important;
    }

    .main-content,
    .operations-shell,
    .membership-main,
    .registry-main,
    .registry-shell,
    .group-workspace-main,
    .access-admin-main,
    .compact-secure-main {
        padding-left: 9px !important;
        padding-right: 9px !important;
    }

    .sidebar,
    .group-workspace-sidebar {
        background: transparent !important;
    }

    .nav-links,
    .group-workspace-nav {
        background: rgba(3,48,32,.99) !important;
        border-color: rgba(255,255,255,.12) !important;
    }
}

.workspace-heading-link {
    padding: 6px 8px;
    border: 1px solid rgba(245,130,32,.3);
    border-radius: 8px;
    background: rgba(245,130,32,.08);
    color: #ffb06a !important;
    text-decoration: none;
    font-size: .62rem;
    font-weight: 850;
}

.workspace-record-pending {
    border-left: 4px solid var(--pi-orange) !important;
}

.workspace-record-actions {
    margin-top: 8px;
}

.workspace-record-actions button {
    padding: 6px 8px;
    border: 1px solid #ff9b45;
    border-radius: 8px;
    background: var(--pi-orange);
    color: #112218;
    cursor: pointer;
    font-size: .62rem;
    font-weight: 900;
}

.workspace-record-actions button:disabled {
    opacity: .62;
    cursor: wait;
}
