/* ============================================================
   PHILCST Incident System — Premium UI Layer v1.0
   Professional design enhancements on top of base styles.
   Brand colors are untouched — only depth, motion, and
   polish are added here.
   ============================================================ */

/* ──────────────────────────────────────────────
   0. DESIGN TOKENS
   ────────────────────────────────────────────── */
:root {
    --ease-out-expo:   cubic-bezier(0.16, 1, 0.3, 1);
    --ease-standard:   cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: .18s var(--ease-standard);
    --transition-med:  .26s var(--ease-standard);
    --inset-shine:     0 0 0 1px rgba(255, 255, 255, 0.55) inset;
    --inset-shine-lg:  0 0 0 1px rgba(255, 255, 255, 0.7) inset;
}

/* ──────────────────────────────────────────────
   1. GLOBAL POLISH
   ────────────────────────────────────────────── */

/* Crisp font rendering */
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
}

/* Brand selection color */
::selection {
    background: rgba(168, 85, 247, 0.22);
    color: #2a0738;
}

.app-skip-link {
    position: fixed;
    top: .75rem;
    left: .75rem;
    z-index: 1100;
    padding: .75rem 1rem;
    border-radius: 10px;
    background: #6e1d8d;
    color: #fff;
    font-weight: 700;
    transform: translateY(calc(-100% - 1rem));
}

.app-skip-link:focus {
    transform: translateY(0);
    color: #fff;
}

.metric-row > span:first-child {
    min-width: 0;
}

.metric-label {
    display: block;
    line-height: 1.4;
}

