/**
 * Western Refrigeration Pvt. Ltd. (WRPL)
 * Enterprise Workstation Design System
 * Clean, Direct, Sorted - Industrial Grade ERP
 * - White sidebar with subtle 1px border and soft blue active indicator
 * - Dark navy workstation header bar (#0e3a6c)
 * - Clean KPI metric cards for direct visibility
 * - Clean status filter chips & search toolbar (no misleading bulk accept/reject)
 * - Soft sage-green records table header with clean sorting indicators
 * - Comprehensive review screen: sticky summary strip, horizontal stepper, OCR matrix,
 *   collapsible audit checks, structured key-value grids, and vertical audit timeline.
 * - Sharp SVG icons across the entire portal (no amateur emojis)
 */

:root {
    --navy-header: #0e3a6c;
    --navy-header-hover: #092647;
    --navy: #0e3a6c;
    --navy-dark: #092647;

    --sidebar-bg: #ffffff;
    --sidebar-border: #e2e8f0;
    --sidebar-text: #475569;
    --sidebar-active-bg: #e8f0fe;
    --sidebar-active-text: #1a73e8;
    --sidebar-active-border: #d2e3fc;

    --blue: #1a73e8;
    --blue-dark: #1557b0;

    --canvas: #f8fafc;
    --surface: #ffffff;
    --border: #cbd5e1;
    --border-light: #e2e8f0;
    --border-subtle: #f1f5f9;
    --line: #cbd5e1;
    --line-dark: #94a3b8;

    --ink: #0f172a;
    --ink-muted: #64748b;
    --ink-subtle: #94a3b8;
    --muted: #64748b;

    --radius: 4px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.05);

    /* Semantic Pill & Badge Tints (Controlled, Subtle 10% Accent) */
    --pill-green-bg: #f0fdf4;
    --pill-green-border: #bbf7d0;
    --pill-green-text: #166534;

    --pill-red-bg: #fef2f2;
    --pill-red-border: #fecaca;
    --pill-red-text: #991b1b;

    --pill-amber-bg: #fffbeb;
    --pill-amber-border: #fde68a;
    --pill-amber-text: #92400e;

    --pill-code-bg: #f1f5f9;
    --pill-code-border: #cbd5e1;
    --pill-code-text: #0e3a6c;

    --pill-blue-bg: #eff6ff;
    --pill-blue-border: #bfdbfe;
    --pill-blue-text: #1d4ed8;

    /* Table Colors (Clean 30% Structural Slate, No Rainbow Sage) */
    --table-head-bg: #f1f5f9;
    --table-head-border: #e2e8f0;
    --table-head-text: #334155;
    --table-head-hover: #e2e8f0;
    --table-head-sorted: #e2e8f0;

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    background-color: var(--canvas);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 12px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--sidebar-active-text);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

/* ==========================================================================
   SVG ICON UTILITIES (Clean, crisp, no emojis)
   ========================================================================== */
svg {
    max-width: 100%;
}

