* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --ink: #0a0f1a;
    --slate: #1a2035;
    --steel: #2d3a52;
    --mist: #8b95a8;
    --cloud: #c4cad6;
    --snow: #f0f2f5;
    --white: #ffffff;
    --accent: #00d4aa;
    --accent-dim: #00b894;
    --glow: rgba(0, 212, 170, 0.12);
    --warn: #ff6b6b;
    --warn-dim: rgba(255, 107, 107, 0.12);
    --success: #00d4aa;
    --info: #5b8dee;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--ink);
    color: var(--cloud);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: 'Space Grotesk', sans-serif;
    color: var(--white);
    line-height: 1.15;
}

.accent { color: var(--accent); }

/* ============ PAGE MANAGEMENT ============ */
.page { display: none; }
.page.active { display: block; }

/* ============ NAV ============ */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: rgba(10, 15, 26, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(45, 58, 82, 0.4);
}

.logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.5px;
}
.logo span { color: var(--accent); }

.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-left { display: flex; align-items: center; gap: 12px; }
.nav-divider { color: var(--steel); font-weight: 300; }
.nav-section { color: var(--mist); font-size: 0.9rem; font-weight: 500; }

.nav-tag {
    font-size: 0.75rem;
    color: var(--mist);
    background: var(--slate);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--steel);
}

.nav-filters select {
    background: var(--slate);
    color: var(--cloud);
    border: 1px solid var(--steel);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    margin-left: 8px;
}
.nav-filters select:focus { outline: none; border-color: var(--accent); }

/* ============ BUTTONS ============ */
.btn {
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-sm { font-size: 0.85rem; padding: 8px 16px; }
.btn-lg { font-size: 1rem; padding: 14px 28px; }
.btn-accent {
    background: var(--accent);
    color: var(--ink);
}
.btn-accent:hover { background: var(--accent-dim); transform: translateY(-1px); }
.btn-ghost {
    background: transparent;
    color: var(--cloud);
    border: 1px solid var(--steel);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--white); }

/* ============ HERO ============ */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 140px 40px 80px;
    max-width: 900px;
    margin: 0 auto;
}

.hero-badge {
    font-size: 0.85rem;
    color: var(--accent);
    background: var(--glow);
    padding: 8px 20px;
    border-radius: 24px;
    border: 1px solid rgba(0, 212, 170, 0.2);
    margin-bottom: 32px;
    font-weight: 500;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 24px;
    letter-spacing: -1px;
}

.hero-sub {
    font-size: 1.15rem;
    color: var(--mist);
    max-width: 640px;
    margin-bottom: 40px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 64px;
}

.hero-stats {
    display: flex;
    gap: 48px;
    padding-top: 48px;
    border-top: 1px solid var(--steel);
}

.hero-stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--white);
}
.hero-stat-label {
    font-size: 0.85rem;
    color: var(--mist);
    margin-top: 4px;
}

/* ============ FEATURES ============ */
.features-section {
    padding: 100px 40px;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}
.features-section h2 {
    font-size: 2rem;
    margin-bottom: 48px;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}
.feature-card {
    background: var(--slate);
    border: 1px solid var(--steel);
    border-radius: var(--radius);
    padding: 28px;
    text-align: left;
    transition: border-color 0.2s;
}
.feature-card:hover { border-color: var(--accent); }
.feature-icon { font-size: 1.5rem; margin-bottom: 12px; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.feature-card p { font-size: 0.9rem; color: var(--mist); line-height: 1.6; }

/* ============ CTA ============ */
.cta-section {
    padding: 100px 40px;
    text-align: center;
    background: linear-gradient(180deg, transparent, rgba(0, 212, 170, 0.04));
}
.cta-section h2 { font-size: 2rem; margin-bottom: 16px; }
.cta-section p { color: var(--mist); margin-bottom: 32px; font-size: 1.1rem; }

/* ============ FOOTER ============ */
.landing-footer {
    padding: 40px;
    text-align: center;
    border-top: 1px solid var(--steel);
}
.footer-text { color: var(--mist); font-size: 0.85rem; margin-top: 8px; }

/* ============ DASHBOARD ============ */
.dash-nav { padding: 12px 24px; }

.dash-content {
    padding: 80px 24px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}
.summary-card {
    background: var(--slate);
    border: 1px solid var(--steel);
    border-radius: var(--radius);
    padding: 20px 24px;
}
.summary-card.warn { border-color: rgba(255, 107, 107, 0.3); }
.summary-label {
    font-size: 0.8rem;
    color: var(--mist);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    margin-bottom: 4px;
}
.summary-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--white);
}
.summary-card.warn .summary-value { color: var(--warn); }

