:root {
    --bg-primary: #0b0e14;
    --bg-card: #131820;
    --bg-card-hover: #1a2130;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-green: #22c55e;
    --accent-yellow: #eab308;
    --accent-orange: #f97316;
    --accent-red: #ef4444;
    --accent-blue: #3b82f6;
    --border: #1e293b;
}

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

html, body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
}

a { color: var(--accent-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.mono { font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace; font-variant-numeric: tabular-nums; }

/* ── Header ─────────────────────────────── */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 32px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-text {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.last-updated {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.btn-booking {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    background: var(--accent-green);
    color: #000 !important;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none !important;
    transition: background 0.2s;
}

.btn-booking:hover {
    background: #16a34a;
}

/* ── Dashboard Grid ─────────────────────── */

.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 20px;
    padding: 24px 32px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ── Cards ──────────────────────────────── */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    transition: border-color 0.2s;
}

.card:hover {
    border-color: #334155;
}

.card-hero {
    grid-column: 1 / -1;
}

.card-affiliations {
    grid-column: 1 / -1;
}

.card h2 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* ── Availability Gauge ─────────────────── */

.gauge-section { text-align: center; }

.gauge-body {
    display: flex;
    align-items: center;
    gap: 32px;
    justify-content: center;
}

.gauge-ring-wrap {
    flex-shrink: 0;
    width: 160px;
}

.gauge-ring {
    width: 100%;
    height: auto;
}

.gauge-value {
    font-size: 1.8rem;
    font-weight: 800;
    fill: var(--text-primary);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.gauge-label {
    font-size: 0.6rem;
    fill: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.gauge-fill {
    transition: stroke-dasharray 1s ease-out, stroke 0.6s;
}

/* Stats panel next to the gauge */
.gauge-stats {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.gauge-stat-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
}

.gauge-stat-divider {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.gauge-stat-free {
    padding-top: 2px;
}

.gauge-stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.gstat-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    flex: 1;
}

.gstat-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 36px;
    text-align: right;
}

.gstat-source {
    font-size: 0.58rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    min-width: 42px;
    text-align: right;
}

/* ── Responsive gauge ─────────────────── */

@media (max-width: 600px) {
    .gauge-body {
        flex-direction: column;
        gap: 16px;
    }
    .gauge-ring-wrap {
        width: 140px;
    }
    .gauge-stats {
        width: 100%;
    }
}

/* ── Stats Rows ─────────────────────────── */

.section-subtitle {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-top: 14px;
    margin-bottom: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.stat-label { font-size: 0.85rem; color: var(--text-secondary); }
.stat-value { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); }

/* ── Language Bars ──────────────────────── */

.lang-bars { margin-top: 12px; }

.lang-bar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.lang-name {
    width: 70px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: right;
    flex-shrink: 0;
}

.lang-bar-track {
    flex: 1;
    height: 6px;
    background: var(--bg-card-hover);
    border-radius: 3px;
    overflow: hidden;
}

.lang-bar-fill {
    height: 100%;
    background: var(--accent-blue);
    border-radius: 3px;
    transition: width 0.5s ease-out;
}

.lang-pct {
    width: 38px;
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ── Daily Sparkline ────────────────────── */

.daily-sparkline {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 60px;
    margin-top: 16px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.spark-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}

.spark-fill {
    width: 100%;
    max-width: 28px;
    background: var(--accent-blue);
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: height 0.5s ease-out;
}

.spark-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── Pricing ────────────────────────────── */

.pricing-hero {
    text-align: center;
    padding: 16px 0;
}

.pricing-rate {
    font-size: 2.8rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
    line-height: 1;
}

.pricing-unit {
    font-size: 1rem;
    color: var(--text-muted);
}

.pricing-tier {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.tier-standard { background: rgba(34,197,94,0.15); color: var(--accent-green); }
.tier-elevated { background: rgba(234,179,8,0.15); color: var(--accent-yellow); }
.tier-premium { background: rgba(239,68,68,0.15); color: var(--accent-red); }

.pricing-availability-context {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.pricing-tiers-list {
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.pricing-tier-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: color 0.2s;
}

.pricing-tier-row.active {
    color: var(--text-primary);
}

.tier-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
}

.tier-dot.active {
    background: var(--accent-blue);
    box-shadow: 0 0 6px var(--accent-blue);
}

.tier-label { flex: 1; }
.tier-range { color: var(--text-muted); }
.tier-rate { font-size: 0.85rem; font-weight: 600; }

.btn-booking-card {
    display: block;
    text-align: center;
    margin-top: 16px;
    padding: 10px 20px;
    background: var(--accent-green);
    color: #000 !important;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none !important;
    transition: background 0.2s;
}

.btn-booking-card:hover {
    background: #16a34a;
}

/* ── Contribution Grid ──────────────────── */

.contrib-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.contrib-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 8px;
    background: var(--bg-card-hover);
    border-radius: 8px;
}

.contrib-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.contrib-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

/* ── Affiliations ───────────────────────── */

.affiliations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.affiliation-row {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.affiliation-row:last-child { border-bottom: none; }

.affiliation-org {
    font-weight: 600;
    font-size: 0.95rem;
    min-width: 160px;
}

.affiliation-role {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.affiliation-dates {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ── DevOps / Clusters ──────────────────── */

.cluster-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cluster-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-card-hover);
    border-radius: 8px;
}

.cluster-info {
    flex: 1;
    min-width: 0;
}

.cluster-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.cluster-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    flex-shrink: 0;
}

.cluster-dot.active {
    background: var(--accent-green);
    box-shadow: 0 0 6px var(--accent-green);
}

.cluster-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
    margin-left: 16px;
}

.cluster-commits {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 56px;
}

.cluster-commit-count {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.cluster-commit-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.cluster-repo {
    font-size: 0.7rem;
    color: var(--text-muted);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Error / Empty ──────────────────────── */

.error-banner {
    margin-bottom: 12px;
    padding: 8px 12px;
    background: rgba(234,179,8,0.1);
    border: 1px solid rgba(234,179,8,0.25);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--accent-yellow);
}

.empty-state {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    padding: 16px 0;
}

/* ── Loading ────────────────────────────── */

.loading-pulse {
    color: var(--text-muted);
    animation: pulse-text 1.5s ease-in-out infinite;
}

@keyframes pulse-text {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ── Footer ─────────────────────────────── */

.footer {
    text-align: center;
    padding: 20px 24px;
    color: var(--text-muted);
    font-size: 0.78rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.footer-sep {
    color: var(--border);
}

/* ── Responsive ─────────────────────────── */

@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 14px;
    }

    .header {
        padding: 10px 18px;
    }

    .btn-booking {
        font-size: 0.8rem;
        padding: 6px 14px;
    }

    .affiliation-row {
        flex-direction: column;
        gap: 4px;
    }

    .gauge-details { gap: 20px; }
    .gauge-value { font-size: 1.6rem; }
    .pricing-rate { font-size: 2.2rem; }
}