.svg-icon {
    width: 14px !important;
    height: 14px !important;
    max-width: 14px !important;
    max-height: 14px !important;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.kpi-icon {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    flex-shrink: 0;
    display: inline-block;
    color: var(--ink-subtle);
}

/* ==========================================================================
   COMMON PORTAL / PUBLIC LAYOUT (Survey & Auth Pages)
   ========================================================================== */
.portal-header {
    background: var(--navy-header);
    border-bottom: 1px solid #092647;
    padding: 10px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo-img {
    height: 42px;
    width: auto;
    max-width: 190px;
    object-fit: contain;
    background: #ffffff;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: block;
    flex-shrink: 0;
}

.brand-title {
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.03em;
    margin: 0;
    line-height: 1.2;
}

.brand-sub {
    color: #93c5fd;
    font-size: 11px;
    font-weight: 500;
    margin-top: 2px;
}

.header-meta {
    color: #dbeafe;
    font-size: 11px;
    text-align: right;
    line-height: 1.4;
    background: rgba(255, 255, 255, 0.08);
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.header-meta strong {
    color: #ffffff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

.panel {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.portal-footer {
    margin-top: 36px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--ink-muted);
    text-align: center;
    line-height: 1.5;
}

/* ==========================================================================
   APP SHELL: WHITE SIDEBAR + DARK NAVY TOPBAR
   ========================================================================== */
.erp-layout {
    display: flex;
    min-height: 100vh;
    background-color: var(--canvas);
}

/* 1. Left White Sidebar (Collapsible Mini-Rail) */
.erp-sidebar {
    width: 220px;
    min-width: 220px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
    transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header-box {
    padding: 10px 12px;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: padding 0.2s;
}

.brand-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid var(--sidebar-border);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--navy-header);
    width: 100%;
    min-width: 0;
}

.brand-badge-pill img {
    height: 22px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.brand-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-collapse-btn {
    background: transparent;
    border: 1px solid var(--sidebar-border);
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-muted);
    cursor: pointer;
    font-size: 12px;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s, transform 0.2s ease;
}

.sidebar-collapse-btn:hover {
    background: #f1f5f9;
    color: var(--navy-header);
}

.sidebar-menu-list {
    flex: 1;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    transition: padding 0.2s;
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 5px;
    color: var(--sidebar-text);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.1s, color 0.1s, width 0.2s;
    white-space: nowrap;
}

.sidebar-menu-link:hover {
    background: #f1f5f9;
    color: var(--ink);
    text-decoration: none;
}

.sidebar-menu-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    border-color: var(--sidebar-active-border);
    font-weight: 700;
}

.sidebar-menu-link .menu-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 10px;
    background: var(--pill-amber-bg);
    color: var(--pill-amber-text);
    border: 1px solid var(--pill-amber-border);
    font-family: var(--font-mono);
}

.sidebar-section-divider {
    height: 1px;
    background: var(--sidebar-border);
    margin: 8px 6px;
}

.sidebar-footer-box {
    padding: 12px 14px;
    border-top: 1px solid var(--sidebar-border);
    background: #ffffff;
    margin-top: auto;
    transition: padding 0.2s;
}

.sidebar-user-block {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.sidebar-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--navy-header);
    color: #ffffff;
    font-weight: 800;
    font-size: 11px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.sidebar-user-info {
    min-width: 0;
    flex: 1;
}

.sidebar-user-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-dept {
    font-size: 10px;
    color: var(--ink-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-signout-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--ink-muted);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    padding: 3px 0;
    text-decoration: none;
    white-space: nowrap;
}

.sidebar-signout-btn:hover {
    color: var(--pill-red-text);
    text-decoration: underline;
}

/* ==========================================================================
   MINI-RAIL COLLAPSED SIDEBAR (Width 58px: Icons remain visible, never disappears)
   ========================================================================== */
.erp-layout.sidebar-collapsed .erp-sidebar {
    width: 58px;
    min-width: 58px;
}

.erp-layout.sidebar-collapsed .sidebar-header-box {
    padding: 10px 4px;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    justify-content: center;
}

.erp-layout.sidebar-collapsed .brand-badge-pill {
    width: auto;
    border: none;
    background: transparent;
    padding: 2px;
    justify-content: center;
}

.erp-layout.sidebar-collapsed .brand-badge-pill img {
    height: 24px;
    width: 24px;
    object-fit: contain;
}

.erp-layout.sidebar-collapsed .brand-text {
    display: none;
}

.erp-layout.sidebar-collapsed .sidebar-collapse-btn {
    width: 30px;
    height: 22px;
}

.erp-layout.sidebar-collapsed .sidebar-collapse-btn .collapse-icon {
    transform: rotate(180deg);
}

.erp-layout.sidebar-collapsed .sidebar-menu-list {
    padding: 8px 6px;
    align-items: center;
    gap: 4px;
}

.erp-layout.sidebar-collapsed .sidebar-menu-link {
    width: 44px;
    height: 38px;
    padding: 0;
    justify-content: center;
    position: relative;
}

.erp-layout.sidebar-collapsed .sidebar-menu-link .menu-text {
    display: none;
}

.erp-layout.sidebar-collapsed .sidebar-menu-link .menu-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 8px;
    min-width: 14px;
    height: 14px;
    padding: 1px 3px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    line-height: 1;
}