.metric-value {
    display: block;
    margin-top: .35rem;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

@media (pointer: coarse) and (max-width: 767.98px) {
    input.form-control,
    textarea.form-control,
    select.form-select {
        font-size: 1rem;
    }

    .btn,
    .select-modal-trigger {
        min-height: 2.75rem;
    }
}

/* ──────────────────────────────────────────────
   2. CUSTOM SCROLLBARS
   ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.22);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.4);
    border-color: transparent;
    background-clip: padding-box;
}

/* Firefox scrollbar */
* { scrollbar-width: thin; scrollbar-color: rgba(168, 85, 247, 0.22) transparent; }

/* ──────────────────────────────────────────────
   3. SIDEBAR — Deep glass & active indicator
   ────────────────────────────────────────────── */

/* Right-edge separator glow */
.app-sidebar {
    border-right: 1px solid rgba(168, 85, 247, 0.18);
    box-shadow: 4px 0 28px rgba(20, 3, 25, 0.22);
}

/* Brand hover zone */
.app-brand {
    padding: .5rem .5rem 1rem;
    border-radius: 20px;
    transition: background var(--transition-fast);
}
.app-brand:hover { background: rgba(255, 255, 255, 0.07); }

/* Sidebar nav links — cubic-bezier hover */
.sidebar-link {
    position: relative;
    transition:
        background var(--transition-fast),
        border-color var(--transition-fast),
        color var(--transition-fast),
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
    letter-spacing: .012em;
}

.sidebar-link:hover {
    transform: translateX(3px);
}

/* Active link — glowing left pill indicator */
.sidebar-link.active {
    font-weight: 800;
    box-shadow:
        0 14px 28px rgba(8, 17, 32, 0.24),
        var(--inset-shine);
}
.sidebar-link.active::after {
    content: '';
    position: absolute;
    left: -.82rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 52%;
    border-radius: 0 4px 4px 0;
    background: linear-gradient(180deg, #c084fc 0%, #a855f7 60%, #7c3aed 100%);
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.6);
}

/* Role badge — glass pill */
.sidebar-role {
    font-weight: 700;
    letter-spacing: .1em;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.13);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

/* ──────────────────────────────────────────────
   4. TOPBAR — Frosted glass + gradient title
   ────────────────────────────────────────────── */
.sidebar-support {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.app-topbar {
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border-bottom: 1px solid rgba(168, 85, 247, 0.1);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 2px 16px rgba(15, 23, 42, 0.04);
}

/* Gradient page title text */
.topbar-title {
    background: linear-gradient(130deg, #140319 0%, #6e1d8d 80%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -.025em;
}

/* Topbar action buttons & user chip — inner shine */
.topbar-action,
.user-chip {
    background: rgba(255, 255, 255, 0.88);
    box-shadow:
        var(--inset-shine),
        0 2px 8px rgba(15, 23, 42, 0.05);
    transition: var(--transition-fast);
}
.topbar-action:hover,
.topbar-action:focus-visible,
.user-chip-button:hover,
.user-chip-button:focus-visible {
    background: rgba(255, 255, 255, 0.98);
    box-shadow:
        var(--inset-shine-lg),
        0 0 0 1px rgba(168, 85, 247, 0.2),
        0 14px 28px rgba(15, 23, 42, 0.09);
    transform: translateY(-1px);
}

/* ──────────────────────────────────────────────
   5. CARDS — Glass morphism + depth layers
   ────────────────────────────────────────────── */
.app-card {
    background: rgba(255, 255, 255, 0.93);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-color: rgba(217, 228, 240, 0.82);
    box-shadow:
        var(--inset-shine),
        0 20px 48px rgba(8, 17, 32, 0.08),
        0 1px 3px rgba(8, 17, 32, 0.04);
    transition:
        box-shadow var(--transition-med),
        transform var(--transition-med),
        border-color var(--transition-med);
}
.app-card:hover {
    box-shadow:
        var(--inset-shine-lg),
        0 28px 64px rgba(8, 17, 32, 0.12),
        0 2px 6px rgba(8, 17, 32, 0.06);
    border-color: rgba(168, 85, 247, 0.14);
}

/* Card header — subtle inner gradient */
.app-card .card-header {
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.96) 0%,
        rgba(248, 250, 255, 0.88) 100%);
    border-bottom-color: rgba(217, 228, 240, 0.78);
}

/* Stats card */
.stats-card {
    background: rgba(255, 255, 255, 0.93);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow:
        var(--inset-shine),
        0 16px 36px rgba(15, 23, 42, 0.06);
    transition:
        transform var(--transition-med),
        box-shadow var(--transition-med),
        border-color var(--transition-med);
}
.stats-card:hover {
    box-shadow:
        var(--inset-shine-lg),
        0 22px 48px rgba(15, 23, 42, 0.1);
}

/* ──────────────────────────────────────────────
   6. FORMS — Refined inputs & labels
   ────────────────────────────────────────────── */
.form-label {
    font-weight: 700;
    font-size: .875rem;
    letter-spacing: .01em;
    color: #374151;
    margin-bottom: .42rem;
}

.form-control,
.form-select {
    background-color: rgba(255, 255, 255, 0.94);
    border-color: rgba(209, 213, 219, 0.88);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05) inset;
    transition:
        border-color var(--transition-fast),
        box-shadow var(--transition-fast),
        background var(--transition-fast);
}
.form-control:hover:not(:focus),
.form-select:hover:not(:focus) {
    border-color: rgba(168, 85, 247, 0.35);
}
.form-control:focus,
.form-select:focus {
    background-color: #fff;
    border-color: rgba(168, 85, 247, 0.52);
    box-shadow:
        0 0 0 3.5px rgba(168, 85, 247, 0.14),
        0 1px 4px rgba(15, 23, 42, 0.05) inset;
}

.form-control.is-invalid,
.form-select.is-invalid {
    box-shadow: 0 0 0 3.5px rgba(220, 38, 38, 0.1);
}

/* Field description */
.field-description {
    font-size: .815rem;
    color: #6b7280;
    line-height: 1.5;
}

/* ──────────────────────────────────────────────
   7. BUTTONS — Premium transitions & glow
   ────────────────────────────────────────────── */
