@media (max-width: 1100px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .notification-hero { flex-direction: column; }
    .notification-metrics { min-width: 0; }
}

@media (max-width: 980px) {
    .dashboard-shell { grid-template-columns: 1fr !important; }
    .sidebar {
        position: fixed;
        z-index: 30;
        inset: 0 auto 0 0;
        width: min(310px, 86vw);
        max-width: min(310px, 86vw);
        transform: translateX(-100%);
        transition: transform 180ms ease;
        box-shadow: 20px 0 45px rgba(16, 24, 40, 0.18);
    }
    .sidebar.is-open { transform: translateX(0); }
    html[dir="rtl"] .sidebar {
        inset: 0 0 0 auto;
        transform: translateX(100%);
        box-shadow: -20px 0 45px rgba(16, 24, 40, 0.18);
    }
    html[dir="rtl"] .sidebar.is-open { transform: translateX(0); }
    .dashboard-shell > .sidebar { width: min(310px, 86vw); max-width: min(310px, 86vw); }
    .dashboard-shell > .dashboard-main { grid-column: 1; }
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 25;
        background: rgba(15, 23, 42, 0.38);
        display: none;
    }
    .sidebar-backdrop.is-open { display: block; }
    .icon-button { display: inline-grid; place-items: center; }
    .dashboard-main { padding: 16px; }
    .dashboard-header { margin: -16px -16px 18px; padding: 14px 16px; align-items: flex-start; }
    .dashboard-header h1 { font-size: 22px; }
    .header-user { display: flex; flex-wrap: wrap; justify-content: flex-end; }
    .header-actions { border-radius: 20px; justify-content: flex-end; }
    .page-actions { flex-direction: column; }
    .filters, .filters input, .filters select, .page-actions .btn { width: 100%; }
    .notification-card { grid-template-columns: 44px minmax(0, 1fr); align-items: flex-start; }
    .notification-actions { grid-column: 1 / -1; flex-wrap: wrap; }
    .notification-actions > *, .notification-actions form, .notification-actions button, .notification-actions a { flex: 1 1 auto; }
    .notification-detail { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .auth-card { padding: 22px; }
    .stats-grid, .form-grid, .detail-grid { grid-template-columns: 1fr; }
    .stat-card strong { font-size: 24px; }
    .panel { padding: 16px; }
    .actions { align-items: stretch; }
    .actions > *, .actions form, .actions button, .actions a { width: 100%; }
    .dashboard-header { flex-wrap: wrap; }
    .header-actions { width: 100%; justify-content: stretch; }
    .header-actions .header-pill, .header-actions .theme-toggle { flex: 1 1 auto; }
    .header-pill-notifications span { display: none; }
    .notification-metrics { grid-template-columns: 1fr; }
    .notification-card-head { flex-direction: column; }
}