.erp-layout.sidebar-collapsed .sidebar-section-divider {
    width: 32px;
    margin: 6px auto;
}

.erp-layout.sidebar-collapsed .sidebar-footer-box {
    padding: 10px 6px;
    text-align: center;
}

.erp-layout.sidebar-collapsed .sidebar-user-block {
    justify-content: center;
    margin-bottom: 6px;
}

.erp-layout.sidebar-collapsed .sidebar-user-info {
    display: none;
}

.erp-layout.sidebar-collapsed .sidebar-user-avatar {
    width: 30px;
    height: 30px;
    font-size: 12px;
    margin: 0 auto;
}

.erp-layout.sidebar-collapsed .sidebar-signout-btn {
    width: 44px;
    height: 32px;
    padding: 0;
    justify-content: center;
    margin: 0 auto;
}

.erp-layout.sidebar-collapsed .sidebar-signout-btn .menu-text {
    display: none;
}

/* 2. Main Workstation Area & Container Fluid */
.container-fluid {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
    box-sizing: border-box;
}

.erp-main-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

/* 3. Top Dark Navy Main Workstation Header (Houses Content Headers & Actions) */
.erp-topbar-navy {
    background: var(--navy-header);
    color: #ffffff;
    padding: 7px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    gap: 12px;
    flex-wrap: wrap;
    z-index: 101;
}

.topbar-navy-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.topbar-navy-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    white-space: nowrap;
}

.topbar-navy-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.topbar-navy-date {
    font-size: 11px;
    color: #cbd5e1;
    font-family: var(--font-mono);
    white-space: nowrap;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 10px;
}

.topbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    background: #ffffff;
    color: var(--navy-header);
    border: 1px solid #ffffff;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    line-height: 1.3;
}

.topbar-btn:hover {
    background: #f1f5f9;
    color: var(--navy-header);
    text-decoration: none;
}

.topbar-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
    line-height: 1.3;
}

.topbar-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    text-decoration: none;
}

.topbar-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    line-height: 1.3;
}

.topbar-pill:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    text-decoration: none;
}

.topbar-pill.active {
    background: #ffffff;
    color: var(--navy-header);
    border-color: #ffffff;
    font-weight: 700;
}

.topbar-pill.active .topbar-pill-count {
    color: var(--navy-header);
    font-weight: 800;
}

.topbar-badge {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 3px;
    font-weight: 700;
}

/* 4. Content Canvas */
.erp-content {
    flex: 1;
    padding: 14px 18px 30px;
}

/* ==========================================================================
   KPI METRIC CARDS (Direct, Sorted, Simple)
   ========================================================================== */
.erp-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.kpi-card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
    border-top: 2px solid transparent;
}

.kpi-card:hover {
    border-color: var(--border);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    text-decoration: none;
}

.kpi-card.active {
    border-color: var(--navy-header);
    border-top: 2px solid var(--navy-header);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    background: #ffffff;
}

.kpi-card-amber.active {
    border-top-color: #d97706;
}

.kpi-card-green.active {
    border-top-color: #16a34a;
}

.kpi-card-purple.active {
    border-top-color: var(--navy-header);
}

.kpi-card-red.active {
    border-top-color: #dc2626;
}

.kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.kpi-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--ink-muted);
    letter-spacing: 0.03em;
}

.kpi-icon {
    width: 15px;
    height: 15px;
    color: var(--ink-subtle);
}

.kpi-val {
    font-size: 22px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--ink);
    line-height: 1.1;
}

.kpi-sub {
    font-size: 10px;
    color: var(--ink-muted);
    margin-top: 3px;
}

