/* Modern Design System - 2025 */
:root {
  /* Colors - shadcn/ui inspired palette */
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --card: 0 0% 100%;
  --card-foreground: 240 10% 3.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 240 10% 3.9%;
  --primary: 221.2 83.2% 53.3%;
  --primary-foreground: 210 40% 98%;
  --secondary: 210 40% 96%;
  --secondary-foreground: 222.2 84% 4.9%;
  --muted: 210 40% 96%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --accent: 210 40% 96%;
  --accent-foreground: 222.2 84% 4.9%;
  --destructive: 0 72.2% 50.6%;
  --destructive-foreground: 210 40% 98%;
  --border: 214.3 31.8% 91.4%;
  --input: 214.3 31.8% 91.4%;
  --ring: 221.2 83.2% 53.3%;
  
  /* Spacing - 8px grid system */
  --space-1: 0.25rem; /* 4px */
  --space-2: 0.5rem;  /* 8px */
  --space-3: 0.75rem; /* 12px */
  --space-4: 1rem;    /* 16px */
  --space-5: 1.25rem; /* 20px */
  --space-6: 1.5rem;  /* 24px */
  --space-8: 2rem;    /* 32px */
  --space-10: 2.5rem; /* 40px */
  --space-12: 3rem;   /* 48px */
  --space-16: 4rem;   /* 64px */
  --space-20: 5rem;   /* 80px */
  
  /* Border radius */
  --radius-sm: 0.375rem;
  --radius: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  
  /* Typography scale */
  --text-xs: 0.75rem;   /* 12px */
  --text-sm: 0.875rem;  /* 14px */
  --text-base: 1rem;    /* 16px */
  --text-lg: 1.125rem;  /* 18px */
  --text-xl: 1.25rem;   /* 20px */
  --text-2xl: 1.5rem;   /* 24px */
  --text-3xl: 1.875rem; /* 30px */
  --text-4xl: 2.25rem;  /* 36px */
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Dark mode support */
[data-theme="dark"] {
  --background: 240 10% 3.9%;
  --foreground: 0 0% 98%;
  --card: 240 10% 3.9%;
  --card-foreground: 0 0% 98%;
  --popover: 240 10% 3.9%;
  --popover-foreground: 0 0% 98%;
  --primary: 221.2 83.2% 53.3%;
  --primary-foreground: 210 40% 98%;
  --secondary: 240 3.7% 15.9%;
  --secondary-foreground: 0 0% 98%;
  --muted: 240 3.7% 15.9%;
  --muted-foreground: 240 5% 64.9%;
  --accent: 240 3.7% 15.9%;
  --accent-foreground: 0 0% 98%;
  --destructive: 0 62.8% 30.6%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 3.7% 15.9%;
  --input: 240 3.7% 15.9%;
  --ring: 221.2 83.2% 53.3%;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    line-height: 1.6;
    font-size: var(--text-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-6);
}

/* Header */
header {
    margin-bottom: var(--space-8);
    padding: var(--space-6);
    background: linear-gradient(135deg, hsl(var(--primary)) 0%, hsl(var(--primary) / 0.9) 100%);
    color: hsl(var(--primary-foreground));
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    border: 1px solid hsl(var(--border) / 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title {
    display: flex;
    align-items: center;
}

.header-title > div {
    margin-left: 1rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-8);
    gap: var(--space-8);
}

.header-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
    flex: 0 0 auto;
}

.header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1 1 auto;
}

.header-user {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-3);
    flex: 0 0 auto;
}

.header-left .header-logo {
    height: 40px;
    width: auto;
    margin-bottom: 5px;
}

.logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    margin-right: 15px;
}

