/* CSS Design System for OpsReport Generator */

:root {
    /* Color Palette */
    --primary-hsl: 224, 76%, 33%;
    --primary: hsl(var(--primary-hsl));
    --primary-light: hsl(224, 76%, 45%);
    --primary-dark: hsl(224, 80%, 22%);
    
    --secondary-hsl: 200, 95%, 45%;
    --secondary: hsl(var(--secondary-hsl));
    
    --success: hsl(142, 72%, 29%);
    --success-light: hsl(142, 76%, 95%);
    --success-border: hsl(142, 76%, 85%);
    
    --warning: hsl(38, 92%, 50%);
    --warning-light: hsl(38, 92%, 96%);
    
    --danger: hsl(350, 84%, 48%);
    --danger-light: hsl(350, 84%, 96%);
    
    --background: hsl(210, 40%, 97%);
    --surface: hsl(0, 0%, 100%);
    --border: hsl(214, 32%, 91%);
    
    --text-main: hsl(215, 25%, 15%);
    --text-muted: hsl(215, 16%, 47%);
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.08);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    --shadow-premium: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base resets & styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    color: var(--primary-dark);
}

/* Layout */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.app-header {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    z-index: 10;
    flex-shrink: 0;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 10px rgba(30, 58, 138, 0.25);
}

.logo-icon i {
    width: 22px;
    height: 22px;
}

.logo-area h1 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-area p {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.system-badge {
    background-color: hsl(210, 40%, 93%);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border);
}

.system-badge i {
    width: 14px;
    height: 14px;
}

/* Main Workspace */
.app-main {
    display: flex;
    flex: 1;
    overflow: hidden;
    padding: 20px 30px;
    gap: 24px;
}

/* Panel Design */
.panel {
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.form-panel {
    flex: 1;
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
}

.panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, hsl(210, 40%, 99%), var(--surface));
}

.panel-title {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-title i {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.panel-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Tab Navigation */
.form-tabs {
    display: flex;
    background-color: hsl(210, 40%, 95%);
    border-bottom: 1px solid var(--border);
    padding: 6px 8px;
    gap: 4px;
}

.tab-btn {
    flex: 1;
    border: none;
    background: none;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
}

.tab-btn i {
    width: 14px;
    height: 14px;
}

.tab-btn:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--text-main);
}

.tab-btn.active {
    background-color: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Form Styling */
.report-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.tab-content {
    display: none;
    padding: 24px;
    flex: 1;
    overflow-y: auto;
}

.tab-content.active {
    display: block;
}

.section-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--primary);
}

.section-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 18px;
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.section-header-row .section-title {
    margin-bottom: 0;
}

/* Grid Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full-width {
    grid-column: span 2;
}

label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

input, select, textarea {
    font-family: inherit;
    font-size: 14px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background-color: var(--surface);
    color: var(--text-main);
    outline: none;
    transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

/* Row Managers (KPIs, Milestones, Issues) */
.kpi-row, .milestone-row, .issue-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background-color: hsl(210, 40%, 98%);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    animation: slideIn 0.25s ease-out;
}

.kpi-row input, .milestone-row input, .milestone-row select, .issue-row input, .issue-row select {
    padding: 8px 12px;
    font-size: 13px;
}

.row-action {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.row-action:hover {
    background-color: var(--danger-light);
}

/* Buttons */
.btn {
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
}

.btn-secondary {
    background-color: hsl(210, 40%, 93%);
    color: var(--primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background-color: hsl(210, 40%, 90%);
}

.btn-success {
    background-color: var(--success);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    background-color: hsl(142, 72%, 24%);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.form-actions-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background-color: var(--surface);
}

/* Auto-save status indicator */
.autosave-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}
.autosave-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: hsl(215, 16%, 70%);
    transition: background 0.2s ease;
}
.autosave-status.saving .autosave-dot {
    background: var(--warning, hsl(38, 92%, 50%));
    animation: pulse-dot 1.2s ease-in-out infinite;
}
.autosave-status.saved .autosave-dot {
    background: var(--success, hsl(142, 72%, 40%));
}
.autosave-status.error .autosave-dot {
    background: var(--danger, hsl(0, 72%, 50%));
}

/* Submit button */
.btn-submit-form {
    background: linear-gradient(135deg, var(--primary), hsl(224, 76%, 50%));
    color: #fff;
    border: none;
    padding: 11px 26px;
    border-radius: 9px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: 0 2px 8px rgba(50, 70, 200, 0.25);
}
.btn-submit-form:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(50, 70, 200, 0.35);
}
.btn-submit-form:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}
.btn-submit-form.submitted {
    background: linear-gradient(135deg, hsl(142, 60%, 40%), hsl(142, 72%, 48%));
    box-shadow: 0 2px 8px rgba(40, 160, 80, 0.25);
}

.form-actions-footer .btn-secondary {
    margin-right: auto;
}

.hidden {
    display: none !important;
}

/* Live Preview Sheet */
.preview-paper-container {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    background-color: hsl(210, 30%, 90%);
    display: flex;
    justify-content: center;
}

.preview-paper {
    background-color: white;
    width: 100%;
    max-width: 612px; /* Letter width proportional scale */
    min-height: 792px; /* Letter height proportional */
    box-shadow: var(--shadow-premium);
    padding: 40px;
    color: #1e293b;
    font-size: 12px;
    position: relative;
    border-radius: 4px;
}

.preview-header {
    border-bottom: 2px solid var(--primary);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.preview-header h2 {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.prev-subtitle {
    font-size: 9px;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.prev-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    font-size: 10px;
}

.prev-meta-grid div {
    color: #475569;
}

.prev-meta-grid strong {
    color: #0f172a;
}

.preview-section {
    margin-top: 18px;
}

.preview-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #1e293b;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 4px;
    margin-bottom: 10px;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9px;
    margin-bottom: 10px;
}

.preview-table th, .preview-table td {
    border: 1px solid #cbd5e1;
    padding: 6px 8px;
    vertical-align: middle;
}

.preview-table th {
    background-color: #1B365D;
    color: white;
    font-weight: 700;
}

.preview-table tr:nth-child(even) td {
    background-color: #f8fafc;
}

/* Badges inside Preview */
.badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 8px;
    text-transform: uppercase;
    display: inline-block;
}

.badge-success {
    background-color: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.badge-warning {
    background-color: var(--warning-light);
    color: hsl(38, 92%, 35%);
    border: 1px solid hsl(38, 92%, 85%);
}

.badge-danger {
    background-color: var(--danger-light);
    color: var(--danger);
    border: 1px solid hsl(350, 84%, 85%);
}

.badge-neutral {
    background-color: hsl(210, 40%, 95%);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* Overlay & Result Cards */
.generation-result-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    z-index: 100;
    animation: fadeIn 0.3s ease-out;
}

.result-card {
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 440px;
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow-premium);
    border: 1px solid var(--border);
    animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Spinner */
.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

.loading-state h3, .success-state h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.loading-state p, .success-state p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.success-badge {
    width: 60px;
    height: 60px;
    background-color: var(--success-light);
    color: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.success-badge i {
    width: 32px;
    height: 32px;
}

.download-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.btn-save-form {
    background: linear-gradient(135deg, hsl(214, 80%, 40%), hsl(214, 80%, 52%));
    color: white;
    padding: 12px 18px;
    font-size: 14px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-save-form:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 90, 200, 0.25);
}
.btn-save-form.saving {
    opacity: 0.7;
    cursor: not-allowed;
}
.btn-save-form.saved {
    background: linear-gradient(135deg, hsl(142, 60%, 29%), hsl(142, 60%, 39%));
}

.btn-pdf {
    background: linear-gradient(135deg, hsl(350, 75%, 48%), hsl(350, 75%, 58%));
    color: white;
    padding: 12px;
    font-size: 14px;
}

.btn-pdf:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.btn-excel {
    background: linear-gradient(135deg, hsl(142, 60%, 29%), hsl(142, 60%, 39%));
    color: white;
    padding: 12px;
    font-size: 14px;
}

.btn-excel:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(22, 101, 52, 0.2);
}

.btn-link {
    background: none;
    color: var(--primary);
    text-decoration: underline;
    font-size: 13px;
    border: none;
    cursor: pointer;
}

