/* CB Geburtenentwicklung Europa – cb-geburten.css
 * Version: 1.0.0
 * Alle Selektoren unter .cb-geburten-wrap gescoped.
 */

/* ── Wrapper ─────────────────────────────────────────────────────────────── */
.cb-geburten-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: #1a1a1a;
    line-height: 1.5;
    box-sizing: border-box;
}
.cb-geburten-wrap *, .cb-geburten-wrap *::before, .cb-geburten-wrap *::after {
    box-sizing: inherit;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.cbg-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.cbg-title {
    font-size: 15px;
    font-weight: 600;
    color: #111;
    display: block;
}
.cbg-sub {
    font-size: 11.5px;
    color: #666;
    margin-top: 1px;
    display: block;
}

/* ── Admin-Leiste ────────────────────────────────────────────────────────── */
.cbg-admin-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 12px;
    flex-wrap: wrap;
}
.cbg-admin-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
    letter-spacing: .04em;
}
.cbg-cache-info {
    font-size: 11px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}
.cbg-cache-info .dashicons { font-size: 14px; width: 14px; height: 14px; }

/* ── Status ──────────────────────────────────────────────────────────────── */
.cbg-status {
    font-size: 12px;
    padding: 6px 10px;
    margin-bottom: 8px;
    border-radius: 4px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    color: #444;
}
.cbg-status--ok { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }

/* ── Modus-Toggle ────────────────────────────────────────────────────────── */
.cbg-mode-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
}
.cbg-mode-btn {
    padding: 5px 12px;
    font-size: 12.5px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background: transparent;
    color: #555;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.cbg-mode-btn:hover { background: #f0f0f0; }
.cbg-mode-btn--active {
    background: #1a1a1a;
    color: #fff;
    border-color: transparent;
}

/* ── Metrikkarten ────────────────────────────────────────────────────────── */
.cbg-metrics {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.cbg-metric {
    flex: 1 1 90px;
    min-width: 90px;
    background: #f7f7f7;
    border-radius: 6px;
    padding: 7px 10px;
}
.cbg-metric__lbl  { font-size: 10.5px; color: #666; margin-bottom: 2px; }
.cbg-metric__val  { font-size: 18px; font-weight: 600; color: #111; line-height: 1.2; }
.cbg-metric__diff { font-size: 10px; margin-top: 2px; }

/* ── Charts-Grid ─────────────────────────────────────────────────────────── */
.cbg-charts-grid {
    display: grid;
    grid-template-columns: 1fr 210px;
    gap: 12px;
    align-items: start;
    margin-bottom: 6px;
}
@media ( max-width: 600px ) {
    .cbg-charts-grid { grid-template-columns: 1fr; }
}

/* Liniendiagramm */
.cbg-canvas-wrap {
    position: relative;
    height: 240px;
    width: 100%;
}
.cbg-line-legend {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 6px;
    font-size: 11px;
    color: #666;
}
.cbg-leg-item { display: flex; align-items: center; gap: 5px; }
.cbg-leg-dash {
    display: inline-block;
    width: 18px;
    border-top: 2px dashed rgba(140,130,120,.55);
}
.cbg-leg-dash--repl { border-top-width: 1.5px; opacity: .5; }
.cbg-leg-note { font-size: 10.5px; color: #888; }

/* Donutchart-Spalte */
.cbg-pie-col { display: flex; flex-direction: column; gap: 4px; }
.cbg-pie-title { font-size: 11.5px; font-weight: 600; color: #222; }
.cbg-pie-canvas-wrap { position: relative; height: 170px; width: 100%; }

.cbg-pie-legend { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.cbg-pie-leg-row {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #444;
}
.cbg-pie-leg-sq  { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
.cbg-pie-leg-lbl { flex: 1; }
.cbg-pie-leg-val { font-weight: 600; color: #111; }
.cbg-pie-total   { font-size: 10px; color: #888; margin-top: 4px; }
.cbg-pie-src     { font-size: 10px; color: #aaa; line-height: 1.4; margin-top: 4px; }

/* Jahres-Slider */
.cbg-year-slider-wrap { margin-top: 8px; }
.cbg-year-slider { width: 100%; margin: 0; }
.cbg-year-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #888;
    margin-top: 2px;
}
.cbg-year-labels span:nth-child(2) { font-weight: 600; color: #333; font-size: 11px; }

/* ── Länder-Auswahl ──────────────────────────────────────────────────────── */
.cbg-country-section { margin: 10px 0 6px; }

.cbg-section-label {
    font-size: 10px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: .07em;
    font-weight: 600;
    margin-bottom: 5px;
}

.cbg-pills { display: flex; flex-wrap: wrap; gap: 5px; }

.cbg-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11.5px;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: background .15s, color .15s;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1.5;
}
.cbg-pill:hover { filter: brightness(1.07); }
.cbg-pill-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

/* Scrollbarer Bereich andere Länder */
.cbg-regions-scroll {
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
    margin-bottom: 10px;
}
.cbg-regions { display: flex; gap: 14px; min-width: max-content; }

.cbg-region-sec { display: flex; flex-direction: column; gap: 5px; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.cbg-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.cbg-source { font-size: 10px; color: #aaa; margin-left: auto; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.cbg-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 11px;
    font-size: 12px;
    font-family: inherit;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    white-space: nowrap;
}
.cbg-btn:hover { background: #f5f5f5; border-color: #aaa; }
.cbg-btn:disabled { opacity: .55; cursor: default; }

.cbg-btn--icon { padding: 5px 8px; }
.cbg-btn--sm   { padding: 3px 9px; font-size: 11.5px; }

.cbg-btn .dashicons { font-size: 14px; width: 14px; height: 14px; line-height: 1; }

/* ── Dark-Mode-Anpassungen ───────────────────────────────────────────────── */
@media ( prefers-color-scheme: dark ) {
    .cb-geburten-wrap          { color: #e8e0d8; }
    .cbg-title                 { color: #f0e8e0; }
    .cbg-sub, .cbg-cache-info,
    .cbg-leg-note, .cbg-source { color: #999; }
    .cbg-admin-bar             { background: #2a2a2a; border-color: #444; }
    .cbg-status                { background: #2a2a2a; border-color: #444; color: #ccc; }
    .cbg-status--ok            { background: #052e16; border-color: #166534; color: #4ade80; }
    .cbg-mode-btn              { border-color: #555; color: #aaa; background: transparent; }
    .cbg-mode-btn:hover        { background: #2a2a2a; }
    .cbg-mode-btn--active      { background: #e8e0d8; color: #111; border-color: transparent; }
    .cbg-metric                { background: #222; }
    .cbg-metric__lbl           { color: #999; }
    .cbg-metric__val           { color: #f0e8e0; }
    .cbg-pie-leg-row           { color: #bbb; }
    .cbg-pie-leg-val           { color: #f0e8e0; }
    .cbg-pie-total,
    .cbg-pie-src               { color: #666; }
    .cbg-section-label         { color: #666; }
    .cbg-year-labels           { color: #666; }
    .cbg-year-labels span:nth-child(2) { color: #ccc; }
    .cbg-btn                   { background: #2a2a2a; border-color: #555; color: #ccc; }
    .cbg-btn:hover             { background: #333; }
}
