/* =============================================================
 * Palm Communities Construction Intelligence Dashboard
 * Premium dark SaaS aesthetic. Designed to feel like a
 * $500K enterprise platform, not a WP site.
 * ============================================================= */

* { box-sizing: border-box; }

html.pcd-html, body.pcd-body {
    margin: 0; padding: 0;
    width: 100%; height: 100%;
    background: #050810;
    color: #e2e8f0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body.pcd-body::before {
    content: "";
    position: fixed; inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at 50% -10%, rgba(59, 130, 246, 0.12), transparent 60%),
        radial-gradient(ellipse 50% 40% at 100% 100%, rgba(34, 197, 94, 0.08), transparent 60%),
        radial-gradient(ellipse 50% 40% at 0% 100%, rgba(245, 158, 11, 0.06), transparent 60%),
        var(--pcd-bg-image, none) center/cover no-repeat,
        linear-gradient(180deg, #050810 0%, #0a0e1a 50%, #050810 100%);
    z-index: 0;
    pointer-events: none;
}

body.pcd-body::after {
    content: "";
    position: fixed; inset: 0;
    background-image:
        linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 0;
    pointer-events: none;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 30%, transparent 80%);
}

.pcd-app {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 64px 1fr;
}

/* ============== SIDEBAR ============== */
.pcd-sidebar {
    background: rgba(8, 12, 24, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: 28px 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pcd-sidebar-icons {
    display: flex; flex-direction: column;
    gap: 4px;
    width: 100%;
    align-items: center;
    flex: 1;
}

.pcd-side-spacer { flex: 1; }

.pcd-side-btn {
    background: transparent;
    border: 0;
    color: #64748b;
    cursor: pointer;
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(.2,.6,.3,1);
    text-decoration: none;
    position: relative;
}
.pcd-side-btn svg { width: 18px; height: 18px; }
.pcd-side-btn:hover { color: #e2e8f0; background: rgba(255,255,255,0.04); }
.pcd-side-btn-active {
    color: #fff;
    background: rgba(59, 130, 246, 0.15);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.3) inset, 0 0 calc(var(--pcd-glow) * 0.3px) rgba(59, 130, 246, 0.4);
}
.pcd-side-btn-active::before {
    content: "";
    position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
    width: 3px; height: 18px;
    background: var(--pcd-accent);
    border-radius: 2px;
    box-shadow: 0 0 calc(var(--pcd-glow) * 0.15px) var(--pcd-accent);
}
.pcd-side-btn[data-tip]::after {
    content: attr(data-tip);
    position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%);
    background: #1a1f2e;
    color: #e2e8f0;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0; pointer-events: none;
    transition: opacity 0.15s;
    border: 1px solid rgba(255,255,255,0.08);
    z-index: 1000;
}
.pcd-side-btn[data-tip]:hover::after { opacity: 1; }

/* ============== MAIN ============== */
.pcd-main {
    padding: 22px 28px 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

/* ============== HEADER ============== */
.pcd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 4px;
}
.pcd-brand { display: flex; align-items: center; gap: 14px; }
.pcd-logo-mark {
    width: 44px; height: 44px;
    display: grid; place-items: center;
    filter: drop-shadow(0 0 calc(var(--pcd-glow) * 0.2px) var(--pcd-accent));
}
.pcd-logo-img {
    height: 44px;
    max-width: 200px;
    object-fit: contain;
    /* Soft halo so a dark logo doesn't disappear on the dark surface. */
    padding: 4px 8px;
    border-radius: 10px;
    background:
        radial-gradient(ellipse at center,
            rgba(59,130,246,0.18) 0%,
            rgba(59,130,246,0.06) 50%,
            rgba(59,130,246,0) 75%);
    animation: pcd-logo-pulse-soft 4s ease-in-out infinite;
}

@keyframes pcd-logo-pulse-soft {
    0%, 100% { filter: drop-shadow(0 0 6px rgba(59,130,246,0.20)); }
    50%      { filter: drop-shadow(0 0 14px rgba(59,130,246,0.45)); }
}
.pcd-brand-text {
    display: flex; align-items: baseline; gap: 12px;
    font-weight: 800; letter-spacing: 0.02em;
}
.pcd-brand-name {
    font-size: 26px;
    color: #fff;
    letter-spacing: 0.04em;
}
.pcd-brand-divider {
    color: rgba(255,255,255,0.2);
    font-weight: 300;
    font-size: 22px;
}
.pcd-brand-tagline {
    font-size: 13px;
    color: #94a3b8;
    font-weight: 400;
    letter-spacing: 0.05em;
    line-height: 1.2;
    max-width: 110px;
}

.pcd-header-right {
    display: flex; align-items: center; gap: 16px;
}
.pcd-user-block {
    display: flex; flex-direction: column;
    align-items: flex-end;
    line-height: 1.3;
}
.pcd-welcome { font-size: 14px; color: #cbd5e1; }
.pcd-welcome strong { color: #fff; font-weight: 600; }
.pcd-user-title { font-size: 12px; color: #64748b; }

.pcd-header-actions { display: flex; gap: 6px; }
.pcd-icon-btn {
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    color: #cbd5e1;
    border-radius: 10px;
    display: grid; place-items: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}
.pcd-icon-btn svg { width: 16px; height: 16px; }
.pcd-icon-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.12);
}
.pcd-icon-btn-sm { width: 28px; height: 28px; border-radius: 8px; }
.pcd-icon-btn-sm svg { width: 13px; height: 13px; }
.pcd-has-dot .pcd-dot {
    position: absolute; top: 7px; right: 8px;
    width: 7px; height: 7px;
    background: var(--pcd-danger);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--pcd-danger);
}

/* ============== TOP STRIP ============== */
.pcd-top {
    display: grid;
    grid-template-columns: minmax(280px, 1.2fr) repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.pcd-overview-card,
.pcd-kpi {
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 16px 18px;
    position: relative;
    overflow: hidden;
}

.pcd-overview-title {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.08em;
    margin-bottom: 2px;
}
.pcd-overview-sub {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 12px;
    letter-spacing: 0.02em;
}
.pcd-filters {
    display: flex; flex-wrap: wrap; gap: 6px;
}
.pcd-select, .pcd-search {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    font-size: 12px;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s;
}
.pcd-select:hover { background: rgba(255,255,255,0.07); }
.pcd-search { padding: 6px 8px 6px 10px; flex: 1; min-width: 110px; }
.pcd-search input {
    background: none; border: 0;
    color: #e2e8f0; font-size: 12px;
    outline: none; width: 100%;
    font-family: inherit;
}
.pcd-search input::placeholder { color: #64748b; }

/* ============== KPI CARDS ============== */
.pcd-kpi-label {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 6px;
    font-weight: 500;
    letter-spacing: 0.02em;
}
.pcd-kpi-value {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 12px;
    display: flex; align-items: baseline; gap: 6px;
    flex-wrap: wrap;
}
.pcd-kpi-delta {
    font-size: 12px;
    font-weight: 500;
}
.pcd-kpi-delta.pcd-up { color: var(--pcd-success); }
.pcd-kpi-delta.pcd-down { color: var(--pcd-danger); }
.pcd-kpi-bar {
    height: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 2px;
    overflow: hidden;
}
.pcd-kpi-bar span {
    display: block; height: 100%;
    border-radius: 2px;
    box-shadow: 0 0 calc(var(--pcd-glow) * 0.12px) currentColor;
}
.pcd-kpi-blue {
    box-shadow: inset 0 1px 0 rgba(59, 130, 246, 0.15), 0 0 calc(var(--pcd-glow) * 0.2px) rgba(59, 130, 246, 0.08);
}
.pcd-kpi-blue .pcd-kpi-bar span {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    color: #3b82f6;
}
.pcd-kpi-green {
    box-shadow: inset 0 1px 0 rgba(34, 197, 94, 0.15), 0 0 calc(var(--pcd-glow) * 0.2px) rgba(34, 197, 94, 0.08);
}
.pcd-kpi-green .pcd-kpi-bar span {
    background: linear-gradient(90deg, #22c55e, #4ade80);
    color: #22c55e;
}
.pcd-kpi-amber {
    box-shadow: inset 0 1px 0 rgba(245, 158, 11, 0.18), 0 0 calc(var(--pcd-glow) * 0.2px) rgba(245, 158, 11, 0.08);
}
.pcd-kpi-amber .pcd-kpi-bar span {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    color: #f59e0b;
}

/* ============== CARD BASE ============== */
.pcd-card {
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 16px 18px;
    position: relative;
    overflow: hidden;
}
.pcd-card-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
}
.pcd-card-head h3 {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.08em;
}

/* ============== MIDDLE GRID ============== */
.pcd-mid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(280px, 320px) minmax(220px, 240px);
    gap: 14px;
    min-height: 460px;
}
.pcd-map-card { padding: 0; overflow: hidden; }
.pcd-map { width: 100%; height: 100%; min-height: 460px; }

/* projects column */
.pcd-projects-card { padding: 14px 14px 14px 16px; }
.pcd-table-head {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) 60px 50px 60px 70px 40px;
    gap: 10px;
    padding: 0 8px 10px;
    font-size: 10px;
    color: #64748b;
    letter-spacing: 0.06em;
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.pcd-project-list {
    display: flex; flex-direction: column;
    margin-top: 4px;
    overflow-y: auto;
    max-height: 410px;
}
.pcd-project-list::-webkit-scrollbar { width: 4px; }
.pcd-project-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.pcd-project-row {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) 60px 50px 60px 70px 40px;
    gap: 10px;
    align-items: center;
    padding: 10px 8px;
    border-radius: 10px;
    transition: background 0.2s;
    cursor: pointer;
    position: relative;
    font-size: 12px;
}
.pcd-project-row:hover { background: rgba(59, 130, 246, 0.06); }
.pcd-project-row.is-active {
    background: rgba(59, 130, 246, 0.1);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.3);
}
.pcd-proj-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pcd-proj-thumb {
    width: 36px; height: 36px;
    border-radius: 6px;
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
    flex-shrink: 0;
    display: grid; place-items: center;
    color: #93c5fd;
    font-size: 14px;
    font-weight: 700;
    overflow: hidden;
    position: relative;
}
.pcd-proj-thumb::after {
    /* subtle skyline silhouette */
    content: "";
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 60%;
    background:
        linear-gradient(to top, #0c1e4f 30%, transparent 100%),
        repeating-linear-gradient(90deg,
            transparent 0 4px, rgba(147, 197, 253, 0.18) 4px 5px,
            transparent 5px 9px, rgba(147, 197, 253, 0.18) 9px 10px,
            transparent 10px 16px, rgba(147, 197, 253, 0.25) 16px 17px);
}
.pcd-proj-info { display: flex; flex-direction: column; min-width: 0; }
.pcd-proj-title {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pcd-proj-id { color: #64748b; font-size: 11px; }
.pcd-proj-pill {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.2);
}
.pcd-proj-pill.pcd-amber { background: rgba(245,158,11,0.12); color: #fbbf24; border-color: rgba(245,158,11,0.2); }
.pcd-proj-pill.pcd-red   { background: rgba(239,68,68,0.12); color: #f87171; border-color: rgba(239,68,68,0.2); }

.pcd-proj-num { color: #cbd5e1; font-weight: 600; font-size: 12px; }
.pcd-proj-num.pcd-pos { color: #4ade80; }
.pcd-proj-num.pcd-neg { color: #f87171; }
.pcd-proj-num.pcd-neutral { color: #fbbf24; }

.pcd-risk-icon {
    display: grid; place-items: center;
    width: 24px; height: 24px;
    border-radius: 6px;
}
.pcd-risk-icon.pcd-red { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.pcd-risk-icon.pcd-amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.pcd-risk-icon.pcd-green { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.pcd-risk-icon svg { width: 14px; height: 14px; }

/* ============== INSIGHTS ============== */
.pcd-insights {
    display: flex; flex-direction: column;
    gap: 14px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 4px;
}
.pcd-insights::-webkit-scrollbar { width: 4px; }
.pcd-insights::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.pcd-insight {
    display: flex; gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.pcd-insight:last-child { border-bottom: 0; padding-bottom: 0; }
.pcd-insight-icon {
    flex-shrink: 0;
    width: 28px; height: 28px;
    border-radius: 8px;
    display: grid; place-items: center;
    font-size: 14px;
}
.pcd-insight-icon-alert { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.pcd-insight-icon-budget { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.pcd-insight-icon-weather { background: rgba(96, 165, 250, 0.15); color: #93c5fd; }
.pcd-insight-icon-rfi { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.pcd-insight-body { min-width: 0; }
.pcd-insight-title {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}
.pcd-insight-text {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.5;
}

/* ============== ALERTS ============== */
.pcd-alerts { display: flex; flex-direction: column; gap: 10px; }
.pcd-alert {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.12);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}
.pcd-alert:hover { background: rgba(239, 68, 68, 0.1); }
.pcd-alert.pcd-amber {
    background: rgba(245, 158, 11, 0.06);
    border-color: rgba(245, 158, 11, 0.12);
}
.pcd-alert.pcd-amber:hover { background: rgba(245, 158, 11, 0.1); }
.pcd-alert-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pcd-alert-label {
    font-size: 11px;
    color: #cbd5e1;
    font-weight: 500;
}
.pcd-alert-value {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}
.pcd-alert-arrow { color: #64748b; }
.pcd-alert-arrow svg { width: 14px; height: 14px; }

/* ============== BOTTOM GRID ============== */
.pcd-bottom {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(220px, 280px) minmax(200px, 220px);
    gap: 14px;
    min-height: 280px;
}

.pcd-budget-card { display: flex; flex-direction: column; }
.pcd-chart-wrap { flex: 1; min-height: 220px; position: relative; }

/* ============== SCHEDULE ============== */
.pcd-schedule {
    display: flex; flex-direction: column;
    gap: 12px;
}
.pcd-sched-row {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 14px;
    align-items: center;
}
.pcd-sched-label {
    display: flex; align-items: center; gap: 10px;
    font-size: 12px; color: #cbd5e1;
}
.pcd-sched-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}
.pcd-sched-text { display: flex; flex-direction: column; min-width: 0; }
.pcd-sched-name { font-size: 12px; color: #cbd5e1; font-weight: 500; }
.pcd-sched-sub { font-size: 10px; color: #64748b; }
.pcd-sched-track {
    position: relative;
    height: 22px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    overflow: hidden;
}
.pcd-sched-bar {
    position: absolute;
    height: 100%;
    border-radius: 6px;
    display: flex; align-items: center; padding: 0 8px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    color: #fff;
}
.pcd-sched-bar.is-key { background: linear-gradient(90deg, #2563eb, #3b82f6); }
.pcd-sched-bar.is-bottleneck {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.pcd-sched-axis {
    display: flex; justify-content: space-between;
    font-size: 10px;
    color: #64748b;
    margin-top: 6px;
    padding: 0 4px;
}

/* ============== WEATHER ============== */
.pcd-weather-card { display: flex; flex-direction: column; padding: 14px; }
.pcd-weather-map {
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
    background: #0a0e1a;
    position: relative;
    min-height: 180px;
}
.pcd-weather-map.pcd-fallback {
    background:
        radial-gradient(ellipse 60% 80% at 60% 50%, rgba(34, 197, 94, 0.5) 0%, rgba(34, 197, 94, 0.2) 30%, transparent 60%),
        radial-gradient(ellipse 30% 40% at 50% 60%, rgba(245, 158, 11, 0.6), transparent 50%),
        radial-gradient(ellipse 15% 20% at 55% 55%, rgba(239, 68, 68, 0.6), transparent 60%),
        radial-gradient(circle at 30% 70%, rgba(34, 197, 94, 0.3), transparent 40%),
        repeating-radial-gradient(circle at 60% 55%, transparent 0 30px, rgba(255,255,255,0.04) 30px 31px);
}

/* ============== DELAY GAUGE ============== */
.pcd-delay-card { display: flex; flex-direction: column; }
.pcd-gauge-wrap {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding-top: 10px;
}
.pcd-gauge { width: 100%; max-width: 200px; height: auto; }
.pcd-gauge-label {
    padding: 6px 18px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.1em;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.pcd-gauge-label.pcd-medium {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
}
.pcd-gauge-label.pcd-low {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.3);
}

/* ============== FOOTER ============== */
.pcd-footer {
    display: flex; align-items: center; justify-content: space-between;
    color: #64748b;
    font-size: 11px;
    padding: 8px 4px 0;
}
.pcd-spark {
    color: var(--pcd-accent);
    font-size: 14px;
    text-shadow: 0 0 calc(var(--pcd-glow) * 0.15px) var(--pcd-accent);
}

/* ============== LEAFLET DARK STYLING ============== */
.pcd-map .leaflet-container,
.pcd-weather-map .leaflet-container {
    background: #0a0e1a !important;
    font-family: inherit;
}
.pcd-map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.7) saturate(0.5); }
.pcd-map .leaflet-control-attribution { background: rgba(0,0,0,0.5) !important; color: #94a3b8 !important; font-size: 10px; }
.pcd-map .leaflet-control-attribution a { color: #cbd5e1 !important; }

/* Custom map marker */
.pcd-marker {
    width: 24px; height: 24px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: grid; place-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5), 0 0 calc(var(--pcd-glow) * 0.15px) currentColor;
}
.pcd-marker::after {
    content: "";
    width: 8px; height: 8px;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
}
.pcd-marker.pcd-red    { background: var(--pcd-danger); color: var(--pcd-danger); }
.pcd-marker.pcd-amber  { background: var(--pcd-warning); color: var(--pcd-warning); }
.pcd-marker.pcd-green  { background: var(--pcd-success); color: var(--pcd-success); }
.pcd-marker.pcd-blue   { background: var(--pcd-accent); color: var(--pcd-accent); }

/* ============== RESPONSIVE ============== */
@media (max-width: 1400px) {
    .pcd-top { grid-template-columns: 1fr 1fr 1fr; }
    .pcd-overview-card { grid-column: 1 / -1; }
    .pcd-mid { grid-template-columns: 1fr 1fr; grid-auto-rows: minmax(280px, auto); }
    .pcd-bottom { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
    .pcd-app { grid-template-columns: 56px 1fr; }
    .pcd-main { padding: 16px; }
    .pcd-top { grid-template-columns: 1fr 1fr; }
    .pcd-overview-card { grid-column: 1 / -1; }
    .pcd-mid, .pcd-bottom { grid-template-columns: 1fr; }
    .pcd-header { flex-wrap: wrap; }
    .pcd-brand-text { display: none; }
}

/* ============== LIGHT THEME ============== */
body.pcd-theme-light {
    background: #f8fafc;
    color: #1e293b;
}
body.pcd-theme-light::before {
    background:
        radial-gradient(ellipse 70% 50% at 50% -10%, rgba(59, 130, 246, 0.08), transparent 60%),
        var(--pcd-bg-image, none) center/cover no-repeat,
        linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
}
body.pcd-theme-light .pcd-card,
body.pcd-theme-light .pcd-overview-card,
body.pcd-theme-light .pcd-kpi {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(15, 23, 42, 0.08);
}
body.pcd-theme-light .pcd-sidebar { background: rgba(255,255,255,0.7); border-right-color: rgba(15,23,42,0.08); }
body.pcd-theme-light .pcd-side-btn { color: #64748b; }
body.pcd-theme-light .pcd-brand-name { color: #0f172a; }
body.pcd-theme-light .pcd-kpi-value, body.pcd-theme-light .pcd-card-head h3, body.pcd-theme-light .pcd-overview-title { color: #0f172a; }
body.pcd-theme-light .pcd-welcome { color: #475569; }
body.pcd-theme-light .pcd-welcome strong { color: #0f172a; }

/* =============================================================
 * v1.1 — Filters, view toggles, grid view, financial view,
 *         project drill-down modal, executive export button
 * ============================================================= */

/* Real <select> filter styling — replaces the static label boxes */
.pcd-filters select.pcd-select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e6edf7;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    padding: 7px 28px 7px 12px;
    border-radius: 8px;
    cursor: pointer;
    background-image:
        linear-gradient(45deg, transparent 50%, #94a3b8 50%),
        linear-gradient(135deg, #94a3b8 50%, transparent 50%);
    background-position:
        calc(100% - 14px) center,
        calc(100% - 9px) center;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.pcd-filters select.pcd-select:hover  { border-color: rgba(59, 130, 246, 0.45); background-color: rgba(255,255,255,0.06); }
.pcd-filters select.pcd-select:focus  { outline: 0; border-color: var(--pcd-accent, #3b82f6); box-shadow: 0 0 0 3px rgba(59,130,246,0.18); }
.pcd-filters select.pcd-select option { background: #0f172a; color: #e6edf7; }
.pcd-search input[data-pcd-search] { min-width: 220px; }

/* View toggle pill group */
.pcd-view-toggles {
    display: inline-flex;
    margin-top: 10px;
    padding: 3px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    gap: 2px;
}
.pcd-view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    background: transparent;
    color: #94a3b8;
    border: 0;
    border-radius: 7px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.pcd-view-toggle:hover { color: #e6edf7; }
.pcd-view-toggle.is-active {
    background: rgba(59, 130, 246, 0.18);
    color: #dbeafe;
    box-shadow: inset 0 0 0 1px rgba(59,130,246,0.35);
}
.pcd-view-toggle svg { width: 13px; height: 13px; flex-shrink: 0; }

/* Premium executive export button — replaces the icon-only button in the header */
.pcd-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: linear-gradient(135deg, var(--pcd-accent, #3b82f6) 0%, #2563eb 100%);
    color: #fff;
    border: 0;
    border-radius: 9px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow:
        0 6px 18px rgba(59, 130, 246, calc(var(--pcd-glow, 60) / 200)),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: filter 0.15s ease, transform 0.12s ease;
}
.pcd-export-btn:hover  { filter: brightness(1.08); transform: translateY(-1px); }
.pcd-export-btn:active { transform: translateY(0); }
.pcd-export-btn:disabled,
.pcd-export-btn.is-loading { opacity: 0.6; cursor: progress; }
.pcd-export-btn svg { width: 14px; height: 14px; }

/* Project rows clickable affordance */
.pcd-project-row { cursor: pointer; }
.pcd-project-row:hover { background: rgba(59, 130, 246, 0.05); }
.pcd-project-row:focus-visible { outline: 2px solid var(--pcd-accent, #3b82f6); outline-offset: -2px; }

/* ===== GRID VIEW ===== */
.pcd-grid-card { padding: 20px; }
.pcd-grid-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}
.pcd-grid-tile {
    padding: 16px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.18s ease;
    position: relative;
    overflow: hidden;
}
.pcd-grid-tile:hover {
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: 0 12px 24px rgba(0,0,0,0.35);
}
.pcd-grid-tile-green::before,
.pcd-grid-tile-amber::before,
.pcd-grid-tile-red::before {
    content: '';
    position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
}
.pcd-grid-tile-green::before { background: var(--pcd-success, #22c55e); box-shadow: 0 0 12px var(--pcd-success, #22c55e); }
.pcd-grid-tile-amber::before { background: var(--pcd-warning, #f59e0b); box-shadow: 0 0 12px var(--pcd-warning, #f59e0b); }
.pcd-grid-tile-red::before   { background: var(--pcd-danger,  #ef4444); box-shadow: 0 0 12px var(--pcd-danger,  #ef4444); }

.pcd-grid-tile-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.pcd-grid-tile-titles { min-width: 0; flex: 1; }
.pcd-grid-tile-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcd-grid-tile-sub  { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.pcd-grid-tile-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin-bottom: 12px; }
.pcd-grid-stat { display: flex; flex-direction: column; gap: 2px; }
.pcd-grid-stat-label { font-size: 10px; font-weight: 500; color: #64748b; letter-spacing: 0.04em; text-transform: uppercase; }
.pcd-grid-stat-value { font-size: 13px; font-weight: 600; color: #e6edf7; font-variant-numeric: tabular-nums; }
.pcd-grid-tile-bar { height: 4px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden; }
.pcd-grid-tile-bar span {
    display: block; height: 100%;
    background: linear-gradient(90deg, var(--pcd-accent, #3b82f6), #60a5fa);
    border-radius: 2px;
    transition: width 0.4s ease;
}
.pcd-empty { padding: 40px 20px; text-align: center; color: #64748b; font-size: 13px; }

/* ===== FINANCIAL VIEW ===== */
.pcd-financial-card { padding: 18px 20px; }
.pcd-financial-card .pcd-card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.pcd-financial-card .pcd-card-sub { font-size: 11px; color: #64748b; letter-spacing: 0.04em; text-transform: uppercase; }
.pcd-financial-chart-wrap { position: relative; height: 320px; }

/* ===== DRILL-DOWN MODAL ===== */
.pcd-modal {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    padding: 32px 20px;
    opacity: 0; pointer-events: none;
    transition: opacity 0.18s ease;
}
.pcd-modal.is-open { opacity: 1; pointer-events: auto; }
.pcd-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(2, 6, 18, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.pcd-modal-shell {
    position: relative;
    width: 100%; max-width: 760px; max-height: calc(100vh - 64px);
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(28px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 32px 36px 28px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    transform: translateY(8px) scale(0.985);
    opacity: 0;
    transition: transform 0.22s cubic-bezier(.22,1,.36,1), opacity 0.18s ease;
}
.pcd-modal.is-open .pcd-modal-shell { transform: translateY(0) scale(1); opacity: 1; }
.pcd-modal-close {
    position: absolute; top: 16px; right: 16px;
    width: 32px; height: 32px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #94a3b8;
    border-radius: 8px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s ease;
}
.pcd-modal-close:hover { background: rgba(239,68,68,0.15); color: #fca5a5; border-color: rgba(239,68,68,0.4); }
.pcd-modal-loading { padding: 40px 0; text-align: center; color: #94a3b8; font-size: 14px; }

.pcd-detail-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.pcd-detail-eyebrow { font-size: 11px; font-weight: 500; color: #3b82f6; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 6px; }
.pcd-detail-title   { margin: 0; font-size: 22px; font-weight: 700; color: #fff; letter-spacing: -0.01em; }
.pcd-detail-sub     { margin-top: 4px; font-size: 13px; color: #94a3b8; }
.pcd-detail-risk {
    flex-shrink: 0;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    border: 1px solid;
}
.pcd-detail-risk-green { background: rgba(34,197,94,0.15);  color: #86efac; border-color: rgba(34,197,94,0.4); }
.pcd-detail-risk-amber { background: rgba(245,158,11,0.15); color: #fcd34d; border-color: rgba(245,158,11,0.4); }
.pcd-detail-risk-red   { background: rgba(239,68,68,0.15);  color: #fca5a5; border-color: rgba(239,68,68,0.4); }

.pcd-detail-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px; margin-bottom: 24px;
}
.pcd-detail-kpi {
    padding: 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
}
.pcd-detail-kpi-label { display: block; font-size: 10px; font-weight: 500; color: #64748b; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 6px; }
.pcd-detail-kpi-value { display: block; font-size: 17px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }

.pcd-detail-section { margin-bottom: 24px; }
.pcd-detail-section h3 { margin: 0 0 12px; font-size: 12px; font-weight: 600; color: #94a3b8; letter-spacing: 0.06em; text-transform: uppercase; }
.pcd-detail-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.pcd-detail-table th, .pcd-detail-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.05); }
.pcd-detail-table th { font-weight: 500; color: #64748b; font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; }
.pcd-detail-table td { color: #e6edf7; font-variant-numeric: tabular-nums; }
.pcd-detail-table td.is-pos { color: #86efac; }
.pcd-detail-table td.is-neg { color: #fca5a5; }

.pcd-detail-milestones { list-style: none; margin: 0; padding: 0; }
.pcd-detail-milestones li {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 13px; color: #e6edf7;
}
.pcd-detail-milestones li:last-child { border-bottom: 0; }
.pcd-milestone-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.pcd-milestone-done .pcd-milestone-dot        { background: var(--pcd-success, #22c55e); box-shadow: 0 0 10px var(--pcd-success, #22c55e); }
.pcd-milestone-in_progress .pcd-milestone-dot { background: var(--pcd-accent,  #3b82f6); box-shadow: 0 0 10px var(--pcd-accent,  #3b82f6); }
.pcd-milestone-pending .pcd-milestone-dot     { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25); }
.pcd-milestone-name { flex: 1; }
.pcd-milestone-date { color: #64748b; font-size: 12px; font-variant-numeric: tabular-nums; }

.pcd-detail-meta {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.pcd-detail-meta div { display: flex; flex-direction: column; gap: 4px; }
.pcd-detail-meta span { font-size: 10px; font-weight: 500; color: #64748b; letter-spacing: 0.04em; text-transform: uppercase; }
.pcd-detail-meta strong { font-size: 13px; font-weight: 600; color: #e6edf7; }

/* All three view panes share the map's grid track (column 1).
   Only one is visible at a time — the JS toggles [hidden] which we
   honor with !important to beat any flex/grid display rules. */
.pcd-mid > [data-view-pane] { grid-column: 1; min-height: 460px; }
.pcd-mid > .pcd-grid-card,
.pcd-mid > .pcd-financial-card { display: flex; flex-direction: column; }
.pcd-mid > .pcd-financial-card .pcd-financial-chart-wrap { flex: 1; min-height: 320px; }
.pcd-mid > [data-view-pane][hidden] { display: none !important; }

/* Responsive: 2-col mid layout already exists at 1280; ensure new panes follow */
@media (max-width: 1280px) {
    .pcd-mid > [data-view-pane] { grid-column: 1; }
}

/* =============================================================
 * v1.2 — Focused project mode, toast, spin, view-pane fix
 * ============================================================= */

@keyframes pcd-spin { to { transform: rotate(360deg); } }

/* Focus mode banner */
.pcd-focus-banner {
    margin: 0 0 14px;
    padding: 0;
    background: linear-gradient(135deg, rgba(59,130,246,0.18), rgba(34,197,94,0.10));
    border: 1px solid rgba(59,130,246,0.35);
    border-radius: 12px;
    overflow: hidden;
}
.pcd-focus-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #dbeafe;
    font-size: 13px;
}
.pcd-focus-inner svg { color: #3b82f6; flex-shrink: 0; }
.pcd-focus-inner span { flex: 1; }
.pcd-focus-inner strong { font-weight: 600; color: #fff; margin-right: 6px; }
.pcd-focus-clear {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.pcd-focus-clear:hover {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.25);
}

/* Toast (used by Help button) */
.pcd-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    max-width: 420px;
    padding: 14px 18px;
    background: rgba(15,23,42,0.96);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    color: #e6edf7;
    font-size: 13px;
    line-height: 1.5;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(.22,1,.36,1);
    z-index: 9998;
}
.pcd-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.pcd-toast strong { color: #3b82f6; font-weight: 600; }

/* Sidebar tooltip — show on hover, since data-tip already exists */
.pcd-side-btn { position: relative; }
.pcd-side-btn::after {
    content: attr(data-tip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(8px);
    background: rgba(15,23,42,0.96);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.1);
    color: #e6edf7;
    font-size: 11px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 1000;
}
.pcd-side-btn:hover::after,
.pcd-side-btn:focus::after { opacity: 1; transform: translateY(-50%) translateX(12px); }

/* AI insights — Claude badge + clickable rows */
.pcd-insight-aibadge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px 5px 8px;
    margin: 0 0 12px;
    background: linear-gradient(135deg, rgba(59,130,246,0.18), rgba(168,85,247,0.18));
    border: 1px solid rgba(99,102,241,0.35);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #c7d2fe;
}
.pcd-insight-aibadge svg { color: #a5b4fc; }
.pcd-insight.is-ai {
    border-left: 2px solid rgba(99,102,241,0.6);
    padding-left: 10px;
    margin-left: -2px;
}
.pcd-insight.is-clickable { cursor: pointer; transition: background 0.15s ease, transform 0.12s ease; }
.pcd-insight.is-clickable:hover { background: rgba(59,130,246,0.06); transform: translateX(2px); }
.pcd-insight.is-clickable:focus-visible { outline: 2px solid var(--pcd-accent, #3b82f6); outline-offset: 2px; }

/* =============================================================
 * v1.3 — Alerts drill-down · Project links · Folder icon
 * ============================================================= */

/* Risk & alerts cards: clickable chevron */
.pcd-alert.is-clickable { cursor: pointer; transition: background 0.15s ease, transform 0.12s ease, border-color 0.15s ease; }
.pcd-alert.is-clickable:hover { background: rgba(255,255,255,0.04); transform: translateX(2px); }
.pcd-alert.is-clickable:focus-visible { outline: 2px solid var(--pcd-accent, #3b82f6); outline-offset: 2px; }
.pcd-alert-arrow {
    flex-shrink: 0;
    color: rgba(255,255,255,0.3);
    transition: color 0.15s ease, transform 0.15s ease;
}
.pcd-alert.is-clickable:hover .pcd-alert-arrow { color: var(--pcd-accent, #3b82f6); transform: translateX(3px); }
.pcd-alert-arrow svg { width: 16px; height: 16px; }

/* Drill-down modal — alert detail */
.pcd-alert-detail-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.pcd-alert-detail-icon {
    flex-shrink: 0;
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(239,68,68,0.18);
    color: #fca5a5;
    border: 1px solid rgba(239,68,68,0.3);
}
.pcd-alert-detail-icon-submittals,
.pcd-alert-detail-icon-change_orders { background: rgba(245,158,11,0.18); border-color: rgba(245,158,11,0.3); color: #fcd34d; }
.pcd-alert-detail-icon-safety        { background: rgba(34,197,94,0.18); border-color: rgba(34,197,94,0.3); color: #86efac; }
.pcd-alert-detail-titles h2 { margin: 0; font-size: 20px; font-weight: 700; color: #fff; }
.pcd-alert-detail-titles p  { margin: 4px 0 0; font-size: 13px; color: #94a3b8; }

.pcd-alert-detail-list { list-style: none; margin: 0; padding: 0; }
.pcd-alert-detail-row {
    display: flex; align-items: center; gap: 16px;
    padding: 14px 4px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    transition: background 0.15s ease, padding 0.15s ease;
    border-radius: 8px;
}
.pcd-alert-detail-row:hover { background: rgba(59,130,246,0.06); padding-left: 12px; padding-right: 12px; }
.pcd-alert-detail-row:focus-visible { outline: 2px solid var(--pcd-accent); outline-offset: 2px; }
.pcd-alert-detail-row-main { flex: 1; min-width: 0; }
.pcd-alert-detail-row-name { font-size: 14px; font-weight: 600; color: #fff; margin-bottom: 3px; }
.pcd-alert-detail-row-meta { font-size: 11px; color: #64748b; }
.pcd-alert-detail-row-stat { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.pcd-alert-detail-row-count {
    font-size: 18px; font-weight: 700;
    font-variant-numeric: tabular-nums;
    padding: 2px 10px; border-radius: 6px;
}
.pcd-alert-detail-risk-green { color: #86efac; background: rgba(34,197,94,0.15); }
.pcd-alert-detail-risk-amber { color: #fcd34d; background: rgba(245,158,11,0.15); }
.pcd-alert-detail-risk-red   { color: #fca5a5; background: rgba(239,68,68,0.18); }
.pcd-alert-detail-row-detail { font-size: 11px; color: #94a3b8; font-weight: 500; }
.pcd-alert-detail-row-arrow { color: rgba(255,255,255,0.3); }
.pcd-alert-detail-row:hover .pcd-alert-detail-row-arrow { color: var(--pcd-accent); }

.pcd-alert-detail-empty {
    display: flex; flex-direction: column; align-items: center;
    gap: 14px; padding: 40px 0; color: #64748b; text-align: center;
}
.pcd-alert-detail-empty svg { color: #22c55e; }
.pcd-alert-detail-empty p { margin: 0; font-size: 14px; }
.pcd-alert-detail-hint {
    margin-top: 16px; padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 11px; color: #64748b; text-align: center;
}

/* Project detail — external link button */
.pcd-detail-link {
    margin: -8px 0 24px;
}
.pcd-detail-link a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(59,130,246,0.12);
    border: 1px solid rgba(59,130,246,0.35);
    border-radius: 10px;
    color: #dbeafe;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.pcd-detail-link a:hover {
    background: rgba(59,130,246,0.22);
    border-color: rgba(59,130,246,0.55);
    transform: translateY(-1px);
}
.pcd-detail-link a svg:first-child { color: #60a5fa; flex-shrink: 0; }
.pcd-detail-link a svg:last-child  { opacity: 0.6; }

/* Grid tile folder icon */
.pcd-grid-tile-head { position: relative; }
.pcd-grid-tile-link {
    flex-shrink: 0;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    margin-left: auto;
    background: rgba(59,130,246,0.15);
    border: 1px solid rgba(59,130,246,0.3);
    border-radius: 7px;
    color: #93c5fd;
    text-decoration: none;
    transition: all 0.15s ease;
    position: relative;
}
.pcd-grid-tile-link:hover {
    background: rgba(59,130,246,0.28);
    border-color: rgba(59,130,246,0.6);
    color: #fff;
    transform: scale(1.08);
}
.pcd-grid-tile-link::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    background: rgba(15,23,42,0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    color: #e6edf7;
    font-size: 11px;
    font-weight: 500;
    padding: 5px 9px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateY(2px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 10;
}
.pcd-grid-tile-link:hover::after { opacity: 1; transform: translateY(0); }

/* =============================================================
 * v1.4 — Alert items list (second-level drill-down)
 * ============================================================= */

.pcd-modal-back {
    flex-shrink: 0;
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #94a3b8;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s ease;
}
.pcd-modal-back:hover {
    background: rgba(59,130,246,0.18);
    color: #93c5fd;
    border-color: rgba(59,130,246,0.4);
}

.pcd-modal-jump {
    margin-left: auto;
    padding: 7px 14px;
    background: rgba(59,130,246,0.12);
    border: 1px solid rgba(59,130,246,0.35);
    border-radius: 8px;
    color: #dbeafe;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.12s ease;
}
.pcd-modal-jump:hover { background: rgba(59,130,246,0.22); transform: translateX(2px); }

.pcd-alert-detail-eyebrow {
    font-size: 10px; font-weight: 600; letter-spacing: 0.06em;
    text-transform: uppercase; color: #3b82f6; margin-bottom: 4px;
}

.pcd-items-list { list-style: none; margin: 0; padding: 0; }
.pcd-item-row {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 13px;
}
.pcd-item-row:last-child { border-bottom: 0; }
.pcd-item-num {
    flex-shrink: 0;
    min-width: 70px;
    font-family: ui-monospace, 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    padding: 4px 8px;
    background: rgba(255,255,255,0.04);
    border-radius: 5px;
    text-align: center;
}
.pcd-item-main { flex: 1; min-width: 0; }
.pcd-item-subject {
    font-weight: 500;
    color: #e6edf7;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.pcd-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 11px;
    color: #64748b;
}
.pcd-item-status { text-transform: capitalize; }
.pcd-item-assignee { color: #94a3b8; }
.pcd-item-due { color: #fcd34d; }
.pcd-item-trail {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.pcd-item-amount {
    font-weight: 600;
    color: #86efac;
    font-variant-numeric: tabular-nums;
    font-size: 12px;
}
.pcd-item-age {
    padding: 3px 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
}
.pcd-item-age.is-warn {
    background: rgba(245,158,11,0.15);
    color: #fcd34d;
}
.pcd-item-age.is-late {
    background: rgba(239,68,68,0.18);
    color: #fca5a5;
}
.pcd-item-extlink {
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.15s ease;
}
.pcd-item-extlink:hover {
    background: rgba(59,130,246,0.18);
    border-color: rgba(59,130,246,0.4);
    color: #dbeafe;
}

/* =============================================================
 * v1.4 — Money in Motion (replaces Weather Radar)
 * ============================================================= */

.pcd-momotion-card { padding: 0; overflow: hidden; }
.pcd-momotion-card .pcd-card-head { padding: 14px 16px 6px; }
.pcd-momotion-body {
    padding: 6px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100%;
}
.pcd-momotion-loading,
.pcd-momotion-empty {
    padding: 32px 16px;
    color: #64748b;
    text-align: center;
    font-size: 12px;
}
.pcd-momotion-empty {
    background: rgba(34, 197, 94, 0.06);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 10px;
    color: #86efac;
}

/* Top-row stats — three thin rows in a stack */
.pcd-momotion-stats { display: flex; flex-direction: column; gap: 8px; }
.pcd-momotion-stat {
    padding: 10px 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    border-left-width: 3px;
}
.pcd-momotion-stat-pending  { border-left-color: var(--pcd-warning, #f59e0b); }
.pcd-momotion-stat-approved { border-left-color: var(--pcd-success, #22c55e); }
.pcd-momotion-stat-velocity { border-left-color: var(--pcd-accent, #3b82f6); }

.pcd-momotion-stat-label {
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 2px;
}
.pcd-momotion-stat-value {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}
.pcd-momotion-stat-pending  .pcd-momotion-stat-value { color: #fcd34d; }
.pcd-momotion-stat-approved .pcd-momotion-stat-value { color: #86efac; }
.pcd-momotion-stat-velocity .pcd-momotion-stat-value { color: #93c5fd; }
.pcd-momotion-stat-sub {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 2px;
}

/* Largest pending — clickable list */
.pcd-momotion-top { padding-top: 4px; border-top: 1px solid rgba(255,255,255,0.05); }
.pcd-momotion-top-label {
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    margin: 6px 0 8px;
}
.pcd-momotion-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pcd-momotion-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(255,255,255,0.02);
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.pcd-momotion-row:hover {
    background: rgba(245,158,11,0.08);
    border-color: rgba(245,158,11,0.25);
    transform: translateX(2px);
}
.pcd-momotion-row:focus-visible { outline: 2px solid var(--pcd-accent, #3b82f6); outline-offset: 2px; }
.pcd-momotion-row-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pcd-momotion-row-project {
    font-size: 11px;
    font-weight: 600;
    color: #e6edf7;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pcd-momotion-row-subject {
    font-size: 10px;
    color: #94a3b8;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pcd-momotion-row-amount {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 700;
    color: #fcd34d;
    font-variant-numeric: tabular-nums;
}

/* =============================================================
 * v1.5 — Grid view: hide redundant project list, expand grid pane
 * ============================================================= */

/* When body is in grid-fullwidth mode, let the grid pane span the
   first two columns (where the map and the project list lived).
   AI Insights and Risk & Alerts in cols 3+4 stay put. */
.pcd-grid-fullwidth .pcd-mid > .pcd-grid-card[data-view-pane="grid"] {
    grid-column: 1 / span 2;
}

/* Each tile gets a bit more breathing room since we have 2 cols of space. */
.pcd-grid-fullwidth .pcd-grid-tiles {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* On 2-col responsive (≤1280px) layouts, projects card collapse becomes
   a no-op since map and grid already share their column; just make sure
   the grid spans full width there too. */
@media (max-width: 1280px) {
    .pcd-grid-fullwidth .pcd-mid > .pcd-grid-card[data-view-pane="grid"] {
        grid-column: 1 / -1;
    }
}

/* Clickable count links inside project detail modal */
.pcd-detail-meta-link {
    color: var(--pcd-accent, #3b82f6);
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px dashed rgba(59,130,246,0.4);
    transition: color 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
}
.pcd-detail-meta-link:hover {
    color: #93c5fd;
    border-color: #93c5fd;
}

/* Money in Motion: clickable stat tiles */
.pcd-momotion-stat.is-clickable {
    cursor: pointer;
    transition: background 0.15s ease, transform 0.12s ease, border-color 0.15s ease;
}
.pcd-momotion-stat.is-clickable:hover {
    background: rgba(255,255,255,0.06);
    transform: translateX(2px);
}
.pcd-momotion-stat.is-clickable:focus-visible {
    outline: 2px solid var(--pcd-accent, #3b82f6);
    outline-offset: 2px;
}

/* Money in Motion drill: project name above subject */
.pcd-item-projectname {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #93c5fd;
    margin-bottom: 3px;
}
.pcd-item-row-clickable {
    cursor: pointer;
    transition: background 0.15s ease;
    border-radius: 6px;
}
.pcd-item-row-clickable:hover {
    background: rgba(59,130,246,0.05);
}

/* Milestones — legend + improved layout */
.pcd-detail-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}
.pcd-detail-section-head h3 { margin: 0; }
.pcd-milestone-legend {
    display: flex;
    gap: 14px;
    font-size: 11px;
    color: rgba(226, 232, 240, 0.6);
}
.pcd-milestone-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.pcd-milestone-legend .pcd-milestone-dot {
    width: 8px;
    height: 8px;
}
.pcd-milestone-done-dot        { background: var(--pcd-success, #22c55e); }
.pcd-milestone-in-progress-dot { background: var(--pcd-accent,  #3b82f6); }
.pcd-milestone-pending-dot     { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25); }

/* Milestones — give the date column some real estate */
.pcd-detail-milestones .pcd-milestone-date {
    color: rgba(226, 232, 240, 0.55);
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    margin-left: auto;
}

/* Schedule Lookahead — context line + empty + status colors */
.pcd-sched-context {
    font-size: 11px;
    color: rgba(226, 232, 240, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 12px 10px;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.pcd-sched-empty {
    padding: 32px 16px;
    text-align: center;
    color: rgba(226, 232, 240, 0.5);
    font-size: 13px;
    line-height: 1.5;
}
.pcd-sched-bar.is-done        { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; }
.pcd-sched-bar.is-in_progress { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; }
.pcd-sched-bar.is-pending     { background: linear-gradient(135deg, #475569, #334155); color: #cbd5e1; border: 1px solid rgba(148,163,184,0.3); }

/* KPI info tooltip — the actual tooltip bubble is injected by JS into
   <body> so it can escape the card's overflow:hidden boundary. */
.pcd-kpi-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    font-size: 11px;
    font-style: normal;
    color: rgba(148, 163, 184, 0.7);
    cursor: help;
    position: relative;
    vertical-align: middle;
    margin-left: 4px;
    transition: color 0.15s ease;
}
.pcd-kpi-info:hover { color: #93c5fd; }

/* Shared tooltip bubble rendered by JS */
#pcd-tooltip {
    position: fixed;
    z-index: 99999;
    background: #1e293b;
    border: 1px solid rgba(148,163,184,0.2);
    border-radius: 8px;
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    padding: 10px 14px;
    max-width: 280px;
    white-space: normal;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}