.btn-link:hover {
    color: var(--primary-light);
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .app-main {
        flex-direction: column;
        overflow-y: auto;
        height: auto;
    }
    .form-panel {
        flex: none;
        width: 100%;
        height: auto;
    }
    .preview-paper-container {
        max-height: 600px;
    }
}

/* Custom multiselect styles */
.custom-multiselect .multiselect-trigger {
    border: 1px solid var(--border);
    transition: var(--transition);
}
.custom-multiselect .multiselect-trigger:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}
.multiselect-dropdown {
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    background-color: var(--surface);
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
}
.multiselect-option {
    transition: background-color 0.15s ease-out;
}
.multiselect-option:hover {
    background-color: hsl(210, 40%, 97%);
}
.multiselect-option input[type="checkbox"] {
    accent-color: var(--primary);
}

/* Boiler exclusive/centralized buttons styling */
.boiler-btn {
    border: 1.5px solid var(--border);
    background-color: var(--surface);
    color: var(--text-main);
    transition: var(--transition);
}
.boiler-btn:hover {
    background-color: hsl(210, 40%, 98%);
    border-color: var(--text-muted);
}
.boiler-btn.active-yes {
    background-color: #DCFCE7;
    border-color: #15803D;
    color: #15803D;
    box-shadow: 0 0 0 2px rgba(21, 128, 61, 0.18);
}
.boiler-btn.active-no {
    background-color: #FEF3C7;
    border-color: #B45309;
    color: #B45309;
    box-shadow: 0 0 0 2px rgba(180, 83, 9, 0.18);
}

/* Submeter toggle button styling */
.submeter-btn {
    border: 1.5px solid var(--border);
    background-color: var(--surface);
    color: var(--text-main);
    transition: var(--transition);
}
.submeter-btn:hover {
    background-color: hsl(210, 40%, 98%);
    border-color: var(--text-muted);
}
.submeter-btn.active-yes {
    background-color: #DCFCE7;
    border-color: #15803D;
    color: #15803D;
    box-shadow: 0 0 0 2px rgba(21, 128, 61, 0.18);
}
.submeter-btn.active-no {
    background-color: #FEF3C7;
    border-color: #B45309;
    color: #B45309;
    box-shadow: 0 0 0 2px rgba(180, 83, 9, 0.18);
}

/* =====================================================
   Pre-Requisite tab — sub-tab pill navigation
   ===================================================== */
.subtab-nav {
    display: flex;
    gap: 6px;
    margin-bottom: 22px;
    padding: 4px;
    background-color: hsl(210, 40%, 95%);
    border-radius: var(--radius-md);
}
.subtab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
    font-family: inherit;
}
.subtab-btn i {
    width: 14px;
    height: 14px;
}
.subtab-btn:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--text-main);
}
.subtab-btn.active {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}
.subtab-btn.active i {
    color: #ffffff;
}
.subtab-content {
    display: block;
}
.subtab-content.hidden {
    display: none;
}
.subtab-nav-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}
.subtab-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 13px;
}
.subtab-nav-btn i {
    width: 14px;
    height: 14px;
}

/* Role banner for isolated-route views */
.role-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 24px 0 24px;
    padding: 14px 18px;
    background: linear-gradient(90deg, hsl(224, 76%, 96%), hsl(200, 95%, 96%));
    border: 1px solid hsl(224, 60%, 88%);
    border-radius: var(--radius-md);
}
.role-banner i {
    width: 22px;
    height: 22px;
    color: var(--primary);
    flex-shrink: 0;
}
.role-banner-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.role-banner-text strong {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
}
.role-banner-text span {
    font-size: 12px;
    color: var(--text-muted);
}

/* =====================================================
   Isolated-route views (hide irrelevant tabs)
   ===================================================== */
/* Hide the top tab nav whenever view_mode is not 'full' */
body.view-pre-requisite .form-tabs,
body.view-data-capturing .form-tabs,
body.view-load-verification .form-tabs {
    display: none;
}
/* On /pre-requisite, hide Data Capturing + Load Verification tab contents */
body.view-pre-requisite #step2,
body.view-pre-requisite #step3 {
    display: none !important;
}
/* On isolated routes, hide the cross-tab "Next" jump buttons —
   the next tab is hidden, so clicking them would do nothing. */
body.view-pre-requisite #prereqGoMetadataBtn,
body.view-data-capturing #dcGoLoadVerifyBtn {
    display: none !important;
}
/* On /data-capturing, hide Pre-Requisite + Load Verification tab contents.
   Activate step2 so it shows even though it isn't .active in the markup. */
body.view-data-capturing #step0,
body.view-data-capturing #step3 {
    display: none !important;
}
body.view-data-capturing #step2 {
    display: block !important;
}
/* Also hide preview's Pre-Requisite section on /data-capturing */
body.view-data-capturing #prev-prereq-section {
    display: none !important;
}
/* On /load-verification, show only step3 */
body.view-load-verification #step0,
body.view-load-verification #step2 {
    display: none !important;
}
body.view-load-verification #step3 {
    display: block !important;
}
body.view-load-verification #prev-prereq-section {
    display: none !important;
}

/* =====================================================
   Toggle switches (Pre-Requisite)
   ===================================================== */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-family: inherit;
    margin: 0;
}
.toggle-switch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.toggle-slider {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
    background-color: #cbd5e1;
    border-radius: 22px;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}
.toggle-slider::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background-color: #ffffff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.toggle-switch input[type="checkbox"]:checked + .toggle-slider {
    background-color: var(--primary);
}
.toggle-switch input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(16px);
}
.toggle-switch input[type="checkbox"]:focus-visible + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.25);
}
.toggle-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
}

/* Submeter rows */
.submeter-row-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.submeter-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 16px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--surface);
}
.submeter-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}
.submeter-working-wrap {
    display: inline-flex;
    align-items: center;
}
/* Not Available chip */
.submeter-na-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    white-space: nowrap;
}
.submeter-na-chip input[type="checkbox"] {
    display: none;
}
.submeter-na-chip:hover {
    border-color: var(--danger);
    color: var(--danger);
}
.submeter-na-chip.na-active {
    border-color: var(--danger);
    color: var(--danger);
    background: var(--danger-light);
}
/* Submeter validation error */
.submeter-error {
    font-size: 12px;
    color: var(--danger);
    font-weight: 500;
    padding: 0 4px;
}
/* Generic inline field error */
.field-error {
    font-size: 12px;
    color: var(--danger);
    font-weight: 500;
    margin-top: 4px;
}
/* Operation time 3-field row */
.op-time-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.op-time-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 120px;
}
.op-time-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
}
.op-time-input {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    background: var(--surface);
    color: var(--text-main);
    width: 100%;
}
.op-time-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px hsla(var(--primary-hsl), 0.1);
}
.op-time-readonly {
    background: hsl(210, 40%, 97%) !important;
    color: var(--text-muted);
    cursor: default;
}

/* ── Clean 12-hour time widget: [HH:MM 🕐] [AM | PM] ── */
.time12-widget {
    display: inline-flex;
    align-items: stretch;
    gap: 10px;
    flex-wrap: wrap;
}
.time12-input-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.time12-input {
    width: 140px;
    padding: 12px 40px 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    background: var(--surface);
    color: var(--text-main);
    font-family: inherit;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.3px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.time12-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px hsla(var(--primary-hsl), 0.12);
}
.time12-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}
.time12-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: auto;
    cursor: pointer;
    transition: color 0.15s;
}
.time12-input-wrap:hover .time12-icon {
    color: var(--primary);
}
/* Hide native time picker — replaced by custom 12h picker */
.time12-native { display: none !important; }

