/* ==========================================
   DEMAND INTELLIGENCE DASHBOARD
   Institutional / B2G audience
   Light theme matching for-programs / for-contractors
   ========================================== */

/* Base — ensure Inter loads for all page content */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Hero */
.di-hero {
    padding: 4rem 1.5rem 3rem;
    text-align: center;
    border-bottom: 2px dotted #b3b8c0;
}
.di-hero-inner {
    max-width: 720px;
    margin: 0 auto;
}
.di-hero-eyebrow {
    margin-bottom: 1.25rem;
}
.di-pilot-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #165DFF;
    background: rgba(22,93,255,0.08);
    padding: 0.35rem 0.85rem;
    border-radius: 100px;
}
.di-hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1.08;
    color: #0F172A;
    margin: 0 0 1rem;
    text-transform: lowercase;
}
.di-hero-sub {
    font-size: 1.1rem;
    color: #546478;
    line-height: 1.6;
    max-width: 580px;
    margin: 0 auto 1.5rem;
}
.di-hero-sources {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Section Layout */
.di-section {
    padding: 3rem 1.5rem;
    border-bottom: 2px dotted #b3b8c0;
}
.di-section-inner {
    max-width: 1100px;
    margin: 0 auto;
}
.di-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #165DFF;
    margin-bottom: 0.5rem;
}
.di-section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #0F172A;
    margin: 0 0 0.5rem;
    text-transform: lowercase;
}
.di-section-sub {
    font-size: 0.95rem;
    color: #546478;
    line-height: 1.5;
    margin: 0 0 2rem;
    max-width: 600px;
}

/* National Overview Table */
.di-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -0.5rem;
}
.di-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 700px;
}
.di-table thead th {
    text-align: left;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #546478;
    padding: 0.6rem 0.75rem;
    border-bottom: 2px solid #E2E8F0;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}
.di-table thead th:hover {
    color: #0F172A;
}
.di-table thead th.sort-active {
    color: #165DFF;
}
.di-table thead th::after {
    content: '';
    display: inline-block;
    margin-left: 4px;
    width: 0;
    height: 0;
    vertical-align: middle;
    opacity: 0;
    transition: opacity 0.15s;
}
.di-table thead th.sort-desc::after {
    opacity: 1;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #165DFF;
}
.di-table thead th.sort-asc::after {
    opacity: 1;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 5px solid #165DFF;
}
.di-table tbody td {
    padding: 0.75rem;
    border-bottom: 1px solid #F1F5F9;
    color: #334155;
    vertical-align: middle;
}
.di-table tbody tr:hover td {
    background: #F8FAFC;
}
.di-trade-name {
    font-weight: 700;
    color: #0F172A;
}
.di-demand-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.55rem;
    border-radius: 100px;
}
.di-demand-hot {
    background: rgba(22,163,74,0.1);
    color: #16A34A;
}
.di-demand-warm {
    background: rgba(234,179,8,0.1);
    color: #B45309;
}
.di-demand-cool {
    background: rgba(100,116,139,0.1);
    color: #64748B;
}
.di-growth-positive {
    color: #16A34A;
    font-weight: 600;
}
.di-growth-negative {
    color: #DC2626;
    font-weight: 600;
}
.di-growth-flat {
    color: #64748B;
    font-weight: 600;
}

/* State Demand Grid */
.di-state-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 4px;
}
.di-state-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #0F172A;
    transition: transform 0.15s;
    cursor: default;
    position: relative;
}
.di-state-cell:hover {
    transform: scale(1.1);
    z-index: 2;
}
.di-state-idx {
    font-size: 0.55rem;
    font-weight: 600;
    opacity: 0.7;
    margin-top: 2px;
}
/* Heat colors */
.di-heat-5 { background: #16A34A; color: #fff; }
.di-heat-4 { background: rgba(22,163,74,0.35); }
.di-heat-3 { background: rgba(234,179,8,0.25); }
.di-heat-2 { background: rgba(100,116,139,0.15); }
.di-heat-1 { background: rgba(100,116,139,0.08); }

.di-heat-legend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.68rem;
    color: #64748B;
}
.di-heat-legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    display: inline-block;
}