.btn {
    letter-spacing: .015em;
    font-size: .93rem;
    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast),
        background-color var(--transition-fast),
        border-color var(--transition-fast),
        color var(--transition-fast);
}
.btn:hover:not(:disabled) {
    transform: translateY(-2px);
}
.btn:active:not(:disabled) {
    transform: translateY(0);
}
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3.5px rgba(168, 85, 247, 0.22);
}

/* PhilCST primary brand button */
.btn-philcst:hover,
.btn-philcst:focus {
    box-shadow:
        0 20px 36px rgba(110, 29, 141, 0.32),
        0 0 0 1px rgba(216, 180, 254, 0.3);
}

/* ──────────────────────────────────────────────
   8. DROPDOWN MENUS — Frosted glass + enter anim
   ────────────────────────────────────────────── */
@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-8px) scale(.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1);   }
}

.topbar-dropdown .dropdown-menu {
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    background: rgba(255, 255, 255, 0.97);
    border-color: rgba(217, 228, 240, 0.85);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.7) inset,
        0 28px 58px rgba(15, 23, 42, 0.18);
    animation: dropdownFadeIn .2s var(--ease-out-expo);
}

/* ──────────────────────────────────────────────
   9. NOTIFICATION DROPDOWN
   ────────────────────────────────────────────── */
.notification-dropdown-list {
    max-height: min(65vh, 32rem);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.notification-dropdown-list .notification-dropdown-item {
    cursor: default;
    overflow-wrap: anywhere;
}

.notification-dropdown-list .notification-actions,
.notification-dropdown-list .notification-actions form,
.notification-dropdown-list .notification-actions .btn {
    width: auto;
    flex: 0 0 auto;
}

.notification-dropdown-item {
    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast),
        border-color var(--transition-fast),
        background-color var(--transition-fast);
}
.notification-dropdown-item:hover,
.notification-dropdown-item:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
    border-color: rgba(168, 85, 247, 0.26);
}
.notification-dropdown-item.is-unread {
    box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.12) inset;
}

/* ──────────────────────────────────────────────
   10. ACCOUNT DROPDOWN MENU
   ────────────────────────────────────────────── */
.account-menu-item {
    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast),
        border-color var(--transition-fast),
        background var(--transition-fast);
}
.account-menu-item:hover,
.account-menu-item:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

/* Hero gradient pill shimmer */
.account-dropdown-hero {
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.14) inset,
        0 22px 44px rgba(91, 33, 182, 0.24);
}

/* ──────────────────────────────────────────────
   11. FLASH POPUP — Frosted glass + refined anim
   ────────────────────────────────────────────── */
@keyframes flashPremiumIn {
    from { opacity: 0; transform: translateY(-16px) scale(.95); }
    to   { opacity: 1; transform: translateY(0)     scale(1);   }
}

.flash-popup {
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border-radius: 22px !important;
    box-shadow:
        var(--inset-shine),
        0 24px 54px rgba(15, 23, 42, 0.16);
    animation: flashPremiumIn .3s var(--ease-out-expo);
}

/* ──────────────────────────────────────────────
   12. PAGE CONTENT — Fade-in on navigation
   ────────────────────────────────────────────── */
@keyframes contentReveal {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0);    }
}

.content-wrap {
    animation: contentReveal .32s var(--ease-out-expo);
}

/* ──────────────────────────────────────────────
   13. PANEL HERO — Depth overlay
   ────────────────────────────────────────────── */
.panel-hero {
    position: relative;
    overflow: hidden;
}
.panel-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.07) 0%, transparent 50%),
        radial-gradient(circle at 0% 100%, rgba(168, 85, 247, 0.08) 0%, transparent 45%);
    pointer-events: none;
}

/* ──────────────────────────────────────────────
   14. DASHBOARD CARDS — Lift on hover
   ────────────────────────────────────────────── */
