:root {
    color-scheme: dark;
    --bg: #020817;
    --bg-soft: rgba(15, 23, 42, 0.8);
    --panel: rgba(15, 23, 42, 0.88);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text: #f8fafc;
    --muted: #94a3b8;
    --emerald: #6ee7b7;
    --amber: #fbbf24;
    --orange: #fb923c;
    --danger: #f87171;
}

* {
    box-sizing: border-box;
}

body.site-shell {
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 15% 20%, rgba(16, 185, 129, 0.16), transparent 25%),
        radial-gradient(circle at 85% 10%, rgba(251, 191, 36, 0.12), transparent 22%),
        radial-gradient(circle at 50% 85%, rgba(59, 130, 246, 0.12), transparent 28%),
        linear-gradient(180deg, #020617 0%, #020817 35%, #020617 100%);
    position: relative;
}

body.site-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(rgba(148, 163, 184, 0.14) 1.5px, transparent 1.5px);
    background-size: 60px 60px;
    mask-image: linear-gradient(180deg, rgba(255, 255, 255, 0.75), transparent 100%);
}

.panel-glow {
    border-radius: 2rem;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(2, 8, 23, 0.96));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 30px 80px rgba(2, 6, 23, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.flow-board,
.panel-card {
    padding: 1.5rem;
}

.flow-node,
.info-card,
.stat-card,
.pricing-card,
.modal-card,
.panel-card,
.sidebar {
    border: 1px solid var(--panel-border);
    background: rgba(15, 23, 42, 0.74);
    backdrop-filter: blur(18px);
}

.flow-node {
    border-radius: 1.5rem;
    padding: 1.25rem;
    text-align: center;
    font-weight: 700;
    color: var(--text);
}

.flow-node-gold {
    background: rgba(245, 158, 11, 0.16);
}

.flow-node-green {
    background: rgba(16, 185, 129, 0.18);
}

.flow-node-orange {
    background: rgba(249, 115, 22, 0.18);
}

.flow-connector {
    margin: 0 auto;
    height: 32px;
    width: 2px;
    background: linear-gradient(180deg, rgba(226, 232, 240, 0), rgba(226, 232, 240, 0.75), rgba(226, 232, 240, 0));
}

.section-kicker {
    font-size: 0.75rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}

.section-title {
    margin-top: 0.5rem;
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1.05;
    font-weight: 900;
    color: var(--text);
}

.stat-card {
    border-radius: 1.5rem;
    padding: 1.25rem;
}

.stat-label {
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 700;
}

.stat-value {
    margin-top: 0.35rem;
    font-size: clamp(1.15rem, 3vw, 1.8rem);
    line-height: 1.2;
    font-weight: 900;
    color: var(--text);
}

.pricing-card {
    display: flex;
    min-height: 100%;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    border-radius: 2rem;
    padding: 2rem;
}

.pricing-card-featured {
    border-color: rgba(251, 191, 36, 0.28);
    box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.12);
}

.choice-chip {
    border-radius: 1rem;
    border: 1px solid rgba(110, 231, 183, 0.22);
    background: rgba(110, 231, 183, 0.12);
    padding: 0.9rem 1rem;
    color: #d1fae5;
    font-weight: 700;
    transition: 160ms ease;
}

.choice-chip:hover {
    background: rgba(110, 231, 183, 0.2);
}

.choice-chip-gold {
    border-color: rgba(251, 191, 36, 0.25);
    background: rgba(251, 191, 36, 0.1);
    color: #fde68a;
}

.info-card {
    border-radius: 1.5rem;
    padding: 1.25rem;
}

.info-card h3 {
    margin-bottom: 0.45rem;
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
}

.info-card p {
    color: var(--muted);
    line-height: 1.7;
}

.site-input,
.site-select,
.site-textarea {
    width: 100%;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.92);
    padding: 1rem 1.1rem;
    color: var(--text);
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.site-input:focus,
.site-select:focus,
.site-textarea:focus {
    border-color: rgba(110, 231, 183, 0.45);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

.modal-shell {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(2, 6, 23, 0.76);
    backdrop-filter: blur(16px);
}

.modal-card {
    position: relative;
    width: min(100%, 34rem);
    border-radius: 2rem;
    padding: 2rem;
}

.modal-close {
    position: absolute;
    right: 1.25rem;
    top: 1.25rem;
    border-radius: 9999px;
    padding: 0.4rem 0.65rem;
    color: var(--muted);
}

.role-option {
    display: block;
}

.role-option input {
    display: none;
}

.role-option span {
    display: flex;
    justify-content: center;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.92);
    padding: 1rem;
    font-weight: 700;
    color: var(--muted);
    transition: 160ms ease;
}

