:root {
    --forest: #06140f;
    --forest2: #0a2118;
    --leaf: #38d36f;
    --leaf2: #8ff0a4;
    --lime: #c8ff5a;
    --water: #3cc8ff;
    --earth: #9b7a45;
    --sand: #f3e7c8;
    --white: #f5fff8;
    --muted: #b8cbbb;
    --darkmuted: #5b6d61;
    --panel: rgba(255,255,255,.075);
    --panel2: rgba(255,255,255,.045);
    --border: rgba(255,255,255,.14);
    --shadow: 0 28px 70px rgba(0,0,0,.32);
    --radius: 26px;
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at 18% 2%, rgba(56,211,111,.22), transparent 32%),
        radial-gradient(circle at 90% 8%, rgba(60,200,255,.16), transparent 30%),
        linear-gradient(180deg, #06140f 0%, #071a13 42%, #050d0a 100%);
    color: var(--white);
}

.site-shell {
    min-height: 100vh;
    background-image:
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 54px 54px;
}

a {
    color: var(--leaf2);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 28px;
    background: rgba(6,20,15,.86);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(16px);
}

.brand a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -.02em;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 14px;
    color: #05200e;
    background: linear-gradient(135deg, var(--leaf), var(--lime));
    box-shadow: 0 0 28px rgba(56,211,111,.25);
}

nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 13px;
    flex-wrap: wrap;
}

nav a {
    color: #d8eadc;
    font-size: 14px;
    font-weight: 700;
    opacity: .88;
}

nav a:hover {
    color: #fff;
    opacity: 1;
}

.admin-link {
    border: 1px solid rgba(143,240,164,.35);
    border-radius: 999px;
    padding: 8px 13px;
    color: #fff;
    background: rgba(56,211,111,.08);
}

.hero {
    max-width: 1240px;
    margin: auto;
    padding: 76px 28px 46px;
}

.hero-tight {
    max-width: 1160px;
    margin: auto;
    padding: 58px 28px 30px;
}

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--lime);
    text-transform: uppercase;
    letter-spacing: .16em;
    font-size: 12px;
    font-weight: 900;
}

.kicker:before {
    content: "";
    width: 24px;
    height: 2px;
    background: linear-gradient(90deg, var(--leaf), var(--lime));
    border-radius: 999px;
}

h1 {
    max-width: 980px;
    margin: 16px 0 18px;
    font-size: clamp(42px, 6.4vw, 84px);
    line-height: .92;
    letter-spacing: -.07em;
}

h2 {
    margin: 0 0 16px;
    font-size: clamp(28px, 3vw, 44px);
    line-height: 1;
    letter-spacing: -.04em;
}

h3 {
    margin: 0 0 10px;
    font-size: 21px;
}

.lead {
    max-width: 900px;
    margin: 0;
    color: #c7dbca;
    font-size: clamp(18px, 2vw, 23px);
    line-height: 1.55;
}

.hero-card {
    margin-top: 34px;
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 18px;
}

.recycling-banner {
    min-height: 320px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(56,211,111,.22), rgba(60,200,255,.12)),
        radial-gradient(circle at 20% 30%, rgba(200,255,90,.2), transparent 28%),
        rgba(255,255,255,.045);
    box-shadow: var(--shadow);
    padding: 30px;
    overflow: hidden;
    position: relative;
}

.recycling-banner:after {
    content: "♻";
    position: absolute;
    right: -24px;
    bottom: -58px;
    font-size: 230px;
    opacity: .12;
    line-height: 1;
}

.recycling-banner strong {
    display: block;
    max-width: 560px;
    font-size: clamp(28px, 4vw, 52px);
    line-height: .98;
    letter-spacing: -.05em;
}

.recycling-banner p {
    max-width: 650px;
    color: #d9f2df;
    font-size: 18px;
    line-height: 1.55;
}

.callout-list {
    display: grid;
    gap: 12px;
}

.callout {
    border: 1px solid var(--border);
    border-radius: 20px;
    background: rgba(255,255,255,.06);
    padding: 18px;
}

.callout b {
    color: #fff;
}

.callout span {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    line-height: 1.45;
}

.cta-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 28px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 13px 18px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.07);
    color: #fff;
    font-weight: 900;
    box-shadow: 0 12px 30px rgba(0,0,0,.18);
}

.btn.primary {
    border: 0;
    background: linear-gradient(135deg, var(--leaf), var(--lime));
    color: #06140f;
}

.btn.blue {
    border: 0;
    background: linear-gradient(135deg, var(--water), var(--leaf2));
    color: #06140f;
}

.section {
    max-width: 1240px;
    margin: auto;
    padding: 34px 28px;
}

