/* PayTable Support Console - Brand Styles */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&family=Montserrat:wght@400;500;600&display=swap');

:root {
    --pt-navy: #000075;
    --pt-navy-dark: #000060;
    --pt-coral: #ec607e;
    --pt-coral-dark: #d94d6a;
    --pt-success: #28a745;
    --pt-warning: #ffc107;
    --pt-danger: #dc3545;
    --pt-info: #17a2b8;
    --pt-light: #f8f9fa;
    --pt-dark: #1a1a2e;
    --pt-sidebar-bg: #0f0f1a;
    --pt-text-muted: #6c757d;
}

html, body {
    font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f6fa;
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: var(--pt-navy);
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: var(--pt-navy);
}

a:hover {
    color: var(--pt-coral);
}

/* Primary button - Coral */
.btn-primary {
    background-color: var(--pt-coral);
    border-color: var(--pt-coral);
    font-weight: 500;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--pt-coral-dark);
    border-color: var(--pt-coral-dark);
}

/* Secondary button - Navy */
.btn-secondary {
    background-color: var(--pt-navy);
    border-color: var(--pt-navy);
}

.btn-secondary:hover, .btn-secondary:focus {
    background-color: var(--pt-navy-dark);
    border-color: var(--pt-navy-dark);
}

/* Outline buttons */
.btn-outline-primary {
    color: var(--pt-coral);
    border-color: var(--pt-coral);
}

.btn-outline-primary:hover {
    background-color: var(--pt-coral);
    border-color: var(--pt-coral);
    color: white;
}

.content {
    padding: 1.5rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--pt-success);
}

.invalid {
    outline: 1px solid var(--pt-danger);
}

.validation-message {
    color: var(--pt-danger);
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: var(--pt-danger);
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* Page layout */
.page {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    background-color: #f5f6fa;
}

/* Sidebar */
.sidebar {
    background: linear-gradient(180deg, var(--pt-sidebar-bg) 0%, var(--pt-dark) 100%);
    min-height: 100vh;
}

.sidebar .brand {
    padding: 1rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar .nav-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.05);
    border-left-color: rgba(236, 96, 126, 0.5);
}

.sidebar .nav-link.active {
    color: white;
    background-color: rgba(236, 96, 126, 0.15);
    border-left-color: var(--pt-coral);
    font-weight: 500;
}

.sidebar .nav-link .oi {
    margin-right: 0.5rem;
    width: 20px;
}

/* Top bar — one source of truth for height + safe-area offset. */
:root {
    --pt-topnav-base: 3.5rem;
    --pt-topnav-total: calc(3.5rem + env(safe-area-inset-top));
}

