/* Frontend improvement pass: responsive inventory workspace */
        :root {
            --op-navy: #064B64;
            --op-navy-dark: #043342;
            --op-lime: #8CD600;
            --op-paper: #edf2f7;
            --op-surface: #ffffff;
            --op-line: #e2e8f0;
            --op-muted: #718096;
            --op-ink: #243141;
        }
        .inventory-table-scroll {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }
        .inventory-table {
            min-width: 980px;
            table-layout: fixed;
        }
        .inventory-table th:nth-child(1),
        .inventory-table td:nth-child(1) { width: 48px; }
        .inventory-table th:nth-child(2),
        .inventory-table td:nth-child(2) { width: 150px; }
        .inventory-table th:nth-child(3),
        .inventory-table td:nth-child(3) { width: 120px; }
        .inventory-table th:nth-child(4),
        .inventory-table td:nth-child(4) { width: 240px; }
        .inventory-table th:nth-child(5),
        .inventory-table td:nth-child(5),
        .inventory-table th:nth-child(6),
        .inventory-table td:nth-child(6) { width: 150px; }
        .inventory-table th:nth-child(7),
        .inventory-table td:nth-child(7),
        .inventory-table th:nth-child(8),
        .inventory-table td:nth-child(8) { width: 130px; }
        .inventory-table th:nth-child(9),
        .inventory-table td:nth-child(9) { width: 130px; }
        .inventory-table td {
            overflow: hidden;
            text-overflow: ellipsis;
            vertical-align: middle;
        }
        .inventory-table td[data-label="Nome"] {
            white-space: normal;
            line-height: 1.35;
        }
        .table-container.is-loading #tableContent {
            opacity: .58;
            pointer-events: none;
        }
        .table-container.is-loading .table-header::after {
            content: 'Atualizando...';
            margin-left: 10px;
            font-size: 11px;
            font-weight: 700;
            color: rgba(255,255,255,.72);
        }
        @media (max-width: 760px) {
            body {
                display: block;
                padding-bottom: 66px;
                background: var(--op-paper);
            }
            .nav-sidebar {
                position: fixed;
                left: 0;
                right: 0;
                bottom: 0;
                top: auto;
                width: 100%;
                height: 66px;
                flex-direction: row;
                z-index: 800;
                border-top: 1px solid rgba(255,255,255,.15);
            }
            body.sidebar-collapsed .nav-sidebar { width: 100%; }
            .nav-brand,
            .nav-sync,
            .nav-user,
            .nav-divider,
            .nav-group-title {
                display: none !important;
            }
            .nav-menu {
                display: flex;
                width: 100%;
                padding: 0;
                overflow-x: auto;
                overflow-y: hidden;
            }
            .nav-group,
            .nav-group + .nav-group {
                display: flex;
                border: 0;
                margin: 0;
                padding: 0;
            }
            .nav-item,
            body.sidebar-collapsed .nav-item {
                min-width: 74px;
                height: 66px;
                padding: 8px 10px;
                flex-direction: column;
                justify-content: center;
                gap: 4px;
                border-left: 0;
                border-top: 3px solid transparent;
                text-align: center;
            }
            .nav-item.active {
                border-left-color: transparent;
                border-top-color: var(--op-lime);
            }
            .nav-item span:not(.nav-icon):not(.nav-badge),
            body.sidebar-collapsed .nav-item span:not(.nav-icon):not(.nav-badge) {
                display: block;
                font-size: 10px;
                max-width: 68px;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }
            .nav-item .nav-icon { width: 20px; height: 20px; }
            .nav-badge {
                position: absolute;
                top: 5px;
                right: 10px;
                margin: 0;
            }
            .main-wrapper { min-height: calc(100vh - 66px); }
            .filter-bar {
                position: sticky;
                top: 0;
                display: grid;
                grid-template-columns: 1fr;
                gap: 8px;
                padding: 8px 10px;
                align-items: stretch;
                background: rgba(255,255,255,.98);
                border-bottom: 1px solid var(--op-line);
                box-shadow: 0 8px 22px rgba(15,23,42,.08);
                backdrop-filter: blur(10px);
            }
            .filter-mobile-header {
                display: grid;
                grid-template-columns: minmax(0, 1fr) auto;
                gap: 10px;
                align-items: center;
            }
            .filter-mobile-title {
                min-width: 0;
                display: grid;
                gap: 2px;
            }
            .filter-mobile-heading {
                color: var(--op-navy-dark);
                font-size: 13px;
                font-weight: 800;
                line-height: 1.1;
            }
            .filter-mobile-summary {
                color: var(--op-muted);
                font-size: 11px;
                line-height: 1.2;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
            }
            .filter-toggle-btn {
                min-width: 92px;
                min-height: 36px;
                padding: 0 12px;
                border: 1px solid rgba(6,75,100,.18);
                border-radius: 8px;
                background: var(--op-navy);
                color: #fff;
                cursor: pointer;
                font-size: 12px;
                font-weight: 800;
                letter-spacing: 0;
            }
            .filter-toggle-btn::after {
                content: '+';
                margin-left: 8px;
                font-weight: 900;
            }
            .filter-bar.is-expanded .filter-toggle-btn::after { content: '-'; }
            .filter-controls {
                display: none;
                grid-template-columns: 1fr 1fr;
                gap: 8px;
                padding-top: 2px;
                max-height: min(54vh, 330px);
                overflow: auto;
                -webkit-overflow-scrolling: touch;
            }
            .filter-bar.is-expanded .filter-controls {
                display: grid;
            }
            .filter-bar .filter-item { min-width: 0; }
            .filter-bar .filter-item:first-child { grid-column: 1 / -1; }
            .filter-bar .filter-item input,
            .filter-bar .filter-item select,
            .filter-bar .filter-item input {
                width: 100%;
                min-height: 38px;
                background: #fff;
            }
            .btn-clear {
                width: 100%;
                align-self: stretch;
                min-height: 38px;
                margin-top: 0;
                grid-column: 1 / -1;
                background: #e8eef3;
                color: var(--op-ink);
                border: 1px solid var(--op-line);
            }
            .btn-clear:hover { background: #dfe7ee; }
            .filter-kpi {
                margin-left: 0;
                justify-content: space-between;
                background: #f7fafc;
                border: 1px solid var(--op-line);
                border-radius: 8px;
                padding: 6px 8px;
            }
            .filter-kpi-item {
                flex: 1;
                border-left: 0;
                border-right: 1px solid var(--op-line);
                padding: 2px 8px;
            }
            .filter-kpi-item:last-child { border-right: 0; }
            .filter-kpi-item .kpi-value { font-size: 16px; }
            .filter-kpi-item .kpi-label { font-size: 9px; }
            .content-area { padding: 10px; }
            .stats-grid {
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 8px;
                margin-bottom: 10px;
            }
            .stat-card {
                padding: 10px 8px;
                border-radius: 8px;
            }
            .stat-card .stat-value { font-size: 20px; }
            .stat-card .stat-label { font-size: 10px; }
            .table-container { border-radius: 8px; }
            .table-header {
                padding: 12px;
                flex-wrap: wrap;
                gap: 8px;
            }
            .table-header h2 { width: 100%; }
            #resultsCount { flex: 1; }
            .move-toggle-btn {
                width: 100%;
                min-height: 38px;
                margin-left: 0 !important;
            }
            .selection-info {
                align-items: stretch;
                gap: 8px;
                flex-direction: column;
                padding: 10px 12px;
            }
            .btn-edit-selected { min-height: 40px; }
            .inventory-table-scroll { overflow: visible; }
            .inventory-table {
                min-width: 0;
                table-layout: auto;
                border-collapse: separate;
                border-spacing: 0;
            }
            .inventory-table thead { display: none; }
            .inventory-table tbody {
                display: grid;
                gap: 10px;
                padding: 10px;
                background: var(--op-paper);
            }
            .inventory-table tr {
                display: block;
                background: var(--op-surface);
                border: 1px solid var(--op-line);
                border-left: 4px solid var(--op-navy);
                border-radius: 8px;
                overflow: hidden;
                box-shadow: 0 1px 4px rgba(15,23,42,.06);
            }
            .inventory-table tr:hover { background: var(--op-surface); }
            .inventory-empty-row td {
                display: block;
                width: 100% !important;
            }
            .inventory-empty-row td::before { display: none; }
            .inventory-table td {
                width: auto !important;
                display: flex;
                justify-content: space-between;
                gap: 12px;
                padding: 8px 10px;
                border-bottom: 1px solid #edf2f7;
                white-space: normal;
                cursor: pointer;
            }
            .inventory-table td:last-child { border-bottom: 0; }
            .inventory-table td::before {
                content: attr(data-label);
                flex: 0 0 92px;
                color: var(--op-muted);
                font-size: 10px;
                font-weight: 800;
                text-transform: uppercase;
                letter-spacing: .3px;
            }
            .inventory-table td[data-label="Nome"] {
                display: block;
                padding-top: 10px;
            }
            .inventory-table td[data-label="Nome"]::before {
                display: block;
                margin-bottom: 4px;
            }
            .inventory-table td[data-label="Codigo"] {
                background: #f8fbfc;
                font-size: 14px;
            }
            .inventory-table .move-mode-col { display: none !important; }
            body.move-mode .inventory-table .move-mode-col {
                display: flex !important;
                align-items: center;
                background: #f0fbe0;
            }
            .pagination {
                gap: 8px;
                padding: 10px;
                flex-direction: column;
                align-items: stretch;
            }
            .pagination div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
            .pagination button { min-height: 40px; }
            .modal { align-items: flex-end; }
            .modal-content,
            .form-modal-content {
                width: 100%;
                max-width: 100%;
                max-height: 92vh;
                border-radius: 14px 14px 0 0;
            }
            .detail-group {
                align-items: flex-start;
                gap: 6px;
                flex-direction: column;
            }
            .detail-group .value {
                max-width: 100%;
                text-align: left;
                word-break: break-word;
            }
            .toast-container {
                left: 10px;
                right: 10px;
                bottom: 78px;
            }
            .toast { min-width: 0; }
        }

@media (max-height: 560px) and (max-width: 1120px) {
    .filter-bar {
        position: sticky;
        top: 0;
        display: grid;
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 6px 10px;
        align-items: stretch;
        background: rgba(255,255,255,.98);
        border-bottom: 1px solid var(--op-line);
        box-shadow: 0 8px 22px rgba(15,23,42,.08);
        backdrop-filter: blur(10px);
    }
    .filter-mobile-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
        align-items: center;
    }
    .filter-mobile-title { min-width: 0; display: grid; gap: 2px; }
    .filter-mobile-heading {
        color: var(--op-navy-dark);
        font-size: 13px;
        font-weight: 800;
        line-height: 1.1;
    }
    .filter-mobile-summary {
        color: var(--op-muted);
        font-size: 11px;
        line-height: 1.2;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .filter-toggle-btn {
        min-width: 92px;
        min-height: 34px;
        padding: 0 12px;
        border: 1px solid rgba(6,75,100,.18);
        border-radius: 8px;
        background: var(--op-navy);
        color: #fff;
        cursor: pointer;
        font-size: 12px;
        font-weight: 800;
        letter-spacing: 0;
    }
    .filter-toggle-btn::after {
        content: '+';
        margin-left: 8px;
        font-weight: 900;
    }
    .filter-bar.is-expanded .filter-toggle-btn::after { content: '-'; }
    .filter-controls {
        display: none;
        grid-template-columns: repeat(4, minmax(120px, 1fr));
        gap: 8px;
        max-height: 42vh;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }
    .filter-bar.is-expanded .filter-controls { display: grid; }
    .filter-bar .filter-item { min-width: 0; }
    .filter-bar .filter-item:first-child { grid-column: span 2; }
    .filter-bar .filter-item input,
    .filter-bar .filter-item select {
        width: 100%;
        min-height: 36px;
        background: #fff;
    }
    .btn-clear {
        width: 100%;
        align-self: stretch;
        min-height: 36px;
        margin-top: 0;
        background: #e8eef3;
        color: var(--op-ink);
        border: 1px solid var(--op-line);
    }
    .filter-kpi { display: none; }
}

/* Request workflow filters, timeline, and mobile cards */
.workflow-filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1.8fr) repeat(4, minmax(130px, 1fr)) repeat(2, minmax(124px, .9fr)) auto;
    gap: 8px;
    margin-bottom: 16px;
    align-items: stretch;
}
.workflow-filter-bar input,
.workflow-filter-bar select {
    min-height: 34px;
    padding: 6px 10px;
    border: 1.5px solid var(--op-line);
    border-radius: 6px;
    font-size: 12px;
    background: #fff;
    color: var(--op-ink);
}
.workflow-clear-btn { min-height: 34px; white-space: nowrap; }
.request-detail-modal-content { width: min(920px, 96vw) !important; }
.request-detail-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.request-detail-field { border: 1px solid var(--op-line); border-radius: 8px; padding: 9px 10px; background: #f8fafc; }
.request-detail-label { display: block; font-size: 10px; font-weight: 800; text-transform: uppercase; color: var(--op-muted); margin-bottom: 3px; }
.request-item-card { background: #fff; border: 1px solid var(--op-line); border-left: 4px solid var(--op-navy); border-radius: 8px; padding: 10px; }
.request-item-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; font-size: 12px; }
.request-json-details { margin-top: 8px; border-top: 1px solid #edf2f7; padding-top: 8px; }
.request-json-details summary { cursor: pointer; color: var(--op-navy); font-weight: 800; font-size: 12px; }
.workflow-timeline { display: grid; gap: 8px; margin-top: 8px; }
.workflow-event { display: grid; grid-template-columns: 10px 1fr; gap: 8px; align-items: start; }
.workflow-event-dot { width: 10px; height: 10px; border-radius: 999px; margin-top: 5px; background: var(--op-lime); box-shadow: 0 0 0 3px rgba(140, 214, 0, .18); }
.workflow-event-body { border: 1px solid var(--op-line); border-radius: 8px; padding: 8px 10px; background: #fbfdff; }
.workflow-event-title { font-size: 12px; font-weight: 800; color: var(--op-navy-dark); }
.workflow-event-meta { margin-top: 2px; font-size: 11px; color: var(--op-muted); }
.review-json-note { font-size: 12px; color: var(--op-muted); margin-bottom: 8px; }

@media (max-width: 960px) {
    .workflow-filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .workflow-filter-bar input:first-child { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
    .page-panel .content-area,
    .content-area[style*="padding"] {
        padding: 10px !important;
    }
    .panel-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 12px;
    }
    .panel-header h2 {
        font-size: 16px;
        line-height: 1.2;
        min-width: 0;
    }
    .request-view-toggle,
    .request-type-toggle {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 6px;
        width: 100%;
    }
    .request-view-toggle button,
    .request-type-toggle button {
        min-height: 38px;
        white-space: normal;
        line-height: 1.15;
    }
    .workflow-filter-bar {
        position: sticky;
        top: 0;
        z-index: 20;
        grid-template-columns: 1fr 1fr;
        padding: 10px;
        margin: -10px -10px 12px;
        background: var(--op-paper);
        border-bottom: 1px solid var(--op-line);
    }
    .workflow-filter-bar input,
    .workflow-filter-bar select,
    .workflow-clear-btn { width: 100%; min-height: 38px; }
    .workflow-clear-btn { grid-column: 1 / -1; }
    .queue-table,
    .user-table { min-width: 0; border-collapse: separate; border-spacing: 0; }
    .queue-table thead,
    .user-table thead { display: none; }
    .queue-table tbody,
    .user-table tbody { display: grid; gap: 10px; }
    .queue-table tr,
    .user-table tr { display: block; border: 1px solid var(--op-line); border-left: 4px solid var(--op-navy); border-radius: 8px; background: #fff; overflow: hidden; }
    .queue-table td,
    .user-table td { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-bottom: 1px solid #edf2f7; white-space: normal; text-align: right; word-break: break-word; }
    .queue-table td:last-child,
    .user-table td:last-child { border-bottom: 0; }
    .queue-table td::before,
    .user-table td::before { content: attr(data-label); flex: 0 0 96px; text-align: left; font-size: 10px; font-weight: 800; text-transform: uppercase; color: var(--op-muted); }
    .queue-table td[data-label="Resumo"],
    .queue-table td[data-label="Título"],
    .user-table td[data-label="Bases"],
    .user-table td[data-label="Email"] { display: block; text-align: left; }
    .queue-table td[data-label="Resumo"]::before,
    .queue-table td[data-label="Título"]::before,
    .user-table td[data-label="Bases"]::before,
    .user-table td[data-label="Email"]::before { display: block; margin-bottom: 3px; }
    .approval-actions-cell { justify-content: flex-end; flex-wrap: wrap; }
    .request-detail-summary,
    .request-item-grid { grid-template-columns: 1fr; }
    #verificationItemFilterBar {
        grid-template-columns: 1fr !important;
    }
    #verificationItemFilterBar > * {
        width: 100% !important;
    }
    .vfy-outcome-row {
        grid-template-columns: 1fr !important;
    }
    .vfy-evidence-actions {
        grid-template-columns: 1fr 1fr !important;
    }
    .vfy-evidence-picker {
        min-height: 42px;
    }
}

.vfy-evidence-picker {
    display: grid;
    place-items: center;
    min-height: 44px;
    border: 1.5px dashed #cbd5e0;
    border-radius: 6px;
    background: #f7fafc;
    color: #2d3748;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.vfy-evidence-picker input {
    display: none;
}
.vfy-evidence-picker.is-disabled {
    cursor: not-allowed;
    opacity: .58;
    background: #edf2f7;
}

@media (max-width: 420px) {
    .vfy-evidence-actions {
        grid-template-columns: 1fr !important;
    }
}