/* ── Custom 12-hour time picker dropdown ──────────────────────────────── */
.time12-picker {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 100;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    display: none;
    padding: 8px;
    width: 240px;
}
.time12-picker.open { display: flex; flex-direction: column; gap: 8px; }
.time12-picker-columns {
    display: flex;
    gap: 4px;
}
.time12-picker-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.time12-picker-col-label {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.time12-picker-scroll {
    height: 160px;
    overflow-y: auto;
    scrollbar-width: thin;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fafbfc;
}
.time12-picker-scroll::-webkit-scrollbar { width: 4px; }
.time12-picker-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }
.time12-picker-item {
    padding: 6px 4px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    border-radius: 6px;
    margin: 1px 3px;
    transition: background 0.1s;
    color: var(--text-main);
}
.time12-picker-item:hover { background: hsl(210, 40%, 93%); }
.time12-picker-item.selected {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}
.time12-picker-ampm {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}
.time12-picker-ampm .time12-picker-item {
    padding: 10px 4px;
    font-weight: 600;
}
.time12-picker-done {
    width: 100%;
    padding: 8px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: background 0.15s;
}
.time12-picker-done:hover { background: var(--primary-dark); }
.ampm-toggle {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-left: 4px;
    background: var(--surface);
}
.ampm-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
    min-width: 48px;
}
.ampm-btn:hover {
    background: hsl(210, 40%, 96%);
    color: var(--text-main);
}
.ampm-btn + .ampm-btn {
    border-left: 1px solid var(--border);
}
.ampm-btn.selected {
    background: var(--primary);
    color: white;
}
.ampm-btn.selected:hover {
    background: var(--primary);
    color: white;
    opacity: 0.92;
}

@media (max-width: 600px) {
    .submeter-row {
        grid-template-columns: 1fr auto;
        row-gap: 8px;
    }
    .submeter-na-chip {
        grid-column: 2;
    }
    .op-time-row {
        flex-direction: column;
    }
    .op-time-clock {
        flex-wrap: wrap;
    }
    .ampm-btn {
        padding: 8px 14px;
    }
}

/* Generic toggle row (used for Weighing Scale / Ramp) */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--surface);
}
.toggle-row-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

/* Monthly occupancy table */
.monthly-occ-table tbody tr:nth-child(even) {
    background-color: rgba(30, 41, 59, 0.02);
}
.monthly-occ-table tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
}
.monthly-occ-table tbody tr:last-child td {
    border-bottom: none;
}
.monthly-occ-table input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
}
.monthly-occ-table .month-label {
    font-weight: 600;
    color: var(--text-main);
    font-size: 13px;
}
.monthly-occ-table .occ-pct-cell {
    font-weight: 600;
    color: var(--primary);
    font-size: 13px;
}