.dashboard-card {
    transition:
        transform .24s var(--ease-out-expo),
        box-shadow .24s ease,
        border-color .24s ease;
}
.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 26px 52px rgba(15, 23, 42, 0.11);
    border-color: rgba(168, 85, 247, 0.18);
}

/* Dashboard feature list items */
.dashboard-feature-list li {
    transition: background var(--transition-fast), border-color var(--transition-fast);
}
.dashboard-feature-list li:hover {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(168, 85, 247, 0.14);
}

/* ──────────────────────────────────────────────
   15. TABLES — Sticky header + premium rows
   ────────────────────────────────────────────── */
.table thead th {
    background: linear-gradient(180deg,
        rgba(249, 250, 255, 0.95) 0%,
        rgba(242, 244, 255, 0.88) 100%);
    letter-spacing: .045em;
}

.table tbody tr {
    transition: background var(--transition-fast);
}
.table tbody tr:hover {
    background: rgba(246, 240, 255, 0.45);
}

/* ──────────────────────────────────────────────
   16. PAGINATION — Polished interactive states
   ────────────────────────────────────────────── */
.pagination .page-link {
    font-weight: 700;
    letter-spacing: .01em;
    transition: all var(--transition-fast);
}
.pagination .page-item:not(.active):not(.disabled) .page-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(110, 29, 141, 0.1);
    border-color: rgba(168, 85, 247, 0.28);
    color: #6e1d8d;
}
.pagination .page-item.active .page-link {
    box-shadow:
        0 14px 26px rgba(110, 29, 141, 0.24),
        var(--inset-shine);
}

/* ──────────────────────────────────────────────
   17. STATUS BADGES — Sharper label look
   ────────────────────────────────────────────── */
.badge-status {
    font-size: .715rem;
    letter-spacing: .05em;
    border: 1px solid transparent;
}
.status-submitted,
.status-pending,
.status-under-review,
.status-pending-review {
    border-color: rgba(245, 158, 11, 0.18);
}
.status-assigned,
.status-in-progress {
    border-color: rgba(168, 85, 247, 0.2);
}
.status-resolved,
.status-closed {
    border-color: rgba(192, 132, 252, 0.2);
}
.status-rejected,
.status-cancelled {
    border-color: rgba(239, 68, 68, 0.18);
}

/* ──────────────────────────────────────────────
   18. MODALS — Frosted backdrop + slide up
   ────────────────────────────────────────────── */
@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(.98); }
    to   { opacity: 1; transform: translateY(0)    scale(1);   }
}

.modal.show .modal-dialog {
    animation: modalSlideUp .3s var(--ease-out-expo);
}

.modal-content {
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    background: rgba(255, 255, 255, 0.97);
    box-shadow:
        var(--inset-shine),
        0 40px 80px rgba(15, 23, 42, 0.22);
}

.modal-backdrop {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    background-color: rgba(8, 3, 18, 0.52);
}

/* ──────────────────────────────────────────────
   19. OFFCANVAS — Premium glass slide
   ────────────────────────────────────────────── */
.offcanvas.offcanvas-start {
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 6px 0 40px rgba(15, 23, 42, 0.22);
}

