/* ═══════════════════════════════════════════════════════════════
   WEXFORD TRACKER - Enterprise Design System
   Consolidated stylesheet for consistent UI across all pages
   ═══════════════════════════════════════════════════════════════ */

/* ── Layout ─────────────────────────────────────────────────── */
.page-container {
    max-width: 1400px;
    margin: 0 auto;
}

.page-container-wide {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.page-container-narrow {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── Page Header ────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--wex-border);
}

.page-header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ── Enterprise Header (gradient banner) ─────────────────── */
.enterprise-header--blue {
    background: rgba(30, 30, 46, 0.8);
}
.enterprise-header--blue::before {
    background: radial-gradient(circle at 25% 0%, rgba(99,102,241,0.5), transparent 50%),
                radial-gradient(circle at 75% 100%, rgba(139,92,246,0.4), transparent 50%);
}
.enterprise-header--green {
    background: rgba(30, 30, 46, 0.8);
}
.enterprise-header--green::before {
    background: radial-gradient(circle at 25% 0%, rgba(34,197,94,0.4), transparent 50%),
                radial-gradient(circle at 75% 100%, rgba(99,102,241,0.3), transparent 50%);
}
.enterprise-header--red {
    background: rgba(30, 30, 46, 0.8);
}
.enterprise-header--red::before {
    background: radial-gradient(circle at 25% 0%, rgba(239,68,68,0.4), transparent 50%),
                radial-gradient(circle at 75% 100%, rgba(251,146,60,0.3), transparent 50%);
}
.enterprise-header--amber {
    background: rgba(30, 30, 46, 0.8);
}
.enterprise-header--amber::before {
    background: radial-gradient(circle at 25% 0%, rgba(245,158,11,0.4), transparent 50%),
                radial-gradient(circle at 75% 100%, rgba(234,179,8,0.3), transparent 50%);
}
.enterprise-header--purple {
    background: rgba(30, 30, 46, 0.8);
}
.enterprise-header--purple::before {
    background: radial-gradient(circle at 25% 0%, rgba(139,92,246,0.5), transparent 50%),
                radial-gradient(circle at 75% 100%, rgba(99,102,241,0.4), transparent 50%);
}

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