/* ==========================================================================
   SUBHEADER FILTER & ACTION TOOLBAR
   ========================================================================== */
.erp-toolbar {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.toolbar-heading {
    font-size: 13px;
    font-weight: 800;
    color: var(--navy-header);
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* Filter Chips Group (Replacing bulk buttons) */
.filter-chips-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.filter-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-muted);
    margin-right: 2px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: #ffffff;
    border: 1px solid var(--border-light);
    color: var(--sidebar-text);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.1s, border-color 0.1s, color 0.1s;
}

.filter-chip:hover {
    background: #f8fafc;
    border-color: var(--border);
    color: var(--ink);
    text-decoration: none;
}

.filter-chip.active {
    background: var(--navy-header);
    border-color: var(--navy-header);
    color: #ffffff;
    font-weight: 700;
}

.filter-chip.active .chip-count {
    color: #93c5fd;
    font-weight: 800;
}

.toolbar-search-input {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 11px;
    min-width: 160px;
    background: #ffffff;
}

.btn-export-excel {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
}

.btn-export-excel:hover {
    background: #f8fafc;
    border-color: var(--ink-muted);
    text-decoration: none;
}

/* ==========================================================================
   RECORDS DATA TABLE (Clean Structural Slate Header - 60-30-10)
   ========================================================================== */
.erp-table-container {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 12px;
}

.records-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    text-align: left;
}

.records-table thead tr {
    background: var(--table-head-bg);
    border-bottom: 1px solid var(--table-head-border);
    color: var(--table-head-text);
}

.records-table th {
    padding: 8px 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-right: 1px solid var(--table-head-border);
    white-space: nowrap;
}

.records-table th.sortable-th {
    cursor: pointer;
    user-select: none;
    transition: background 0.12s, color 0.12s;
}

.records-table th.sortable-th:hover {
    background: var(--table-head-hover);
    color: var(--ink);
}

.records-table th.sortable-th.sorted {
    background: var(--table-head-sorted);
    color: var(--navy-header);
    font-weight: 800;
}

.th-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.sort-indicator {
    font-size: 11px;
    font-weight: 800;
    color: var(--ink-muted);
    display: inline-block;
    min-width: 14px;
    text-align: right;
}

.records-table th.sortable-th.sorted .sort-indicator {
    color: var(--navy-header);
    opacity: 1;
}

.records-table th.sortable-th:not(.sorted) .sort-indicator {
    opacity: 0.35;
}

/* AJAX Loading Overlay */
.table-loading-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(1px);
    z-index: 20;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.table-loading-spinner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 8px 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    font-size: 11px;
    font-weight: 700;
    color: var(--navy-header);
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

.records-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-light);
    border-right: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.records-table tbody tr:hover {
    background: #f8fafc;
}

.records-table tbody tr:nth-child(even) {
    background: #fbfcfd;
}

/* Table Footer Pagination */
.table-pagination-footer {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--ink-muted);
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 4px;
}

.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-btn {
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: #ffffff;
    color: var(--ink);
    font-size: 11px;
    text-decoration: none;
    cursor: pointer;
}

.pagination-btn.active {
    background: var(--sidebar-active-bg);
    border-color: var(--sidebar-active-text);
    color: var(--sidebar-active-text);
    font-weight: 700;
}

/* ==========================================================================
   REVIEW SCREEN: STICKY STRIP, STEPPER, CARDS, GRID, MATRIX
   ========================================================================== */
.sticky-summary-strip {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: -14px -18px 14px -18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.summary-strip-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.summary-strip-vendor {
    font-size: 13px;
    font-weight: 800;
    color: var(--navy-header);
}

.summary-strip-ref {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink);
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid var(--border-light);
}

.summary-strip-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Status Stepper */
.status-stepper {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 10px 16px;
    margin-bottom: 14px;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-circle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 1px solid var(--border);
    color: var(--ink-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    flex-shrink: 0;
}

.step-item.completed .step-circle {
    background: var(--pill-green-bg);
    border-color: var(--pill-green-text);
    color: var(--pill-green-text);
}

.step-item.active .step-circle {
    background: var(--pill-blue-bg);
    border-color: var(--pill-blue-text);
    color: var(--pill-blue-text);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.step-text {
    display: flex;
    flex-direction: column;
}

.step-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--ink);
}