/* Linen list items */
.linen-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--surface);
}
.linen-item .linen-index {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    width: 28px;
    flex-shrink: 0;
}
.linen-item input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font-size: 14px;
    font-family: inherit;
    padding: 4px 0;
    outline: none;
    color: var(--text-main);
}
.linen-item .delete-linen-btn {
    border: none;
    background: none;
    color: var(--danger);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.linen-item .delete-linen-btn:hover {
    background-color: rgba(220, 38, 38, 0.08);
    border-radius: var(--radius-sm);
}

/* ── Load Verification (Phase 5) ───────────────────────────────────────────── */

/* LV sub-tab nav — reuse pill style but scoped */
.lv-subtab-nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding: 10px 14px;
    background: var(--bg);
    border-radius: 10px;
    border: 1px solid var(--border);
}
.lv-subtab-btn {
    padding: 7px 14px;
    border-radius: 7px;
    border: 1.5px solid var(--border);
    background: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.lv-subtab-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.lv-subtab-btn.active { background: var(--primary); color: #fff !important; border-color: var(--primary); font-weight: 600; }
.lv-subtab-btn.active i,
.lv-subtab-btn.active svg { color: #fff !important; stroke: #fff !important; }
.lv-subtab-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.lv-subtab-content { display: block; }
.lv-subtab-content.hidden { display: none; }

/* Shared measurement header */
.lv-meas-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
    margin-bottom: 20px;
}

/* Controls row above table */
.lv-table-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.lv-ctrl-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 13px;
    border-radius: 7px;
    border: 1.5px solid var(--primary);
    background: transparent;
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.13s;
}
.lv-ctrl-btn:hover:not(:disabled) { background: var(--primary); color: #fff; }
.lv-ctrl-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.lv-ctrl-btn.danger { border-color: #dc2626; color: #dc2626; }
.lv-ctrl-btn.danger:hover:not(:disabled) { background: #dc2626; color: #fff; }
.lv-batch-counter {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    margin-left: 4px;
}

/* Scrollable grid wrapper */
.lv-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 9px;
    margin-bottom: 12px;
}
.lv-grid {
    border-collapse: collapse;
    font-size: 12px;
    min-width: 100%;
    white-space: nowrap;
}
.lv-grid th, .lv-grid td {
    border: 1px solid #e2e8f0;
    padding: 6px 8px;
    text-align: center;
    vertical-align: middle;
}
/* Sticky label column */
.lv-label-col {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 2;
    text-align: left !important;
    min-width: 170px;
    max-width: 200px;
    white-space: normal;
    word-break: break-word;
}
.lv-label-col.lv-th { background: var(--primary-dark); z-index: 3; }

/* Header row */
.lv-grid thead th {
    background: var(--primary-dark);
    color: #fff;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.3px;
}
.lv-batch-th { min-width: 80px; }
.lv-sub-th { background: #1e3a6e; font-size: 10px; font-weight: 500; min-width: 70px; }

/* Category group header row */
.lv-cat-row td {
    background: #f1f5f9;
    font-weight: 700;
    font-size: 11px;
    color: var(--primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 7px 10px;
}
.lv-cat-row .lv-label-col { background: #e8edf5; }

/* Cell inputs */
.lv-cell-input {
    width: 60px;
    border: none;
    outline: none;
    text-align: center;
    font-size: 12px;
    background: transparent;
    padding: 2px 4px;
    font-family: 'Inter', sans-serif;
}
.lv-cell-input:focus { background: #eff6ff; border-radius: 4px; }
.lv-time-input {
    width: 85px;
    border: none;
    outline: none;
    text-align: center;
    font-size: 11px;
    background: transparent;
    padding: 2px;
    font-family: 'Inter', sans-serif;
}
.lv-time-input:focus { background: #eff6ff; border-radius: 4px; cursor: pointer; }
.lv-text-input-td {
    border: none;
    outline: none;
    font-size: 12px;
    background: transparent;
    width: 90px;
    font-family: 'Inter', sans-serif;
    padding: 2px 4px;
}
.lv-text-input-td:focus { background: #eff6ff; border-radius: 4px; }

/* Item name inline input */
.lv-item-name-wrap { display: flex; align-items: center; gap: 5px; }
.lv-item-name-input {
    border: none;
    outline: none;
    font-size: 12px;
    background: transparent;
    flex: 1;
    min-width: 100px;
    font-family: 'Inter', sans-serif;
}
.lv-item-name-input:focus { background: #eff6ff; border-radius: 4px; padding: 1px 4px; }
.lv-del-row-btn {
    border: none;
    background: none;
    color: #dc2626;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    padding: 1px 3px;
    opacity: 0.5;
    flex-shrink: 0;
    border-radius: 3px;
}
.lv-del-row-btn:hover { opacity: 1; background: #fee2e2; }

/* Add row/category inline button */
.lv-add-inline-btn {
    font-size: 11px;
    color: var(--primary);
    background: none;
    border: 1.5px dashed var(--primary);
    border-radius: 5px;
    padding: 3px 10px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 6px;
    transition: all 0.12s;
}
.lv-add-inline-btn:hover { background: #eff6ff; }

/* Timing Record — group headings */
.lv-timing-group-heading {
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 18px 0 8px;
    padding: 6px 10px;
    background: hsl(224, 60%, 96%);
    border-left: 3px solid var(--primary);
    border-radius: 0 6px 6px 0;
    letter-spacing: 0.3px;
}
.lv-timing-group-heading:first-child { margin-top: 0; }

/* × row delete button inside timing tables */
.lv-timing-row-del {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    transition: background 0.12s;
}
.lv-timing-row-del:hover { background: rgba(220, 38, 38, 0.22); }

/* Machine name cell */
.lv-machine-td {
    font-weight: 600;
    color: var(--primary-dark);
    text-align: left !important;
    font-size: 12px;
}

/* Avg Weights table */
.lv-avg-wrap { margin-bottom: 12px; }

/* Card container */
.lv-avg-cards { display: flex; flex-direction: column; gap: 10px; }

/* Individual card */
.lv-avg-card {
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    background: var(--surface);
    transition: border-color 0.15s;
}
.lv-avg-card:hover { border-color: var(--primary); }

.lv-avg-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.lv-avg-num {
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.lv-avg-card-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    flex: 1;
}

.lv-avg-item-input {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    padding: 8px 10px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.13s;
    margin-bottom: 10px;
    box-sizing: border-box;
}
.lv-avg-item-input:focus { border-color: var(--primary); }

.lv-avg-card-weights {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.lv-avg-card-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}
.lv-avg-card-input-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    overflow: hidden;
    transition: border-color 0.13s;
}
.lv-avg-card-input-wrap:focus-within { border-color: var(--primary); }
.lv-avg-weight-input {
    flex: 1;
    border: none;
    padding: 7px 8px;
    font-size: 13px;
    text-align: right;
    font-family: 'Inter', sans-serif;
    outline: none;
    min-width: 0;
}
.lv-avg-card-unit {
    padding: 0 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: hsl(210, 40%, 96%);
    align-self: stretch;
    display: flex;
    align-items: center;
}

/* ─────────────────────────────────────────────────────────────
   LV Day 1 / Day 2 Toggle (Weight/Timing/Avg/Meter wrap)
   ───────────────────────────────────────────────────────────── */
.lv-day-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: 14px;
    background: linear-gradient(135deg, hsl(224, 60%, 96%) 0%, hsl(224, 76%, 97%) 100%);
    border: 1px solid hsl(224, 76%, 88%);
    border-radius: 10px;
    flex-wrap: wrap;
}
.lv-day-nav.hidden { display: none; }
.lv-day-nav-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.lv-day-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1.5px solid hsl(224, 76%, 80%);
    background: #fff;
    color: var(--primary-dark);
    border-radius: 999px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.lv-day-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.lv-day-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(50, 70, 200, 0.25);
}
.lv-day-btn.has-error {
    border-color: var(--danger);
}
.lv-day-btn.has-error:not(.active) {
    color: var(--danger);
}
.lv-day-hint {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
    margin-left: auto;
}
.lv-day-pane-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 14px;
    padding: 8px 12px;
    background: hsl(224, 60%, 97%);
    border-radius: 6px;
    border-left: 3px solid var(--primary);
}
.lv-day-pane-hint strong { color: var(--primary-dark); }

/* ─────────────────────────────────────────────────────────────
   LV Meter Sub-tab
   ───────────────────────────────────────────────────────────── */
.meter-category {
    margin-bottom: 28px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: hsl(224, 30%, 98%);
}
.meter-cat-heading {
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 14px;
    letter-spacing: 0.3px;
    padding-bottom: 6px;
    border-bottom: 1.5px solid var(--border);
}

.meter-heads-picker {
    margin-bottom: 14px;
}
.meter-picker-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.meter-heads-checklist {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}
.meter-head-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border: 1.5px solid var(--border);
    background: #fff;
    border-radius: 999px;
    font-size: 12px;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.12s ease;
    font-family: inherit;
}
.meter-head-chip:hover { border-color: var(--primary); }
.meter-head-chip.selected {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 600;
}
.meter-head-chip.custom {
    background: hsl(38, 70%, 95%);
    border-color: hsl(38, 70%, 80%);
}
.meter-head-chip.custom.selected {
    background: hsl(38, 80%, 50%);
    border-color: hsl(38, 80%, 50%);
}

.meter-add-custom-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.meter-add-custom-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border: 1px dashed var(--primary);
    background: rgba(99, 102, 241, 0.05);
    color: var(--primary);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    align-self: flex-start;
    font-family: inherit;
    transition: all 0.12s ease;
}
.meter-add-custom-btn:hover { background: rgba(99, 102, 241, 0.12); }
.meter-custom-input-row {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
}
.meter-custom-input {
    flex: 1;
    max-width: 260px;
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
}
.meter-custom-input:focus { outline: none; border-color: var(--primary); }
.meter-custom-add-confirm,
.meter-custom-add-cancel {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    transition: all 0.12s ease;
}
.meter-custom-add-confirm { background: var(--primary); color: #fff; }
.meter-custom-add-confirm:hover { background: var(--primary-dark); }
.meter-custom-add-cancel {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}
.meter-custom-add-cancel:hover { background: rgba(220, 38, 38, 0.2); }

.meter-table-wrap {
    overflow-x: auto;
    margin-bottom: 14px;
}
.meter-grid {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    font-size: 12.5px;
}
.meter-grid thead th {
    background: var(--primary-dark);
    color: #fff;
    font-weight: 600;
    text-align: left;
    padding: 10px 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.meter-grid tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.meter-grid tbody tr:last-child td { border-bottom: none; }
.meter-grid tbody tr.meter-empty-row td {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 18px 12px;
}
.meter-head-name { font-weight: 600; color: var(--text-main); }

.meter-reading-input-wrap {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    max-width: 160px;
}
.meter-reading-input-wrap:focus-within { border-color: var(--primary); }
.meter-reading-input {
    width: 90px;
    padding: 6px 8px;
    border: none;
    font-size: 12.5px;
    font-family: inherit;
}
.meter-reading-input:focus { outline: none; }
.meter-reading-suffix {
    padding: 0 8px;
    font-size: 11px;
    color: var(--text-muted);
    background: hsl(224, 30%, 96%);
    align-self: stretch;
    display: flex;
    align-items: center;
    border-left: 1px solid var(--border);
}
.meter-consumption-cell {
    font-weight: 700;
    color: var(--primary-dark);
}
.meter-consumption-warn {
    display: block;
    font-size: 10.5px;
    color: hsl(38, 80%, 35%);
    margin-top: 2px;
    font-weight: 500;
    font-style: italic;
}

.meter-supporting {
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}
.meter-supporting-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.meter-supporting-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.meter-photo-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}
.meter-photo-thumb {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #fff;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}
.meter-photo-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,.65);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s;
    font-family: inherit;
}
.meter-photo-remove:hover { background: var(--danger); }
.meter-photo-thumb.uploading {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 10px;
    font-style: italic;
    background: hsl(224, 30%, 96%);
}
.meter-photo-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px dashed var(--primary);
    background: rgba(99, 102, 241, 0.05);
    color: var(--primary);
    border-radius: 7px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.12s ease;
}
.meter-photo-add-btn:hover { background: rgba(99, 102, 241, 0.12); }

.meter-day-summary-err {
    background: hsl(0, 84%, 95%);
    border: 1.5px solid hsl(0, 84%, 80%);
    color: var(--danger);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12.5px;
    font-weight: 500;
    margin-top: 18px;
}

@media (max-width: 700px) {
    .lv-day-hint { display: none; }
    .meter-reading-input { width: 70px; }
}

/* Coming Soon stub */
.lv-coming-soon {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
    font-size: 14px;
}
.lv-coming-soon .cs-icon { font-size: 36px; margin-bottom: 12px; opacity: 0.3; }
.lv-coming-soon p { margin: 0; }

/* ─────────────────────────────────────────────────────────────
   LV → Manpower Sub-tab
   ───────────────────────────────────────────────────────────── */
.mp-block { margin-bottom: 18px; }

.mp-question-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: 0.2px;
}

.mp-pill-group {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}
.mp-pill {
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}
.mp-pill:hover { border-color: var(--primary); color: var(--primary); }
.mp-pill.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 600;
}

.mp-mgr-details { margin-top: 8px; }

.mp-mgr-blocks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 6px;
}
#mp_mgr_blocks_same { grid-template-columns: 1fr; }

.mp-detail-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    background: rgba(99, 102, 241, 0.025);
}

.mp-detail-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
    letter-spacing: 0.3px;
}

