/* Workload KPI (sq ft) modal — js/admin/workload-sqft.js.
 *
 * VISUAL COPY of the CRM Dashboard's Workload KPI card
 * (crm/frontend-crm/src/pages/dashboard/DashboardPage.css: .dashboard__workload-*,
 * .bar-chart*, .dashboard__stat-tile*, plus components/common/InfoTooltip.css),
 * so both apps read as the same dashboard. Colors and sizes are the CRM's own
 * values on purpose — not the PNG --ras-* tokens. Keep in sync with the CRM.
 * Everything is scoped under .wsq-card so it can't leak into the PNG.
 */
.wsq-card {
    --wsq-surface: #ffffff;
    --wsq-text: #1a1a1a;
    --wsq-muted: #718096;
    --wsq-border: #e2e8f0;
    --wsq-primary: #045339;
    --wsq-warning: #d69e2e;
    --wsq-warning-bg: #fefcbf;
    background: var(--wsq-surface);
    border: 1px solid var(--wsq-border);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    color: var(--wsq-text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Title row + metric pill */
.wsq-card .wsq-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--wsq-border);
}
.wsq-card .wsq-metric {
    display: inline-flex;
    border: 1px solid var(--wsq-border);
    border-radius: 999px;
    overflow: hidden;
    flex-shrink: 0;
}
.wsq-card .wsq-metric span {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 12px;
    background: var(--wsq-primary);
    color: #fff;
}