.logo-link:hover {
    text-decoration: none;
    color: inherit;
    opacity: 0.9;
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

.logo-link:visited {
    color: inherit;
}

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

.text-logo {
    display: inline;
    margin-right: 15px;
    font-size: 20px;
    font-weight: bold;
    color: #1976d2;
}

/* Mobile Menu Styles */
.mobile-menu-toggle {
    display: none;
}

.hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hamburger-line {
    width: 24px;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.mobile-menu-overlay.active {
    display: flex;
    justify-content: flex-end;
}

.mobile-menu-content {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    width: 280px;
    height: 100%;
    padding: 20px;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 20px;
}

.mobile-menu-header span {
    color: white;
    font-weight: 500;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: white;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
    width: 100%;
    text-align: left;
}

.mobile-menu-item:hover {
    background: rgba(255, 255, 255, 0.2);
}

.menu-icon {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

/* Schedule Table Mobile Optimization */
.day-short {
    display: none;
}

.day-full {
    display: inline;
}

#back-to-receiving {
    margin-right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

#back-to-receiving:hover {
    background: rgba(255, 255, 255, 0.3);
}

.header-title h1 {
    font-size: var(--text-4xl);
    font-weight: 700;
    margin-bottom: var(--space-3);
    letter-spacing: -0.025em;
}

.header-title p {
    font-size: var(--text-lg);
    opacity: 0.9;
    font-weight: 500;
}

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

.header-user span {
    font-weight: 500;
    font-size: 1.1em;
}

.header-user button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.header-user button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Admin Interface Styles */
.admin-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
    border-radius: 10px;
}

.admin-section {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.admin-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 2px solid #f1f5f9;
}

.admin-tab-btn {
    background: none;
    border: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    color: #64748b;
}

.admin-tab-btn.active {
    color: #1976d2;
    border-bottom-color: #1976d2;
}

.admin-tab-btn:hover {
    color: #1976d2;
    background: #f8fafc;
}

.admin-tab-content {
    display: none;
}

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

.debug-section {
    padding: 20px;
}

.debug-actions {
    margin: 20px 0;
}

.debug-actions button {
    margin-right: 10px;
    margin-bottom: 10px;
}

.debug-results {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-top: 20px;
    font-family: monospace;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
}

.roles-grid {
    display: grid;
    gap: 2rem;
}

.roles-section h3 {
    margin-bottom: 1rem;
    color: #1e293b;
    font-size: 1.25rem;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkbox-group label:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.checkbox-group input[type="checkbox"] {
    margin: 0;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
}

/* Navigation badge */
.nav-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.375rem;
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1;
  color: hsl(var(--primary-foreground));
  background: hsl(var(--primary));
  border-radius: 9999px;
  margin-left: auto;
  white-space: nowrap;
    font-weight: 500;
}

.status-active {
    background: #dcfce7;
    color: #16a34a;
}

.status-inactive {
    background: #fef2f2;
    color: #dc2626;
}

.twofa-enabled {
    color: #16a34a;
    font-weight: 500;
}

.twofa-disabled {
    color: #64748b;
}

.user-actions {
    display: flex;
    gap: 0.5rem;
}

.user-actions button {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-actions .btn-edit {
    color: #1976d2;
    border-color: #4f46e5;
}

.user-actions .btn-edit:hover {
    background: #4f46e5;
    color: white;
}

.user-actions .btn-deactivate {
    color: #dc2626;
    border-color: #dc2626;
}

.user-actions .btn-deactivate:hover {
    background: #dc2626;
    color: white;
}

.permission-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.permission-tag {
    background: #e0e7ff;
    color: #4338ca;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    margin-bottom: 30px;
    background: white;
    border-radius: 10px;
    padding: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.tab-button:hover {
    background-color: #f0f0f0;
}

.tab-button.active {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

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

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

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    border-left: 4px solid #667eea;
}

.card h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.3em;
}

#stats-content {
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2.5em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.actions {
    text-align: center;
    margin-top: 30px;
}

.actions .btn {
    margin: 0 10px;
}

/* Toolbar */
.toolbar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.filter-select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    min-width: 150px;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}

/* Sortable table headers */
th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s ease;
}

th.sortable:hover {
    background: #e9ecef;
    color: #343a40;
}

th.sortable:active {
    background: #dee2e6;
}

.sort-indicator {
    font-weight: bold;
    color: #667eea;
    font-size: 14px;
}

th.sort-asc {
    background: #e3f2fd;
    color: #1976d2;
}

th.sort-desc {
    background: #e8f5e8;
    color: #2e7d2e;
}

tr:hover {
    background-color: #f8f9fa;
}

.loading {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px;
}

/* Schedule Grid */
.schedule-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.date-navigation {
    display: flex;
    align-items: center;
    gap: 20px;
}

#current-period {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
}

.schedule-grid {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

/* Emphasize pickup/delivery toggle */
.view-toggle {
    display: flex;
    gap: 8px;
    background: rgba(25, 118, 210, 0.1);
    border: 1px solid rgba(25, 118, 210, 0.2);
    border-radius: 999px;
    padding: 4px;
}

.view-toggle .toggle-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    color: #0d47a1;
}

.view-toggle .toggle-option input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #1976d2;
    position: relative;
}

.view-toggle .toggle-option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 6px;
    height: 6px;
    background: #1976d2;
    border-radius: 50%;
}

.view-toggle .toggle-option:has(input[type="radio"]:checked) {
    background: #1976d2;
    color: white;
}