.section.light {
    max-width: none;
    margin-top: 34px;
    background:
        radial-gradient(circle at 10% 0%, rgba(56,211,111,.12), transparent 30%),
        rgba(255,255,255,.04);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section.light > .inner {
    max-width: 1240px;
    margin: auto;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 18px;
}

.grid.two {
    grid-template-columns: repeat(2, minmax(0,1fr));
}

.grid.four {
    grid-template-columns: repeat(4, minmax(0,1fr));
}

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(255,255,255,.078), rgba(255,255,255,.035));
    box-shadow: var(--shadow);
    padding: 25px;
}

.card.green {
    background:
        linear-gradient(135deg, rgba(56,211,111,.16), rgba(255,255,255,.035));
}

.card.earth {
    background:
        linear-gradient(135deg, rgba(155,122,69,.2), rgba(255,255,255,.035));
}

.card.water {
    background:
        linear-gradient(135deg, rgba(60,200,255,.15), rgba(255,255,255,.035));
}

.card p,
.card li {
    color: var(--muted);
    line-height: 1.58;
}

.card ul {
    margin-bottom: 0;
    padding-left: 20px;
}

.icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    margin-bottom: 14px;
    color: #06140f;
    background: linear-gradient(135deg, var(--leaf), var(--lime));
    font-size: 24px;
    font-weight: 900;
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}

.badge {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(143,240,164,.24);
    border-radius: 999px;
    padding: 8px 11px;
    background: rgba(56,211,111,.08);
    color: #dfffe5;
    font-size: 13px;
    font-weight: 800;
}

.process {
    counter-reset: step;
}

.process .card {
    position: relative;
    overflow: hidden;
}

.process .card:before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    right: 18px;
    top: 10px;
    font-size: 72px;
    line-height: 1;
    color: rgba(255,255,255,.07);
    font-weight: 900;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 14px;
}

.stat {
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(255,255,255,.055);
    padding: 20px;
}

.stat strong {
    display: block;
    font-size: 36px;
    line-height: 1;
    color: var(--lime);
}

.stat span {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    line-height: 1.35;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 14px;
}

.table th,
.table td {
    border-bottom: 1px solid var(--border);
    padding: 12px;
    text-align: left;
    vertical-align: top;
    color: var(--muted);
}

.table th {
    color: #fff;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: 12px;
}

.admin-wrap {
    max-width: 1420px;
    margin: auto;
    padding: 28px;
}

.admin-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 22px;
}

.sidebar {
    background: rgba(255,255,255,.04);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 16px;
    height: fit-content;
}

.sidebar a {
    display: block;
    padding: 11px 12px;
    color: var(--muted);
    border-radius: 10px;
}

.sidebar a:hover,
.sidebar a.active {
    background: rgba(83,224,141,.11);
    color: #fff;
    text-decoration: none;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 12px;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #08140f;
    color: #fff;
}

textarea {
    min-height: 110px;
}

label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 13px;
}

.form-card {
    display: grid;
    gap: 12px;
}

.notice {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(83,224,141,.12);
    border: 1px solid rgba(83,224,141,.28);
    color: #dfffee;
}

.footer {
    margin-top: 58px;
    padding: 36px 28px 26px;
    border-top: 1px solid var(--border);
    background: rgba(0,0,0,.16);
}

.footer-grid {
    max-width: 1240px;
    margin: auto;
    display: grid;
    grid-template-columns: 1.4fr 1fr .7fr;
    gap: 24px;
}

.footer p {
    color: var(--muted);
    line-height: 1.55;
}

.footer-bottom {
    max-width: 1240px;
    margin: 24px auto 0;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--darkmuted);
    font-size: 13px;
}

@media (max-width: 980px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    nav {
        justify-content: flex-start;
    }

    .hero-card,
    .grid,
    .grid.two,
    .grid.four,
    .stat-grid,
    .footer-grid,
    .admin-grid,
    .form-row {
        grid-template-columns: 1fr;
    }

    .recycling-banner {
        min-height: 260px;
    }
}

/* === Phase 3 Technology Hub Enhancements === */

.tech-banner {
    background:
        linear-gradient(135deg, rgba(56,211,111,.24), rgba(60,200,255,.18)),
        radial-gradient(circle at 72% 18%, rgba(200,255,90,.22), transparent 30%),
        radial-gradient(circle at 25% 75%, rgba(255,255,255,.08), transparent 26%),
        rgba(255,255,255,.045);
}

.tech-banner:before {
    content: "";
    position: absolute;
    inset: 18px;
    border: 1px dashed rgba(255,255,255,.15);
    border-radius: 22px;
    pointer-events: none;
}

.mini-link {
    display: inline-flex;
    margin-top: 12px;
    font-weight: 900;
    color: var(--lime);
}

