/* === NetCoord Admin — Court Analytics portal (index.html dashboard) === */

/* Like the other admin editors, this sits on a light card, so force dark text
   regardless of the site's dark theme. */
.analytics-portal { display: flex; flex-direction: column; gap: 16px; color: #1B1B2A; }
.analytics-portal label { color: #1B1B2A; }

/* ---- controls ---- */
.an-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}

.an-control {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
}

.an-control select,
.an-control input[type="date"] {
    padding: 7px 10px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    font-weight: 400;
    background: #fff;
    color: #1B1B2A;
}

.an-custom-dates { flex-direction: row; gap: 10px; }
.an-custom-dates[hidden] { display: none; }
.an-custom-dates label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; }

.an-source-toggle { flex-direction: row; gap: 0; }
.an-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid rgba(0, 0, 0, 0.25);
    background: #fff;
    color: #1B1B2A;
    font-size: 14px;
    cursor: pointer;
}
.an-pill:first-child { border-radius: 999px 0 0 999px; }
.an-pill:last-child { border-radius: 0 999px 999px 0; }
.an-pill + .an-pill { border-left: none; }
.an-pill-icon { font-size: 16px; }
.an-pill.active[data-source="bookings"] { background: #4A33FF; border-color: #4A33FF; color: #fff; }
.an-pill.active[data-source="checkins"] { background: #FF3366; border-color: #FF3366; color: #fff; }
.an-pill.active[data-source="total"] { background: #0D9488; border-color: #0D9488; color: #fff; }

.an-load-needed { box-shadow: 0 0 0 2px rgba(74, 51, 255, 0.35); }

.an-status { font-size: 13px; align-self: center; }
.an-status.error { color: #c81e4a; font-weight: 600; }

/* ---- summary strip ---- */
.an-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.an-summary:empty { display: none; }

.an-stat {
    flex: 1 1 130px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 10px 14px;
}
.an-stat-value { font-size: 20px; font-weight: 700; }
.an-stat-label { font-size: 12px; opacity: 0.65; margin-top: 2px; }

/* ---- chart area ---- */
.an-chart {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 14px;
    overflow-x: auto;
}

.an-svg { width: 100%; height: auto; display: block; }
.an-grid { stroke: rgba(0, 0, 0, 0.08); stroke-width: 1; }
.an-axis { font-size: 11px; fill: #666; font-family: inherit; }
.an-line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.an-dot { stroke: #fff; stroke-width: 1; }

.an-empty { padding: 30px 10px; text-align: center; font-size: 14px; opacity: 0.7; }

/* heatmap */
.an-heatmap {
    display: grid;
    gap: 3px;
    min-width: 640px;
}
.an-hm-label { font-size: 10px; text-align: center; opacity: 0.65; align-self: center; }
.an-hm-dow { text-align: right; padding-right: 6px; font-weight: 600; }
.an-hm-cell {
    aspect-ratio: 1.6;
    min-height: 20px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.03);
}
.an-hm-empty {
    background:
        repeating-linear-gradient(45deg, rgba(0,0,0,0.04), rgba(0,0,0,0.04) 3px, transparent 3px, transparent 7px);
}
.an-hm-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    opacity: 0.75;
    margin-top: 10px;
}
.an-hm-scale { width: 120px; height: 10px; border-radius: 5px; display: inline-block; }

/* comparison bars */
.an-compare { display: flex; flex-direction: column; gap: 8px; }
.an-cmp-row { display: grid; grid-template-columns: 170px 1fr 170px; gap: 10px; align-items: center; }
.an-cmp-label {
    font-size: 13px;
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.an-cmp-track { background: rgba(0, 0, 0, 0.05); border-radius: 6px; height: 18px; }
.an-cmp-bar { height: 100%; border-radius: 6px; min-width: 2px; }
.an-cmp-value { font-size: 13px; font-weight: 700; white-space: nowrap; }
.an-cmp-sub { font-weight: 400; opacity: 0.6; font-size: 12px; }

/* ---- context panel ---- */
.an-context {
    background: rgba(74, 51, 255, 0.05);
    border: 1px solid rgba(74, 51, 255, 0.18);
    border-radius: 12px;
    padding: 14px 18px;
    font-size: 13.5px;
    line-height: 1.55;
}
.an-context p { margin: 0 0 8px; }
.an-caveats { margin: 8px 0 0; padding-left: 20px; opacity: 0.8; }
.an-caveats li { margin-bottom: 4px; }

@media (max-width: 700px) {
    .an-cmp-row { grid-template-columns: 110px 1fr; }
    .an-cmp-value { grid-column: 2; }
}
