/* ==========================================================================
   DESIGN SYSTEM & VARIABLES - ACCESSIBLE LIGHT THEME (ELDERLY FRIENDLY)
   ========================================================================== */
:root {
    /* Bright Theme Color Palette */
    --bg-main: #f1f5f9;      /* Light gray background */
    --bg-card: #ffffff;      /* Pure white cards for maximum contrast */
    --bg-card-hover: #f8fafc;
    --bg-header: rgba(255, 255, 255, 0.9);
    --border-color: #cbd5e1;  /* Visible gray borders */
    --border-hover: #94a3b8;
    
    /* Text Colors - High Contrast Slate */
    --text-primary: #0f172a;    /* Deep slate (almost black) for text readability */
    --text-secondary: #334155;  /* Dark slate for secondary text */
    --text-muted: #475569;      /* Slate for muted text (kept dark enough for contrast) */
    
    /* Action Colors - Deepened for high contrast on light backgrounds */
    --primary: #3730a3;         /* Deep indigo (excellent contrast) */
    --primary-light: #4338ca;
    --primary-glow: rgba(79, 70, 229, 0.08);
    
    --success: #065f46;         /* Deep forest green for approval */
    --success-light: #047857;
    --success-glow: rgba(5, 150, 105, 0.08);
    
    --warning: #92400e;         /* Deep amber for pending status */
    --warning-light: #b45309;
    --warning-glow: rgba(217, 119, 6, 0.08);
    
    --danger: #991b1b;          /* Deep crimson red for reject */
    --danger-light: #b91c1c;
    --danger-glow: rgba(220, 38, 38, 0.08);

    --vendor-a: #be185d;        /* Deep Pink */
    --vendor-b: #0891b2;        /* Deep Cyan */
    
    /* Layout Constants */
    --header-height: 75px;
    --border-radius-lg: 12px;
    --border-radius-md: 8px;
    --border-radius-sm: 4px;
    --shadow-premium: 0 4px 20px -2px rgba(0, 0, 0, 0.1), 0 2px 8px -1px rgba(0, 0, 0, 0.06);
    --transition-smooth: all 0.2s ease-in-out;
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    font-size: 16px; /* Increased base size for readability */
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: #e2e8f0;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==========================================================================
   HEADER / NAVIGATION
   ========================================================================== */
.app-header {
    height: var(--header-height);
    background-color: var(--bg-header);
    backdrop-filter: blur(12px);
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

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

.logo-icon {
    background: linear-gradient(135deg, var(--primary), var(--success));
    width: 44px;
    height: 44px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.2);
    color: white;
}

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

.logo-text h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--primary);
}

.logo-text span {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.view-toggles {
    background: #e2e8f0;
    border: 1px solid var(--border-color);
    padding: 4px;
    border-radius: var(--border-radius-md);
    display: flex;
    gap: 4px;
}

.toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 700;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

.toggle-btn svg {
    width: 18px;
    height: 18px;
}

.toggle-btn:hover {
    color: var(--primary);
    background: rgba(255,255,255,0.5);
}

.toggle-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(55, 48, 163, 0.25);
}

/* Button Classes - Bold and high-contrast */
.action-btn {
    border: none;
    padding: 12px 22px;
    border-radius: var(--border-radius-md);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-smooth);
    border: 1.5px solid transparent;
}

.action-btn svg {
    width: 18px;
    height: 18px;
}

.outline-btn {
    background: white;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
}

.outline-btn:hover {
    border-color: var(--text-primary);
    background: var(--bg-main);
}

.success-btn {
    background: var(--success);
    color: white;
}
.success-btn:hover {
    background: var(--success-light);
    box-shadow: 0 4px 12px rgba(6, 95, 70, 0.2);
}

.danger-btn {
    background: var(--danger);
    color: white;
}
.danger-btn:hover {
    background: var(--danger-light);
    box-shadow: 0 4px 12px rgba(153, 27, 27, 0.2);
}

/* ==========================================================================
   LAYOUT STRUCTURES (SPLIT VIEW)
   ========================================================================== */