.step-time {
    font-size: 9px;
    color: var(--ink-muted);
    font-family: var(--font-mono);
}

.step-divider {
    flex: 1;
    height: 2px;
    background: var(--border-light);
    margin: 0 12px;
}

.step-divider.completed {
    background: var(--pill-green-text);
}

/* Review Split-Panel Dual-Scroll Workstation */
.review-fixed-header {
    flex-shrink: 0;
    margin-bottom: 6px;
}

.review-fixed-header .sticky-summary-strip {
    margin-bottom: 6px;
    position: static;
}

.review-fixed-header .status-stepper {
    margin-bottom: 0;
    padding: 8px 14px;
}

.review-panels-container {
    display: flex;
    gap: 16px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding-bottom: 8px;
    margin-top: 6px;
}

/* Center Panel (Left / Main Content) - Scrollable independently */
.review-center-panel {
    flex: 1;
    min-width: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.review-center-panel::-webkit-scrollbar {
    width: 6px;
}

.review-center-panel::-webkit-scrollbar-track {
    background: transparent;
}

.review-center-panel::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.review-center-panel::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Side Panel (Right / Decision & Timeline) - Scrollable independently */
.review-side-panel {
    width: 380px;
    min-width: 350px;
    max-width: 440px;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-left: 2px;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
    flex-shrink: 0;
}

.review-side-panel::-webkit-scrollbar {
    width: 6px;
}

.review-side-panel::-webkit-scrollbar-track {
    background: transparent;
}

.review-side-panel::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.review-side-panel::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

@media (max-width: 1024px) {
    .review-panels-container {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    .review-center-panel,
    .review-side-panel {
        width: 100%;
        height: auto;
        overflow: visible;
        padding: 0;
    }
}

/* Legacy Review Grid fallback */
.review-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 14px;
    align-items: start;
}

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

/* Cards */
.card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    margin-bottom: 14px;
    overflow: hidden;
}

.card-head {
    padding: 9px 12px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--navy-header);
}

.card-body {
    padding: 12px;
}

/* Key-Value Data Grid */
.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
}

.data-item {
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: 3px;
    padding: 7px 10px;
}

.data-k {
    font-size: 9px;
    font-weight: 700;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.data-v {
    font-size: 11px;
    font-weight: 600;
    color: var(--ink);
    word-break: break-word;
}

/* Semantic Check Tags */
.check-tag {
    display: inline-block;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: var(--font-mono);
    text-transform: uppercase;
}

.check-tag.pass {
    background: var(--pill-green-bg);
    color: var(--pill-green-text);
    border: 1px solid var(--pill-green-border);
}

.check-tag.warn {
    background: var(--pill-amber-bg);
    color: var(--pill-amber-text);
    border: 1px solid var(--pill-amber-border);
}

.check-tag.fail {
    background: var(--pill-red-bg);
    color: var(--pill-red-text);
    border: 1px solid var(--pill-red-border);
}

.check-tag.info {
    background: var(--pill-blue-bg);
    color: var(--pill-blue-text);
    border: 1px solid var(--pill-blue-border);
}

.pass-accordion-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    margin-top: 6px;
}

.pass-accordion-toggle:hover {
    background: #f1f5f9;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: 3px;
    padding: 7px 9px;
    margin-bottom: 6px;
    font-size: 11px;
    cursor: pointer;
}

.checklist-item input {
    margin-top: 2px;
    cursor: pointer;
}

/* Allocated Master Code Card */
.allocated-code-card {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 10px;
}

.allocated-code-value {
    font-size: 20px;
    font-weight: 800;
    color: #166534;
    font-family: var(--font-mono);
    margin: 3px 0;
}