/* Trade Deep Dive */
.di-deepdive-controls {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.di-select {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    background: #fff;
    color: #0F172A;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23546478' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}
.di-select:focus {
    outline: none;
    border-color: #165DFF;
}

.di-deepdive-card {
    background: #fff;
    border: 2px dotted #b3b8c0;
    border-radius: 14px;
    padding: 2rem;
}
.di-deepdive-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.di-deepdive-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: #0F172A;
    text-transform: lowercase;
    letter-spacing: -0.02em;
}
.di-deepdive-stats {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.di-deepdive-stat {
    text-align: center;
}
.di-deepdive-stat-val {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.3rem;
    font-weight: 900;
    color: #0F172A;
}
.di-deepdive-stat-label {
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #546478;
}
.di-deepdive-drivers {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.di-driver-tag {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    background: rgba(22,93,255,0.08);
    color: #165DFF;
    border-radius: 100px;
}
.di-deepdive-metros-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #546478;
    margin-bottom: 0.75rem;
}
.di-metro-bars {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.di-metro-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.di-metro-state {
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
    min-width: 32px;
}
.di-metro-bar-wrap {
    flex: 1;
    height: 20px;
    background: #F1F5F9;
    border-radius: 4px;
    overflow: hidden;
}
.di-metro-bar {
    height: 100%;
    background: #165DFF;
    border-radius: 4px;
    transition: width 0.4s ease;
}
.di-metro-wage {
    font-size: 0.78rem;
    font-weight: 700;
    color: #0F172A;
    min-width: 50px;
    text-align: right;
}
.di-metro-emp {
    font-size: 0.68rem;
    color: #64748B;
    min-width: 60px;
    text-align: right;
}

/* Pipeline Signals */
.di-pipeline-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.di-pipeline-card {
    background: #fff;
    border: 2px dotted #b3b8c0;
    border-radius: 14px;
    padding: 1.5rem;
}
.di-pipeline-card-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #546478;
    margin-bottom: 1rem;
}
.di-search-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid #F1F5F9;
    font-size: 0.82rem;
}
.di-search-row:last-child {
    border-bottom: none;
}
.di-search-trade {
    font-weight: 600;
    color: #0F172A;
}
.di-search-change {
    font-size: 0.72rem;
    font-weight: 700;
}
.di-search-up { color: #16A34A; }
.di-search-down { color: #DC2626; }

.di-switcher-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #F1F5F9;
}
.di-switcher-row:last-child { border-bottom: none; }
.di-switcher-label {
    font-size: 0.82rem;
    color: #334155;
}
.di-switcher-val {
    font-size: 0.85rem;
    font-weight: 700;
    color: #0F172A;
}

.di-sample-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #B45309;
    background: rgba(234,179,8,0.12);
    padding: 0.2rem 0.5rem;
    border-radius: 100px;
    margin-bottom: 1rem;
}

/* CTA */
.di-cta-section {
    padding: 3.5rem 1.5rem;
    text-align: center;
}
.di-cta-inner {
    max-width: 520px;
    margin: 0 auto;
}
.di-cta-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #0F172A;
    margin: 0 0 0.75rem;
    text-transform: lowercase;
}
.di-cta-sub {
    font-size: 0.95rem;
    color: #546478;
    line-height: 1.5;
    margin: 0 0 1.5rem;
}
.di-btn-primary {
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.75rem 2rem;
    background: #165DFF;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.di-btn-primary:hover {
    background: #1249CC;
    transform: translateY(-1px);
}
.di-btn-ghost {
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: #165DFF;
    border: 2px dotted #165DFF;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    margin-left: 0.75rem;
}
.di-btn-ghost:hover {
    background: rgba(22,93,255,0.05);
}

/* Responsive */
@media (max-width: 768px) {
    .di-pipeline-grid {
        grid-template-columns: 1fr;
    }
    .di-deepdive-header {
        flex-direction: column;
    }
    .di-deepdive-stats {
        width: 100%;
        justify-content: space-between;
    }
    .di-hero {
        padding: 3rem 1.25rem 2rem;
    }
    .di-section {
        padding: 2rem 1.25rem;
    }
    .di-metro-emp {
        display: none;
    }
}

@media (max-width: 480px) {
    .di-state-grid {
        grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
    }
    .di-deepdive-card {
        padding: 1.25rem;
    }
    .di-btn-ghost {
        margin-left: 0;
        margin-top: 0.5rem;
    }
}