/* Section Headers */
.section-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 32px 0 16px;
}
.section-header h2 { font-size: 1.25rem; }
.section-sub { font-size: 0.85rem; color: var(--mist); }

/* Stage Pipeline */
.stage-pipeline {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
}
.stage-col {
    flex: 1;
    min-width: 200px;
    background: var(--slate);
    border: 1px solid var(--steel);
    border-radius: var(--radius);
    overflow: hidden;
}
.stage-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--steel);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.stage-name {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--white);
    text-transform: capitalize;
}
.stage-count {
    font-size: 0.75rem;
    background: var(--steel);
    color: var(--cloud);
    padding: 2px 8px;
    border-radius: 10px;
}
.stage-deals { padding: 8px; }
.stage-deal-card {
    background: var(--ink);
    border: 1px solid var(--steel);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.2s;
}
.stage-deal-card:hover { border-color: var(--accent); }
.stage-deal-card:last-child { margin-bottom: 0; }
.sdc-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--white);
    margin-bottom: 4px;
}
.sdc-meta {
    font-size: 0.8rem;
    color: var(--mist);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sdc-value { color: var(--accent); font-weight: 600; }
.sdc-risk {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}
.risk-low { background: rgba(0, 212, 170, 0.15); color: var(--accent); }
.risk-med { background: rgba(255, 193, 7, 0.15); color: #ffc107; }
.risk-high { background: var(--warn-dim); color: var(--warn); }
.risk-none { background: var(--steel); color: var(--mist); }

/* Priority badge */
.priority-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.priority-critical { background: var(--warn-dim); color: var(--warn); }
.priority-high { background: rgba(255, 193, 7, 0.15); color: #ffc107; }
.priority-medium { background: rgba(91, 141, 238, 0.15); color: var(--info); }
.priority-low { background: var(--steel); color: var(--mist); }

/* Workstream Grid */
.workstream-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.ws-card {
    background: var(--slate);
    border: 1px solid var(--steel);
    border-radius: var(--radius);
    padding: 16px;
}
.ws-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--white);
    text-transform: capitalize;
    margin-bottom: 8px;
}
.ws-progress-bar {
    height: 4px;
    background: var(--steel);
    border-radius: 2px;
    margin-bottom: 8px;
    overflow: hidden;
}
.ws-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s;
}
.ws-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--mist);
}
.ws-risk { font-weight: 600; }

/* Deal Table */
.deal-table-wrap { overflow-x: auto; }
.deal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.deal-table th {
    text-align: left;
    padding: 12px 16px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--mist);
    background: var(--slate);
    border-bottom: 1px solid var(--steel);
    font-weight: 600;
    position: sticky;
    top: 0;
}
.deal-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(45, 58, 82, 0.3);
    color: var(--cloud);
}
.deal-table tr {
    cursor: pointer;
    transition: background 0.15s;
}
.deal-table tbody tr:hover { background: rgba(26, 32, 53, 0.5); }
.deal-name-cell {
    font-weight: 600;
    color: var(--white);
}
.deal-stage-badge {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 500;
    display: inline-block;
}
.stage-sourcing { background: var(--steel); color: var(--cloud); }
.stage-loi_signed { background: rgba(91, 141, 238, 0.15); color: var(--info); }
.stage-due_diligence { background: rgba(255, 193, 7, 0.15); color: #ffc107; }
.stage-negotiation { background: rgba(156, 77, 255, 0.15); color: #b388ff; }
.stage-closed { background: rgba(0, 212, 170, 0.15); color: var(--accent); }
.stage-dead { background: var(--warn-dim); color: var(--warn); }

/* Workstream dots */
.ws-dots {
    display: flex;
    gap: 4px;
}
.ws-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    position: relative;
}
.ws-dot::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--ink);
    border: 1px solid var(--steel);
    color: var(--cloud);
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    margin-bottom: 4px;
    z-index: 10;
}
.ws-dot:hover::after { opacity: 1; }
.ws-dot.completed { background: var(--accent); }
.ws-dot.in_progress { background: #ffc107; }
.ws-dot.not_started { background: var(--steel); }

/* Risk Alerts */
.risk-alerts {
    display: grid;
    gap: 8px;
}
.risk-alert {
    background: var(--slate);
    border: 1px solid rgba(255, 107, 107, 0.2);
    border-left: 3px solid var(--warn);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: border-color 0.2s;
}
.risk-alert:hover { border-color: var(--warn); }
.ra-left { display: flex; align-items: center; gap: 16px; }
.ra-score {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--warn);
    min-width: 40px;
}
.ra-deal {
    font-weight: 600;
    color: var(--white);
    font-size: 0.9rem;
}
.ra-ws {
    font-size: 0.8rem;
    color: var(--mist);
    text-transform: capitalize;
}
.ra-summary {
    font-size: 0.85rem;
    color: var(--mist);
    max-width: 500px;
    text-align: right;
}