.enterprise-card {
    background: rgba(30, 30, 46, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.enterprise-card:hover {
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.stat-card {
    padding: 1.25rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--wex-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

.stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.stat-card.success .stat-value,
.stat-card.stat-success .stat-value { color: var(--wex-success); }
.stat-card.success .stat-icon { background: color-mix(in srgb, var(--wex-success) 15%, transparent); color: var(--wex-success); }

.stat-card.warning .stat-value,
.stat-card.stat-warning .stat-value { color: var(--wex-warning, var(--wex-accent)); }
.stat-card.warning .stat-icon { background: color-mix(in srgb, var(--wex-warning, var(--wex-accent)) 15%, transparent); color: var(--wex-warning, var(--wex-accent)); }

.stat-card.danger .stat-value,
.stat-card.stat-danger .stat-value { color: var(--wex-danger); }
.stat-card.danger .stat-icon { background: color-mix(in srgb, var(--wex-danger) 15%, transparent); color: var(--wex-danger); }

.stat-card.primary .stat-value,
.stat-card.stat-primary .stat-value { color: var(--wex-primary); }
.stat-card.primary .stat-icon { background: color-mix(in srgb, var(--wex-primary) 15%, transparent); color: var(--wex-primary); }

/* ── Section Card (content sections) ───────────────────────── */
.section-card {
    background: rgba(30, 30, 46, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 16px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.section-card:hover {
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.08);
}

.section-header {
    background: rgba(45, 45, 65, 0.5);
    backdrop-filter: blur(8px);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.section-header h2,
.section-header h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header h2 i,
.section-header h3 i {
    color: var(--wex-primary);
}

.section-body {
    padding: 1.25rem;
}

.section-body-flush {
    padding: 0;
}

/* ── Filters Bar ────────────────────────────────────────────── */
.filters-bar {
    background: rgba(30, 30, 46, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.25rem;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    align-items: end;
}

/* ── Actions Bar ────────────────────────────────────────────── */
.actions-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    padding: 1rem;
    background: rgba(10, 10, 15, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(99, 102, 241, 0.08);
    border-radius: 10px;
    margin-bottom: 1rem;
}

/* ── Session/Item Cards ─────────────────────────────────────── */
.session-card {
    background: rgba(30, 30, 46, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    height: 100%;
}

.session-card:hover {
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.session-card .merchant-name {
    font-size: 1.1rem;
    font-weight: 700;
}

.session-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-top: 0.25rem;
}

.session-card .progress {
    height: 8px;
    background: var(--wex-surface-highlight);
    border-radius: 4px;
}

.session-card .progress-bar {
    background: var(--wex-success);
    border-radius: 4px;
}

.session-card .stats {
    /* 2026-05-12 — switched from flex to a 4-column grid so each box
       gets equal width regardless of value length, and an OOS box now
       fits cleanly next to Pending / Picked / Total. */
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.session-card .stats .stat { text-align: center; }
.session-card .stats .stat .value { font-size: 1.5rem; font-weight: 700; }
.session-card .stats .stat .label {
    font-size: 0.7rem;
    color: var(--wex-muted);
    text-transform: uppercase;
}

/* ── Status Badges (unified) ────────────────────────────────── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.status-badge-success,
.status-badge-removed,
.status-badge-completed { background: color-mix(in srgb, var(--wex-success) 15%, transparent); color: #4ade80; border: 1px solid color-mix(in srgb, var(--wex-success) 25%, transparent); }
.status-badge-warning,
.status-badge-pending { background: color-mix(in srgb, var(--wex-warning, var(--wex-accent)) 15%, transparent); color: #fbbf24; border: 1px solid color-mix(in srgb, var(--wex-warning, var(--wex-accent)) 25%, transparent); }
.status-badge-danger,
.status-badge-cancelled { background: color-mix(in srgb, var(--wex-danger) 15%, transparent); color: #f87171; border: 1px solid color-mix(in srgb, var(--wex-danger) 25%, transparent); }
.status-badge-info,
.status-badge-primary { background: color-mix(in srgb, var(--wex-primary) 15%, transparent); color: #60a5fa; border: 1px solid color-mix(in srgb, var(--wex-primary) 25%, transparent); }
.status-badge-muted { background: color-mix(in srgb, var(--wex-muted) 10%, transparent); color: var(--wex-muted); border: 1px solid color-mix(in srgb, var(--wex-muted) 20%, transparent); }

/* ── Enterprise Table ───────────────────────────────────────── */
.enterprise-table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 12px;
}

.enterprise-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.enterprise-table thead th {
    padding: 0.85rem 1rem;
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--wex-muted);
    /* Jun 11 2026: solid bg, NO backdrop-filter. The blur(8px) on a sticky
     * header repainted every scroll frame = the "flickers while scrolling"
     * report; the translucent bg also let tinted rows ghost through. */
    background: #1e1e2e;
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
    text-align: left;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

.enterprise-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.06);
    font-size: 0.875rem;
    vertical-align: middle;
}

/* Jun 11 2026: hover keeps its tint but with NO transition — animating
 * background-color made every row flash for 200ms as the cursor swept over
 * it during scroll (the second half of the "flickers while scrolling"
 * report, amplified by the Phase-2.5 status-tinted rows). */
.enterprise-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.06);
}

.enterprise-table tbody tr:last-child td {
    border-bottom: none;
}

/* Compact table variant */
.enterprise-table-sm thead th { padding: 0.6rem 0.75rem; }
.enterprise-table-sm tbody td { padding: 0.5rem 0.75rem; font-size: 0.8rem; }

/* Striped table variant */
.enterprise-table-striped tbody tr:nth-child(even) {
    background: rgba(30, 30, 46, 0.3);
}

/* ── Data Cells ─────────────────────────────────────────────── */
.cell-mono {
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.cell-id {
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--wex-primary);
}

.cell-sku {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--wex-text);
}

.cell-qty {
    font-family: var(--font-mono);
    font-weight: 600;
    text-align: center;
}

.cell-muted {
    color: var(--wex-muted);
    font-size: 0.8rem;
}

.cell-truncate {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Inline Edit ────────────────────────────────────────────── */
.inline-edit {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.inline-edit input {
    width: 80px;
    text-align: center;
    padding: 0.3rem 0.5rem;
    font-size: 0.85rem;
    background: var(--wex-bg);
    border: 1px solid var(--wex-border);
    border-radius: 4px;
    color: var(--wex-text);
}

.inline-edit input:focus {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.1);
    outline: none;
}

/* ── Quick Add Section ──────────────────────────────────────── */
.quick-add-section {
    background: rgba(30, 30, 46, 0.5);
    backdrop-filter: blur(8px);
    border: 1px dashed rgba(99, 102, 241, 0.25);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

/* ── Credits Value Pill ─────────────────────────────────────── */
.credits-pill {
    background: linear-gradient(135deg, var(--wex-success), #059669);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1rem;
    display: inline-block;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.25);
}

/* ── Panel (Station view legacy) ────────────────────────────── */
.panel {
    background: rgba(30, 30, 46, 0.7);
    backdrop-filter: blur(12px);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.1);
    margin-bottom: 1.5rem;
}

/* ── Batch Header (Production scanning) ─────────────────────── */
.batch-header {
    display: none;
    background: rgba(30, 30, 46, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.15);
    animation: batchSlideIn 0.3s ease-out;
}

.batch-header.visible { display: block; }

@keyframes batchSlideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.batch-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.batch-header-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.batch-header-icon {
    width: 48px;
    height: 48px;
    background: var(--wex-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.batch-header-info h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--wex-primary);
    font-family: var(--font-mono);
}

.batch-header-info p {
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
    color: var(--wex-muted);
}

.batch-header-stats {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.batch-stat {
    text-align: center;
    padding: 0.5rem 1rem;
    background: color-mix(in srgb, var(--wex-primary) 15%, transparent);
    border-radius: 8px;
    min-width: 80px;
}

.batch-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--wex-primary);
    font-family: var(--font-mono);
}

.batch-stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--wex-muted);
    letter-spacing: 0.05em;
}

/* ── InStock Row Styling ────────────────────────────────────── */
tr.instock-row {
    border-left: 4px solid #0dcaf0;
    background-color: rgba(13,202,240,0.06);
}

tr.instock-row:hover {
    background-color: rgba(13,202,240,0.12);
}

/* ── Reprint Badge ──────────────────────────────────────────── */
.reprint-badge {
    display: inline-block;
    margin-left: 0.5em;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    background: var(--wex-danger);
    color: #fff;
    vertical-align: middle;
}

.reprint-badge.reprint-badge-done {
    background: var(--wex-success);
}

/* ── Reprint Modal ──────────────────────────────────────────── */
.reprint-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1.25rem;
}