.warning-card {
    border-color: rgba(242,201,76,.35);
    background:
        linear-gradient(135deg, rgba(242,201,76,.13), rgba(255,255,255,.035));
}

.warning-card h2,
.warning-card h3 {
    color: #ffe08a;
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 18px;
}

.matrix-table th,
.matrix-table td {
    border-bottom: 1px solid var(--border);
    padding: 14px;
    vertical-align: top;
    text-align: left;
}

.matrix-table th {
    color: #fff;
    background: rgba(56,211,111,.08);
}

.matrix-table td {
    color: var(--muted);
}

@media (max-width: 980px) {
    .topbar nav a {
        font-size: 13px;
    }
}

/* === Phase 4 Private Technology Document Library === */

input[type="file"] {
    padding: 10px;
    background: rgba(255,255,255,.04);
}

small {
    color: var(--darkmuted);
}

.table .btn {
    box-shadow: none;
}

.warning-card {
    border-color: rgba(242,201,76,.35);
    background:
        linear-gradient(135deg, rgba(242,201,76,.13), rgba(255,255,255,.035));
}

.warning-card h2,
.warning-card h3 {
    color: #ffe08a;
}

@media (max-width: 1100px) {
    .table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* === Phase 5 LOI Generator / Print Letters === */

.print-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
}

.letter-preview {
    max-width: 850px;
    margin: 18px auto;
    padding: 48px;
    border-radius: 16px;
    background: #ffffff;
    color: #111111;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 16px;
    line-height: 1.55;
    box-shadow: 0 26px 80px rgba(0,0,0,.35);
    white-space: normal;
}

.letter-preview * {
    color: #111111;
}

@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }

    .topbar,
    .sidebar,
    .footer,
    .card,
    .notice,
    .print-actions,
    h1,
    .admin-wrap > .admin-grid > aside {
        display: none !important;
    }

    .site-shell,
    .admin-wrap,
    .admin-grid,
    main {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        background: #ffffff !important;
        color: #000000 !important;
        max-width: none !important;
    }

    .letter-preview {
        display: block !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0.25in 0.35in !important;
        color: #000000 !important;
        background: #ffffff !important;
        font-size: 12pt !important;
        line-height: 1.45 !important;
    }
}

/* === Phase 6 Contact-to-LOI Workflow === */

.contact-workflow-card {
    margin: 16px 0;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.065), rgba(255,255,255,.028));
}

.contact-workflow-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

.contact-workflow-head h3 {
    margin: 0 0 6px;
    font-size: 24px;
}

.contact-workflow-head p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.compact-form {
    margin-top: 12px;
}

.workflow-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

@media (max-width: 900px) {
    .contact-workflow-head {
        flex-direction: column;
    }
}

/* === Phase 7 Email Generator === */

.email-preview-card {
    border-color: rgba(60,200,255,.28);
}

.email-preview {
    white-space: pre-wrap;
    background: #07110d;
    color: #dfffee;
    padding: 18px;
    border-radius: 14px;
    border: 1px solid var(--border);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.55;
}

/* === Phase 9 Dashboard Command Center === */

.dashboard-subtitle {
    color: var(--muted);
    margin-top: -8px;
    margin-bottom: 18px;
}

.command-quicklinks {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0 22px;
}

.command-stats {
    margin-bottom: 14px;
}

.command-grid {
    margin-top: 18px;
}

.danger-stat strong {
    color: #ff8a8a;
}

.today-stat strong {
    color: #ffe08a;
}

.danger-card {
    border-color: rgba(255,107,107,.35);
    background:
        linear-gradient(135deg, rgba(255,107,107,.13), rgba(255,255,255,.035));
}

.today-card {
    border-color: rgba(242,201,76,.35);
    background:
        linear-gradient(135deg, rgba(242,201,76,.13), rgba(255,255,255,.035));
}

.mini-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.mini-table th,
.mini-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
    color: var(--muted);
}

.mini-table th {
    color: #fff;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.mini-table small {
    color: var(--darkmuted);
}

.pipeline-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
}

.pipeline-row strong {
    color: var(--lime);
    font-size: 22px;
}

.command-next ol {
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: 0;
}

@media (max-width: 1000px) {
    .mini-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* === Phase 10 Armel Field Portal === */

body.armel-portal .topbar {
    border-bottom-color: rgba(60,200,255,.24);
}

.armel-alert {
    border: 1px solid rgba(60,200,255,.28);
    border-radius: 18px;
    padding: 14px;
    background: rgba(60,200,255,.08);
}

/* === Phase 11 Users / Permissions / Assignments === */

.permission-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.perm-check {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255,255,255,.035);
    color: var(--muted);
}

.perm-check input {
    width: auto;
}

@media (max-width: 1000px) {
    .permission-grid {
        grid-template-columns: 1fr;
    }
}

