/* ==========================================================================
   analytics.css - manager Analytics page
   ========================================================================== */

/* KPI cards */
.an-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
}
@media (max-width: 1100px) { .an-kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 850px)  { .an-kpis { grid-template-columns: 1fr; } }

.an-kpi {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px 24px;
}
.an-kpi-label {
    font-size: 12px; text-transform: uppercase; letter-spacing: .07em;
    color: var(--text-muted); margin-bottom: 12px;
}
.an-kpi-value { font-size: 30px; font-weight: 700; color: var(--text-primary); line-height: 1; }
.an-kpi-sub { font-size: 13px; margin-top: 10px; color: var(--text-muted); }
.an-kpi-sub.an-up   { color: var(--green); }
.an-kpi-sub.an-down { color: #F87171; }
.an-kpi-sub.an-blue { color: var(--accent2); }

/* Two-column layout */
.an-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 1.25rem;
    align-items: start;
}
@media (max-width: 1000px) { .an-layout { grid-template-columns: 1fr; } }

.an-main { display: flex; flex-direction: column; gap: 1.25rem; }
.an-side { display: flex; flex-direction: column; gap: 1.25rem; }

.an-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
}
.an-card-title { font-size: 17px; font-weight: 600; color: var(--text-primary); margin-bottom: 20px; }
.an-placeholder { color: var(--text-muted); font-size: 13px; padding: 30px 0; text-align: center; }

/* Revenue bars (12 months) */
.an-bars {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 10px;
    align-items: end;
    height: 260px;
    padding-top: 10px;
}
.an-month { display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.an-bar {
    width: 60%;
    max-width: 34px;
    border-radius: 6px 6px 0 0;
    min-height: 2px;
    background: linear-gradient(180deg, var(--accent2), var(--primary-dark));
    transition: height 0.35s ease;
    position: relative;
}
.an-bar:hover::after {
    content: attr(data-val);
    position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
    background: var(--accent); color: #fff; font-size: 11px; padding: 3px 7px;
    border-radius: 5px; white-space: nowrap; margin-bottom: 4px;
}
.an-month-label { font-size: 11px; color: var(--text-muted); }

/* Donut (jobs by service type) */
.an-donut-wrap { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.an-donut {
    width: 180px; height: 180px; border-radius: 50%;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    position: relative;
}
.an-donut::after {
    content: ''; position: absolute; width: 108px; height: 108px;
    border-radius: 50%; background: var(--white);
}
.an-donut-center {
    position: relative; z-index: 1; text-align: center;
}
.an-donut-center .n { font-size: 24px; font-weight: 700; color: var(--text-primary); }
.an-donut-center .l { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.an-legend { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 160px; }
.an-legend-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.an-legend-dot { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.an-legend-name { color: var(--text-secondary); flex: 1; }
.an-legend-val { color: var(--text-primary); font-weight: 600; }

/* Side lists */
.an-list { display: flex; flex-direction: column; }
.an-list-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 0; border-bottom: 1px solid var(--bg-accent); font-size: 14px;
}
.an-list-row:last-child { border-bottom: none; }
.an-list-name { color: var(--text-secondary); }
.an-list-val { color: var(--text-primary); font-weight: 600; }
.an-list-val.an-green { color: var(--green); }

/* Top customers rows */
.an-cust { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--bg-accent); }
.an-cust:last-child { border-bottom: none; }
.an-avatar {
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600; color: var(--accent2);
    background: var(--bg-accent);
}
.an-cust-info { flex: 1; }
.an-cust-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.an-cust-meta { font-size: 12px; color: var(--text-muted); }