/* ============ MODAL ============ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    justify-content: center;
    align-items: flex-start;
    padding: 80px 24px 24px;
    overflow-y: auto;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--slate);
    border: 1px solid var(--steel);
    border-radius: var(--radius);
    max-width: 900px;
    width: 100%;
    padding: 32px;
    position: relative;
    box-shadow: var(--shadow);
}
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--steel);
    border: none;
    color: var(--cloud);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-close:hover { background: var(--warn-dim); color: var(--warn); }

.modal-header {
    margin-bottom: 24px;
}
.modal-header h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}
.modal-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--mist);
}
.modal-meta span { display: flex; align-items: center; gap: 4px; }

.modal-section {
    margin-bottom: 24px;
}
.modal-section h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--steel);
}

/* Workstream Detail */
.ws-detail-grid {
    display: grid;
    gap: 10px;
}
.ws-detail-row {
    background: var(--ink);
    border: 1px solid var(--steel);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
}
.ws-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.ws-detail-name {
    font-weight: 600;
    color: var(--white);
    text-transform: capitalize;
    font-size: 0.95rem;
}
.ws-detail-status {
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 6px;
    font-weight: 500;
}
.ws-detail-stats {
    display: flex;
    gap: 20px;
    font-size: 0.8rem;
    color: var(--mist);
    margin-bottom: 6px;
}
.ws-detail-summary {
    font-size: 0.85rem;
    color: var(--cloud);
    line-height: 1.5;
    font-style: italic;
}

/* Progress bar in modal */
.ws-doc-bar {
    height: 3px;
    background: var(--steel);
    border-radius: 2px;
    margin: 8px 0;
    overflow: hidden;
}
.ws-doc-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
}

/* Activity Log */
.activity-list { display: grid; gap: 6px; }
.activity-item {
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
    padding: 8px 0;
    border-bottom: 1px solid rgba(45, 58, 82, 0.2);
}
.activity-time {
    color: var(--mist);
    font-size: 0.8rem;
    min-width: 140px;
    white-space: nowrap;
}
.activity-desc { color: var(--cloud); }

/* Notes */
.deal-notes {
    background: var(--ink);
    border: 1px solid var(--steel);
    border-radius: var(--radius-sm);
    padding: 16px;
    font-size: 0.9rem;
    color: var(--cloud);
    line-height: 1.6;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--mist);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
    .summary-cards { grid-template-columns: repeat(2, 1fr); }
    .stage-pipeline { flex-direction: column; }
    .hero-stats { flex-direction: column; gap: 24px; }
    .hero-actions { flex-direction: column; }
    nav { padding: 12px 16px; }
    .dash-content { padding: 70px 16px 24px; }
    .features-grid { grid-template-columns: 1fr; }
    .nav-filters { display: none; }
}

@media (max-width: 600px) {
    .summary-cards { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2rem; }
    .modal { padding: 20px; margin: 0; border-radius: 0; min-height: 100vh; }
    .modal-overlay { padding: 0; }
}

/* Loading shimmer */
@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: 200px 0; }
}
.loading-bar {
    height: 20px;
    background: linear-gradient(90deg, var(--steel) 25%, var(--slate) 50%, var(--steel) 75%);
    background-size: 400px 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}