/* ⓘ tooltip (CSS-only, same as the CRM's InfoTooltip) */
.wsq-card .wsq-info { position: relative; display: inline-flex; align-items: center; margin-left: 6px; vertical-align: middle; }
.wsq-card .wsq-info__icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 14px; height: 14px; border-radius: 50%;
    background: #95a0ad; color: #fff;
    font-size: 0.65rem; font-weight: 700; font-style: italic;
    font-family: Georgia, 'Times New Roman', serif;
    cursor: help;
}
.wsq-card .wsq-info__icon:hover, .wsq-card .wsq-info__icon:focus-visible { background: #5a6470; outline: none; }
.wsq-card .wsq-info__bubble {
    position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
    background: #2b3340; color: #f3f5f8;
    padding: 8px 12px; border-radius: 6px;
    font-size: 0.75rem; font-weight: 400; font-style: normal; line-height: 1.45;
    width: 240px; text-align: left; white-space: normal;
    z-index: 100; opacity: 0; pointer-events: none; transition: opacity 150ms;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}
.wsq-card .wsq-info__bubble::before {
    content: ''; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
    border: 5px solid transparent; border-bottom-color: #2b3340;
}
.wsq-card .wsq-info:hover .wsq-info__bubble, .wsq-card .wsq-info:focus-within .wsq-info__bubble { opacity: 1; }

/* Status chips — multi-select, like the CRM's .dashboard__status-filter-btn */
.wsq-card .wsq-statuses { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 16px; }
.wsq-card .wsq-status {
    border: 1px solid var(--wsq-border);
    border-radius: 999px;
    background: transparent;
    color: var(--wsq-muted);
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 12px;
    cursor: pointer;
}
.wsq-card .wsq-status--active { background: var(--wsq-primary); border-color: var(--wsq-primary); color: #fff; }
.wsq-card .wsq-status-dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    margin-right: 5px; box-shadow: 0 0 0 1px #fff;
}

/* Stage colors — the CRM's .bar-chart__segment--* */
.wsq-card .wsq-seg--awarded { background: #2E8B57; }
.wsq-card .wsq-seg--soft-award { background: #E0A526; }

/* Framing Start range */
.wsq-card .wsq-range { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 16px; }
.wsq-card .wsq-range-caption, .wsq-card .wsq-range label {
    font-size: 0.75rem; font-weight: 600; color: var(--wsq-muted);
}
.wsq-card .wsq-range label { display: inline-flex; align-items: center; gap: 4px; }
.wsq-card .wsq-range input[type='month'] {
    border: 1px solid var(--wsq-border);
    border-radius: 6px;
    font: inherit;
    font-size: 0.75rem;
    padding: 2px 6px;
    color: var(--wsq-text);
    background: var(--wsq-surface);
}

.wsq-card .wsq-subtitle, .wsq-card .wsq-msg { font-size: 0.875rem; color: var(--wsq-muted); margin: 4px 0 16px; }
.wsq-card .wsq-msg--error { color: #c53030; }

/* Vertical bar chart */
.wsq-card .wsq-chart { display: flex; align-items: flex-end; gap: 8px; height: 200px; padding-top: 16px; }
.wsq-card .wsq-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.wsq-card .wsq-track { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.wsq-card .wsq-bar {
    width: 100%;
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height 0.4s ease, filter 0.15s ease;
    position: relative;
    /* stacked: segments fill bottom → top (first child at the base) */
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-start;
}
.wsq-card .wsq-seg { width: 100%; flex-shrink: 0; }
/* thin gap between stacked stages so adjacent colors don't blend */
.wsq-card .wsq-seg + .wsq-seg { border-bottom: 2px solid var(--wsq-surface); }
/* top segment carries the rounded corners (last div = top under column-reverse) */
.wsq-card .wsq-seg:last-of-type { border-radius: 4px 4px 0 0; }

/* Legend — the CRM's .grouped-bar-chart__legend */
.wsq-card .wsq-legend { display: flex; justify-content: center; gap: 24px; margin-top: 8px; }
.wsq-card .wsq-legend-item { display: flex; align-items: center; gap: 4px; font-size: 0.6875rem; color: var(--wsq-muted); }
.wsq-card .wsq-legend-dot { width: 10px; height: 10px; border-radius: 2px; }
.wsq-card .wsq-col:hover .wsq-bar { filter: brightness(1.15); }
.wsq-card .wsq-hover-value, .wsq-card .wsq-hover-count {
    position: absolute; left: 50%; transform: translateX(-50%);
    white-space: nowrap; opacity: 0; transition: opacity 0.15s ease; pointer-events: none;
}
.wsq-card .wsq-hover-value { bottom: calc(100% + 4px); font-size: 0.6875rem; font-weight: 700; color: var(--wsq-text); }
.wsq-card .wsq-hover-count { bottom: calc(100% + 18px); font-size: 0.5625rem; font-weight: 500; color: var(--wsq-muted); }
.wsq-card .wsq-col:hover .wsq-hover-value, .wsq-card .wsq-col:hover .wsq-hover-count { opacity: 1; }
.wsq-card .wsq-label { font-size: 0.6875rem; font-weight: 500; color: var(--wsq-muted); white-space: nowrap; }

/* Missing-schedule / missing-GFA stat tiles */
.wsq-card .wsq-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.wsq-card .wsq-tile {
    display: flex; align-items: center; gap: 8px;
    border-radius: 8px; padding: 8px 14px;
    font: inherit; text-align: left; cursor: default;
}
.wsq-card button.wsq-tile { cursor: pointer; border: 1px solid var(--wsq-warning); }
.wsq-card .wsq-tile--outlined { border: 1px solid var(--wsq-warning); }
/* the neutral (missing floor area) tile keeps its grey border when it's a button */
.wsq-card button.wsq-tile--neutral { border: 1px solid var(--wsq-border); }
.wsq-card .wsq-tile--warn { background: var(--wsq-warning-bg); }
.wsq-card .wsq-tile--neutral { background: var(--wsq-surface); border: 1px solid var(--wsq-border); }
.wsq-card .wsq-tile-num { font-size: 1.1rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.wsq-card .wsq-tile--warn .wsq-tile-num { color: #b3690f; }
.wsq-card .wsq-tile--neutral .wsq-tile-num { color: var(--wsq-muted); }
.wsq-card .wsq-tile-label { font-size: 0.75rem; font-weight: 600; line-height: 1.25; }
.wsq-card .wsq-tile--warn .wsq-tile-label { color: #8a5a12; }
.wsq-card .wsq-tile--neutral .wsq-tile-label { color: var(--wsq-muted); }
.wsq-card .wsq-tile-arrow { margin-left: auto; color: #b3690f; font-size: 0.9rem; }
.wsq-card .wsq-tile-arrow--neutral { color: var(--wsq-muted); }

/* Names of the awarded projects missing a schedule — the CRM tile links to its
   Projects list; the PNG has no such page, so the tile reveals the names here. */
.wsq-card .wsq-missing-list {
    margin: 8px 0 0; padding: 8px 14px 8px 30px;
    border: 1px solid var(--wsq-border); border-radius: 8px;
    font-size: 0.75rem; color: var(--wsq-text);
    columns: 2 220px;
}

@media (max-width: 640px) {
    .wsq-card { padding: 16px; }
    .wsq-card .wsq-chart { gap: 4px; }
    .wsq-card .wsq-label { font-size: 0.5625rem; }
}
