.ncd-wrap {
    --ncd-chart-bar: #93c5fd;
    --ncd-chart-tip: #2563eb;
    font-family: inherit;
    margin: 1.5em 0;
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.ncd-header {
    display: flex;
    align-items: center;
    gap: 0.75em;
    margin-bottom: 1em;
    flex-wrap: wrap;
}

.ncd-title {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
    flex: 1;
}

.ncd-title small {
    font-size: 0.75em;
    font-weight: 400;
    color: #6b7280;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.ncd-btn-edit {
    padding: 0.4em 0.9em;
    background: transparent;
    color: #2563eb;
    border: 1px solid #2563eb;
    border-radius: 4px;
    font-size: 0.85em;
    text-decoration: none;
    white-space: nowrap;
    display: inline-block;
}

.ncd-btn-edit:hover {
    background: #eff6ff;
}

.ncd-btn-refresh {
    padding: 0.4em 0.9em;
    background: transparent;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    white-space: nowrap;
}

.ncd-btn-refresh:hover {
    background: #f3f4f6;
}

.ncd-btn-download {
    padding: 0.4em 0.9em;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    white-space: nowrap;
}

.ncd-btn-download:hover {
    background: #1d4ed8;
}

/* ── KPI tiles ───────────────────────────────────────────────────────────── */

.ncd-kpis {
    display: flex;
    gap: 0.75em;
    margin-bottom: 1.25em;
    flex-wrap: wrap;
}

.ncd-kpi {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.6em 1.2em 0.5em;
    min-width: 80px;
    gap: 0.2em;
}

.ncd-kpi-value {
    font-size: 1.8em;
    font-weight: 700;
    color: #1e40af;
    line-height: 1;
}

.ncd-kpi-label {
    font-size: 0.72em;
    color: #6b7280;
    text-align: center;
    white-space: nowrap;
}

.ncd-kpi--chart {
    flex: 1;
    min-width: 200px;
    padding: 0.5em 0.75em 0.4em;
    align-items: stretch;
}

.ncd-sparkline {
    display: block;
    width: 100%;
    height: 52px;
}

/* ── Chart tooltip ───────────────────────────────────────────────────────── */

.ncd-chart-tip {
    position: fixed;
    z-index: 9999;
    background: #1e293b;
    color: #f1f5f9;
    font-size: 0.78em;
    padding: 4px 9px;
    border-radius: 4px;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
}

/* ── Table ────────────────────────────────────────────────────────────────── */

.ncd-table-wrap {
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
}

.ncd-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84em;
}

.ncd-table th,
.ncd-table td {
    padding: 0.4em 0.7em;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    white-space: nowrap;
}

.ncd-table th {
    background: #f3f4f6;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.ncd-table tbody tr:last-child td {
    border-bottom: none;
}

.ncd-table tbody tr:hover {
    background: #f9fafb;
}

/* ── States ───────────────────────────────────────────────────────────────── */

.ncd-error { color: #b91c1c; font-style: italic; }
.ncd-empty { color: #6b7280; font-style: italic; }