.top-row {
    background-color: var(--pt-navy);
    color: #fff;
    border-bottom: 1px solid #000050;
    justify-content: space-between;
    height: var(--pt-topnav-base);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    /* Sticky on every breakpoint — users need the hamburger and logout
       reachable even when scrolled deep into a page. */
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-row .brand-text {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: #fff;
    font-size: 1.1rem;
    white-space: nowrap;
}

/* Two variants of the brand text; show one or the other based on width. */
.top-row .brand-text-short { display: none; }
.top-row .brand-text-full  { display: inline; }

/* Logout link: text by default (desktop), icon only on mobile. */
.top-row .logout-text { display: inline; }
.top-row .logout-icon { display: none; }

.top-row .user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.top-row .user-name {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
}

.top-row a {
    margin-left: 1rem;
    color: var(--pt-coral);
    text-decoration: none;
    font-weight: 500;
}

.top-row a:hover {
    text-decoration: underline;
}

@media (min-width: 641px) {
    .page {
        flex-direction: row;
    }

    .sidebar {
        width: 240px;
        height: 100vh;
        position: sticky;
        top: 0;
        flex-shrink: 0;
    }

    .top-row {
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .top-row.auth ::deep a:first-child {
        flex: 1;
        text-align: right;
        width: 0;
    }
}

/* Dashboard Cards */
.dashboard-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e9ecef;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dashboard-card .card-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.dashboard-card .card-label {
    font-size: 0.85rem;
    color: var(--pt-text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dashboard-card .card-value {
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--pt-navy);
    line-height: 1.2;
}

.dashboard-card .card-subtitle {
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.dashboard-card .card-subtitle.success {
    color: var(--pt-success);
}

.dashboard-card .card-subtitle.warning {
    color: var(--pt-warning);
}

.dashboard-card .card-subtitle.danger {
    color: var(--pt-danger);
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: white;
    border-bottom: 1px solid #e9ecef;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    padding: 1rem 1.25rem;
    border-radius: 12px 12px 0 0 !important;
}

.card-body {
    padding: 1.25rem;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--pt-text-muted);
    border-bottom: 2px solid #e9ecef;
    padding: 0.875rem 1rem;
}

.table td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Severity Badges */
.badge {
    font-weight: 600;
    font-size: 0.7rem;
    padding: 0.4em 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
}

.badge-critical,
.badge.bg-danger {
    background-color: var(--pt-danger) !important;
    color: white;
}

.badge-high {
    background-color: #ff6b35 !important;
    color: white;
}

.badge-warning,
.badge.bg-warning {
    background-color: var(--pt-warning) !important;
    color: #212529;
}

.badge-info,
.badge.bg-info {
    background-color: var(--pt-info) !important;
    color: white;
}

.badge-success,
.badge.bg-success {
    background-color: var(--pt-success) !important;
    color: white;
}

/* Alert rows */
.alert-row-critical {
    background-color: #fff5f5 !important;
    border-left: 3px solid var(--pt-danger);
}

.alert-row-high {
    background-color: #fff8e6 !important;
    border-left: 3px solid #ff6b35;
}

.alert-row-warning {
    background-color: #fffde6 !important;
    border-left: 3px solid var(--pt-warning);
}

/* Action buttons in tables */
.btn-sm {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline-event {
    position: relative;
    padding-left: 1.5rem;
    padding-bottom: 1.25rem;
    border-left: 2px solid #e9ecef;
    margin-left: 0.5rem;
}

.timeline-event:last-child {
    border-left: 2px solid transparent;
    padding-bottom: 0;
}

.timeline-event::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--pt-navy);
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--pt-navy);
}

.timeline-event.alert::before {
    background-color: var(--pt-danger);
    box-shadow: 0 0 0 2px var(--pt-danger);
}

.timeline-event.success::before {
    background-color: var(--pt-success);
    box-shadow: 0 0 0 2px var(--pt-success);
}

.timeline-timestamp {
    font-size: 0.8rem;
    color: var(--pt-text-muted);
    font-weight: 500;
}

.timeline-title {
    font-weight: 600;
    color: var(--pt-dark);
}

.timeline-details {
    font-size: 0.9rem;
    color: var(--pt-text-muted);
}

/* Search and filters */
.search-box {
    position: relative;
}

.search-box input {
    padding-left: 2.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.search-box .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--pt-text-muted);
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Page header */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.page-header .subtitle {
    color: var(--pt-text-muted);
    font-size: 0.9rem;
}

/* Loading spinner (legacy - kept for modal buttons) */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

.spinner-border {
    color: var(--pt-coral);
}

/* ── PayTable Loading Overlay ─────────────────────────── */

.pt-loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pt-navy);
    z-index: 10000;
}

.pt-loading-overlay.fullscreen {
    position: fixed;
    inset: 0;
    pointer-events: all;
}

.pt-loading-overlay.inline {
    position: relative;
    width: 100%;
    min-height: 200px;
    border-radius: 12px;
}

.pt-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.pt-squares-grid {
    display: grid;
    grid-template-columns: repeat(3, 48px);
    grid-template-rows: repeat(3, 48px);
    gap: 6px;
}

.pt-square {
    width: 48px;
    height: 48px;
    background: var(--pt-coral);
    border-radius: 4px;
    opacity: 0.15;
    animation: pt-square-pulse 1.2s ease-in-out infinite;
    animation-delay: var(--delay);
}

@keyframes pt-square-pulse {
    0%, 100% { opacity: 0.15; transform: scale(0.92); }
    50% { opacity: 1; transform: scale(1); }
}

.pt-loading-message {
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
    letter-spacing: 0.3px;
}

@media (max-width: 480px) {
    .pt-squares-grid {
        grid-template-columns: repeat(3, 36px);
        grid-template-rows: repeat(3, 36px);
        gap: 4px;
    }
    .pt-square {
        width: 36px;
        height: 36px;
    }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--pt-text-muted);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-card .card-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile Navigation */
.sidebar-toggle {
    color: var(--pt-navy);
    padding: 0.25rem 0.5rem;
    text-decoration: none;
}