/* Audit Timeline */
.timeline {
    position: relative;
    padding-left: 18px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--border-light);
}

.timeline-item {
    position: relative;
    margin-bottom: 14px;
}

.timeline-dot {
    position: absolute;
    left: -18px;
    top: 3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #94a3b8;
}

.timeline-dot.dot-approve {
    border-color: var(--pill-green-text);
    background: var(--pill-green-bg);
}

.timeline-dot.dot-reject {
    border-color: var(--pill-red-text);
    background: var(--pill-red-bg);
}

.timeline-dot.dot-code {
    border-color: var(--pill-code-text);
    background: var(--pill-code-bg);
}

.timeline-dot.dot-info {
    border-color: var(--sidebar-active-text);
    background: var(--sidebar-active-bg);
}

.timeline-content {
    font-size: 11px;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
}

.timeline-actor {
    font-weight: 700;
    color: var(--ink);
}

.timeline-event {
    font-family: var(--font-mono);
    color: var(--ink-muted);
}

.timeline-desc {
    color: #334155;
    margin-top: 2px;
    font-size: 11px;
}

.timeline-time {
    font-size: 9px;
    color: var(--ink-subtle);
    font-family: var(--font-mono);
    margin-top: 2px;
}

/* Document Preview Modal */
.doc-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.doc-modal-dialog {
    background: #ffffff;
    border-radius: 4px;
    width: 100%;
    max-width: 900px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.doc-modal-head {
    background: var(--navy-header);
    color: #ffffff;
    padding: 8px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.doc-modal-body {
    flex: 1;
    background: #f8fafc;
}

/* ==========================================================================
   BUTTONS & BADGES
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px 12px;
    font-weight: 700;
    font-size: 11px;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.1s, border-color 0.1s;
}

.btn-primary {
    background: var(--navy-header);
    color: #ffffff;
    border-color: var(--navy-header-hover);
}

.btn-primary:hover {
    background: var(--navy-header-hover);
    color: #ffffff;
    text-decoration: none;
}

.btn-secondary {
    background: #ffffff;
    color: var(--ink);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: var(--ink-muted);
    text-decoration: none;
}

.btn-danger {
    background: var(--pill-red-text);
    color: #ffffff;
    border-color: #a51d24;
}

.btn-danger:hover {
    background: #a51d24;
    text-decoration: none;
}

.btn-sm {
    padding: 3px 8px;
    font-size: 10px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.badge-pending {
    background: var(--pill-amber-bg);
    color: var(--pill-amber-text);
    border-color: var(--pill-amber-border);
}

.badge-approved {
    background: var(--pill-green-bg);
    color: var(--pill-green-text);
    border-color: var(--pill-green-border);
}

.badge-rejected {
    background: var(--pill-red-bg);
    color: var(--pill-red-text);
    border-color: var(--pill-red-border);
}

.badge-code {
    background: var(--pill-code-bg);
    color: var(--pill-code-text);
    border-color: var(--pill-code-border);
    font-family: var(--font-mono);
}

/* Alerts */
.alert {
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 11px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success {
    background: var(--pill-green-bg);
    color: var(--pill-green-text);
    border: 1px solid var(--pill-green-border);
}

.alert-danger {
    background: var(--pill-red-bg);
    color: var(--pill-red-text);
    border: 1px solid var(--pill-red-border);
}

.alert-warning {
    background: var(--pill-amber-bg);
    color: var(--pill-amber-text);
    border: 1px solid var(--pill-amber-border);
}

/* Form Fields */
.field {
    margin-bottom: 10px;
}

.field label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 3px;
    text-transform: uppercase;
}

.field input:not([type=checkbox]):not([type=radio]),
.field select,
.field textarea {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #ffffff;
    color: var(--ink);
    font-size: 11px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--sidebar-active-text);
    box-shadow: 0 0 0 1px var(--sidebar-active-text);
}

/* Modals */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-dialog {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 4px;
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.modal-header {
    background: var(--navy-header);
    color: #ffffff;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
}