.schedule-header {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    background: #667eea;
    color: white;
}

.schedule-header > div {
    padding: 20px;
    text-align: center;
    font-weight: 600;
    border-right: 1px solid rgba(255,255,255,0.2);
}

.schedule-week {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    min-height: 120px;
}

.schedule-day {
    border-right: 1px solid #eee;
    border-bottom: 1px solid #eee;
    padding: 15px;
    position: relative;
}

.schedule-day:hover {
    background-color: #f8f9fa;
}

.day-header {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.delivery-item {
    background: #e3f2fd;
    border-left: 3px solid #2196f3;
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 4px;
    font-size: 0.85em;
    cursor: pointer;
}

.delivery-item:hover {
    background: #bbdefb;
}

.delivery-item .delivery-actions {
    margin-top: 6px;
    display: flex;
    justify-content: flex-end;
}

.delivery-item .trash-btn {
    background: transparent;
    border: none;
    color: #d32f2f;
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
}

.delivery-item .trash-btn:hover {
    color: #b71c1c;
}

.delivery-vendor {
    font-weight: 600;
    color: #1976d2;
}

.delivery-po {
    color: #666;
    font-size: 0.8em;
}

/* Overdue PO styling */
.late-item {
    background: #ffebee !important;
    border-left: 3px solid #f44336 !important;
}

.late-item:hover {
    background: #ffcdd2 !important;
}

.old-item {
    background: #fff8e1 !important;
    border-left: 3px solid #ff9800 !important;
}

.old-item:hover {
    background: #ffecb3 !important;
}

.late-badge {
    color: #d32f2f;
    font-weight: 600;
    font-size: 0.85em;
}

.old-badge {
    color: #f57c00;
    font-weight: 600;
    font-size: 0.85em;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

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

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
}

/* Status badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
    text-transform: uppercase;
}

.status-g {
    background: #e8f5e8;
    color: #2e7d2e;
}

.status-h {
    background: #fff3cd;
    color: #856404;
}

.scheduled {
    background: #d4edda;
    color: #155724;
}

.not-scheduled {
    background: #f8d7da;
    color: #721c24;
}

/* Scheduling specific styles */
.scheduling-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.scheduling-header h2 {
    margin-bottom: 10px;
    font-size: 1.8em;
}

.scheduling-header p {
    opacity: 0.9;
    font-size: 1em;
}

.overdue {
    color: #dc3545;
    font-weight: 600;
    background: #f8d7da;
    padding: 2px 6px;
    border-radius: 4px;
}

.on-time {
    color: #28a745;
    font-weight: 600;
    background: #d4edda;
    padding: 2px 6px;
    border-radius: 4px;
}

.po-checkbox {
    transform: scale(1.2);
    cursor: pointer;
}

#select-all-scheduling {
    transform: scale(1.2);
    cursor: pointer;
}

.partial-indicator {
    font-size: 0.8em;
    color: #667eea;
    font-weight: 500;
    background: #e3f2fd;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
}

/* Late deliveries specific styles */
.late-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.late-header h2 {
    margin-bottom: 10px;
    font-size: 1.8em;
}

.late-header p {
    opacity: 0.9;
    font-size: 1em;
}

.late-row {
    background-color: #fff5f5;
}

.late-row:hover {
    background-color: #fed7d7;
}

.days-late {
    color: #dc3545;
    font-weight: 700;
    background: #f8d7da;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.9em;
}

.delivery-notes {
    font-style: italic;
    color: #6c757d;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.late-checkbox {
    transform: scale(1.2);
    cursor: pointer;
}

#select-all-late {
    transform: scale(1.2);
    cursor: pointer;
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #212529;
    border: none;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #e0a800 0%, #e8590c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4);
}

/* Status badge colors for different statuses */
.status-a {
    background: #fff3cd;
    color: #856404;
}

.status-b {
    background: #d1ecf1;
    color: #0c5460;
}

.status-c {
    background: #d4edda;
    color: #155724;
}

.status-d {
    background: #ffeaa7;
    color: #856404;
}

.status-e {
    background: #e2e3e5;
    color: #495057;
}

.status-f {
    background: #f8d7da;
    color: #721c24;
}

