/*
 * The shared dashboard.css owns typography, spacing, tables, search fields,
 * sorting, charts, progress bars and pagination. Only customer-specific
 * additions belong in this file so both dashboards stay visually identical.
 */
.customer-widget {
    border-radius: 18px;
    box-shadow: var(--shadow);
}

/* Same twelve-column layout model as the master dashboard. */
.customer-dashboard-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
}

.customer-width-20 { grid-column: span 2; }
.customer-width-25 { grid-column: span 3; }
.customer-width-33 { grid-column: span 4; }
.customer-width-40 { grid-column: span 5; }
.customer-width-50 { grid-column: span 6; }
.customer-width-66 { grid-column: span 8; }
.customer-width-75 { grid-column: span 9; }
.customer-width-100 { grid-column: span 12; }

.customer-metric-card {
    gap: 14px;
}

/* Keep the unit immediately visible on every certificate-count variant. */
.customer-metric-card .customer-certificate-count {
    white-space: nowrap;
    font-size: clamp(30px, 3.4vw, 48px);
    letter-spacing: -.045em;
}

/* The location field exists only for the reusable location-progress element. */
.customer-placement-fields.has-location,
.customer-placement-fields.has-cohort {
    grid-template-columns: minmax(190px, 1fr) minmax(170px, .8fr) 110px auto;
}

.customer-location-progress-card {
    min-height: 150px;
    gap: 10px;
}

.customer-location-progress-value {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
    color: var(--brand);
    line-height: 1;
}

.customer-location-progress-value strong {
    flex: 0 0 auto;
    font-size: clamp(35px, 4.2vw, 54px);
    letter-spacing: -.055em;
}

.customer-location-progress-value span {
    font-size: clamp(22px, 2.3vw, 32px);
    font-weight: 650;
}

.customer-location-progress-value b {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: clamp(22px, 2.3vw, 32px);
    line-height: 1.08;
}

.customer-location-progress-card .customer-metric-caption {
    margin-top: 0;
}

.customer-location-progress-empty {
    display: grid;
    gap: 8px;
    color: var(--brand);
}

.customer-location-progress-empty strong {
    font-size: clamp(25px, 2.7vw, 36px);
    line-height: 1.08;
}

.customer-location-progress-empty span {
    color: var(--muted);
    font-size: 13px;
}

.customer-metric-caption {
    display: block;
    margin-top: -7px;
    color: var(--muted);
    font-size: 12px;
}

.customer-metric-progress {
    width: 100%;
    height: 12px;
    appearance: none;
    -webkit-appearance: none;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    background: #e1e5e8;
    accent-color: var(--gold);
}

.customer-metric-progress::-webkit-progress-bar {
    background: #e1e5e8;
    border-radius: 999px;
}

.customer-metric-progress::-webkit-progress-value {
    background: var(--gold);
    border-radius: 999px;
}

.customer-metric-progress::-moz-progress-bar {
    background: var(--gold);
    border-radius: 999px;
}

.customer-widget .dashboard-export {
    border: 0;
    font-weight: 850;
    cursor: pointer;
}

.customer-dashboard-bar {
    fill: var(--gold);
    transition: opacity .16s ease;
}

.customer-dashboard-bar:hover {
    opacity: .8;
}

.customer-dashboard-table-scroll {
    /* Roughly 15–20 rows stay visible; up to 500 rows remain scrollable. */
    max-height: 720px;
    overflow: auto;
}

.customer-widget[data-customer-widget="activity_monthly"] .dashboard-chart-scroll,
.customer-widget[data-customer-widget="certificates_monthly"] .dashboard-chart-scroll {
    padding-top: 12px;
}

.customer-course-details[open]::before {
    content: "";
    position: fixed;
    z-index: 29;
    inset: 0;
    background: rgba(22, 52, 79, .34);
}

.customer-course-details > div {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    width: min(640px, calc(100vw - 32px));
    max-height: 78vh;
    padding: 28px 76px 28px 28px;
    transform: translate(-50%, -50%);
}

.customer-course-details ul {
    columns: 1;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}

.customer-course-details li {
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    line-height: 1.45;
}

.customer-course-details li:nth-child(odd) {
    background: #f8f9fa;
}

.customer-course-details-close {
    position: sticky;
    top: 0;
    float: right;
    width: 42px;
    height: 42px;
    margin: -10px -58px 10px 18px;
    border: 0;
    border-radius: 50%;
    background: var(--brand-dark);
    color: #fff;
    font: 700 29px/1 sans-serif;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(22, 52, 79, .2);
}

.customer-course-details-close:hover,
.customer-course-details-close:focus-visible {
    background: var(--gold);
    color: var(--brand-dark);
    outline: 3px solid var(--gold-soft);
}

.customer-widget .dashboard-table td[data-key="download_url"] a {
    color: var(--brand);
    font-size: inherit;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.customer-widget .dashboard-table td[data-key="download_url"] a:hover {
    color: var(--gold-dark);
}

.customer-widget .dashboard-table td[data-key="download_url"] a:focus-visible {
    border-radius: 3px;
    outline: 3px solid var(--gold-soft);
    outline-offset: 2px;
}

.dashboard-pagination-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard-pagination-range {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}

@media (max-width: 1050px) {
    .customer-width-20,
    .customer-width-25,
    .customer-width-33,
    .customer-width-40 {
        grid-column: span 6;
    }

    .customer-width-66,
    .customer-width-75,
    .customer-width-100 {
        grid-column: span 12;
    }
}

@media (max-width: 760px) {
    .customer-placement-fields.has-location,
    .customer-placement-fields.has-cohort {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {
    .customer-metric-card {
        min-height: 145px;
    }

    .dashboard-pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
}