.sidebar-toggle:hover {
    color: var(--pt-coral);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

@media (max-width: 767.98px) {
    .page {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
        /* Respect iOS notch — without this the drawer renders under the status bar. */
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }

    .sidebar.show {
        left: 0;
    }

    main {
        width: 100%;
    }

    /* Mobile top nav trims: short brand, icon-only logout, touch-sized toggle.
       Uses the shared --pt-topnav-total so nav height and content offset
       stay in lockstep. */
    .top-row {
        padding: 0 0.75rem;
        padding-top: env(safe-area-inset-top);
        height: var(--pt-topnav-total);
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
    }
    /* Offset the content area — not main — so elements like Messages' fixed-
       height container that live inside .content compose correctly without
       double-counting main's padding. */
    main {
        padding-top: 0;
    }
    .content {
        margin-top: var(--pt-topnav-total);
    }

    .top-row .brand-text {
        font-size: 1rem;
    }
    .top-row .brand-text-full  { display: none; }
    .top-row .brand-text-short { display: inline; }

    .top-row .logout-text { display: none; }
    .top-row .logout-icon {
        display: inline-flex;
        font-size: 1.4rem;
        line-height: 1;
    }
    .top-row .logout-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
    }

    .sidebar-toggle {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Mobile nav trigger: hamburger + brand fused into one large tap target
       so users don't have to aim for a 24px icon in the top-left corner. */
    .top-row .nav-trigger {
        background: transparent;
        border: 0;
        padding: 0 0.75rem;
        display: inline-flex;
        align-items: center;
        gap: 0.6rem;
        min-height: 44px;
        cursor: pointer;
        color: #fff;
        font-family: 'Poppins', sans-serif;
        font-weight: 600;
        font-size: 1rem;
        -webkit-tap-highlight-color: rgba(236, 96, 126, 0.25); /* coral flash on tap */
    }
    .top-row .nav-trigger:active {
        background: rgba(255, 255, 255, 0.1);
    }
    .top-row .nav-trigger i {
        font-size: 1.75rem;
        line-height: 1;
        color: #fff;
    }
    .top-row .nav-trigger .brand-dot {
        font-size: 0.7rem;
        margin-right: 0.15rem;
        color: var(--pt-coral) !important;
    }

    .content {
        /* Light 1rem breathing room on all sides; bottom adds the iOS home-
           indicator inset so scrollable content doesn't end under it. */
        padding: 1rem;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }
    /* Collapse any default top margin on the first rendered element(s) —
       <h1>, Bootstrap cards, .page-header, etc. all ship with their own
       user-agent/framework top margin, and that's the residual gap that
       survived zeroing .content's top padding. */
    .content > *:first-child,
    .content > *:first-child > *:first-child {
        margin-top: 0 !important;
        padding-top: 0;
    }
}

/* ── Sentinel Dashboard ──────────────────────────────────── */

.sentinel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.sentinel-card {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 4px solid #e9ecef;
}

.sentinel-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.sentinel-card.expanded {
    grid-column: 1 / -1;
    cursor: default;
}

.sentinel-card-healthy {
    border-left-color: var(--pt-success);
}

.sentinel-card-degraded {
    border-left-color: var(--pt-warning);
    background: #fffdf5;
}

.sentinel-card-critical {
    border-left-color: var(--pt-danger);
    background: #fff8f8;
}

.sentinel-card-unknown {
    border-left-color: var(--pt-text-muted);
}

.sentinel-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.sentinel-card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.sentinel-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.sentinel-card-healthy .sentinel-status-dot {
    background-color: var(--pt-success);
    box-shadow: 0 0 6px rgba(40, 167, 69, 0.4);
}

.sentinel-card-degraded .sentinel-status-dot {
    background-color: var(--pt-warning);
    box-shadow: 0 0 6px rgba(255, 193, 7, 0.4);
}

.sentinel-card-critical .sentinel-status-dot {
    background-color: var(--pt-danger);
    box-shadow: 0 0 6px rgba(220, 53, 69, 0.4);
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.sentinel-score {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--pt-navy);
}

.sentinel-card-critical .sentinel-score {
    color: var(--pt-danger);
}

.sentinel-card-degraded .sentinel-score {
    color: #b8860b;
}

/* Dimension indicators */
.sentinel-dimensions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.sentinel-dim {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.25rem 0.4rem;
    border-radius: 6px;
    font-size: 0.65rem;
    min-width: 42px;
    text-align: center;
    border: 1px solid transparent;
}

.dim-healthy {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #c8e6c9;
}

.dim-degraded {
    background: #fff8e1;
    color: #f57f17;
    border-color: #ffecb3;
}

.dim-critical {
    background: #ffebee;
    color: #c62828;
    border-color: #ffcdd2;
}

.dim-unknown {
    background: #f5f5f5;
    color: #757575;
    border-color: #e0e0e0;
}

.dim-icon {
    font-size: 0.85rem;
    line-height: 1;
}

.dim-label {
    font-weight: 600;
    letter-spacing: 0.5px;
}

.sentinel-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Expanded detail panel */
.sentinel-detail {
    cursor: default;
}

.sentinel-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.25rem;
}