.simulation-container {
    margin-top: var(--header-height);
    flex: 1;
    display: flex;
    width: 100vw;
    height: calc(100vh - var(--header-height));
    overflow: hidden;
}

/* Layout Mode Classes */
.simulation-container.only-admin .mobile-panel {
    display: none !important;
}
.simulation-container.only-admin .admin-panel {
    width: 100% !important;
}

.simulation-container.only-mobile .admin-panel {
    display: none !important;
}
.simulation-container.only-mobile .mobile-panel {
    width: 100% !important;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Left Admin Dashboard View */
.admin-panel {
    width: 65%;
    padding: 30px;
    overflow-y: auto;
    border-right: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.panel-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 26px;
    font-weight: 800;
    color: var(--primary);
}

.panel-header p {
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    margin-top: 4px;
}

/* Right Mobile Device Frame Panel */
.mobile-panel {
    width: 35%;
    background: #e2e8f0; /* Lighter background for split layout frame */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    padding: 20px;
}

/* ==========================================================================
   ADMIN: STATS CARDS & PROGRESS
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-card {
    background-color: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-premium);
    transition: var(--transition-smooth);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 26px;
    height: 26px;
}

/* Accent bg adjusted for high readability */
.pending-icon { background: #fef3c7; color: #b45309; }   /* Light Amber / Dark Amber text */
.approved-icon { background: #d1fae5; color: #047857; }  /* Light Green / Dark Green text */
.rejected-icon { background: #fee2e2; color: #b91c1c; }  /* Light Red / Dark Red text */
.total-icon { background: #e0e7ff; color: #4338ca; }     /* Light Blue / Dark Blue text */

.stat-details .stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 700;
}

.stat-details .stat-value {
    font-size: 28px;
    font-weight: 800;
    margin-top: 2px;
    color: var(--text-primary);
}

/* Vendor Performance Metrics */
.vendor-performance-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.vendor-card {
    background-color: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-premium);
}

.vendor-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
}

#vendor-a-perf::before { background: var(--vendor-a); }
#vendor-b-perf::before { background: var(--vendor-b); }

.vendor-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 15px;
}

.vendor-a-badge { background: #fce7f3; color: var(--vendor-a); }
.vendor-b-badge { background: #ecfeff; color: var(--vendor-b); }

.progress-bar-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}

.progress-track {
    background: #e2e8f0;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #cbd5e1;
}

.progress-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.8s ease-in-out;
}

#vendor-a-progress { background: var(--vendor-a); }
#vendor-b-progress { background: var(--vendor-b); }

.progress-value {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    align-self: flex-end;
    margin-top: -4px;
}

.jobs-summary-pills {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.pill-mini {
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 700;
    border: 1px solid transparent;
}

.pill-mini.approved { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.pill-mini.rejected { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }

/* ==========================================================================
   ADMIN: FILTER BAR
   ========================================================================== */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    padding: 14px 20px;
    border-radius: var(--border-radius-lg);
    gap: 20px;
    box-shadow: var(--shadow-premium);
}

.search-input-wrapper {
    position: relative;
    flex: 1;
}

.search-input-wrapper svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

.search-input-wrapper input {
    width: 100%;
    background: #f8fafc;
    border: 2px solid var(--border-color);
    padding: 12px 14px 12px 44px;
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    outline: none;
    transition: var(--transition-smooth);
}

.search-input-wrapper input:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.filter-selects {
    display: flex;
    gap: 12px;
}

.filter-selects select {
    background: #f8fafc;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 12px 18px;
    border-radius: var(--border-radius-md);
    font-size: 15px;
    font-weight: 700;
    outline: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.filter-selects select:focus {
    background: white;
    border-color: var(--primary);
}

/* ==========================================================================
   ADMIN: TABLE OF REPORTS
   ========================================================================== */
.table-container {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow-x: auto;
    box-shadow: var(--shadow-premium);
}

.reports-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.reports-table th, .reports-table td {
    padding: 18px 20px;
    border-bottom: 2px solid #e2e8f0;
}

.reports-table th {
    background-color: #f8fafc;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
}

.reports-table tbody tr {
    transition: var(--transition-smooth);
}

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

/* Table Custom Cells */
.cleaner-name-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cleaner-name-cell strong {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 700;
}

.vendor-tag-inline {
    font-size: 11px;
    font-weight: 800;
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    width: fit-content;
}

.vendor-tag-inline.v-a { background: #fce7f3; color: var(--vendor-a); border: 1px solid #fbcfe8; }
.vendor-tag-inline.v-b { background: #ecfeff; color: var(--vendor-b); border: 1px solid #cffafe; }

.area-cell {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
}

.time-cell {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
}

/* Before After Thumbnails */
.photos-thumbnail-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.thumb-wrapper {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    border: 2px solid var(--border-color);
    background: #f1f5f9;
}

.thumb-tag {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    font-size: 10px;
    font-weight: 800;
    text-align: center;
    padding: 2px 0;
    color: white;
}

.thumb-tag.bef { background: #c2410c; } /* darker orange-red */
.thumb-tag.aft { background: #047857; }

/* Status Badges - Solid and bright for clear visual contrast */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 800;
    border: 1.5px solid transparent;
}

.status-badge.status-pending { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.status-badge.status-approved { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.status-badge.status-rejected { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }

.status-badge svg {
    width: 16px;
    height: 16px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
    gap: 15px;
}

.empty-state svg {
    width: 54px;
    height: 54px;
}

/* ==========================================================================
   RIGHT: PHONE SIMULATOR FRAME
   ========================================================================== */
.phone-frame {
    width: 380px; /* Increased slightly for larger layout view */
    height: 740px;
    background: #000;
    border: 14px solid #1e293b; /* slate frame look */
    border-radius: 44px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 4px #cbd5e1;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Notch & Details */
.phone-speaker {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 5px;
    background: #334155;
    border-radius: 3px;
    z-index: 20;
}

.phone-camera {
    position: absolute;
    top: 8px;
    left: calc(50% + 50px);
    width: 8px;
    height: 8px;
    background: #334155;
    border-radius: 50%;
    z-index: 20;
}

.phone-home-indicator {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 130px;
    height: 5px;
    background: #94a3b8;
    border-radius: 3px;
    z-index: 20;
}

/* Status Bar */
.phone-status-bar {
    height: 38px;
    padding: 0 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
    font-weight: 800;
    color: #1e293b;
    z-index: 10;
}

.phone-status-icons {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Screen Shell */
.phone-screen {
    flex: 1;
    background: #f8fafc; /* Bright screen */
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
    padding-bottom: 20px;
}

/* Mobile App Header - High contrast bright */
.mobile-app-header {
    background: #ffffff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #cbd5e1;
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-weight: 800;
    font-size: 16px;
}

.mobile-logo svg {
    color: var(--success-light);
    width: 20px;
    height: 20px;
}

.vendor-indicator {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
}

.mobile-app-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mobile-banner {
    background: #f0fdf4; /* Pale green base */
    border: 2px solid #bbf7d0;
    border-radius: var(--border-radius-md);
    padding: 12px 14px;
}

.mobile-banner h4 {
    font-size: 15px;
    font-weight: 800;
    color: #065f46;
    margin-bottom: 4px;
}

.mobile-banner p {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
}

/* Form Styles for Elder Readability */
.mobile-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.form-group label {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.form-group select, .form-group textarea {
    background: #ffffff;
    border: 2px solid #cbd5e1;
    border-radius: var(--border-radius-md);
    padding: 12px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 700;
    outline: none;
    transition: var(--transition-smooth);
}

.form-group select {
    height: 48px; /* Easier to tap */
}

.form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-help {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

/* Preset Picker for simulation - Large buttons */
.preset-images-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 columns instead of 4 so buttons are MUCH bigger and easier to press */
    gap: 8px;
    margin-top: 4px;
}

.preset-btn {
    background: #ffffff;
    border: 2px solid #cbd5e1;
    border-radius: var(--border-radius-md);
    padding: 12px 8px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    font-weight: 700;
    text-align: center;
    transition: var(--transition-smooth);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.preset-btn:hover {
    border-color: var(--text-primary);
    background: #f1f5f9;
}

.preset-btn.active {
    background: #e0e7ff;
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 2px 5px rgba(79, 70, 229, 0.15);
}

/* Mobile Photo Columns */
.mobile-photos-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.photo-box-sim {
    background: #ffffff;
    border: 2px solid #cbd5e1;
    border-radius: var(--border-radius-md);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.photo-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    color: white;
    z-index: 2;
}

.tag-before { background: #b91c1c; }
.tag-after { background: #047857; }

.photo-preview-container {
    width: 100%;
    aspect-ratio: 1;
    background: #f1f5f9;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
}

.photo-preview-container svg {
    width: 100%;
    height: 100%;
}

.photo-info-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    background: #f1f5f9;
    padding: 6px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.photo-info-pill svg {
    width: 12px;
    height: 12px;
}

.submit-mobile-btn {
    background: linear-gradient(135deg, var(--success), #047857);
    color: white;
    border: none;
    padding: 15px; /* Bigger button size */
    border-radius: var(--border-radius-md);
    font-size: 16px; /* Larger text */
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-smooth);
    margin-top: 10px;
    box-shadow: 0 4px 10px rgba(6, 95, 70, 0.2);
}

.submit-mobile-btn:hover {
    background: #047857;
    filter: brightness(1.1);
}

.submit-mobile-btn svg {
    width: 18px;
    height: 18px;
}

/* Mobile Alert ReDo Notification - High contrast and bold text */
.mobile-alert-redo {
    background: #fef2f2;
    border: 2.5px solid #ef4444; /* thicker red border */
    border-radius: var(--border-radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: slideInUp 0.3s ease;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.15);
}

.alert-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #991b1b;
    font-size: 14px;
    font-weight: 800;
}

.alert-header svg {
    width: 18px;
    height: 18px;
}

.alert-header span {
    flex: 1;
}

.close-alert-btn {
    background: transparent;
    border: none;
    color: #991b1b;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
}

#mobile-redo-text {
    font-size: 13px; /* highly readable */
    font-weight: 700;
    color: #1e293b;
    line-height: 1.5;
}

/* Animations */
@keyframes slideInUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   ADMIN DETAIL / COMPARISON MODAL
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7); /* translucent slate overlay */
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 580px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

.modal-backdrop.open .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 22px 24px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.modal-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
}

.close-modal-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.close-modal-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-job-info {
    background: #f8fafc;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.info-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.info-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 800;
    text-transform: uppercase;
    display: block;
    margin-bottom: 2px;
}

.info-val {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid transparent;
}

.notes-block {
    border-top: 1.5px solid var(--border-color);
    padding-top: 12px;
}

.notes-content {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 4px;
}

.rejection-block {
    background: #fef2f2;
    border: 1.5px solid #fca5a5;
    padding: 12px;
    border-radius: var(--border-radius-sm);
    margin-top: 8px;
}

.text-danger {
    color: #b91c1c;
    font-weight: 700;
}

/* BEFORE AFTER SLIDER */
.comparison-container-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.comparison-hint {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.comparison-slider {
    width: 480px;
    height: 320px;
    position: relative;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    border: 2px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    user-select: none;
    cursor: ew-resize;
}

.image-before-container {
    width: 100%;
    height: 100%;
    background: #fff;
    position: absolute;
    top: 0;
    left: 0;
}

.image-before-container svg, .image-after-container svg {
    width: 480px;
    height: 320px;
    display: block;
}

.image-after-container {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--slider-pos, 50%);
    overflow: hidden;
    background: #fff;
    border-right: 3px solid var(--primary); /* thick Indigo divider line */
    z-index: 10;
}

.slider-img-label {
    position: absolute;
    bottom: 12px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 4px;
    color: white;
    z-index: 15;
}

.before-label { right: 12px; background: #b91c1c; }
.after-label { left: 12px; background: #047857; }

.slider-handle {
    position: absolute;
    top: 0;
    left: var(--slider-pos, 50%);
    width: 0;
    height: 100%;
    z-index: 20;
}

.handle-button {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border: 2.5px solid white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 0;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    color: white;
}

.handle-button svg {
    width: 20px;
    height: 20px;
}

/* Modal Actions */
.modal-actions {
    padding: 22px 24px;
    border-top: 2px solid var(--border-color);
    background: #f8fafc;
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

.standard-actions {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
}

.rejection-input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: fadeIn 0.2s ease;
}

.rejection-input-group label {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
}

.rejection-input-group input {
    background: white;
    border: 2px solid var(--border-color);
    padding: 12px;
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 700;
    outline: none;
}

.rejection-input-group input:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px var(--danger-glow);
}

.rejection-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

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

/* ==========================================================================
   TOAST SYSTEM
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2000;
}

.toast {
    background: white;
    border-left: 6px solid var(--primary);
    border-radius: var(--border-radius-md);
    padding: 16px 22px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 340px;
    border: 1.5px solid #cbd5e1;
    border-left-width: 6px;
    animation: slideInLeft 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.2);
    transition: var(--transition-smooth);
}

.toast svg {
    width: 24px;
    height: 24px;
}

.toast-info {
    flex: 1;
}

.toast-info h5 {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
}

.toast-info p {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 2px;
}

.toast.toast-success { border-left-color: #059669; }
.toast.toast-success svg { color: #059669; }

.toast.toast-warning { border-left-color: #d97706; }
.toast.toast-warning svg { color: #d97706; }

.toast.toast-danger { border-left-color: #dc2626; }
.toast.toast-danger svg { color: #dc2626; }

@keyframes slideInLeft {
    from { transform: translateX(-50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   RESPONSIVE OVERRIDES
   ========================================================================== */
@media (max-width: 1024px) {
    .simulation-container {
        flex-direction: column;
        overflow-y: auto;
        height: auto;
    }
    .admin-panel, .mobile-panel {
        width: 100% !important;
        overflow-y: visible;
        height: auto;
    }
    .mobile-panel {
        padding: 50px 20px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .vendor-performance-section {
        grid-template-columns: 1fr;
    }
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .comparison-slider {
        width: 100%;
        max-width: 320px;
        height: 220px;
    }
    .image-before-container svg, .image-after-container svg {
        width: 320px;
        height: 220px;
    }
}

/* ==========================================================================
   DAILY ROUTINE CHECKLIST & SIMULATOR EXTENSIONS (LIGHT THEME)
   ========================================================================== */
.mobile-role-selector {
    background: #ffffff;
    border: 2px solid var(--border-color);
    padding: 12px 14px;
    border-radius: var(--border-radius-md);
    margin-bottom: 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.mobile-role-selector label {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
}

.mobile-checklist-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-checklist-item {
    background: #ffffff;
    border: 2px solid var(--border-color);
    border-left: 6px solid #64748b; /* dynamic border color based on status */
    border-radius: var(--border-radius-md);
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    transition: var(--transition-smooth);
}

.mobile-checklist-item:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.mobile-checklist-item.status-not_started { border-left-color: #94a3b8; }
.mobile-checklist-item.status-pending { border-left-color: #d97706; }
.mobile-checklist-item.status-approved { border-left-color: #059669; }
.mobile-checklist-item.status-rejected { border-left-color: #dc2626; }

.task-info-block {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    padding-right: 10px;
}

.task-area-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
}

.task-meta-detail {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}

.task-action-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

/* Checklist specific status tags */
.status-badge.status-not_started {
    background: #f1f5f9;
    color: #475569;
    border-color: #cbd5e1;
}

/* Button styles for tasks */
.checklist-start-btn {
    background: var(--primary);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.2);
    transition: var(--transition-smooth);
}

.checklist-start-btn:hover {
    background: var(--primary-light);
    transform: scale(1.05);
}

/* Action button disabled state */
.action-btn:disabled {
    background: #e2e8f0 !important;
    border-color: #cbd5e1 !important;
    color: #94a3b8 !important;
    cursor: not-allowed;
    box-shadow: none !important;
    transform: none !important;
}

/* Visual cue for not started items in admin dashboard */
.not-started-row {
    background-color: rgba(248, 250, 252, 0.5);
}

.not-started-row td {
    color: #94a3b8;
}

.not-started-row .area-cell {
    color: #64748b;
}

.not-started-row .time-cell {
    color: #cbd5e1;
}

/* ==========================================================================
   NEW WORKFLOW LAYOUTS: LOGIN, MENU CARDS, AND DATE FILTER
   ========================================================================== */

/* Admin Menu Grid Home */
.admin-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.menu-card-box {
    background: #ffffff;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 26px 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.menu-card-box:hover:not(.disabled) {
    border-color: var(--primary-light);
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -8px rgba(79, 70, 229, 0.15);
}

.menu-card-icon {
    width: 54px;
    height: 54px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.menu-card-icon svg {
    width: 26px;
    height: 26px;
}

.menu-card-box h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.menu-card-box p {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
    flex: 1;
}

.menu-card-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 800;
    border-radius: 12px;
    background: #e0e7ff;
    color: #4338ca;
}

.menu-card-badge.locked {
    background: #f1f5f9;
    color: #475569;
}

.menu-card-box.disabled {
    opacity: 0.65;
    cursor: not-allowed;
    background: #f8fafc;
}

/* Date Filter styling */
.filter-group.date-filter-group input[type="date"] {
    height: 48px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 0 12px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
    background-color: white;
}

.filter-group.date-filter-group input[type="date"]:focus {
    border-color: var(--primary);
}

/* Mobile Screens Styles */
.mobile-layout-screen {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background: #f8fafc; /* high contrast light background for PWA style */
}

/* Login Screen Mobile */
.mobile-login-header {
    text-align: center;
    padding: 40px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mobile-logo-big {
    width: 68px;
    height: 68px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 15px;
    box-shadow: 0 8px 16px rgba(79, 70, 229, 0.2);
}

.mobile-logo-big svg {
    width: 32px;
    height: 32px;
}

.mobile-login-header h3 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.mobile-login-header p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 5px;
}

.form-group-mobile {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group-mobile label {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-muted);
}

.mobile-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.mobile-input-wrapper i, .mobile-input-wrapper svg {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.mobile-input-wrapper input {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 44px;
    border-radius: var(--border-radius-md);
    border: 2px solid var(--border-color);
    background: #ffffff;
    font-size: 14px;
    font-weight: 600;
    outline: none;
    color: var(--text-primary);
    transition: var(--transition-smooth);
}

.mobile-input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.demo-accounts-helper {
    margin: 25px 15px 0;
    padding: 12px 14px;
    background: #f1f5f9;
    border: 1.5px dashed var(--border-color);
    border-radius: var(--border-radius-md);
}

.demo-accounts-helper p {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    margin: 0 0 8px 0;
}

.demo-account-pills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.demo-pill {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    transition: var(--transition-smooth);
}

.demo-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f8fafc;
}

/* Mobile Menu Boxes Grid */
.mobile-profile-welcome {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 14px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.welcome-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-avatar svg {
    width: 22px;
    height: 22px;
}

.welcome-text h4 {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.welcome-text p {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    margin: 2px 0 0 0;
}

.mobile-section-heading {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

.mobile-menu-grid-boxes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 25px;
}

.mob-menu-box {
    background: #ffffff;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: var(--transition-smooth);
}

.mob-menu-box:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -5px rgba(79, 70, 229, 0.12);
}

.menu-box-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.menu-box-icon svg {
    width: 20px;
    height: 20px;
}

.mob-menu-box h5 {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.mob-menu-box p {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

.logout-mobile-btn {
    width: 100%;
    height: 44px;
    border-color: #fca5a5 !important;
    color: #dc2626 !important;
    font-weight: 800;
}

.logout-mobile-btn:hover {
    background: #fee2e2 !important;
}

/* Badge status */
.badge-status-neutral {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
    padding: 6px 12px;
    border-radius: 12px;
}
