/* ==========================================================================
   Horecamerk Reporting — Adverteerder Dashboard
   Prefix: awcf_hcm-
   Mobile-first, nested CSS
   ========================================================================== */

.awcf_hcm-dashboard {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    color: #1e293b;

    & * {
        box-sizing: border-box;
    }
}

/* Title */
.awcf_hcm-dashboard__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 1.5rem;

    .awcf_hcm-dashboard__period {
        font-size: 0.875rem;
        font-weight: 400;
        color: #64748b;
    }
}

/* ---- KPI tiles ---- */
.awcf_hcm-kpi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;

    @media (min-width: 640px) {
        grid-template-columns: repeat(4, 1fr);
    }
}

.awcf_hcm-kpi {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.25rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.awcf_hcm-kpi__value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: #0f172a;
}

.awcf_hcm-kpi__label {
    font-size: 0.8125rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ---- Chart cards ---- */
.awcf_hcm-chart-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;

    /* Chart.js needs a position:relative container with fixed height
       to prevent the infinite resize loop when maintainAspectRatio: false */
    .awcf_hcm-chart-canvas-wrap {
        position: relative;
        width: 100%;
    }
}

.awcf_hcm-chart-card__title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem;
}

.awcf_hcm-chart-row {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 1.5rem;

    @media (min-width: 768px) {
        flex-direction: row;

        .awcf_hcm-chart-card--half {
            flex: 1;
            margin-bottom: 0;
        }
    }
}

/* ---- Table card ---- */
.awcf_hcm-table-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.awcf_hcm-table-card__title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem;
}

.awcf_hcm-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.awcf_hcm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;

    th, td {
        padding: 0.625rem 0.75rem;
        text-align: left;
        border-bottom: 1px solid #f1f5f9;
    }

    th {
        font-weight: 600;
        color: #64748b;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        white-space: nowrap;
    }

    td:not(:first-child),
    th:not(:first-child) {
        text-align: right;
    }

    tbody tr:hover {
        background: #f8fafc;
    }

    a {
        color: #2563eb;
        text-decoration: none;

        &:hover {
            text-decoration: underline;
        }
    }
}

/* ---- Notice blocks (login / no-access / empty) ---- */
.awcf_hcm-notice {
    max-width: 600px;
    margin: 2rem auto;
    padding: 1.5rem;
    border-radius: 0.75rem;
    text-align: center;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.awcf_hcm-notice--info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.awcf_hcm-notice--warning {
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #92400e;
}

.awcf_hcm-btn {
    display: inline-block;
    padding: 0.625rem 1.5rem;
    background: #2563eb;
    color: #fff;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: background 0.15s ease;

    &:hover {
        background: #1d4ed8;
        color: #fff;
        text-decoration: none;
    }
}