/* Responsive */
/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .container {
        padding: 10px;
        max-width: 100%;
    }
    
    /* Header Mobile */
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
        gap: 1rem;
    }
    
    .header-left {
        align-items: center;
        flex-direction: row;
        gap: 10px;
    }
    
    .header-left .header-logo {
        height: 35px;
        margin-bottom: 0;
        margin-right: 10px;
    }
    
    .header-center {
        flex: 1;
        text-align: center;
    }
    
    .header-center p {
        display: none; /* Hide description on mobile */
    }
    
    .header-user {
        display: none; /* Hide on mobile, replaced by hamburger */
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    #back-to-receiving {
        display: none; /* Hide back button on mobile, moved to hamburger menu */
    }
    
    /* Schedule Table Mobile */
    .day-full {
        display: none;
    }
    
    .day-short {
        display: inline;
        font-size: 0.9rem;
        font-weight: bold;
    }
    
    .schedule-header {
        font-size: 0.8rem;
    }
    
    .schedule-header > div {
        padding: 8px 4px;
    }
    
    .schedule-week > div {
        padding: 8px 4px;
        font-size: 0.75rem;
    }
    
    .delivery-item {
        padding: 4px;
        margin: 2px 0;
        font-size: 0.7rem;
    }
    
    /* Schedule table container for horizontal scroll if needed */
    .schedule-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    #schedule-grid {
        min-width: 320px;
    }
    
    .header-title > div {
        margin-left: 0;
        margin-top: 0.5rem;
    }
    
    .header-title h1 {
        font-size: 1.8rem;
        margin-bottom: 5px;
    }
    
    .header-title p {
        font-size: 0.9rem;
    }
    
    #back-to-receiving {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    /* Navigation Mobile */
    .nav-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .tab-button {
        font-size: 0.9rem;
        padding: 0.75rem;
    }
    
    /* Toolbar Mobile */
    .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .search-input {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Schedule Mobile */
    .schedule-toolbar {
        flex-direction: column;
        gap: 15px;
    }
    
    .date-navigation {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    #current-period {
        font-size: 0.9rem;
        text-align: center;
        width: 100%;
        order: -1;
        margin-bottom: 0.5rem;
    }
    
    /* Dashboard Mobile */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Tables Mobile */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
        font-size: 0.85rem;
    }
    
    th, td {
        padding: 0.5rem 0.25rem;
        white-space: nowrap;
    }
    
    /* Modal Mobile */
    .modal-content {
        margin: 5% auto;
        width: 95%;
        max-width: none;
        padding: 15px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .form-actions button {
        width: 100%;
    }
    
    /* Stats Mobile */
    .stat {
        text-align: center;
        padding: 0.5rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    /* Actions Mobile */
    .actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .actions button {
        width: 100%;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .container {
        padding: 5px;
    }
    
    .header-title h1 {
        font-size: 1.5rem;
    }
    
    .header-title p {
        font-size: 0.8rem;
    }
    
    .header-left .header-logo {
        height: 30px;
        margin-bottom: 6px;
    }
    
    /* Extra small mobile schedule optimization */
    .schedule-header {
        font-size: 0.7rem;
    }
    
    .schedule-header > div {
        padding: 6px 2px;
    }
    
    .schedule-week > div {
        padding: 6px 2px;
        font-size: 0.65rem;
    }
    
    .delivery-item {
        padding: 3px;
        margin: 1px 0;
        font-size: 0.6rem;
    }
    
    .day-short {
        font-size: 0.8rem;
    }
    
    .tab-button {
        font-size: 0.8rem;
        padding: 0.6rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }
    
    table {
        font-size: 0.75rem;
        min-width: 500px;
    }
    
    .modal-content {
        margin: 2% auto;
        width: 98%;
        padding: 10px;
    }
}

/* NetSuite PO link styling */
.po-link {
    color: #1976d2;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

.po-link:hover {
    color: #0d47a1;
    text-decoration: none;
    border-bottom: 1px solid #1976d2;
    cursor: pointer;
}

.po-link:visited {
    color: #5e35b1;
}

/* Ensure PO links work well in tables */
td .po-link {
    display: inline-block;
}

/* External link icon for PO links */
.po-link::after {
    content: ' ↗';
    font-size: 0.8em;
    opacity: 0.6;
    margin-left: 2px;
}

/* Priority badge minimal */
.pri-badge{display:inline-flex;align-items:center;gap:.25rem;border-radius:9999px;padding:.125rem .5rem;font-size:12px;font-weight:600}
.pri-high{background:#dcfce7;color:#166534;box-shadow:0 0 0 1px #86efac inset}
.pri-med{background:#fef3c7;color:#92400e;box-shadow:0 0 0 1px #fcd34d inset}
.pri-low{background:#fee2e2;color:#991b1b;box-shadow:0 0 0 1px #fca5a5 inset}