.mp-field-row {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.mp-ctc-row { margin-bottom: 0; }

.mp-field {
    flex: 1;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mp-field-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.mp-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    transition: border-color 0.15s ease;
    box-sizing: border-box;
}
.mp-input:focus { outline: none; border-color: var(--primary); }

.mp-input-prefix-wrap {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.15s ease;
}
.mp-input-prefix-wrap:focus-within { border-color: var(--primary); }
.mp-input-prefix {
    padding: 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(99, 102, 241, 0.06);
    align-self: stretch;
    display: flex;
    align-items: center;
    border-right: 1px solid var(--border);
}
.mp-input-prefix-wrap .mp-input {
    border: none;
    border-radius: 0;
    flex: 1;
    min-width: 0;
}
.mp-input-prefix-wrap .mp-input:focus { outline: none; }

.mp-input-suffix-wrap {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.15s ease;
}
.mp-input-suffix-wrap:focus-within { border-color: var(--primary); }
.mp-input-suffix {
    padding: 0 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(99, 102, 241, 0.06);
    align-self: stretch;
    display: flex;
    align-items: center;
    border-left: 1px solid var(--border);
    white-space: nowrap;
}
.mp-input-suffix-wrap .mp-input {
    border: none;
    border-radius: 0;
    flex: 1;
    min-width: 0;
}
.mp-input-suffix-wrap .mp-input:focus { outline: none; }

.mp-headcount-block { margin-top: 18px; }
.mp-headcount-input { max-width: 280px; margin-top: 4px; }
.mp-helper-text {
    font-size: 11px;
    font-style: italic;
    color: var(--text-muted);
    margin-top: 4px;
}

.mp-employees-section { margin-top: 22px; }

.mp-sub-heading {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

.mp-emp-card {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    background: rgba(99, 102, 241, 0.025);
    margin-bottom: 10px;
}

.mp-emp-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
    letter-spacing: 0.3px;
}

.mp-emp-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}
.mp-emp-remove-btn:hover { background: rgba(220, 38, 38, 0.2); }

.mp-emp-fields {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}
.mp-emp-fields .mp-field { min-width: 0; }

/* Inline "Add Custom Role" input row inside Role field */
.mp-role-custom-row {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
}
.mp-role-custom-input {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    min-width: 0;
}
.mp-role-custom-input:focus { outline: none; border-color: var(--primary); }
.mp-role-custom-add-btn,
.mp-role-custom-cancel-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: inherit;
    transition: all 0.12s ease;
}
.mp-role-custom-add-btn {
    background: var(--primary);
    color: #fff;
}
.mp-role-custom-add-btn:hover { background: var(--primary-dark, hsl(224, 80%, 22%)); }
.mp-role-custom-cancel-btn {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}
.mp-role-custom-cancel-btn:hover { background: rgba(220, 38, 38, 0.2); }

.mp-emp-fresher-row {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
}
.mp-emp-fresher-row .mp-question-label { margin-bottom: 0; font-size: 12px; }
.mp-emp-fresher-row .mp-pill { padding: 5px 11px; font-size: 11px; }

.mp-add-emp-btn {
    margin-top: 6px;
    padding: 9px 16px;
    border: 1px dashed var(--primary);
    background: rgba(99, 102, 241, 0.05);
    color: var(--primary);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    transition: all 0.15s ease;
}
.mp-add-emp-btn:hover { background: rgba(99, 102, 241, 0.12); }

/* ─────────────────────────────────────────────────────────────
   Pre-Req Monthly Occupancy migration banner
   ───────────────────────────────────────────────────────────── */
.prereq-mig-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
    background: hsl(38, 100%, 96%);
    border: 1px solid hsl(38, 80%, 78%);
    border-left: 4px solid hsl(38, 90%, 50%);
    border-radius: 8px;
    font-size: 12.5px;
    color: hsl(38, 70%, 24%);
    line-height: 1.55;
}
.prereq-mig-banner.hidden { display: none; }
.prereq-mig-banner-icon {
    flex-shrink: 0;
    color: hsl(38, 90%, 50%);
    margin-top: 1px;
}
.prereq-mig-banner-body { flex: 1; }
.prereq-mig-banner-body strong { color: hsl(38, 80%, 30%); }
.prereq-mig-banner-close {
    background: none;
    border: none;
    color: hsl(38, 50%, 50%);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    margin-left: 6px;
    flex-shrink: 0;
    transition: color 0.12s;
    font-family: inherit;
}
.prereq-mig-banner-close:hover { color: hsl(38, 90%, 35%); }

.mp-headcount-reminder {
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    border: 1px solid;
}
.mp-headcount-reminder.warn {
    background: #fef3c7;
    border-color: #fbbf24;
    color: #92400e;
}
.mp-headcount-reminder.ok {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

@media (max-width: 980px) {
    .mp-emp-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .mp-mgr-blocks { grid-template-columns: 1fr; }
    .mp-emp-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mp-field-row { gap: 8px; }
    .mp-field { min-width: 120px; }
}
@media (max-width: 480px) {
    .mp-emp-fields { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════
 * WEIGHT RECORD — Category accordion + Batch cards
 * ═══════════════════════════════════════════════════════════════════ */
.wr-cat {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    margin-bottom: 12px;
    overflow: hidden;
}
.wr-cat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: hsl(210, 40%, 97%);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
}
.wr-cat-head:hover { background: hsl(210, 40%, 94%); }
.wr-cat-chevron {
    width: 14px; height: 14px;
    color: var(--text-muted);
    transition: transform 0.15s;
    flex-shrink: 0;
}
.wr-cat.collapsed .wr-cat-chevron { transform: rotate(-90deg); }
.wr-cat-name {
    flex: 1;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-main);
    background: transparent;
    border: none;
    padding: 4px 0;
    font-family: inherit;
}
.wr-cat-name:focus { outline: none; box-shadow: inset 0 -2px 0 var(--primary); }
.wr-cat-count {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
}
.wr-cat-del {
    background: transparent;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}
.wr-cat-del:hover { background: hsl(0, 70%, 95%); }
.wr-cat-body { padding: 12px; }
.wr-cat.collapsed .wr-cat-body { display: none; }

.wr-batches { display: flex; flex-direction: column; gap: 10px; }
.wr-batch {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: hsl(210, 40%, 99%);
    padding: 12px;
    position: relative;
}
.wr-batch-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 10px;
    align-items: end;
}
.wr-batch-label {
    grid-column: span 2;
    font-weight: 700;
    color: var(--primary);
    font-size: 13px;
    align-self: center;
    padding-top: 4px;
}
.wr-batch-load,
.wr-batch-machine,
.wr-batch-status,
.wr-batch-time {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.wr-batch-load { grid-column: span 3; }
.wr-batch-machine { grid-column: span 3; }
.wr-batch-status { grid-column: span 2; }
.wr-batch-time { grid-column: span 2; }
.wr-batch .wr-mini-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
}
.wr-batch input,
.wr-batch select {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    background: var(--surface);
    color: var(--text-main);
    width: 100%;
}
.wr-batch input:focus,
.wr-batch select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px hsla(var(--primary-hsl), 0.1);
}
.wr-batch input.wr-required-missing {
    border-color: var(--danger);
    background: hsl(0, 80%, 99%);
}
.wr-batch-time-row {
    display: flex;
    gap: 6px;
    align-items: center;
}
.wr-batch-time-row input { width: 56px; text-align: center; }
.wr-batch-time-row .wr-unit {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}
.wr-batch-load-row {
    display: flex;
    gap: 6px;
    align-items: center;
}
.wr-batch-load-row .wr-unit {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}
.wr-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    min-height: 32px;
    background: hsl(210, 40%, 96%);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.wr-status-pill.optimal {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}
.wr-status-pill.underloaded {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}
.wr-status-pill.overloaded {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}
.wr-batch-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}
.wr-batch-remove:hover {
    background: hsl(0, 70%, 95%);
    color: var(--danger);
    border-color: #fca5a5;
}
.wr-batch-warn {
    color: var(--danger);
    font-size: 11px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}
.wr-batch-warn.hidden { display: none; }