.reprint-modal-backdrop.open { display: flex; }

.reprint-modal {
    width: min(1200px, 96vw);
    max-height: 90vh;
    background: rgba(30, 30, 46, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(99, 102, 241, 0.08);
    display: flex;
    flex-direction: column;
}

.reprint-modal-header,
.reprint-modal-footer {
    padding: 0.9rem 1.1rem;
    background: rgba(45, 45, 65, 0.5);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.reprint-modal-header {
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.reprint-modal-footer {
    border-top: 1px solid rgba(99, 102, 241, 0.1);
}

.reprint-preview-container {
    padding: 1rem 1.1rem;
    overflow: auto;
    flex: 1;
}

/* ── Item Processed State ───────────────────────────────────── */
tr.item-processed {
    opacity: 0.6;
    background-color: rgba(39,39,42,0.5);
}

.previous-area-cell,
.previous-action-cell {
    color: var(--wex-accent);
    font-style: italic;
}

/* ── Form Styling Helpers ───────────────────────────────────── */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.form-grid-2 { grid-template-columns: repeat(2, 1fr); }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 768px) {
    .form-grid-2,
    .form-grid-3 { grid-template-columns: 1fr; }
}

.form-card {
    background: rgba(30, 30, 46, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb-enterprise {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--wex-muted);
    margin-bottom: 1rem;
}

.breadcrumb-enterprise a {
    color: var(--wex-primary);
    text-decoration: none;
}

.breadcrumb-enterprise a:hover {
    text-decoration: underline;
}

.breadcrumb-enterprise .separator {
    color: var(--wex-border);
}

/* ── No Data / Muted Text ───────────────────────────────────── */
.no-data {
    color: var(--wex-muted);
    font-style: italic;
    font-size: 0.85rem;
}

/* ── Responsive Utilities ───────────────────────────────────── */
@media (max-width: 576px) {
    .page-container { padding: 0 0.75rem; }
    .enterprise-header { padding: 1.25rem; border-radius: 12px; }
    .stats-row { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .stat-card { padding: 0.75rem; }
    .stat-card .stat-value { font-size: 1.5rem; }
    .section-body { padding: 1rem; }
    .filters-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .enterprise-section { padding: 1rem; border-radius: 12px; }
}

@media (max-width: 768px) {
    .enterprise-table-wrap { border-radius: 8px; }
    .session-card .stats { gap: 0.4rem; }
    .session-card .stats .stat .value { font-size: 1.25rem; }
    .batch-header-inner { flex-direction: column; }
}

@media (min-width: 992px) {
    .page-container-wide { padding: 0 2rem; }
}

/* ── Animation Utilities ────────────────────────────────────── */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes upload-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ── Print Styles ───────────────────────────────────────────── */
@media print {
    .navbar, .filters-bar, .actions-bar, .page-header-actions { display: none !important; }
    .enterprise-header { border: none; background: none; padding: 0; }
    .section-card { border: 1px solid #ccc; }
    body { background: white; color: black; }
}

/* ── Error Pages ─────────────────────────────────── */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--wex-bg);
    padding: 2rem;
}

.error-code {
    font-size: 8rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, #818cf8, #6366f1, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.error-content {
    text-align: center;
    max-width: 500px;
}

.error-message {
    font-size: 1.5rem;
    color: var(--wex-text);
    margin-bottom: 0.5rem;
}

.error-detail {
    color: var(--wex-muted);
    margin-bottom: 2rem;
}

.error-action .btn {
    padding: 0.75rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

/* ────────────────────────────────────────────────────────────────────────
 * Data Table — UX#12 unified table styling.
 *
 * Designed to be applied ALONGSIDE .enterprise-table (additive, non-breaking).
 * Provides consistent borders, striping, padding, hover, sticky header, and
 * a compact (.data-table-sm) variant.
 *
 * Usage:
 *   <table class="enterprise-table data-table">…</table>
 *   <table class="enterprise-table data-table data-table-sm">…</table>
 * ──────────────────────────────────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--wex-text);
}

.data-table thead {
    position: sticky;
    top: 0;
    z-index: 5;
}

.data-table thead th {
    padding: 12px;
    /* Jun 11 2026: solid bg, no backdrop-filter (same scroll-shimmer fix as
     * .enterprise-table thead th above). */
    background: #1e1e2e;
    border-bottom: 1px solid var(--wex-border);
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--wex-muted);
}

.data-table tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--wex-border);
    vertical-align: middle;
    font-size: 0.875rem;
}