.mobile-nav-link {
    transition:
        transform var(--transition-fast),
        background var(--transition-fast),
        border-color var(--transition-fast),
        box-shadow var(--transition-fast);
    letter-spacing: .012em;
}
.mobile-nav-link:hover {
    transform: translateX(4px) !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

/* ──────────────────────────────────────────────
   20. ALERTS
   ────────────────────────────────────────────── */
.alert {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

/* ──────────────────────────────────────────────
   21. SELECT MODAL TRIGGER — Match form input
   ────────────────────────────────────────────── */
.select-modal-trigger {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(209, 213, 219, 0.88);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05) inset;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
.select-modal-trigger:hover {
    background: rgba(255, 255, 255, 0.99);
    border-color: rgba(168, 85, 247, 0.35);
    box-shadow:
        0 1px 4px rgba(15, 23, 42, 0.05) inset,
        0 4px 14px rgba(110, 29, 141, 0.07);
}
.select-modal-trigger:focus {
    background: #fff;
    border-color: rgba(168, 85, 247, 0.52);
    box-shadow:
        0 0 0 3.5px rgba(168, 85, 247, 0.14),
        0 1px 4px rgba(15, 23, 42, 0.05) inset;
}

.select-picker-modal .modal-content {
    border-radius: 24px;
}
.select-picker-option {
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

/* ──────────────────────────────────────────────
   22. GUEST SHELL — Frosted top bar
   ────────────────────────────────────────────── */
.guest-top {
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    box-shadow:
        var(--inset-shine),
        0 20px 44px rgba(39, 7, 55, 0.26);
}

/* ──────────────────────────────────────────────
   23. AUTH FORM CARD — Premium glass
   ────────────────────────────────────────────── */
.auth-form-card {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(217, 228, 240, 0.85);
    box-shadow:
        var(--inset-shine),
        0 24px 56px rgba(15, 23, 42, 0.1);
}

/* ──────────────────────────────────────────────
   24. UTILITIES — Helpers
   ────────────────────────────────────────────── */

/* Gradient text for any heading */
.text-brand-gradient {
    background: linear-gradient(135deg, #2a0738 0%, #6e1d8d 60%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Soft hover card lift */
.hover-lift {
    transition: transform var(--transition-med), box-shadow var(--transition-med);
}
.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.1);
}

/* ──────────────────────────────────────────────
   25. MOBILE SCROLLBARS (offcanvas / modal body)
   ────────────────────────────────────────────── */
.modal-body,
.offcanvas-body,
.select-picker-body {
    scrollbar-width: thin;
    scrollbar-color: rgba(168, 85, 247, 0.24) transparent;
}
.modal-body::-webkit-scrollbar,
.offcanvas-body::-webkit-scrollbar,
.select-picker-body::-webkit-scrollbar {
    width: 5px;
}
.modal-body::-webkit-scrollbar-thumb,
.offcanvas-body::-webkit-scrollbar-thumb,
.select-picker-body::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.24);
    border-radius: 999px;
}

/* ──────────────────────────────────────────────
   26. METRIC ICON — Enhanced shadows
   ────────────────────────────────────────────── */
.metric-icon {
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.16);
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}
.metric-icon:hover {
    transform: scale(1.06);
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.2);
}

/* ──────────────────────────────────────────────
   27. FOCUS RING — Consistent brand focus
   ────────────────────────────────────────────── */
:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3.5px rgba(168, 85, 247, 0.2) !important;
}
a:focus-visible {
    border-radius: 6px;
}

/* ──────────────────────────────────────────────
   28. ACCORDION / COLLAPSE — Smooth reveal
   ────────────────────────────────────────────── */
.accordion-item {
    border-color: rgba(217, 228, 240, 0.8);
    background: rgba(255, 255, 255, 0.9);
    overflow: hidden;
}
.accordion-button {
    font-weight: 700;
    letter-spacing: .01em;
    background: rgba(248, 250, 255, 0.92);
}
.accordion-button:not(.collapsed) {
    color: #6e1d8d;
    background: rgba(245, 238, 255, 0.94);
    box-shadow: none;
}
.accordion-button:focus {
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.14) !important;
}

/* ──────────────────────────────────────────────
   29. PROGRESS BAR — Brand gradient fill
   ────────────────────────────────────────────── */