.role-option input:checked + span {
    border-color: rgba(110, 231, 183, 0.42);
    background: rgba(16, 185, 129, 0.14);
    color: #d1fae5;
}

.dashboard-layout {
    display: grid;
    gap: 1.5rem;
    padding: 1.5rem;
}

.sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.5rem;
    border-radius: 2rem;
    padding: 1.5rem;
}

.content-grid {
    display: grid;
    gap: 1.5rem;
}

.stats-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel-head {
    margin-bottom: 1rem;
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
}

.panel-title {
    margin-top: 0.3rem;
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--text);
}

.ghost-btn {
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--muted);
}

.card-list {
    display: grid;
    gap: 1rem;
}

.record-card {
    border-radius: 1.4rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(2, 6, 23, 0.4);
    padding: 1rem;
}

.record-card h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
}

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

.record-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.8rem 0;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 9999px;
    padding: 0.38rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.pill-neutral { background: rgba(148, 163, 184, 0.16); color: #e2e8f0; }
.pill-success { background: rgba(16, 185, 129, 0.16); color: #bbf7d0; }
.pill-warning { background: rgba(251, 191, 36, 0.16); color: #fde68a; }
.pill-danger { background: rgba(248, 113, 113, 0.16); color: #fecaca; }

.inline-form {
    display: grid;
    gap: 0.8rem;
    margin-top: 1rem;
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.primary-btn,
.secondary-btn,
.danger-btn {
    border-radius: 1rem;
    padding: 0.85rem 1rem;
    font-weight: 800;
    transition: 160ms ease;
}

.primary-btn {
    background: var(--emerald);
    color: #052e16;
}

.secondary-btn {
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.danger-btn {
    background: rgba(248, 113, 113, 0.16);
    color: #fecaca;
}

.feedback-box {
    margin-top: 1rem;
    border-radius: 1rem;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
}

.feedback-box.success {
    border: 1px solid rgba(16, 185, 129, 0.28);
    background: rgba(16, 185, 129, 0.12);
    color: #d1fae5;
}

.feedback-box.error {
    border: 1px solid rgba(248, 113, 113, 0.28);
    background: rgba(248, 113, 113, 0.12);
    color: #fecaca;
}

.photo-list {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.photo-list img {
    height: 110px;
    width: 100%;
    object-fit: cover;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

@media (min-width: 1024px) {
    .dashboard-layout {
        grid-template-columns: 320px minmax(0, 1fr);
        align-items: start;
    }

    .sidebar {
        position: sticky;
        top: 1.5rem;
        min-height: calc(100vh - 3rem);
    }

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

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

.intel-grid {
    margin-top: 1rem;
}

.doc-preview-card {
    border-radius: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(2, 6, 23, 0.45);
    padding: 0.85rem 1rem;
}

.doc-preview-card summary {
    cursor: pointer;
    list-style: none;
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
    padding: 0.25rem 0;
}

.doc-preview-card summary::-webkit-details-marker {
    display: none;
}

.md-preview {
    margin-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 0.85rem;
}

.md-preview h1,
.md-preview h2,
.md-preview h3 {
    color: var(--text);
    margin-top: 0.8rem;
    margin-bottom: 0.5rem;
    font-weight: 800;
}

.md-preview p,
.md-preview li {
    color: var(--muted);
    line-height: 1.8;
}

.md-preview ul {
    padding-left: 1rem;
}

.md-preview code {
    color: #c7f9e6;
}

.diagram-preview {
    margin-top: 0.75rem;
    overflow-x: auto;
    white-space: pre;
    border-radius: 1rem;
    border: 1px solid rgba(110, 231, 183, 0.26);
    background: rgba(16, 185, 129, 0.09);
    padding: 0.95rem;
    color: #d1fae5;
    font-family: "Courier New", monospace;
    font-size: 0.86rem;
    line-height: 1.5;
}

.ico { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico .fill { fill: currentColor; stroke: none; }
.hidden { display: none; }