/* Striped alternating rows */
.data-table tbody tr:nth-child(odd) {
    background: var(--wex-surface);
}
.data-table tbody tr:nth-child(even) {
    background: var(--wex-surface-highlight);
}

/* Smooth hover state with subtle highlight + 4px row border-radius */
.data-table tbody tr {
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.data-table tbody tr:hover {
    background: color-mix(in srgb, var(--wex-primary) 10%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--wex-primary) 25%, transparent);
}
.data-table tbody tr:hover td:first-child {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}
.data-table tbody tr:hover td:last-child {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Compact variant: tighter padding + smaller font */
.data-table.data-table-sm thead th,
.data-table.data-table-sm tbody td {
    padding: 6px;
    font-size: 0.85em;
}

/* Wrapper for horizontal scroll on narrow viewports */
.data-table-wrap {
    overflow-x: auto;
    overflow-y: visible;
    border-radius: 8px;
    border: 1px solid var(--wex-border);
}

/* Sortable header link styling within data-table */
.data-table .sortable-header {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 1.5rem !important;
}
.data-table .sortable-header::after {
    content: "\2195";
    position: absolute;
    right: 0.5rem;
    opacity: 0.3;
    font-size: 0.8rem;
}
.data-table .sortable-header.asc::after { content: "\2191"; opacity: 0.8; }
.data-table .sortable-header.desc::after { content: "\2193"; opacity: 0.8; }

.data-table .data-table-sort-link {
    color: inherit;
    text-decoration: none;
}
.data-table .data-table-sort-link:hover {
    color: var(--wex-primary);
}

/* ────────────────────────────────────────────────────────────────────────
 * Inline Edit UX Polish — UX#13.
 *
 * Layered on top of inventory_unified.html's existing .qty-inline-* and
 * .field-inline-* classes. We avoid touching the existing rules by adding
 * dedicated additive selectors.
 * ──────────────────────────────────────────────────────────────────────── */

/* Pencil icon: appears on hover next to editable cells */
.qty-inline-wrap,
.field-inline-wrap {
    position: relative;
}
.qty-inline-wrap::before,
.field-inline-wrap::before {
    content: "\f4ca"; /* bi-pencil-square */
    font-family: "bootstrap-icons";
    position: absolute;
    left: -1.1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    color: var(--wex-primary);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}
tr:hover .qty-inline-wrap::before,
tr:hover .field-inline-wrap::before,
.qty-inline-wrap:hover::before,
.field-inline-wrap:hover::before {
    opacity: 0.85;
}

/* Edit-mode (focused) input: 2px left border in primary color */
.qty-inline-input:focus,
.field-inline-input:focus,
.field-inline-select:focus,
.field-inline-textarea:focus {
    outline: none;
    border-left: 2px solid var(--wex-primary) !important;
    border-color: var(--wex-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--wex-primary) 15%, transparent);
}

/* Inline error popup tooltip (shown when save fails) */
.qty-feedback.error,
.field-feedback.error {
    position: relative;
    display: inline-block;
    background: color-mix(in srgb, var(--wex-danger) 18%, transparent);
    border: 1px solid color-mix(in srgb, var(--wex-danger) 50%, transparent);
    color: #f87171;
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    animation: data-table-fade-in 0.2s ease;
}
.qty-feedback.error::before,
.field-feedback.error::before {
    content: "";
    position: absolute;
    top: -5px;
    left: 12px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid color-mix(in srgb, var(--wex-danger) 50%, transparent);
}