.progress {
    background: rgba(216, 180, 254, 0.18);
    border-radius: 999px;
    overflow: hidden;
}
.progress-bar {
    background: linear-gradient(90deg, #6e1d8d, #a855f7);
    border-radius: 999px;
}

/* ──────────────────────────────────────────────
   30. MEDIA QUERIES — Preserve mobile performance
   ────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    /* Reduce blur cost on mobile */
    .app-topbar {
        backdrop-filter: blur(16px) saturate(160%);
        -webkit-backdrop-filter: blur(16px) saturate(160%);
    }
    .app-card,
    .stats-card {
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
    .modal-content,
    .offcanvas.offcanvas-start {
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }
}

@media (prefers-reduced-motion: reduce) {
    /* Respect accessibility — kill animations */
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ──────────────────────────────────────────────
   31. INCIDENT CREATE PAGE
   ────────────────────────────────────────────── */

/* Main report card — lifted glass */
.report-card {
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(214, 226, 238, 0.88);
    box-shadow:
        var(--inset-shine),
        0 20px 48px rgba(15, 23, 42, 0.07);
    transition: box-shadow var(--transition-med), border-color var(--transition-med);
}
.report-card:hover {
    box-shadow:
        var(--inset-shine-lg),
        0 28px 60px rgba(15, 23, 42, 0.1);
    border-color: rgba(168, 85, 247, 0.12);
}

/* Card header inside report cards */
.report-card .card-header {
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.97) 0%,
        rgba(248, 250, 255, 0.92) 100%);
    border-bottom-color: rgba(226, 232, 240, 0.88);
}

/* Header card (dark gradient hero) — depth overlay */
.report-header-card {
    position: relative;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.12) inset,
        0 24px 52px rgba(42, 7, 56, 0.26);
}
.report-header-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 100% 0%,
        rgba(255, 255, 255, 0.08) 0%, transparent 55%);
    pointer-events: none;
}

/* Meta chips on header card */
.meta-chip {
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.7) inset,
        0 8px 18px rgba(42, 7, 56, 0.08);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.meta-chip:hover {
    transform: translateY(-1px);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.8) inset,
        0 12px 24px rgba(42, 7, 56, 0.12);
}

/* Guide button premium */
.header-guide-btn {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.18) inset,
        0 12px 28px rgba(42, 7, 56, 0.22);
    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast),
        background var(--transition-fast),
        border-color var(--transition-fast);
}

/* Summary items */
.summary-item {
    background: rgba(248, 250, 252, 0.94);
    border-color: rgba(226, 232, 240, 0.9);
    transition: border-color var(--transition-fast), background var(--transition-fast);
}
.summary-item:hover {
    background: rgba(245, 240, 255, 0.6);
    border-color: rgba(168, 85, 247, 0.16);
}

/* Location metric tiles */
.location-metric {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(223, 232, 241, 0.9);
    box-shadow: var(--inset-shine), 0 8px 18px rgba(15, 23, 42, 0.04);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.location-metric:hover {
    border-color: rgba(168, 85, 247, 0.18);
    box-shadow: var(--inset-shine-lg), 0 12px 26px rgba(110, 29, 141, 0.06);
}

/* Submit strip */
.submit-strip {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(255, 255, 255, 0.97);
    box-shadow:
        var(--inset-shine),
        0 20px 44px rgba(15, 23, 42, 0.08);
}

/* Floor picker option buttons */
.floor-option-btn {
    background: rgba(255, 255, 255, 0.97);
    border-color: rgba(229, 231, 235, 0.9);
    transition:
        border-color var(--transition-fast),
        background var(--transition-fast),
        box-shadow var(--transition-fast),
        transform var(--transition-fast);
}
.floor-option-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(147, 197, 253, 0.8);
    background: rgba(240, 249, 255, 0.98);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.08);
}
.floor-option-btn.selected {
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.18) inset,
                0 10px 22px rgba(37, 99, 235, 0.1);
}