/* === Phases 12-16 Operations Module === */

.ops-section-title {
    margin-top: 24px;
}

.letter-preview {
    max-width: 920px;
}

@media print {
    .topbar,
    .footer,
    .command-quicklinks,
    .print-actions,
    .card:not(.print-keep),
    .admin-wrap > h1,
    .dashboard-subtitle {
        display: none !important;
    }

    .letter-preview {
        display: block !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0.25in 0.35in !important;
        color: #000 !important;
        background: #fff !important;
        font-size: 12pt !important;
        line-height: 1.45 !important;
    }
}

/* === Phases 17-21 Multi-User / My Work / Audit / Calendar === */

.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(255,255,255,.055);
    color: var(--muted);
    font-weight: 800;
}

.calendar-due {
    border-color: rgba(242,201,76,.35);
    background: linear-gradient(135deg, rgba(242,201,76,.12), rgba(255,255,255,.035));
}

.audit-row-login {
    background: rgba(56,211,111,.05);
}

/* === Phases 22-26 Password / Files / Field Reports / Weekly Reports === */

.file-link-pill {
    display: inline-flex;
    padding: 6px 9px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.05);
    color: var(--muted);
    font-size: 12px;
    margin: 3px;
}

.report-card {
    border-color: rgba(143,240,164,.3);
}

@media print {
    .topbar,
    .footer,
    .cta-row,
    .print-actions,
    .card:not(.print-keep),
    .hero-tight {
        display: none !important;
    }
}

/* === Phases 27-36 Planning / Finance / CRM === */

.planning-number {
    font-variant-numeric: tabular-nums;
}

.kpi-good strong {
    color: var(--leaf2);
}

.kpi-warning strong {
    color: #ffe08a;
}

.kpi-danger strong {
    color: #ff8a8a;
}

input[name*="amount"],
input[name*="cost"],
input[name*="revenue"],
input[name*="capex"],
input[name*="price"],
input[name*="budget"] {
    font-variant-numeric: tabular-nums;
}

/* === Phases 37-46 Advanced Planning === */

.advanced-lock {
    border-color: rgba(255,107,107,.38);
    background: linear-gradient(135deg, rgba(255,107,107,.12), rgba(255,255,255,.035));
}

.factsheet-public {
    border-color: rgba(143,240,164,.35);
}

.health-ok {
    color: var(--leaf2);
    font-weight: 900;
}

.health-bad {
    color: #ff8a8a;
    font-weight: 900;
}

/* === Phases 47-56 Governance / Command / Hardening === */

.hardening-critical {
    border-color: rgba(255,107,107,.45);
    background: linear-gradient(135deg, rgba(255,107,107,.14), rgba(255,255,255,.035));
}

.governance-safe {
    border-color: rgba(143,240,164,.35);
    background: linear-gradient(135deg, rgba(56,211,111,.12), rgba(255,255,255,.035));
}

.governance-review {
    border-color: rgba(242,201,76,.35);
    background: linear-gradient(135deg, rgba(242,201,76,.12), rgba(255,255,255,.035));
}

@media print {
    .topbar,
    .footer,
    .command-quicklinks,
    .print-actions,
    .cta-row,
    .card:not(.print-keep),
    .hero-tight {
        display: none !important;
    }

    .letter-preview {
        display: block !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0.35in !important;
        box-shadow: none !important;
        color: #000 !important;
        background: #fff !important;
    }
}

/* === Phases 57-66 SaaS Polish / Search / Alerts / Presentation Packets === */

:root {
    --panel-glow: 0 24px 90px rgba(56,211,111,.08);
}

.topbar {
    backdrop-filter: blur(14px);
}

.card,
.contact-workflow-card,
.stat {
    box-shadow: var(--panel-glow);
}

.btn {
    transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.table tr:hover td,
.mini-table tr:hover td {
    background: rgba(255,255,255,.025);
}

.search-highlight {
    color: var(--lime);
    font-weight: 900;
}

.alert-critical {
    border-color: rgba(255,107,107,.5);
    background: rgba(255,107,107,.10);
}

.alert-medium {
    border-color: rgba(242,201,76,.42);
    background: rgba(242,201,76,.10);
}

.presentation-cover {
    min-height: 65vh;
    display: grid;
    place-items: center;
    text-align: center;
}

@media print {
    .topbar,
    .footer,
    .hero-tight,
    .card:not(.print-keep),
    .print-actions,
    .workflow-actions,
    .cta-row {
        display: none !important;
    }

    .letter-preview {
        display: block !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0.35in !important;
        box-shadow: none !important;
        color: #000 !important;
        background: #fff !important;
        font-size: 12pt !important;
        line-height: 1.45 !important;
    }
}