.sentinel-metric {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    padding: 0.15rem 0.4rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.metric-key {
    color: var(--pt-text-muted);
}

.metric-value {
    font-weight: 600;
    font-family: 'Poppins', monospace;
    color: var(--pt-dark);
}

/* Snapshot history bar chart */
.sentinel-history {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 60px;
    padding: 0 2px;
}

.history-bar {
    flex: 1;
    min-width: 8px;
    border-radius: 3px 3px 0 0;
    transition: height 0.3s ease;
    cursor: default;
}

.bar-healthy {
    background: var(--pt-success);
    opacity: 0.7;
}

.bar-degraded {
    background: var(--pt-warning);
    opacity: 0.8;
}

.bar-critical {
    background: var(--pt-danger);
    opacity: 0.8;
}

.bar-unknown {
    background: #dee2e6;
}

.history-bar:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .sentinel-grid {
        grid-template-columns: 1fr;
    }

    .sentinel-card.expanded {
        grid-column: 1;
    }

    .sentinel-metrics {
        grid-template-columns: 1fr;
    }
}

/* ── Responsive table pattern ───────────────────────────────────────
   Add `.table-responsive-stack` to any <table> that's row-dense. On screens
   ≤ 767px the table flattens into a vertical list of cards — one card per
   <tr>, one key/value row per <td>. The key text comes from each td's
   data-label attribute (set per-page in razor). Above 768px, the class is
   a no-op; tables render as normal Bootstrap tables.
   ───────────────────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
    .table-responsive-stack {
        display: block;
        width: 100%;
        border: 0;
    }
    .table-responsive-stack thead { display: none; }
    .table-responsive-stack tbody,
    .table-responsive-stack tr { display: block; width: 100%; }
    .table-responsive-stack tr {
        background: white;
        border: 1px solid #e9ecef;
        border-radius: 10px;
        padding: 0.75rem 1rem;
        margin-bottom: 0.75rem;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    }
    /* alert-row severity colours retained as a left border stripe */
    .table-responsive-stack tr.alert-row-critical { border-left: 4px solid var(--pt-danger); }
    .table-responsive-stack tr.alert-row-high     { border-left: 4px solid var(--pt-warning); }
    .table-responsive-stack tr.alert-row-warning  { border-left: 4px solid var(--pt-info); }
    .table-responsive-stack tr:hover { background: white; } /* no hover bg on phone */

    .table-responsive-stack td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.75rem;
        padding: 0.45rem 0;
        border: 0;
        border-bottom: 1px solid #f1f3f5;
        font-size: 0.9rem;
        text-align: right;
        min-height: auto;
    }
    .table-responsive-stack td:last-child { border-bottom: 0; }
    .table-responsive-stack td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--pt-text-muted);
        text-transform: uppercase;
        font-size: 0.7rem;
        letter-spacing: 0.4px;
        flex-shrink: 0;
        text-align: left;
    }
    /* Cells explicitly flagged as action-only: stack action buttons full-width */
    .table-responsive-stack td.td-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    .table-responsive-stack td.td-actions::before { display: none; }
    .table-responsive-stack td.td-actions .btn { width: 100%; min-height: 40px; }

    /* Rich content cells (title + description, multi-line bodies): stack the
       label above the content and let the content use the full row width. */
    .table-responsive-stack td.td-stack {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        gap: 0.25rem;
    }
    .table-responsive-stack td.td-stack::before {
        margin-bottom: 0;
    }
    .table-responsive-stack td.td-stack > * {
        width: 100%;
    }

    /* Sentinel page card-header filter row: dropdowns stack vertically + full-width. */
    .sentinel-filter-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.5rem !important;
        width: 100%;
    }
    .sentinel-filter-row .form-select {
        width: 100% !important;
    }

    /* Scroll-mode fallback: tables that keep horizontal scroll get touch-smooth scrolling */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
}