/* Evidence preview items */
.evidence-preview-item {
    border-color: rgba(226, 232, 240, 0.9);
    box-shadow: var(--inset-shine), 0 8px 16px rgba(15, 23, 42, 0.06);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.evidence-preview-item:hover {
    transform: scale(1.04);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

/* Guide items in float panel */
.guide-item {
    background: rgba(248, 250, 252, 0.95);
    border-color: rgba(226, 232, 240, 0.92);
    transition: border-color var(--transition-fast), background var(--transition-fast);
}
.guide-item:hover {
    background: rgba(245, 240, 255, 0.7);
    border-color: rgba(168, 85, 247, 0.2);
}

/* ──────────────────────────────────────────────
   32. INCIDENT SHOW PAGE
   ────────────────────────────────────────────── */

/* Response timeline item */
.response-item {
    border-left-width: 3px;
    background: rgba(248, 250, 252, 0.94);
    border-radius: 0 14px 14px 0;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}
.response-item:hover {
    background: rgba(245, 240, 255, 0.5);
    border-left-color: #6e1d8d;
}

/* Staff communication messages */
.staff-message {
    background: rgba(248, 250, 252, 0.92);
    border-color: rgba(226, 232, 240, 0.9);
    box-shadow: var(--inset-shine), 0 6px 14px rgba(15, 23, 42, 0.04);
    transition: border-color var(--transition-fast), background var(--transition-fast);
}
.staff-message.own {
    background: rgba(238, 246, 255, 0.96);
    border-color: rgba(191, 219, 254, 0.9);
    box-shadow: 0 0 0 1px rgba(191, 219, 254, 0.4) inset, 0 6px 14px rgba(37, 99, 235, 0.06);
}

/* Before/after update blocks */
.incident-update-item {
    background: rgba(255, 255, 255, 0.97);
    transition: background var(--transition-fast);
}
.incident-update-block {
    border-radius: 14px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.before-block {
    background: rgba(255, 251, 235, 0.96);
    border-color: rgba(253, 230, 138, 0.8);
    box-shadow: 0 6px 14px rgba(245, 158, 11, 0.06);
}
.after-block {
    background: rgba(240, 253, 244, 0.96);
    border-color: rgba(187, 247, 208, 0.8);
    box-shadow: 0 6px 14px rgba(34, 197, 94, 0.06);
}
.before-block:hover {
    border-color: rgba(253, 230, 138, 1);
    box-shadow: 0 10px 22px rgba(245, 158, 11, 0.1);
}
.after-block:hover {
    border-color: rgba(134, 239, 172, 1);
    box-shadow: 0 10px 22px rgba(34, 197, 94, 0.1);
}

/* Map container */
#incidentMap,
.location-map-shell {
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.1);
}

/* ──────────────────────────────────────────────
   33. GRAB BANNER (Responder Dashboard)
   ────────────────────────────────────────────── */
[class*="grab-banner"],
[data-grab-banner] {
    position: relative;
    overflow: hidden;
}
[class*="grab-banner"]::after,
[data-grab-banner]::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 100% 0%,
        rgba(255, 255, 255, 0.06) 0%, transparent 55%);
    pointer-events: none;
}

/* ──────────────────────────────────────────────
   34. USER MANAGEMENT / ADMIN PAGES
   ────────────────────────────────────────────── */
.user-create-card,
.user-form-section {
    transition: box-shadow var(--transition-med), border-color var(--transition-med);
}
.user-form-section {
    background: rgba(255, 255, 255, 0.78);
    border-color: rgba(226, 232, 240, 0.85);
    transition: border-color var(--transition-fast);
}
.user-form-section:focus-within {
    border-color: rgba(168, 85, 247, 0.22);
    background: rgba(255, 255, 255, 0.88);
}

.role-context {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background:
        radial-gradient(260px circle at 0% 0%, rgba(245, 158, 11, 0.08) 0%, transparent 50%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(249, 251, 255, 0.97) 100%);
    box-shadow: var(--inset-shine), 0 14px 32px rgba(15, 23, 42, 0.05);
}

/* ──────────────────────────────────────────────
   35. PROFILE / SETTINGS PAGES
   ────────────────────────────────────────────── */