/* Supporting docs row inside a batch */
.wr-batch-docs {
    grid-column: span 12;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding-top: 6px;
    border-top: 1px dashed var(--border);
    margin-top: 4px;
}
.wr-docs-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding-top: 6px;
    white-space: nowrap;
}
.wr-docs-thumbs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}
.wr-doc-thumb {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}
.wr-doc-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.wr-doc-thumb-x {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    border: none;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    padding: 0;
}
.wr-doc-add {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    border: 2px dashed var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.wr-doc-add:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.wr-doc-add.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.wr-docs-help {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

.wr-add-batch-btn {
    margin-top: 10px;
    background: transparent;
    color: var(--primary);
    border: 1px dashed var(--primary);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
}
.wr-add-batch-btn:hover {
    background: hsla(var(--primary-hsl), 0.05);
}

@media (max-width: 900px) {
    .wr-batch-grid { grid-template-columns: repeat(6, 1fr); }
    .wr-batch-label { grid-column: span 6; }
    .wr-batch-load,
    .wr-batch-machine,
    .wr-batch-status,
    .wr-batch-time { grid-column: span 3; }
}
@media (max-width: 600px) {
    .wr-batch-load,
    .wr-batch-machine,
    .wr-batch-status,
    .wr-batch-time { grid-column: span 6; }
}

/* Meter photo action buttons — Upload + Capture side by side */
.meter-photo-actions {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.meter-photo-capture-btn {
    /* Slightly tinted variant to distinguish from Upload */
    background: hsla(var(--primary-hsl), 0.06);
    border-color: hsla(var(--primary-hsl), 0.25);
    color: var(--primary);
}
.meter-photo-capture-btn:hover {
    background: hsla(var(--primary-hsl), 0.12);
}

/* Weight Record per-batch supporting docs: add a small camera button next
 * to the "+ Add" tile. Both live inside .wr-docs-thumbs. */
.wr-doc-capture {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    border: 2px dashed hsla(var(--primary-hsl), 0.4);
    background: hsla(var(--primary-hsl), 0.04);
    color: var(--primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
}
.wr-doc-capture svg, .wr-doc-capture i {
    width: 20px;
    height: 20px;
}
.wr-doc-capture:hover {
    background: hsla(var(--primary-hsl), 0.1);
    border-color: var(--primary);
}
.wr-doc-capture.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════════════════
 * MOBILE RESPONSIVE PASS
 *
 * Single additive block. Only @media rules — desktop styles are untouched.
 * Breakpoints:
 *   ≤ 900px : tablets / large phones in portrait
 *   ≤ 640px : phones
 *   ≤ 420px : very narrow phones (iPhone SE etc.)
 * ═══════════════════════════════════════════════════════════════════════ */

/* ── Inputs: 16px font on mobile prevents iOS auto-zoom on focus ────── */
@media (max-width: 900px) {
    .form-control,
    .op-time-input,
    .time12-input,
    .wr-batch input,
    .wr-batch select,
    .wr-cat-name,
    .preview-table input,
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    input[type="tel"],
    input[type="date"],
    input[type="time"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* ── Container padding shrinks on mobile, full-bleed body ───────────── */
@media (max-width: 680px) {
    body { padding: 0; }
    .form-panel { padding: 0 12px; }
    .panel-header {
        padding: 14px 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .section-card {
        padding: 14px 12px;
        border-radius: 8px;
        margin-bottom: 12px;
    }
    .form-group { margin-bottom: 10px; }
}

/* ── Buttons get min-44px tap targets ───────────────────────────────── */
@media (max-width: 680px) {
    .btn,
    .lv-day-btn,
    .lv-subtab-btn,
    .ampm-btn,
    .wr-add-batch-btn,
    .meter-photo-add-btn {
        min-height: 44px;
        padding-top: 10px;
        padding-bottom: 10px;
    }
    .btn-sm { min-height: 36px; }
}

/* ── Tables wrap in horizontal scroll so they never break layout ────── */
@media (max-width: 900px) {
    .lv-table-wrap,
    #lv_weight_table_wrap,
    #lv_timing_table_wrap,
    #lv_avg_grid_wrap,
    .preview-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .lv-grid,
    .preview-table {
        font-size: 12.5px;
    }
    .lv-grid th,
    .lv-grid td {
        white-space: nowrap;
        padding: 6px 8px;
    }
    /* Hint scrollability with a subtle shadow on the right edge */
    .lv-table-wrap,
    #lv_timing_table_wrap {
        background:
            linear-gradient(to right, var(--surface, #fff) 30%, rgba(255,255,255,0)),
            linear-gradient(to left, var(--surface, #fff) 30%, rgba(255,255,255,0)) 100% 0,
            radial-gradient(farthest-side at 0 50%, rgba(0,0,0,0.15), rgba(0,0,0,0)),
            radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,0.15), rgba(0,0,0,0)) 100% 0;
        background-repeat: no-repeat;
        background-size: 30px 100%, 30px 100%, 14px 100%, 14px 100%;
        background-attachment: local, local, scroll, scroll;
    }
}

/* ── Monthly Occupancy table: keep all 4 columns but allow horizontal scroll ── */
@media (max-width: 680px) {
    #prereq_monthly_occ_tbody,
    table.prereq-monthly-table {
        font-size: 13px;
    }
}

/* ── Sub-Meter status grid: 2×2 → stacked single column on phones ───── */
@media (max-width: 700px) {
    .submeter-grid { gap: 8px !important; }
    .submeter-row { padding: 10px 12px; }
}

/* ── Pre-Req KPI tiles row stacks on mobile ─────────────────────────── */
@media (max-width: 680px) {
    .kpi-row,
    .kpi-three-up {
        flex-direction: column;
    }
    .kpi-tile,
    .kpi-card {
        width: 100% !important;
        max-width: none !important;
    }
}

/* ── Sub-tab navigation: horizontal scroll instead of wrap ──────── */
@media (max-width: 900px) {
    .lv-subtab-nav,
    .subtab-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding-bottom: 4px;
        margin-bottom: 8px;
    }
    .lv-subtab-btn,
    .subtab-btn {
        flex: 0 0 auto;
        white-space: nowrap;
    }
}

/* ── Day 1 / Day 2 toggle: full width on phones ─────────────────────── */
@media (max-width: 680px) {
    #lvDayNav,
    .lv-day-nav {
        width: 100%;
    }
    .lv-day-btn {
        flex: 1 1 0;
        min-width: 0;
    }
}

/* ── Time-picker widget wraps cleanly ───────────────────────────────── */
@media (max-width: 680px) {
    .time12-widget {
        gap: 8px;
        width: 100%;
    }
    .time12-input { width: 100%; max-width: 180px; }
    .ampm-toggle {
        margin-left: 0;
        flex: 0 0 auto;
    }
    .ampm-btn {
        padding: 10px 18px;
        font-size: 14px;
    }
    .op-time-row {
        flex-direction: column;
        gap: 12px;
    }
    .op-time-field {
        width: 100%;
    }
}

/* ── Weight Record batch grid stacks more aggressively on phones ────── */
@media (max-width: 680px) {
    .wr-batch { padding: 10px; }
    .wr-batch-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .wr-batch-label,
    .wr-batch-load,
    .wr-batch-machine,
    .wr-batch-status,
    .wr-batch-time,
    .wr-batch-docs {
        grid-column: 1 / -1;
    }
    .wr-batch-docs {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .wr-batch-remove { top: 6px; right: 6px; }
    .wr-cat-head { padding: 10px 12px; }
    .wr-cat-name { font-size: 14px; }
}

/* ── LV Measurement header stacks on mobile ──────────────────────────── */
@media (max-width: 680px) {
    .lv-meas-header {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .lv-day-nav-label {
        font-size: 12px;
    }
    .section-title-main {
        font-size: 15px;
    }
    #step3 .section-card {
        overflow-x: visible;
        word-wrap: break-word;
    }
    /* Avg Weight cards: tighten on small screens */
    .lv-avg-card { padding: 10px; }
    .lv-avg-card-weights { gap: 8px; }

    /* Timing Record tables: sticky Machine column at 100px */
    .lv-label-col {
        min-width: 100px !important;
        max-width: 100px !important;
        width: 100px !important;
        position: sticky;
        left: 0;
        z-index: 2;
        background: #fff;
    }
    .lv-label-col.lv-th {
        background: var(--primary-dark);
        z-index: 3;
    }
    #lv_timing_table_wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .lv-grid {
        min-width: 580px;
    }
}

/* ── Swipe hint for timing tables (mobile only) ──────────────────────── */
.lv-swipe-hint { display: none; }
@media (max-width: 680px) {
    .lv-swipe-hint {
        display: block;
        text-align: center;
        font-size: 11px;
        color: var(--text-muted);
        font-style: italic;
        margin: 4px 0 8px;
    }
}

/* ── Meter photo action row stacks on narrow phones ─────────────────── */
@media (max-width: 480px) {
    .meter-photo-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .meter-photo-add-btn { justify-content: center; }
}

/* ── Multiselect dropdowns: full-width on phones ────────────────────── */
@media (max-width: 680px) {
    .multiselect-trigger,
    .multiselect-dropdown,
    [class*="multiselect"] {
        width: 100%;
        max-width: none;
    }
}

/* ── Tables in the live preview wrap if too wide ────────────────────── */
@media (max-width: 680px) {
    .preview-table {
        display: block;
        overflow-x: auto;
    }
    .preview-table thead, .preview-table tbody { display: table; min-width: 100%; }
}

/* ── Generic two-col / three-col grids stack ────────────────────────── */
@media (max-width: 680px) {
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    .form-group.full-width {
        grid-column: span 1 !important;
    }
    [style*="grid-template-columns: 1fr 1fr"]:not(.lv-grid),
    [style*="grid-template-columns:1fr 1fr"]:not(.lv-grid) {
        grid-template-columns: 1fr !important;
    }
    [style*="grid-template-columns: repeat(3,"]:not(.lv-grid),
    [style*="grid-template-columns:repeat(3,"]:not(.lv-grid) {
        grid-template-columns: 1fr !important;
    }
}

/* ── Avoid layout jank from x-overflow on body ──────────────────────── */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

/* ── Login card on small phones ─────────────────────────────────────── */
@media (max-width: 480px) {
    .login-card { padding: 24px 18px !important; }
    .login-wrap { padding: 16px !important; }
}

/* ── Admin dashboard tables: horizontal scroll ──────────────────────── */
@media (max-width: 900px) {
    .admin-table-wrap,
    table.admin-table {
        overflow-x: auto;
        display: block;
    }
}

/* ── Slightly smaller section headings on narrow screens ────────────── */
@media (max-width: 680px) {
    .section-title {
        font-size: 14px !important;
        margin-top: 18px !important;
        margin-bottom: 10px !important;
    }
    .panel-title { font-size: 18px !important; }
}

/* ── Pending (offline-queued) photos ───────────────────────────────── */
.meter-photo-thumb.pending {
    position: relative;
    box-shadow: 0 0 0 2px #f59e0b inset;
}
.meter-photo-pending-badge {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: rgba(245, 158, 11, 0.92);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    pointer-events: none;
}
.wr-doc-thumb.pending {
    box-shadow: 0 0 0 2px #f59e0b inset;
}
.wr-doc-pending-badge {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.92);
    color: white;
    font-size: 14px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    pointer-events: none;
    animation: wr-pending-spin 1.5s linear infinite;
}
@keyframes wr-pending-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════════════════
 * COMPREHENSIVE MOBILE RESPONSIVE PASS — v2 (priority fix)
 *
 * Spec-driven block. Single source of truth for mobile behavior across
 * Pre-Requisite, Data Capturing, Load Verification, and Admin Dashboard.
 *
 * Breakpoints:
 *   <= 1024px : tablets / small laptops
 *   <= 768px  : phones (primary target)
 *   <= 480px  : narrow phones (iPhone SE, small Androids)
 *
 * Desktop styles above these breakpoints are completely untouched.
 * CSS-only — no JS layout logic added.
 * ═══════════════════════════════════════════════════════════════════════ */

/* ── TABLET (<= 1024px) — 2-column where 3-col was used ─────────── */
@media (max-width: 1024px) {
    .form-grid[style*="grid-template-columns: 1fr 1fr 1fr"],
    .form-grid[style*="grid-template-columns:1fr 1fr 1fr"] {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* ── MOBILE (<= 768px) — single column, full-width inputs ──────── */
@media (max-width: 768px) {
    /* A. Layout container & page chrome */
    html, body { max-width: 100vw; overflow-x: hidden; }
    body { padding: 0; }
    .app-main { flex-direction: column; }
    .form-panel, .preview-panel {
        max-width: 100%; width: 100%; padding: 0 16px;
    }
    .panel-header {
        padding: 14px 16px;
        flex-direction: column;
        align-items: flex-start !important;
        gap: 8px;
    }
    .panel-title { font-size: 18px !important; }
    .panel-subtitle { font-size: 13px; line-height: 1.5; }
    .section-card {
        padding: 16px 14px;
        margin-bottom: 14px;
        border-radius: 10px;
    }

    /* B. Top brand header — never overflow the screen */
    .app-header {
        flex-wrap: wrap;
        padding: 10px 14px;
        gap: 8px;
        max-height: 15vh;
    }
    .app-header .logo-area {
        flex: 1 1 auto;
        min-width: 0;
        gap: 8px;
    }
    .app-header .logo-area img {
        height: 32px !important;
    }
    .app-header .logo-area > div {
        padding-left: 8px !important;
        margin-left: 4px !important;
        min-width: 0;
        overflow: hidden;
    }
    .app-header .logo-area span {
        font-size: 11px !important;
        letter-spacing: 0.3px !important;
        line-height: 1.2 !important;
        white-space: normal;
        display: inline-block;
    }
    .app-header a[href="/admin"] {
        padding: 6px 10px !important;
        font-size: 11px !important;
        flex-shrink: 0;
    }

    /* C. Form rows — every multi-col grid collapses to 1 col */
    .form-grid,
    .form-grid[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        row-gap: 12px;
        column-gap: 0;
    }
    .form-group { margin-bottom: 0; }
    .form-group.full-width { grid-column: 1 / -1; }

    /* D. Inputs / selects / textareas — 16px font, 48px min height */
    .form-control,
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    input[type="tel"],
    input[type="date"],
    input[type="time"],
    select,
    textarea,
    .time12-input,
    .op-time-input,
    .wr-batch input,
    .wr-batch select,
    .wr-cat-name {
        font-size: 16px !important;
        min-height: 48px !important;
        width: 100% !important;
        padding: 12px 14px !important;
        box-sizing: border-box;
    }
    textarea { min-height: 96px !important; }
    .form-group label, .form-label {
        display: block !important;
        font-size: 12px !important;
        margin-bottom: 6px !important;
    }
    .form-group .helper,
    .form-group .form-hint,
    .form-group span[style*="font-size: 10px"],
    .form-group span[style*="font-size:10px"] {
        font-size: 12px !important;
        line-height: 1.5;
    }

    /* E. Buttons — full width, 48px min */
    .btn,
    .btn-primary, .btn-secondary, .btn-success,
    .btn-submit-form, .btn-save-form,
    .btn-pdf, .btn-excel {
        min-height: 48px;
        font-size: 16px;
        padding: 12px 18px;
    }
    .btn-sm { min-height: 40px; font-size: 14px; }
    .panel-footer .btn,
    .form-footer .btn,
    button[type="submit"] {
        width: 100%;
    }
    /* Keep tiny icon-only buttons compact. */
    .delete-prereq-model-btn,
    .lv-del-row-btn,
    .pdc-chem-remove,
    .wr-batch-remove,
    .wr-cat-del,
    .wr-doc-thumb-x {
        min-height: 32px !important;
        width: 32px;
        padding: 4px !important;
    }

    /* F. Toggle switches & rows */
    .toggle-switch { transform: scale(1.05); }
    .toggle-row,
    .toggle-row-group .toggle-row { padding: 14px; }
    .toggle-row-label {
        font-size: 14px;
        line-height: 1.4;
        padding-right: 8px;
    }

    /* G. Tabs — horizontally scrollable */
    .form-tabs,
    .subtab-nav,
    .lv-subtab-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding-bottom: 6px;
    }
    .tab-btn, .subtab-btn, .lv-subtab-btn {
        flex: 0 0 auto;
        white-space: nowrap;
        min-height: 44px;
        padding: 10px 14px;
        font-size: 13px;
    }

    /* H. Day 1 / Day 2 toggle (LV) — full width 50/50 */
    #lvDayNav, .lv-day-nav { width: 100%; display: flex; }
    .lv-day-btn {
        flex: 1 1 0;
        min-width: 0;
        min-height: 48px;
        font-size: 14px;
    }

    /* I. Tables — horizontal scroll within own container */
    .lv-table-wrap,
    #lv_weight_table_wrap,
    #lv_weight_cats_wrap,
    #lv_timing_table_wrap,
    #lv_avg_grid_wrap,
    .preview-table-wrap,
    .admin-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        max-width: 100%;
    }
    .lv-grid {
        font-size: 12.5px;
        min-width: 580px;
    }
    .lv-grid th, .lv-grid td {
        padding: 8px;
        white-space: nowrap;
    }

    /* J. Monthly Occupancy table — card per row */
    #prereq_monthly_occ_tbody tr {
        display: block;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 10px;
        margin-bottom: 10px;
        padding: 10px;
    }
    #prereq_monthly_occ_tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 8px 4px !important;
        border-bottom: 1px dashed var(--border);
    }
    #prereq_monthly_occ_tbody td:last-child { border-bottom: none; }
    #prereq_monthly_occ_tbody td::before {
        content: attr(data-label);
        font-size: 11px;
        font-weight: 700;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.4px;
        flex: 0 0 auto;
    }
    table.prereq-monthly-table thead,
    .monthly-occ-table thead,
    #prereq_monthly_occ_wrap thead { display: none; }
    #prereq_monthly_occ_tbody td input {
        flex: 1 1 0;
        min-width: 0;
        text-align: right;
    }

    /* K. Sub-Meter rows — stack vertically */
    .submeter-row-wrap { padding: 0; }
    .submeter-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px;
        padding: 14px;
    }
    .submeter-label {
        font-size: 14px;
        font-weight: 700;
        line-height: 1.4;
    }
    .submeter-row .submeter-toggle-wrap,
    .submeter-row .submeter-working-wrap {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }
    .submeter-na-chip {
        width: 90%;
        justify-content: center;
        min-height: 44px;
    }

    /* L. Pre-Req KPI tiles — stack vertically */
    .kpi-row,
    .kpi-three-up {
        flex-direction: column !important;
        gap: 10px;
    }
    .kpi-tile,
    .kpi-card {
        width: 100% !important;
        max-width: none !important;
        min-height: 80px;
    }

    /* M. Linen chip grid — 2 per row */
    #prereq_linen_list,
    .linen-chip-grid {
        grid-template-columns: 1fr 1fr !important;
    }
    .linen-chip {
        font-size: 13px;
        min-height: 44px;
    }

    /* N. Machine Type multiselect — stack trigger + custom button */
    #machine_type_multiselect,
    #prereq_machine_type_multiselect,
    [id*="machine_type_multiselect"] {
        width: 100%;
    }
    [id*="machine_type_multiselect"] + button,
    #prereq_add_custom_machine_type_btn,
    #add_custom_machine_type_btn {
        width: 100% !important;
        margin-top: 8px;
    }
    .form-group:has(#prereq_machine_type_multiselect),
    .form-group:has(#machine_type_multiselect) {
        display: flex;
        flex-direction: column;
    }
    .multiselect-trigger,
    .multiselect-dropdown {
        width: 100%;
        min-height: 48px;
    }
    .multiselect-option {
        padding: 12px 16px !important;
        font-size: 14px !important;
        min-height: 44px;
    }

    /* O. Time-picker widget — stack vertically */
    .op-time-row {
        flex-direction: column !important;
        gap: 14px;
    }
    .op-time-field { width: 100%; }
    .time12-widget {
        gap: 10px;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
    .time12-input-wrap { width: 100%; }
    .time12-input { width: 100% !important; max-width: none; }
    .ampm-toggle {
        margin-left: 0;
        width: 100%;
    }
    .ampm-btn {
        flex: 1 1 0;
        min-height: 48px;
        padding: 12px 18px;
        font-size: 15px;
    }

    /* P. Weight Record batch cards — all fields stack */
    .wr-cat { margin-bottom: 14px; }
    .wr-cat-head {
        padding: 12px 14px;
        gap: 10px;
    }
    .wr-cat-name { font-size: 14px; }
    .wr-batch { padding: 14px; }
    .wr-batch-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    .wr-batch-label,
    .wr-batch-load,
    .wr-batch-machine,
    .wr-batch-status,
    .wr-batch-time,
    .wr-batch-docs {
        grid-column: 1 / -1 !important;
    }
    .wr-batch-docs {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .wr-doc-thumb,
    .wr-doc-add,
    .wr-doc-capture {
        width: 80px !important;
        height: 80px !important;
    }
    .meter-photo-thumb {
        width: 80px !important;
        height: 80px !important;
    }

    /* Q. Section 3 Chemical cards — stack rows */
    .pdc-chem-card .form-grid {
        grid-template-columns: 1fr !important;
        row-gap: 10px;
    }
    .pdc-chem-card { padding: 14px !important; }

    /* R. Section 5 Sub-Meter rows (DC) — stack toggles */
    .pdc-submeter-row > div:first-child {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }
    .pdc-sm-toggles {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100%;
    }
    .pdc-sm-toggles label {
        padding: 10px;
        min-height: 44px;
        background: hsl(210, 40%, 98%);
        border: 1px solid var(--border);
        border-radius: 8px;
    }
    .pdc-sm-details {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }
    .pdc-sm-mf-wrap {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .pdc-sm-mf-wrap input { width: 100% !important; }

    /* S. Manpower / Employee cards (LV) */
    .mp-mgr-blocks { grid-template-columns: 1fr !important; }
    .mp-emp-fields { grid-template-columns: 1fr !important; }
    .mp-emp-card { padding: 14px; }

    /* T. Modals & dropdowns — near full screen */
    .modal, .modal-content, .dialog, .overlay-dialog {
        max-width: 100vw;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
    }
    .overlay-card { width: 100% !important; max-width: 100% !important; }

    /* U. Admin dashboard */
    .admin-table { font-size: 13px; }
    .admin-table-wrap.cardify table,
    .admin-table-wrap.cardify tbody,
    .admin-table-wrap.cardify tr,
    .admin-table-wrap.cardify td {
        display: block;
        width: 100%;
    }
    .admin-table-wrap.cardify thead { display: none; }
    .admin-table-wrap.cardify tr {
        border: 1px solid var(--border);
        border-radius: 10px;
        margin-bottom: 10px;
        padding: 12px;
    }
    .admin-table-wrap.cardify td {
        padding: 6px 0;
        border: none;
        text-align: left;
    }

    /* V. Linen chip / pill components */
    .multiselect-option,
    .submeter-na-chip,
    .meter-head-chip {
        min-height: 44px;
        padding: 10px 14px;
        font-size: 14px;
    }

    /* W. Live Preview Panel */
    .preview-panel { padding: 16px; }
    .preview-table { font-size: 12px; }
    .preview-table th,
    .preview-table td { padding: 8px; }

    /* X. Status badges */
    #autosaveStatus,
    .autosave-status {
        font-size: 12px;
        padding: 8px 12px;
    }

    /* Y. Section headings */
    .section-title,
    h3.section-title {
        font-size: 18px !important;
        line-height: 1.4 !important;
        margin-top: 24px !important;
        margin-bottom: 12px !important;
    }

    /* Z. Body text */
    body, p {
        font-size: 14px;
        line-height: 1.5;
    }
    .form-group p,
    .form-group small,
    .helper, .hint {
        font-size: 12px;
        line-height: 1.5;
    }
}

/* ── NARROW PHONES (<= 480px) ─────────────────────────────────────── */
@media (max-width: 480px) {
    .panel-header { padding: 12px 14px; }
    .section-card { padding: 14px 12px; }
    .form-panel { padding: 0 12px; }

    /* Brand header gets aggressive */
    .app-header .logo-area > div {
        border-left-width: 1px !important;
        padding-left: 6px !important;
        margin-left: 2px !important;
    }
    .app-header .logo-area span {
        font-size: 10px !important;
    }
    .app-header a[href="/admin"] span {
        display: none;
    }

    /* Cards tighter */
    .wr-batch { padding: 12px; }
    .pdc-chem-card { padding: 12px !important; }
    .section-card { border-radius: 8px; }
    .lv-grid { font-size: 12px; }
    .lv-grid th, .lv-grid td { padding: 6px; }

    .ampm-btn {
        font-size: 14px;
        padding: 10px 14px;
    }

    .wr-doc-thumb,
    .wr-doc-add,
    .wr-doc-capture,
    .meter-photo-thumb { width: 76px !important; height: 76px !important; }
}