@keyframes data-table-fade-in {
    from { opacity: 0; transform: translateY(-2px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Undo button — appears for 5s after a successful inline save */
.qty-undo-btn {
    display: none;
    margin-left: 0.4rem;
    padding: 2px 6px;
    background: transparent;
    border: 1px solid var(--wex-border);
    border-radius: 4px;
    color: var(--wex-text-muted, var(--wex-muted));
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.15s ease;
    vertical-align: middle;
}
.qty-undo-btn:hover {
    background: var(--wex-surface-highlight);
    color: var(--wex-primary);
    border-color: var(--wex-primary);
}
.qty-undo-btn.show {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    animation: data-table-fade-in 0.2s ease;
}
.qty-undo-btn i {
    font-size: 0.85rem;
}

/* ===========================================================================
 * Inventory Phase 2.5 — shared section shell (accent identity + stat strip +
 * status-tinted rows + table-in-accent-card). Reuses the existing dark
 * enterprise kit; the per-section accent comes in as --wr-accent (set inline
 * on .inv-section by the template, from the landing palette).
 * =========================================================================== */

/* --- Status pills: PROMOTED from inventory_category.html's inline <style> so
 * the template-rendered rows and the JS-appended rows (inventory_lazy_load.js)
 * share ONE source of truth. Colors are the design's convention:
 * ok #16a34a · low #d97706 · critical #dc2626 · out/empty #6b7280. */
.stock-badge { display:inline-block; padding:.15rem .5rem; border-radius:4px; font-size:.72rem; font-weight:600; background:#334155; color:#e2e8f0; }
.stock-badge.stock-ok { background:#16a34a; color:#fff; }
.stock-badge.stock-low { background:#d97706; color:#fff; }
.stock-badge.stock-critical { background:#dc2626; color:#fff; }
.stock-badge.stock-out { background:#6b7280; color:#fff; }

/* --- Row status tint: the ONLY genuinely new rule. A 3px left border + a
 * faint status-colored wash so the operator reads health down the table even
 * after columns collapse on mobile. One class per status; the mapping
 * (status -> row-status-<status>) is shared by template + JS. */
tr.row-status-ok       { border-left:3px solid #16a34a; background:color-mix(in srgb, #16a34a 6%, transparent); }
tr.row-status-low      { border-left:3px solid #d97706; background:color-mix(in srgb, #d97706 6%, transparent); }
tr.row-status-critical { border-left:3px solid #dc2626; background:color-mix(in srgb, #dc2626 6%, transparent); }
tr.row-status-out      { border-left:3px solid #6b7280; background:color-mix(in srgb, #6b7280 6%, transparent); }

/* --- Section accent header chip + one-line purpose (above the stat strip). */
.inv-section-id { display:flex; align-items:flex-start; gap:.75rem; }
.inv-section-id .stat-card-icon {
    width: 42px; height: 42px; border-radius: 10px; flex: 0 0 auto;
    background: color-mix(in srgb, var(--wr-accent, var(--wex-primary)) 15%, transparent);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; color: var(--wr-accent, var(--wex-primary));
}

/* --- Stat strip: cheap color-coded chips (total/low/critical/out). Reuses the
 * enterprise-card border-left idiom; collapses to one column under 820px. */
.inv-stat-strip {
    display: grid; gap: .75rem; margin: 0 0 1rem;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.inv-stat-chip {
    display: flex; flex-direction: column; gap: .15rem;
    padding: .65rem .85rem; border-radius: 10px;
    background: var(--wex-surface, #1a2027);
    border: 1px solid var(--wex-border, #2d3b47);
    border-left: 4px solid var(--chip-color, var(--wex-muted, #6b7280));
}
.inv-stat-chip .inv-stat-value {
    font-family: var(--font-heading); font-size: 1.4rem; font-weight: 700;
    color: var(--wex-text, #e2e8f0); line-height: 1.1;
}
.inv-stat-chip .inv-stat-label {
    font-size: .72rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .04em; color: var(--wex-muted, #94a3b8);
}
.inv-stat-chip.chip-total    { --chip-color: var(--wr-accent, var(--wex-primary)); }
.inv-stat-chip.chip-low      { --chip-color: #d97706; }
.inv-stat-chip.chip-critical { --chip-color: #dc2626; }
.inv-stat-chip.chip-out      { --chip-color: #6b7280; }
.inv-stat-chip.chip-context  { --chip-color: var(--wr-accent, var(--wex-primary)); }

/* --- Table-in-accent-card: dark-theme equivalent of the wood-review wr-card.
 * NB: do NOT reuse _wood_review_tab.html's wr-card (it is themed with light
 * --bs-* vars and would render transparent/white on these dark pages). */
.inv-card-accent {
    display: flex; flex-direction: column;
    background: var(--wex-surface, #1a2027);
    border: 1px solid var(--wex-border, #2d3b47);
    border-top: 4px solid var(--wr-accent, var(--wex-primary));
    border-radius: 12px; overflow: hidden;
}
.inv-card-accent-head {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: .5rem; padding: .7rem 1rem;
    background: color-mix(in srgb, var(--wr-accent, var(--wex-primary)) 9%, transparent);
    border-bottom: 1px solid var(--wex-border, #2d3b47);
}
.inv-card-accent-head .inv-card-accent-title {
    display: flex; align-items: center; gap: .5rem;
    margin: 0; font-size: 1rem; font-weight: 600; color: var(--wex-text, #e2e8f0);
}
.inv-card-accent-head .inv-card-accent-title .inv-dot {
    width: .8rem; height: .8rem; border-radius: 50%;
    background: var(--wr-accent, var(--wex-primary)); display: inline-block;
}
.inv-card-accent-head .inv-card-accent-total {
    font-size: .85rem; font-weight: 600; color: var(--wex-muted, #94a3b8);
}
.inv-card-accent-body { padding: 0; overflow-x: auto; }
.inv-card-accent-tools {
    display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
    padding: .65rem 1rem; border-top: 1px solid var(--wex-border, #2d3b47);
    font-size: .82rem; color: var(--wex-muted, #94a3b8);
}

/* ===========================================================================
 * Inventory Phase 2.6 — bespoke per-section redesigns. Reuses the same dark
 * --wex-* kit, the --wr-accent var and the established status colors
 * (ok #16a34a · low #d97706 · critical #dc2626 · out/empty #6b7280) plus a new
 * "unlinked" slate/indigo (#6366f1) for mouldings with no backing material.
 * =========================================================================== */

/* --- D4: Moulding "unlinked" state — DISTINCT from gray "out". A moulding with
 * no linked RawMaterial gets a slate/indigo tint + badge so "no material linked
 * yet" no longer reads the same as "depleted". */
.stock-badge.stock-unlinked { background:#6366f1; color:#fff; }
tr.row-status-unlinked { border-left:3px solid #6366f1; background:color-mix(in srgb, #6366f1 6%, transparent); }

/* --- D1: Pre-cortados (PRE_MADE_FRAME) as a responsive TILE GRID. The ~30-40
 * bins read better as cards than as a table; status is conveyed by a colored
 * top border + the existing status pill. */
.inv-tile-grid {
    display: grid; gap: .75rem; padding: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.inv-tile {
    display: flex; flex-direction: column; gap: .4rem;
    padding: .7rem .8rem; border-radius: 10px;
    background: var(--wex-surface, #1a2027);
    border: 1px solid var(--wex-border, #2d3b47);
    border-top: 4px solid var(--tile-color, #6b7280);
}
.inv-tile .inv-tile-top {
    display: flex; align-items: center; justify-content: space-between; gap: .4rem;
}
.inv-tile .inv-tile-bin { font-size: 1rem; font-weight: 700; }
.inv-tile .inv-tile-meta {
    display: flex; flex-wrap: wrap; gap: .35rem; align-items: center;
    font-size: .76rem; color: var(--wex-muted, #94a3b8);
}
.inv-tile .inv-tile-cat {
    font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
    color: var(--wex-text, #e2e8f0);
}
.inv-tile .inv-tile-qty {
    font-family: var(--font-heading); font-size: 2rem; font-weight: 700;
    line-height: 1; color: var(--wex-text, #e2e8f0);
}
.inv-tile .inv-tile-foot {
    display: flex; align-items: center; justify-content: space-between; gap: .4rem;
    margin-top: auto; padding-top: .3rem; font-size: .74rem;
    color: var(--wex-muted, #94a3b8);
    border-top: 1px solid var(--wex-border, #2d3b47);
}
/* Tile status accent (top border) reuses the row-tint palette. */
.inv-tile.tile-status-ok       { --tile-color:#16a34a; }
.inv-tile.tile-status-low      { --tile-color:#d97706; }
.inv-tile.tile-status-critical { --tile-color:#dc2626; }
.inv-tile.tile-status-out      { --tile-color:#6b7280; }

/* --- D1 rev2: full-width category divider inside the tile grid (WC / Inner /
 * …). Carries the category color via --tile-color, same var the tiles use. */
.inv-tile-divider {
    grid-column: 1 / -1;
    display: flex; align-items: center; gap: .5rem;
    margin-top: .35rem; padding: .3rem 0 .15rem;
    font-size: .8rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; color: var(--wex-text, #e2e8f0);
    border-bottom: 1px solid var(--wex-border, #2d3b47);
}
.inv-tile-divider .inv-dot {
    width: .7rem; height: .7rem; border-radius: 50%; display: inline-block;
    background: var(--tile-color, var(--wex-muted, #6b7280));
}

/* --- D2 rev2: In Stock SKU group rows — ONE table, a clickable summary row
 * per SKU followed by its lot rows (collapsed by default on the full
 * listing). Replaces the per-location <details> design, which exploded under
 * prod cardinality (~416 locations → ~200 stacked tables/sticky theads). */
.inv-sku-group-row { cursor: pointer; user-select: none; }
/* rev3: the summary row spans the SAME 12 columns as the lot rows (the
 * full-width colspan version left the thead floating over nothing). Cells
 * keep the table's natural padding so they line up under the thead. */
.inv-sku-group-row > td {
    font-size: .85rem; font-weight: 600;
    color: var(--wex-text, #e2e8f0);
    background: color-mix(in srgb, var(--wr-accent, var(--wex-primary)) 7%, transparent);
    border-top: 1px solid var(--wex-border, #2d3b47);
}
.inv-sku-group-row:hover > td {
    background: color-mix(in srgb, var(--wr-accent, var(--wex-primary)) 13%, transparent);
}
.inv-sku-group-row .inv-chevron {
    display: inline-block;
    color: var(--wex-muted, #94a3b8);
    transition: transform .15s ease;
}
.inv-sku-group-row.expanded .inv-chevron { transform: rotate(90deg); }
.inv-sku-group-row .inv-group-name {
    font-weight: 400; color: var(--wex-muted, #94a3b8);
}
.inv-sku-group-row .inv-group-chips {
    font-size: .76rem; font-weight: 600; white-space: nowrap;
    color: var(--wex-muted, #94a3b8);
}

/* --- D3: the scanned-as SKU chip reads as a muted variant of .sku-code so it's
 * visually subordinate to the canonical SKU it mapped to. */
.sku-scanned { opacity: .85; }

/* ═══════════════════════════════════════════════════════════════════════════
 * Phase 2.7 (2026-06-11) — Moulding PHOTO CARD GRID
 * (/inventory/?section=moulding — inventory_category.html MOULDING branch).
 * APPEND-ONLY block: do not fold into earlier rules. Status accent rides the
 * card's top border via --mcard-color (same palette as the tile grid / row
 * tints, plus indigo for "unlinked" = no backing raw material). */
.inv-mcard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: .75rem;
    padding: .9rem;
}
.inv-mcard {
    display: flex; flex-direction: column;
    background: var(--wex-surface, #1e1e2e);
    border: 1px solid var(--wex-border, rgba(99, 102, 241, 0.15));
    border-top: 3px solid var(--mcard-color, var(--wex-muted, #6b7280));
    border-radius: .55rem;
    overflow: hidden;
    transition: transform .15s ease, border-color .15s ease;
}
.inv-mcard:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--mcard-color, var(--wex-primary, #6366f1)) 40%, transparent);
    border-top-color: var(--mcard-color, var(--wex-muted, #6b7280));
}
.inv-mcard.mstatus-ok       { --mcard-color: #16a34a; }
.inv-mcard.mstatus-low      { --mcard-color: #d97706; }
.inv-mcard.mstatus-critical { --mcard-color: #dc2626; }
.inv-mcard.mstatus-out      { --mcard-color: #6b7280; }
.inv-mcard.mstatus-unlinked { --mcard-color: #6366f1; }
/* Photo area: ~4:3 at ~150px tall; uploads object-fit cover, the no-photo
 * placeholder centers a muted icon + label on a subtle surface tint. */
.inv-mcard-img {
    height: 150px; width: 100%;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    background: var(--wex-surface-highlight, #2d2d41);
    border-bottom: 1px solid var(--wex-border, rgba(99, 102, 241, 0.15));
}
.inv-mcard-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.inv-mcard-noimg {
    display: flex; flex-direction: column; align-items: center; gap: .25rem;
    color: var(--wex-muted, #94a3b8); font-size: .76rem;
}
.inv-mcard-noimg .bi { font-size: 1.7rem; opacity: .5; }
.inv-mcard-body {
    display: flex; flex-direction: column; gap: .28rem;
    padding: .6rem .7rem .45rem;
    flex: 1;
}
.inv-mcard-code { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.inv-mcard-code .sku-code { font-size: .95rem; font-weight: 700; }
.inv-mcard-inactive {
    font-size: .66rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; padding: 0 .32rem; border-radius: .35rem;
    color: var(--wex-muted, #94a3b8);
    border: 1px solid var(--wex-border, rgba(99, 102, 241, 0.15));
}
.inv-mcard-name {
    font-size: .84rem; color: var(--wex-text, #e2e8f0);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.inv-mcard-meta { font-size: .76rem; color: var(--wex-muted, #94a3b8); }
.inv-mcard-meta span + span::before { content: " · "; }
.inv-mcard-stock {
    display: flex; align-items: center; justify-content: space-between;
    gap: .4rem; margin-top: auto; padding-top: .3rem;
}
.inv-mcard-stock strong { font-size: 1.05rem; color: var(--wex-text, #e2e8f0); }
.inv-mcard-foot {
    display: flex; align-items: center; justify-content: space-between;
    gap: .5rem; padding: .45rem .7rem;
    border-top: 1px solid var(--wex-border, rgba(99, 102, 241, 0.15));
}
/* Card checkboxes live OUTSIDE .enterprise-table — restate the dark-theme
 * visibility fix the table got (native ~13px boxes were invisible). */
.inv-mcard-foot .row-select-cb { width: 18px; height: 18px; cursor: pointer; accent-color: #2563EB; }


/* ── Moulding box tracking (2026-06-12) ──────────────────────────────────────
 * Compact shipment-math line under the card's stock number
 * ("12 cajas × 25 pzs × 96.00 in = 28,800 in");
 * .inv-mcard-boxes-empty mutes the "no box data yet" state. */
.inv-mcard-boxes { font-size: .72rem; color: var(--text-muted, #8b93a7); margin-top: 2px; }
.inv-mcard-boxes.inv-mcard-boxes-empty { opacity: .55; }


/* ══ Pre-Made Frame Stock manage page (2026-06-12 redesign) ══════════════════
 * Replaces the page's pre-kit inline <style> (hardcoded-hex pills / category
 * stripes). Reuses the established kit: inv-stat-chip strip, stock-badge
 * status colors (ok #16a34a · low #d97706 · out #6b7280), section-card. */

/* Stat chips are now <button>s (clickable filters) — reset button chrome. */
button.inv-stat-chip.pms-chip {
    appearance: none; text-align: left; cursor: pointer; width: 100%;
    transition: border-color .15s ease, transform .15s ease;
}
button.inv-stat-chip.pms-chip:hover {
    border-color: var(--chip-color, var(--wex-primary, #2563eb));
    transform: translateY(-1px);
}

/* Filter pills — kit-tokened replacement for the old hardcoded-hex pills. */
.pms-filter-bar { display: flex; flex-direction: column; gap: .5rem; }
.pms-pill-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.pms-pill {
    appearance: none;
    border: 1px solid var(--wex-border, #2d3b47);
    background: transparent;
    color: var(--wex-text, #e2e8f0);
    border-radius: 999px;
    padding: .35rem .85rem;
    font-size: .85rem;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}
.pms-pill:hover { background: color-mix(in srgb, var(--wex-text, #e2e8f0) 5%, transparent); }
.pms-pill.active {
    background: color-mix(in srgb, var(--wex-primary, #2563eb) 18%, transparent);
    border-color: var(--wex-primary, #2563eb);
    color: var(--wex-text, #fff);
}
.pms-pill .pms-pill-count {
    background: color-mix(in srgb, var(--wex-text, #e2e8f0) 8%, transparent);
    padding: .05rem .45rem;
    border-radius: 10px;
    font-size: .72rem;
    font-weight: 600;
}
.pms-pill.active .pms-pill-count {
    background: color-mix(in srgb, var(--wex-primary, #2563eb) 40%, transparent);
}
.pms-pill-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: #6b7280; }

/* One accent per category — shared by the pill dots, the row stripes and the
 * category badges (single mapping, three selectors each). */
.pms-pill-dot[data-dot="Inner"]      { background: #3b82f6; }
.pms-pill-dot[data-dot="Inner FL"]   { background: #6366f1; }
.pms-pill-dot[data-dot="Inner 4FL"]  { background: #8b5cf6; }
.pms-pill-dot[data-dot="WC"]         { background: #10b981; }
.pms-pill-dot[data-dot="WCGDF"]      { background: #14b8a6; }
.pms-pill-dot[data-dot="Moulding"]   { background: #f59e0b; }

#premade-stock-table tr[data-category="Inner"]      { border-left: 4px solid #3b82f6; }
#premade-stock-table tr[data-category="Inner FL"]   { border-left: 4px solid #6366f1; }
#premade-stock-table tr[data-category="Inner 4FL"]  { border-left: 4px solid #8b5cf6; }
#premade-stock-table tr[data-category="WC"]         { border-left: 4px solid #10b981; }
#premade-stock-table tr[data-category="WCGDF"]      { border-left: 4px solid #14b8a6; }
#premade-stock-table tr[data-category="Moulding"]   { border-left: 4px solid #f59e0b; }

.pms-cat-badge { font-size: .72rem; padding: .25rem .5rem; border-radius: 4px; font-weight: 600; white-space: nowrap; }
.pms-cat-badge[data-cat-badge="Inner"]      { background: rgba(59,130,246,.15);  color: #93c5fd; }
.pms-cat-badge[data-cat-badge="Inner FL"]   { background: rgba(99,102,241,.15);  color: #a5b4fc; }
.pms-cat-badge[data-cat-badge="Inner 4FL"]  { background: rgba(139,92,246,.15);  color: #c4b5fd; }
.pms-cat-badge[data-cat-badge="WC"]         { background: rgba(16,185,129,.15);  color: #6ee7b7; }
.pms-cat-badge[data-cat-badge="WCGDF"]      { background: rgba(20,184,166,.15);  color: #5eead4; }
.pms-cat-badge[data-cat-badge="Moulding"]   { background: rgba(245,158,11,.15);  color: #fcd34d; }

/* Manage table: sticky header inside a scrollable card body; on narrow
 * viewports it scrolls horizontally with the Bin column pinned. */
.pms-table-wrap { overflow: auto; max-height: 72vh; }
.pms-table { width: 100%; }
.pms-table thead th {
    position: sticky; top: 0; z-index: 3;
    background: var(--wex-surface, #1a2027);
}
.pms-table .pms-input { width: 92px; }
.pms-table .pms-input.pms-input-notes { width: 160px; }
.pms-table .pms-col-save { white-space: nowrap; }
.pms-table .pms-save-status { font-size: .8em; }
.pms-table tr.hidden-by-filter { display: none; }
.pms-table tr.pms-dirty td { background: color-mix(in srgb, #d97706 7%, transparent); }

@media (max-width: 768px) {
    .pms-table th:first-child,
    .pms-table td.pms-col-bin {
        position: sticky; left: 0; z-index: 2;
        background: var(--wex-surface, #1a2027);
    }
    .pms-table thead th:first-child { z-index: 4; }
    .pms-table .pms-input { width: 76px; }
    .pms-table .pms-input.pms-input-notes { width: 120px; }
}

/* Honest empty state — the add-bins path is the bulk upload. */
.pms-empty { text-align: center; padding: 2.5rem 1rem; color: var(--wex-muted, #94a3b8); }
.pms-empty i { font-size: 2rem; display: block; margin-bottom: .5rem; opacity: .6; }
.pms-empty p { margin-bottom: 1rem; }