.profile-photo-card {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--inset-shine), 0 18px 36px rgba(15, 23, 42, 0.06);
}
.profile-photo-preview {
    box-shadow: 0 18px 32px rgba(75, 13, 99, 0.2);
}
.account-detail {
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.account-detail:hover {
    border-color: rgba(168, 85, 247, 0.18);
    box-shadow: var(--inset-shine), 0 14px 28px rgba(15, 23, 42, 0.07);
}

/* Mobile fit overrides loaded after the base app layout. */
@media (max-width: 991.98px) {
    html,
    body,
    .app-main,
    .app-content,
    .content-wrap {
        min-width: 0;
        max-width: 100%;
    }

    body {
        overflow-x: clip;
    }

    .app-topbar {
        position: sticky;
        top: 0;
        z-index: 1020;
    }

    .app-topbar > .d-flex,
    .app-topbar > .d-flex > .d-flex:first-child,
    .app-topbar > .d-flex > .d-flex:first-child > div {
        min-width: 0;
    }

    .app-topbar > .d-flex > .d-flex:first-child {
        flex: 1 1 auto;
    }

    .topbar-title {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .profile-dropdown .user-chip {
        display: inline-flex !important;
    }
}

@media (max-width: 767.98px) {
    .app-card,
    .panel-hero,
    .page-summary-bar,
    .page-toolbar,
    .page-hero-shell,
    .table-responsive,
    .modal-content,
    .offcanvas,
    .form-control,
    .form-select,
    .select-modal-trigger,
    .btn {
        min-width: 0;
        max-width: 100%;
    }

    .app-card .card-header,
    .app-card .card-body {
        padding: .95rem;
    }

    .page-toolbar-actions,
    .page-hero-actions,
    .filter-form-actions,
    .mobile-form-actions,
    .notification-actions,
    .user-management-actions,
    .staff-data-actions {
        width: 100%;
        display: grid !important;
        grid-template-columns: 1fr;
        gap: .55rem;
    }

    .page-toolbar-actions > *,
    .page-hero-actions > *,
    .filter-form-actions > *,
    .mobile-form-actions > *,
    .notification-actions > *,
    .user-management-actions > *,
    .staff-data-actions > * {
        width: 100%;
        min-width: 0;
    }

    .profile-dropdown .user-chip {
        justify-content: center;
        width: 2.65rem;
        height: 2.65rem;
        padding: .32rem;
    }

    .profile-dropdown .user-chip-copy,
    .profile-dropdown .user-chip-caret {
        display: none !important;
    }

    .profile-dropdown .user-chip-avatar {
        width: 2rem;
        height: 2rem;
    }

    .dashboard-floating-panel {
        position: fixed;
        inset: auto .75rem calc(.75rem + env(safe-area-inset-bottom)) .75rem;
        width: auto;
        max-height: min(70dvh, 28rem);
        overflow-y: auto;
    }

    .table-responsive {
        overflow-x: visible;
    }

    .badge,
    .btn,
    .dropdown-item,
    .table-mobile-cards td,
    .card-body,
    .card-header,
    p,
    dd {
        overflow-wrap: anywhere;
    }

    .topbar-dropdown .dropdown-menu {
        position: fixed !important;
        inset: calc(4.15rem + env(safe-area-inset-top)) .65rem auto .65rem !important;
        width: auto !important;
        max-width: none !important;
        max-height: calc(100dvh - 4.85rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        overflow-y: auto;
        transform: none !important;
    }
}

@media (max-width: 575.98px) {
    .app-topbar {
        padding-inline: .65rem;
    }

    .app-content {
        padding-inline: .65rem;
    }

    .app-content .row,
    .content-wrap > .row,
    .guest-shell .row {
        --bs-gutter-x: 0;
    }

    .app-card,
    .panel-hero,
    .page-summary-bar,
    .modal-content {
        border-radius: 16px;
    }

    .topbar-title {
        font-size: .95rem;
    }

    .topbar-action,
    .profile-dropdown .user-chip {
        width: 2.45rem;
        height: 2.45rem;
    }

    .profile-dropdown .user-chip-avatar {
        width: 1.86rem;
        height: 1.86rem;
    }
}
