/* ================================================================
 * V1.4.0-dev.3 · Content-Zentrale responsive UX consolidation
 * Desktop keeps dense data tables; smartphones use scan-friendly cards.
 * ================================================================ */

@media (max-width:760px) {
    /* KPI groups: compact two-column overview instead of long single stacks. */
    .ninagrafie-dashboard-stats,
    .ninagrafie-event-stats {
        display:grid !important;
        grid-template-columns:repeat(2,minmax(0,1fr)) !important;
        gap:12px !important;
    }
    .ninagrafie-dashboard-stat,
    .ninagrafie-event-stat {
        min-width:0 !important;
        min-height:104px !important;
        height:auto !important;
    }
    .ninagrafie-event-stat--new { grid-column:auto !important; }

    /* Event filters: search first, two selectors side by side, action full width. */
    .ninagrafie-event-filterbar {
        grid-template-columns:repeat(2,minmax(0,1fr)) !important;
        gap:12px !important;
    }
    .ninagrafie-event-filterbar__search { grid-column:1 / -1 !important; }
    .ninagrafie-event-filterbar > button { grid-column:1 / -1; width:100%; }
    .ninagrafie-event-filterbar__reset { grid-column:1 / -1; text-align:center; }

    /* Article overview: rows become management cards. */
    .ninagrafie-dashboard-table-wrapper { overflow:visible !important; }
    .ninagrafie-dashboard-table,
    .ninagrafie-dashboard-table tbody,
    .ninagrafie-dashboard-table tr,
    .ninagrafie-dashboard-table td { display:block !important; width:100% !important; box-sizing:border-box; }
    .ninagrafie-dashboard-table thead { display:none !important; }
    .ninagrafie-dashboard-table { border:0 !important; background:transparent !important; }
    .ninagrafie-dashboard-table tr {
        margin:0 0 16px !important;
        padding:18px !important;
        border:1px solid rgba(184,143,84,.72) !important;
        border-radius:14px;
        background:#fff;
    }
    .ninagrafie-dashboard-table td {
        display:flex !important;
        align-items:flex-start;
        justify-content:space-between;
        gap:18px;
        padding:7px 0 !important;
        border:0 !important;
        text-align:right;
    }
    .ninagrafie-dashboard-table td::before {
        flex:0 0 92px;
        color:#6d6862;
        font-size:11px;
        font-weight:700;
        letter-spacing:.04em;
        text-align:left;
        text-transform:uppercase;
    }
    .ninagrafie-dashboard-table td:nth-child(1)::before { content:'ID'; }
    .ninagrafie-dashboard-table td:nth-child(2)::before { content:'Bereich'; }
    .ninagrafie-dashboard-table td:nth-child(3)::before { content:'Titel'; }
    .ninagrafie-dashboard-table td:nth-child(4)::before { content:'Status'; }
    .ninagrafie-dashboard-table td:nth-child(5)::before { content:'QA'; }
    .ninagrafie-dashboard-table td:nth-child(6)::before { content:'Featured'; }
    .ninagrafie-dashboard-table td:nth-child(7)::before { content:'Bild'; }
    .ninagrafie-dashboard-table td:nth-child(8)::before { content:'Teaser'; }
    .ninagrafie-dashboard-table td:nth-child(9)::before { content:'Taxonomien'; }
    .ninagrafie-dashboard-table td:nth-child(10)::before { content:'Crosslinks'; }
    .ninagrafie-dashboard-table td:nth-child(11)::before { content:'Verlinkt von'; }
    .ninagrafie-dashboard-table td:nth-child(12)::before { content:'Freigabe'; }
    .ninagrafie-dashboard-table td:nth-child(13)::before { content:'Datum'; }
    .ninagrafie-dashboard-table td:nth-child(14)::before { content:'Aktionen'; }
    /* ID is useful but secondary; keep it compact at the bottom of the information stack. */
    .ninagrafie-dashboard-table td:nth-child(1) { font-size:11px; color:#777; }
    .ninagrafie-dashboard-table td:nth-child(3) { font-size:16px; font-weight:700; color:#74233d; }

    /* Event inventory: same card principle, tailored to event data. */
    .ninagrafie-event-table-wrap { overflow:visible !important; }
    .ninagrafie-event-table,
    .ninagrafie-event-table tbody,
    .ninagrafie-event-table tr,
    .ninagrafie-event-table td { display:block !important; width:100% !important; box-sizing:border-box; }
    .ninagrafie-event-table thead { display:none !important; }
    .ninagrafie-event-table { border:0 !important; background:transparent !important; }
    .ninagrafie-event-table tr {
        margin:0 0 16px !important;
        padding:18px !important;
        border:1px solid var(--event-border) !important;
        border-radius:14px;
        background:#fff;
    }
    .ninagrafie-event-table td {
        display:flex !important;
        align-items:flex-start;
        justify-content:space-between;
        gap:18px;
        padding:7px 0 !important;
        border:0 !important;
        text-align:right;
    }
    .ninagrafie-event-table td::before {
        flex:0 0 88px;
        color:var(--event-text-muted);
        font-size:11px;
        font-weight:700;
        letter-spacing:.04em;
        text-align:left;
        text-transform:uppercase;
    }
    .ninagrafie-event-table td:nth-child(1)::before { content:'Event'; }
    .ninagrafie-event-table td:nth-child(2)::before { content:'Status'; }
    .ninagrafie-event-table td:nth-child(3)::before { content:'Termin'; }
    .ninagrafie-event-table td:nth-child(4)::before { content:'Saison'; }
    .ninagrafie-event-table td:nth-child(5)::before { content:'Plätze'; }
    .ninagrafie-event-table td:nth-child(6)::before { content:'Featured'; }
    .ninagrafie-event-table td:nth-child(7)::before { content:'Aktionen'; }
    .ninagrafie-event-table td:first-child strong { display:block; font-size:16px; }
    .ninagrafie-event-table td:first-child small { display:block; margin-top:4px; }
    .ninagrafie-event-actions { justify-content:flex-end; flex-wrap:wrap; }

    /* To-dos: turn the former list rows into clear operational cards. */
    .ninagrafie-cz-todos__list { border-top:0 !important; }
    .ninagrafie-cz-todo {
        display:grid !important;
        grid-template-columns:auto auto minmax(0,1fr) !important;
        gap:10px 12px !important;
        margin:0 0 16px !important;
        padding:18px !important;
        border:1px solid rgba(184,143,84,.72) !important;
        border-radius:14px;
        background:#fff;
    }
    .ninagrafie-cz-todo__select { grid-column:1; grid-row:1; }
    .ninagrafie-cz-todo__toggle-form { grid-column:2; grid-row:1; }
    .ninagrafie-cz-todo__content { grid-column:3; grid-row:1 / span 2; gap:10px !important; }
    .ninagrafie-cz-todo__actions {
        grid-column:3 !important;
        display:flex !important;
        flex-wrap:wrap;
        gap:8px 14px !important;
        padding-top:8px !important;
        border-top:1px solid rgba(184,143,84,.45);
    }
    .ninagrafie-cz-todo__title { flex-basis:100%; font-size:16px !important; line-height:1.3; }
    .ninagrafie-cz-todo__description { font-size:13px !important; }
    .ninagrafie-cz-todo__meta { gap:7px 10px !important; font-size:10.5px !important; }
    .ninagrafie-cz-todo__meta > span:last-of-type { color:#74233d; font-weight:700; }
    .ninagrafie-cz-todo__actions > a,
    .ninagrafie-cz-todo__delete { font-size:11px !important; }
    .ninagrafie-cz-todo__delete {
        width:auto !important;
        height:auto !important;
        border-radius:0 !important;
    }
    .ninagrafie-cz-todo.is-child { margin-left:min(22px, calc(var(--todo-depth, 0) * 12px)) !important; }
}

@media (max-width:430px) {
    .ninagrafie-event-filterbar { grid-template-columns:1fr !important; }
    .ninagrafie-event-filterbar__search,
    .ninagrafie-event-filterbar > button,
    .ninagrafie-event-filterbar__reset { grid-column:auto !important; }
    .ninagrafie-dashboard-table td,
    .ninagrafie-event-table td { display:block !important; text-align:left; }
    .ninagrafie-dashboard-table td::before,
    .ninagrafie-event-table td::before { display:block; margin-bottom:5px; }
    .ninagrafie-event-actions { justify-content:flex-start; }
}
