/* ============================================
   NASTY COOKIE ERP - MAIN STYLESHEET
   ============================================ */

/* CSS Variables */
:root {
    --primary: #14b8a6;
    --primary-hover: #0d9488;
    --primary-light: #ccfbf1;
    --secondary: #6b7280;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;
    
    --bg-body: #f3f4f6;
    --bg-white: #ffffff;
    --bg-sidebar: #111827;
    --bg-card: #ffffff;
    --bg-hover: #f9fafb;
    
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --text-white: #ffffff;
    
    --border: #e5e7eb;
    --border-dark: #d1d5db;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    --sidebar-width: 260px;
    --header-height: 70px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-body);
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    color: var(--text-white);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

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

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

.logo i {
    font-size: 28px;
    color: #2dd4bf;
}

.logo span {
    font-size: 18px;
    font-weight: 700;
}

.toggle-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.6);
    transition: all 0.2s;
}

.toggle-btn:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar-menu {
    flex: 1;
    padding: 16px 0;
}

.menu-section {
    margin-bottom: 8px;
}

.section-title {
    display: block;
    padding: 8px 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.4);
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

.menu-item.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left-color: #2dd4bf;
}

.menu-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.menu-item span {
    font-size: 14px;
}

.back-to-hub {
    margin-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 16px;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #0f766e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
}

.user-details {
    flex: 1;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    display: block;
}

.user-role {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.top-header {
    height: var(--header-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
}

.breadcrumb {
    font-size: 13px;
    color: var(--text-secondary);
}

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

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-body);
    padding: 10px 16px;
    border-radius: var(--radius-lg);
    width: 280px;
}

.search-box i {
    color: var(--text-muted);
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    font-size: 14px;
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    position: relative;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: var(--bg-body);
    color: var(--text-primary);
}

.icon-btn .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: var(--radius-lg);
    transition: all 0.2s;
}

.user-profile:hover {
    background: var(--bg-body);
}

.user-profile .user-avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: white;
}

.user-profile span {
    font-weight: 500;
}

.user-profile i {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================
   CONTENT CONTAINER
   ============================================ */

.content-container {
    padding: 30px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* ============================================
   HUB / DASHBOARD
   ============================================ */

.hub-container {
    max-width: 1600px;
}

.hub-header {
    margin-bottom: 30px;
}

.hub-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.hub-header p {
    color: var(--text-secondary);
}

.nodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.nodes-grid.six-nodes {
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    white-space: nowrap;
}

.nodes-grid.six-nodes .node-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 16px;
    min-width: 0;
}

.nodes-grid.six-nodes .node-icon {
    width: 72px;
    height: 72px;
    font-size: 32px;
    margin-bottom: 12px;
}

.nodes-grid.six-nodes .node-content h3 {
    font-size: 16px;
    margin: 8px 0 6px;
}

.nodes-grid.six-nodes .node-content p {
    font-size: 12px;
    line-height: 1.3;
    margin-bottom: 12px;
}

.nodes-grid.six-nodes .node-stats {
    gap: 16px;
    margin-bottom: 12px;
}

.nodes-grid.six-nodes .stat-value {
    font-size: 20px;
}

.nodes-grid.six-nodes .stat-label {
    font-size: 11px;
}

.nodes-grid.six-nodes .node-alerts {
    font-size: 11px;
    padding: 6px 10px;
}

.node-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    gap: 20px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
    position: relative;
}

.node-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.node-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.node-icon.warehouse { background: #dbeafe; color: #2563eb; }
.node-icon.inbound { background: #d1fae5; color: #059669; }
.node-icon.outbound { background: #ffedd5; color: #ea580c; }
.node-icon.production { background: #ede9fe; color: #7c3aed; }
.node-icon.management { background: #fce7f3; color: #db2777; }
.node-icon.audit { background: #ccfbf1; color: #0d9488; }

.node-content {
    flex: 1;
}

.node-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
}

.node-content p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.node-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 12px;
}

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

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.node-alerts {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    padding: 8px 12px;
    border-radius: var(--radius);
}

.node-alerts.alert-warning {
    background: var(--warning-light);
    color: #92400e;
}

.node-alerts.alert-danger {
    background: var(--danger-light);
    color: #991b1b;
}

.node-arrow {
    position: absolute;
    right: 20px;
    bottom: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    opacity: 0;
    transition: all 0.2s;
}

.node-card:hover .node-arrow {
    opacity: 1;
    background: var(--primary);
    color: white;
}

/* ============================================
   MODULE HEADER
   ============================================ */

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.module-header h2 {
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.module-header h2 i {
    color: var(--primary);
}

.module-actions {
    display: flex;
    gap: 10px;
}

/* ============================================
   KPI CARDS
   ============================================ */

.kpi-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.kpi-icon.blue { background: var(--info-light); color: var(--info); }
.kpi-icon.green { background: var(--success-light); color: var(--success); }
.kpi-icon.orange { background: var(--warning-light); color: var(--warning); }
.kpi-icon.red { background: var(--danger-light); color: var(--danger); }

.kpi-info h4 {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
}

.kpi-change {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.kpi-change.up { color: var(--success); }
.kpi-change.down { color: var(--danger); }

/* ============================================
   TABLES
   ============================================ */

.table-container {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.table-header h3 {
    font-size: 16px;
    font-weight: 600;
}

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

.filter-bar input,
.filter-bar select {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    outline: none;
}

.filter-bar input:focus,
.filter-bar select:focus {
    border-color: var(--primary);
}

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

.data-table th,
.data-table td {
    padding: 14px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    background: var(--bg-hover);
}

.data-table tbody tr {
    cursor: pointer;
    transition: background 0.2s;
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

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

/* ============================================
   STATUS BADGES
   ============================================ */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-badge.draft { background: #f3f4f6; color: #6b7280; }
.status-badge.draft::before { background: #9ca3af; }

.status-badge.pending { background: var(--warning-light); color: #92400e; }
.status-badge.pending::before { background: var(--warning); }

.status-badge.approved { background: var(--info-light); color: #1e40af; }
.status-badge.approved::before { background: var(--info); }

.status-badge.sent { background: #e0e7ff; color: #3730a3; }
.status-badge.sent::before { background: #6366f1; }

.status-badge.partial { background: #ffedd5; color: #9a3412; }
.status-badge.partial::before { background: #f97316; }

.status-badge.received { background: var(--success-light); color: #065f46; }
.status-badge.received::before { background: var(--success); }

.status-badge.put-away { background: var(--success-light); color: #065f46; }
.status-badge.put-away::before { background: var(--success); }

.status-badge.qc-hold { background: var(--danger-light); color: #991b1b; }
.status-badge.qc-hold::before { background: var(--danger); }

.status-badge.incomplete { background: var(--warning-light); color: #92400e; }
.status-badge.incomplete::before { background: var(--warning); }

.status-badge.awaiting { background: #f3f4f6; color: #6b7280; }
.status-badge.awaiting::before { background: #9ca3af; }

.status-badge.qc-approved { background: var(--success-light); color: #065f46; }
.status-badge.qc-approved::before { background: var(--success); }

.status-badge.qc-rejected { background: var(--danger-light); color: #991b1b; }
.status-badge.qc-rejected::before { background: var(--danger); }

.status-badge.cancelled { background: var(--danger-light); color: #991b1b; }
.status-badge.cancelled::before { background: var(--danger); }

.status-badge.blocked { background: var(--danger-light); color: #991b1b; }
.status-badge.blocked::before { background: var(--danger); }

.status-badge.active { background: var(--success-light); color: #065f46; }
.status-badge.active::before { background: var(--success); }

.status-badge.inactive { background: #f3f4f6; color: #6b7280; }
.status-badge.inactive::before { background: #9ca3af; }

/* Status Tag (simpler inline version) */
.status-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-tag.status-draft { background: #f3f4f6; color: #6b7280; }
.status-tag.status-pending { background: #fef3c7; color: #92400e; }
.status-tag.status-approved { background: #dbeafe; color: #1e40af; }
.status-tag.status-completed { background: #d1fae5; color: #065f46; }
.status-tag.status-cancelled { background: #fee2e2; color: #991b1b; }
.status-tag.status-rejected { background: #fee2e2; color: #991b1b; }

/* ============================================
   BADGES
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.badge-success { background: var(--success-light); color: #065f46; }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-danger { background: var(--danger-light); color: #991b1b; }
.badge-info { background: var(--info-light); color: #1e40af; }
.badge-gray { background: #f3f4f6; color: #6b7280; }
.badge-secondary { background: #e5e7eb; color: #374151; }

/* QC Sub-status badges */
.badge-qc-pending { background: var(--warning-light); color: #92400e; border: 1px solid #fbbf24; }
.badge-qc-approved { background: var(--success-light); color: #065f46; border: 1px solid #34d399; }
.badge-qc-rejected { background: var(--danger-light); color: #991b1b; border: 1px solid #f87171; }

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--bg-body);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

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

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-xs {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius);
}

/* ============================================
   FORMS
   ============================================ */

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: all 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group input:read-only,
.form-group textarea:read-only,
.form-group input:disabled,
.form-group select:disabled {
    background: var(--bg-body);
    cursor: not-allowed;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* ============================================
   MODALS
   ============================================ */

/* ── Light-mode modal system ── */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
}

.modal-content {
    background: var(--bg-white, #ffffff);
    border-radius: var(--radius-lg, 12px);
    width: 90%;
    max-width: 640px;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0,0,0,0.08);
    animation: modalSlide 0.25s cubic-bezier(.22,.68,0,1.2);
    border: 1px solid var(--border, #e5e7eb);
}

@keyframes modalSlide {
    from { opacity: 0; transform: translateY(-14px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border, #e5e7eb);
    flex-shrink: 0;
    background: var(--bg-white, #ffffff);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #111827);
}

.modal-header h3 i {
    color: var(--primary, #14b8a6);
    margin-right: 8px;
}

.btn-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary, #6b7280);
    transition: all 0.15s;
    cursor: pointer;
    border: none;
    background: transparent;
    font-size: 16px;
}

.btn-close:hover {
    background: var(--bg-body, #f3f4f6);
    color: var(--text-primary, #111827);
}

.modal-body {
    padding: 22px 24px;
    overflow-y: auto;
    flex: 1;
    color: var(--text-primary, #111827);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 24px;
    border-top: 1px solid var(--border, #e5e7eb);
    flex-shrink: 0;
    background: var(--bg-body, #f9fafb);
}

/* Form elements inside modals */
.modal .form-group label,
.modal-body label {
    color: var(--text-primary, #111827);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 5px;
    display: block;
}

.modal .form-group input,
.modal .form-group select,
.modal .form-group textarea,
.modal-body input:not([type=range]),
.modal-body select,
.modal-body textarea {
    background: var(--bg-white, #ffffff);
    border: 1px solid var(--border, #e5e7eb);
    color: var(--text-primary, #111827);
    border-radius: var(--radius, 8px);
    padding: 9px 12px;
    font-size: 13px;
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
    font-family: inherit;
}

.modal .form-group input:focus,
.modal .form-group select:focus,
.modal .form-group textarea:focus,
.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
    outline: none;
    border-color: var(--primary, #14b8a6);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.modal .form-group input::placeholder,
.modal-body input::placeholder,
.modal-body textarea::placeholder {
    color: var(--text-muted, #9ca3af);
}

/* Section headings inside modal body */
.modal-body h4,
.modal-section-title {
    color: var(--text-secondary, #6b7280);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 600;
    margin: 16px 0 8px;
}

/* Info rows (label: value) */
.modal-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border, #e5e7eb);
    font-size: 13px;
}
.modal-info-row .label { color: var(--text-secondary, #6b7280); }
.modal-info-row .value { color: var(--text-primary, #111827); font-weight: 500; }

/* Tables inside modals */
.modal-body table th {
    color: var(--text-secondary, #6b7280);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 600;
    padding: 8px;
    border-bottom: 2px solid var(--border, #e5e7eb);
    background: transparent;
}

.modal-body table td {
    padding: 9px 8px;
    color: var(--text-primary, #111827);
    font-size: 13px;
    border-bottom: 1px solid var(--border, #e5e7eb);
}

.modal-body table tr:hover td {
    background: var(--bg-hover, #f9fafb);
}

/* Size variants */
.modal-content.modal-sm { max-width: 420px; }
.modal-content.modal-lg { max-width: 900px; }
.modal-content.modal-xl { max-width: 1100px; width: 95vw; }

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-sidebar);
    color: white;
    padding: 16px 20px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-lg);
    animation: toastSlide 0.3s ease;
    min-width: 300px;
}

@keyframes toastSlide {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast i {
    font-size: 18px;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }

/* ============================================
   DETAIL PAGES
   ============================================ */

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
}

.detail-title h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.detail-title p {
    color: var(--text-secondary);
}

.detail-actions {
    display: flex;
    gap: 10px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.detail-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

.detail-card.full-width {
    grid-column: 1 / -1;
}

.detail-card .card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.detail-card .card-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.detail-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.field-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.field-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.field-row label {
    font-size: 13px;
    color: var(--text-secondary);
}

.field-row value {
    font-weight: 600;
    color: var(--text-primary);
}

/* ============================================
   PICKING CARDS
   ============================================ */

.picking-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pick-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid var(--warning);
}

.pick-card:hover {
    box-shadow: var(--shadow-md);
}

.pick-card.urgent {
    border-left-color: var(--danger);
    background: linear-gradient(to right, var(--danger-light), white);
}

.pick-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.pick-id {
    font-weight: 600;
    font-size: 14px;
}

.pick-time {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.pick-time.urgent {
    color: var(--danger);
    font-weight: 600;
}

.pick-body h4 {
    font-size: 16px;
    margin-bottom: 6px;
}

.pick-batch {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

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

/* ============================================
   LOCATION MAP
   ============================================ */

.zone-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.zone-tab {
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: none;
    color: var(--text-secondary);
}

.zone-tab:hover {
    background: var(--bg-body);
    color: var(--text-primary);
}

.zone-tab.active {
    background: var(--primary);
    color: white;
}

.location-map {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.aisle {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}

.aisle-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
    min-width: 80px;
}

.racks {
    display: flex;
    gap: 12px;
    flex: 1;
}

.rack {
    display: flex;
    gap: 6px;
}

.location-slot {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.location-slot.available {
    background: var(--success-light);
    color: #065f46;
}

.location-slot.occupied {
    background: var(--info-light);
    color: #1e40af;
}

.location-slot.full {
    background: var(--danger-light);
    color: #991b1b;
}

.location-slot:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

/* ============================================
   VIEW TOGGLE
   ============================================ */

.view-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg-body);
    padding: 4px;
    border-radius: var(--radius);
}

.toggle-btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: none;
    color: var(--text-secondary);
}

.toggle-btn:hover {
    background: var(--bg-white);
}

.toggle-btn.active {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    color: var(--text-primary);
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.alert-info {
    background: var(--info-light);
    color: #1e40af;
}

.alert-success {
    background: var(--success-light);
    color: #065f46;
}

.alert-warning {
    background: var(--warning-light);
    color: #92400e;
}

.alert-danger {
    background: var(--danger-light);
    color: #991b1b;
}

/* ============================================
   INVENTORY LEVELS
   ============================================ */

.level-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.level-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.level-fill.min { background: var(--danger); }
.level-fill.reorder { background: var(--warning); }
.level-fill.normal { background: var(--success); }

.level-marker {
    position: absolute;
    top: -4px;
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    border: 2px solid white;
    transform: translateX(-50%);
}

/* ============================================
   SKU DETAIL
   ============================================ */

.sku-header-grid {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 30px;
    align-items: start;
}

.sku-image {
    width: 200px;
    height: 200px;
    background: var(--bg-body);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
}

.sku-main-info h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.sku-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.sku-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.sku-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.tag-raw { background: var(--info-light); color: #1e40af; }
.tag-fg { background: var(--success-light); color: #065f46; }
.tag-batch { background: var(--warning-light); color: #92400e; }

.allergen-tag {
    padding: 2px 8px;
    background: var(--danger-light);
    color: #991b1b;
    border-radius: 4px;
    font-size: 11px;
}

/* ============================================
   RATING STARS
   ============================================ */

.rating-input {
    display: flex;
    gap: 5px;
}

.rating-star {
    font-size: 20px;
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.2s;
}

.rating-star:hover,
.rating-star.active {
    color: #fbbf24;
}

/* ============================================
   GR ITEM STYLES (Goods Receiving)
   ============================================ */

.gr-item-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    padding: 12px;
    background: var(--bg-body);
    border-radius: var(--radius);
    margin-bottom: 10px;
    border-left: 4px solid var(--warning);
}

.gr-item-row.confirmed {
    background: var(--success-light);
    border-left-color: var(--success);
}

.gr-item-row .form-group {
    margin-bottom: 0;
}

.gr-item-row .form-group:first-child {
    flex: 2;
}

.gr-item-row .form-group:last-child {
    flex: 0 0 auto;
}

/* ============================================
   LOCKED FIELD
   ============================================ */

.locked-field {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.locked-field i {
    color: var(--success);
}

.locked-field span {
    font-weight: 500;
}

/* ============================================
   ADMIN PANEL
   ============================================ */

.admin-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.admin-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.admin-card:hover {
    box-shadow: var(--shadow-md);
    border: 2px solid var(--primary);
}

.admin-card i {
    font-size: 32px;
    margin-bottom: 12px;
    color: var(--primary);
}

.admin-card h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.admin-card p {
    font-size: 12px;
    color: var(--text-secondary);
}

.module-nav-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}

.module-nav-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 16px;
}

.module-nav-card:hover {
    background: var(--bg-body);
}

.module-nav-card i {
    font-size: 24px;
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
}

.module-nav-card.blue i { background: var(--info-light); color: var(--info); }
.module-nav-card.green i { background: var(--success-light); color: var(--success); }
.module-nav-card.orange i { background: var(--warning-light); color: var(--warning); }

.module-nav-card h4 {
    font-size: 14px;
    font-weight: 600;
}

.module-nav-card p {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Hub Stats Row */
.hub-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 16px;
}

.hub-stat {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.hub-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.hub-stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   PLACEHOLDER
   ============================================ */

.placeholder-content {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.placeholder-icon {
    font-size: 64px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.placeholder-content h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.placeholder-content p {
    color: var(--text-secondary);
}

/* ============================================
   FILE REPOSITORY
   ============================================ */

.file-repo-container {
    display: flex;
    height: calc(100vh - 200px);
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.file-repo-sidebar {
    width: 280px;
    background: var(--bg-body);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.file-repo-search {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-white);
}

.file-repo-search i {
    color: var(--text-muted);
}

.file-repo-search input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 14px;
}

.folder-tree {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.folder-tree-list {
    list-style: none;
}

.folder-tree-item {
    position: relative;
}

.folder-tree-node {
    transition: all 0.2s;
}

.folder-tree-node:hover {
    background: var(--bg-hover);
}

.folder-tree-item.active .folder-tree-node {
    background: var(--primary-light);
    color: var(--primary);
}

.file-repo-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.file-repo-breadcrumb {
    padding: 12px 20px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    font-size: 13px;
}

.breadcrumb-item {
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.breadcrumb-item:hover {
    color: var(--primary);
}

.breadcrumb-item.current {
    color: var(--text-primary);
    font-weight: 500;
    cursor: default;
}

.file-repo-list-header {
    display: flex;
    padding: 12px 20px;
    background: var(--bg-hover);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.file-repo-list {
    flex: 1;
    overflow-y: auto;
}

.file-repo-item {
    transition: background 0.2s;
}

.file-repo-item:hover {
    background: var(--bg-hover);
}

.file-col-name { flex: 2; }
.file-col-size { flex: 1; }
.file-col-type { flex: 1; }
.file-col-date { flex: 1; }
.file-col-uploader { flex: 1; }
.file-col-actions { flex: 0 0 120px; }

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

.file-repo-empty i {
    font-size: 64px;
    margin-bottom: 20px;
}

.file-repo-empty p {
    font-size: 16px;
    margin-bottom: 20px;
}

/* File Drop Zone */
.file-drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-body);
}

.file-drop-zone:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.file-drop-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(1.02);
}

.file-drop-zone p {
    margin-top: 10px;
    color: var(--text-secondary);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1400px) {
    .nodes-grid.six-nodes {
        grid-template-columns: repeat(6, 1fr);
        gap: 12px;
    }
    
    .nodes-grid.six-nodes .node-icon {
        width: 56px;
        height: 56px;
        font-size: 24px;
    }
    
    .nodes-grid.six-nodes .node-content h3 {
        font-size: 14px;
    }
    
    .nodes-grid.six-nodes .node-content p {
        font-size: 10px;
    }
    
    .admin-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .module-nav-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .kpi-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .detail-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hub-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .nodes-grid.six-nodes {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .nodes-grid.six-nodes .node-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .nodes-grid.six-nodes .node-content h3 {
        font-size: 12px;
    }
    
    .nodes-grid.six-nodes .node-content p {
        display: none;
    }
    
    .admin-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .kpi-cards {
        grid-template-columns: 1fr;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .top-header {
        padding: 0 16px;
    }
    
    .search-box {
        display: none;
    }
    
    .content-container {
        padding: 16px;
    }
    
    .module-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .aisle {
        flex-direction: column;
    }
    
    .racks {
        flex-wrap: wrap;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
/* Location Management */
.locations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 20px;
}

.location-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.location-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.location-card.available {
    border-left: 4px solid #10b981;
}

.location-card.occupied {
    border-left: 4px solid #f59e0b;
}

.location-card.blocked {
    border-left: 4px solid #ef4444;
}

.location-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.location-id {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.location-body {
    margin-bottom: 12px;
}

.location-zone, .location-type {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 4px;
}

.location-capacity {
    margin-top: 8px;
}

.capacity-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.capacity-fill {
    height: 100%;
    background: #3b82f6;
    border-radius: 3px;
    transition: width 0.3s;
}

.capacity-fill.high {
    background: #ef4444;
}

.capacity-text {
    font-size: 12px;
    color: #6b7280;
}

.location-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #6b7280;
    border-top: 1px solid #f3f4f6;
    padding-top: 12px;
}

/* Stock Count */
.count-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 12px;
    background: #fafafa;
}

.count-item-info {
    flex: 1;
}

.count-item-info strong {
    display: block;
    color: #1f2937;
    font-size: 14px;
}

.count-item-info span {
    display: block;
    color: #6b7280;
    font-size: 13px;
    margin-top: 2px;
}

.count-item-info small {
    display: block;
    color: #9ca3af;
    font-size: 12px;
    margin-top: 4px;
}

.count-item-input {
    display: flex;
    align-items: center;
    gap: 16px;
}

.count-item-input label {
    font-size: 13px;
    color: #6b7280;
}

.count-item-input .system-qty {
    font-weight: 600;
    color: #1f2937;
}

.count-item-input input {
    width: 120px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    text-align: right;
}

.count-item-input input:focus {
    border-color: #3b82f6;
    outline: none;
}

/* Count status badges */
.status-badge.counting {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-badge.pending {
    background: #fef3c7;
    color: #d97706;
}

/* Text colors for variance */
.text-success {
    color: #10b981;
}

.text-danger {
    color: #ef4444;
}

.text-warning {
    color: #f59e0b;
}
/* Location Management Styles */

/* Locations Grid */
.locations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
    min-height: 200px;
}

/* Location Card */
.location-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.location-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.location-card.available {
    border-left: 4px solid #10b981;
}

.location-card.occupied {
    border-left: 4px solid #f59e0b;
}

.location-card.blocked {
    border-left: 4px solid #ef4444;
}

.location-card.unknown {
    border-left: 4px solid #9ca3af;
}

/* Location Header */
.location-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.location-id {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

/* Location Body */
.location-body {
    margin-bottom: 16px;
}

.location-zone, .location-type {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 4px;
}

/* Capacity Bar */
.location-capacity {
    margin-top: 12px;
}

.capacity-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.capacity-fill {
    height: 100%;
    background: #3b82f6;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.capacity-fill.high {
    background: #ef4444;
}

.capacity-text {
    font-size: 12px;
    color: #6b7280;
    display: block;
    text-align: right;
}

/* Location Footer */
.location-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #6b7280;
    border-top: 1px solid #f3f4f6;
    padding-top: 12px;
}

.location-actions {
    display: flex;
    gap: 8px;
}

.location-actions .btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.location-actions .btn-icon:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #d1d5db;
}

.empty-state p {
    margin-bottom: 8px;
}

/* Stock Count Styles */
.count-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 12px;
    background: #fafafa;
}

.count-item-info {
    flex: 1;
}

.count-item-info strong {
    display: block;
    color: #1f2937;
    font-size: 14px;
}

.count-item-info span {
    display: block;
    color: #6b7280;
    font-size: 13px;
    margin-top: 2px;
}

.count-item-info small {
    display: block;
    color: #9ca3af;
    font-size: 12px;
    margin-top: 4px;
}

.count-item-input {
    display: flex;
    align-items: center;
    gap: 16px;
}

.count-item-input label {
    font-size: 13px;
    color: #6b7280;
}

.count-item-input .system-qty {
    font-weight: 600;
    color: #1f2937;
}

.count-item-input input {
    width: 120px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    text-align: right;
}

.count-item-input input:focus {
    border-color: #3b82f6;
    outline: none;
}

/* Status Badge Extensions */
.status-badge.counting {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-badge.pending {
    background: #fef3c7;
    color: #d97706;
}

/* Text Colors for Variance */
.text-success {
    color: #10b981;
}

.text-danger {
    color: #ef4444;
}

.text-warning {
    color: #f59e0b;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-input, .filter-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.filter-input:focus, .filter-select:focus {
    border-color: #3b82f6;
    outline: none;
}

/* Page Header Actions */
.page-header-actions {
    padding: 0 20px 20px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 0;
}

/* ============================================
   PRODUCTION SCHEDULING MODULE STYLES
   ============================================ */

/* Section Headers */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    margin-top: 20px;
    border-bottom: 2px solid var(--primary-light);
}

.section-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.section-header h4 i {
    color: var(--primary);
    margin-right: 8px;
}

/* Ingredient Summary Table */
.ingredient-summary-table {
    margin: 16px 0;
    max-height: 200px;
    overflow-y: auto;
}

.ingredient-summary-table .data-table {
    font-size: 13px;
}

.ingredient-summary-table th {
    background: var(--bg-hover);
    padding: 10px;
}

.ingredient-summary-table td {
    padding: 8px 10px;
}

/* Process Lines Container */
.process-lines-container {
    margin: 16px 0;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.process-lines-container .data-table {
    margin: 0;
    font-size: 13px;
}

.process-lines-container th {
    background: var(--bg-hover);
    padding: 10px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.process-lines-container td {
    padding: 8px;
}

.process-lines-container input,
.process-lines-container select {
    width: 100%;
    padding: 6px 8px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.process-seq-input {
    width: 50px !important;
    text-align: center;
}

.process-duration-input {
    width: 70px !important;
}

.process-manpower-qty {
    width: 60px !important;
}

/* Template Summary */
.template-summary {
    display: flex;
    gap: 32px;
    padding: 16px;
    background: var(--primary-light);
    border-radius: var(--radius);
    margin-top: 16px;
}

.summary-item {
    display: flex;
    flex-direction: column;
}

.summary-item .label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-item .value {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    margin-top: 4px;
}

/* Checkbox Label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Process Preview */
.process-preview {
    background: var(--bg-hover);
    padding: 16px;
    border-radius: var(--radius);
    margin-top: 16px;
}

.process-preview h5 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.process-preview ul {
    margin: 0;
    padding-left: 20px;
}

.process-preview li {
    margin: 6px 0;
    font-size: 13px;
}

/* ============================================
   SCHEDULER INTERFACE STYLES
   ============================================ */

.scheduler-container {
    display: flex;
    height: calc(100vh - 200px);
    gap: 16px;
    padding: 20px;
    background: var(--bg-body);
}

/* Sidebar (Job Queue) */
.scheduler-sidebar {
    width: 320px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.sidebar-header h3 i {
    color: var(--primary);
    margin-right: 8px;
}

.job-queue {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.job-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.2s;
}

.job-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.job-card-header {
    padding: 12px;
    background: var(--bg-hover);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.job-card-title {
    font-weight: 600;
    font-size: 14px;
}

.job-card-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    font-weight: 600;
}

.job-card-status.unscheduled {
    background: var(--warning-light);
    color: var(--warning);
}

.job-card-status.partially-scheduled {
    background: var(--info-light);
    color: var(--info);
}

.job-card-status.fully-scheduled {
    background: var(--success-light);
    color: var(--success);
}

.job-card-body {
    padding: 12px;
}

.job-card-info {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.job-card-progress {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.job-process-list {
    padding: 8px 12px;
    background: var(--bg-hover);
}

.job-process-item {
    display: flex;
    align-items: center;
    padding: 8px;
    margin: 4px 0;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    cursor: grab;
    font-size: 12px;
    transition: all 0.2s;
}

.job-process-item:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.job-process-item.scheduled {
    opacity: 0.5;
    cursor: not-allowed;
}

.job-process-item .process-seq {
    width: 20px;
    height: 20px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    margin-right: 8px;
}

.job-process-item .process-name {
    flex: 1;
}

.job-process-item .process-duration {
    color: var(--text-secondary);
    font-size: 11px;
}

/* Timeline */
.scheduler-timeline {
    flex: 1;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.timeline-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timeline-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.timeline-date-range {
    font-weight: 600;
    font-size: 14px;
    min-width: 200px;
    text-align: center;
}

.timeline-zoom {
    display: flex;
    gap: 4px;
}

.timeline-zoom button {
    padding: 4px 12px;
    font-size: 12px;
}

.timeline-zoom button.active {
    background: var(--primary);
    color: white;
}

.timeline-grid-container {
    flex: 1;
    overflow: auto;
    position: relative;
}

.timeline-grid {
    display: grid;
    min-width: 100%;
    min-height: 100%;
}

/* Timeline Header Row */
.timeline-header-row {
    display: contents;
}

.timeline-room-label {
    position: sticky;
    left: 0;
    background: var(--bg-white);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 12px;
    font-weight: 600;
    font-size: 13px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.timeline-room-label .room-capacity {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 400;
}

.timeline-time-header {
    background: var(--bg-hover);
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    padding: 8px;
    font-size: 11px;
    text-align: center;
    color: var(--text-secondary);
    min-width: 60px;
}

/* Timeline Rows */
.timeline-row {
    display: contents;
}

.timeline-cell {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    min-height: 50px;
    position: relative;
}

.timeline-cell:hover {
    background: var(--bg-hover);
}

.timeline-cell.droppable {
    background: var(--primary-light);
}

.timeline-cell.drag-over {
    background: var(--success-light);
    border: 2px dashed var(--success);
}

/* Process Blocks */
.process-block {
    position: absolute;
    top: 4px;
    bottom: 4px;
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: 11px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 5;
}

.process-block:hover {
    z-index: 10;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.process-block.mixing {
    background: #dbeafe;
    border: 1px solid #3b82f6;
    color: #1e40af;
}

.process-block.forming {
    background: #fce7f3;
    border: 1px solid #ec4899;
    color: #be185d;
}

.process-block.baking {
    background: #ffedd5;
    border: 1px solid #f97316;
    color: #c2410c;
}

.process-block.cooling {
    background: #d1fae5;
    border: 1px solid #10b981;
    color: #047857;
}

.process-block.packing {
    background: #e0e7ff;
    border: 1px solid #6366f1;
    color: #4338ca;
}

.process-block-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.process-block-job {
    font-size: 10px;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.process-block-time {
    font-size: 9px;
    opacity: 0.7;
}

/* Partial Capacity Indicator */
.process-block.partial-capacity {
    background: transparent;
    border: 2px dashed;
    border-style: dashed;
}

.capacity-indicator {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 9px;
    background: rgba(255,255,255,0.9);
    padding: 1px 4px;
    border-radius: 3px;
}

/* View Tabs */
.view-tabs {
    display: flex;
    gap: 4px;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-white);
}

.view-tab {
    padding: 12px 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-tab:hover {
    color: var(--primary);
    background: var(--bg-hover);
}

.view-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.view-content {
    padding: 20px;
    background: var(--bg-body);
    min-height: calc(100vh - 250px);
}

/* Gantt View Styles */
.gantt-container {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 20px;
    overflow-x: auto;
}

.gantt-job {
    margin-bottom: 24px;
}

.gantt-job-header {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: var(--bg-hover);
    border-radius: var(--radius);
}

.gantt-timeline {
    position: relative;
    height: 60px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.gantt-process {
    position: absolute;
    top: 8px;
    height: 44px;
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    cursor: pointer;
}

.gantt-process-name {
    font-weight: 600;
    white-space: nowrap;
}

.gantt-process-room {
    font-size: 10px;
    opacity: 0.8;
}

.gantt-time-axis {
    display: flex;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.gantt-time-marker {
    flex: 1;
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary);
    position: relative;
}

.gantt-time-marker::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    width: 1px;
    height: 6px;
    background: var(--border-dark);
}

/* Room View Styles */
.room-view-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

.room-view-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.room-view-header {
    padding: 16px;
    background: var(--primary-light);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.room-view-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.room-view-capacity {
    font-size: 12px;
    background: var(--bg-white);
    padding: 4px 12px;
    border-radius: 999px;
}

.room-view-timeline {
    padding: 16px;
}

.room-activity {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: var(--bg-hover);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
}

.room-activity-time {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 100px;
}

.room-activity-content {
    flex: 1;
}

.room-activity-job {
    font-weight: 600;
    font-size: 13px;
}

.room-activity-process {
    font-size: 12px;
    color: var(--text-secondary);
}

.room-activity-slot {
    font-size: 11px;
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 999px;
}

/* Validation Errors */
.validation-errors {
    background: var(--danger-light);
    border: 1px solid var(--danger);
    border-radius: var(--radius);
    padding: 12px;
    margin-top: 16px;
}

.validation-errors ul {
    margin: 0;
    padding-left: 20px;
    color: var(--danger);
    font-size: 13px;
}

.validation-errors li {
    margin: 4px 0;
}

/* Detail Group (for view modals) */
.detail-group {
    margin-bottom: 16px;
}

.detail-group label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    padding: 8px;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
}

/* Process line action buttons */
.process-action-btn {
    padding: 4px 8px;
    font-size: 12px;
    border: none;
    background: transparent;
    color: var(--danger);
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.process-action-btn:hover {
    background: var(--danger-light);
}

/* Form Row */
.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

/* Allocation Modal Specific */
#alloc-validation-errors {
    background: #fee2e2;
    border: 1px solid #ef4444;
    border-radius: 6px;
    padding: 12px;
    margin-top: 16px;
}

/* Process Lines Table Fix */
#processLinesTable {
    table-layout: fixed;
    width: 100%;
}

#processLinesTable th,
#processLinesTable td {
    padding: 8px;
    vertical-align: middle;
}

#processLinesTable input,
#processLinesTable select {
    width: 100%;
    padding: 6px 8px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-sizing: border-box;
}

#processLinesTable input[type="checkbox"] {
    width: auto;
    margin: 0 auto;
    display: block;
}

.process-seq-input {
    width: 50px !important;
    text-align: center;
}

.process-duration-input {
    width: 60px !important;
    display: inline-block;
}

.manpower-row {
    display: flex;
    gap: 6px;
    margin-bottom: 4px;
    align-items: center;
}

.manpower-row select {
    flex: 1;
    min-width: 80px;
}

.manpower-row input[type="number"] {
    width: 50px !important;
    flex-shrink: 0;
}

.manpower-row button {
    flex-shrink: 0;
    padding: 2px 6px;
    font-size: 11px;
}

/* Template Summary Enhanced */
.template-summary {
    display: flex;
    gap: 32px;
    padding: 16px 20px;
    background: var(--primary-light);
    border-radius: var(--radius);
    margin-top: 16px;
    flex-wrap: wrap;
}

.template-summary .summary-item {
    display: flex;
    flex-direction: column;
    min-width: 140px;
}

.template-summary .summary-item.full-width {
    width: 100%;
    margin-top: 8px;
}

.template-summary .label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.template-summary .value {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
}

.template-summary .manpower-detail {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Scheduler Grid Fixes */
.timeline-grid {
    display: grid;
    min-width: 100%;
    min-height: 100%;
    gap: 1px;
    background: var(--border);
}

.timeline-room-label {
    background: var(--bg-white);
    padding: 12px;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    left: 0;
    z-index: 10;
    border-right: 1px solid var(--border);
}

.timeline-time-header {
    background: var(--bg-hover);
    padding: 8px;
    font-size: 11px;
    text-align: center;
    color: var(--text-secondary);
    white-space: nowrap;
}

.timeline-cell {
    background: var(--bg-white);
    min-height: 60px;
    position: relative;
    transition: background 0.2s;
}

.timeline-cell:hover {
    background: var(--bg-hover);
}

.timeline-cell.drag-over {
    background: var(--success-light);
    box-shadow: inset 0 0 0 2px var(--success);
}

/* Process Block Fixes */
.process-block {
    position: relative;
    margin: 2px;
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: 11px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 5;
    min-height: 50px;
}

.process-block:hover {
    z-index: 10;
    box-shadow: var(--shadow-md);
    transform: scale(1.02);
}

.process-block.mixing {
    background: #dbeafe;
    border: 1px solid #3b82f6;
    color: #1e40af;
}

.process-block.forming {
    background: #fce7f3;
    border: 1px solid #ec4899;
    color: #be185d;
}

.process-block.baking {
    background: #ffedd5;
    border: 1px solid #f97316;
    color: #c2410c;
}

.process-block.cooling {
    background: #d1fae5;
    border: 1px solid #10b981;
    color: #047857;
}

.process-block.packing {
    background: #e0e7ff;
    border: 1px solid #6366f1;
    color: #4338ca;
}

.process-block-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.process-block-job {
    font-size: 10px;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.process-block-time {
    font-size: 9px;
    opacity: 0.7;
}

/* Overlap Icon in Job Queue */
.process-name .fa-circle {
    margin-left: 6px;
    vertical-align: middle;
}

/* Scheduler Row Colors and Visibility Improvements */
.timeline-cell {
    min-height: 80px;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
    transition: background 0.2s;
}

.timeline-cell:hover {
    filter: brightness(0.95);
}

.timeline-cell.drag-over {
    box-shadow: inset 0 0 0 3px #10b981;
}

/* Process Block Improvements */
.process-block {
    margin: 4px;
    padding: 8px 12px;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 6px;
}

.process-block:hover {
    transform: scale(1.02);
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Room Label Improvements */
.timeline-room-label {
    padding: 16px;
    font-size: 14px;
    font-weight: 600;
    border-right: 2px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.room-capacity {
    font-size: 11px;
    color: #6b7280;
    font-weight: 400;
}

/* Work Hours Display */
#workHoursDisplay {
    font-weight: 500;
    color: #4b5563;
}

/* Collapsible Job Queue */
.scheduler-sidebar {
    transition: width 0.3s ease;
}

.scheduler-sidebar .sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-white);
}

.scheduler-sidebar .sidebar-header:hover {
    background: var(--bg-hover);
}

.scheduler-sidebar h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.scheduler-sidebar h3 i {
    color: var(--primary);
}

.job-queue {
    transition: all 0.3s ease;
}

.job-queue.collapsed {
    display: none;
}

#jobQueueToggleIcon {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Job Card Summary View (when collapsed) */
.job-queue-summary {
    padding: 12px;
    background: var(--bg-hover);
}

.job-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: var(--bg-white);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
}

.job-summary-name {
    font-weight: 500;
    font-size: 13px;
}

.job-summary-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
}

/* FLIPPED SCHEDULER - Time on Y-axis, Rooms on X-axis */

/* Room Header (top row) */
.timeline-room-header {
    background: var(--bg-hover);
    padding: 12px 8px;
    font-weight: 600;
    font-size: 12px;
    text-align: center;
    border-right: 1px solid var(--border);
    border-bottom: 2px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.room-capacity-header {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-top: 2px;
}

/* Time Label (left column) */
.timeline-time-label {
    padding: 12px 8px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    border-right: 2px solid var(--border);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Flipped Grid Cell */
.timeline-cell-flipped {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    min-height: 50px;
    position: relative;
    transition: all 0.2s;
}

.timeline-cell-flipped:hover {
    filter: brightness(0.95);
}

.timeline-cell-flipped.drag-over {
    box-shadow: inset 0 0 0 3px #10b981;
}

/* Process Block - Flipped Layout */
.process-block-flipped {
    margin: 2px;
    padding: 6px 8px;
    min-height: 40px;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 1px solid #3b82f6;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.process-block-flipped:hover {
    transform: scale(1.02);
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.process-block-flipped.partial-capacity {
    border-style: dashed;
}

.process-block-name-flipped {
    font-size: 12px;
    font-weight: 600;
    color: #1e40af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.capacity-indicator-flipped {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 9px;
    background: rgba(255,255,255,0.9);
    padding: 1px 4px;
    border-radius: 3px;
    color: #3b82f6;
}

/* Job Color Indicator */
.job-color-indicator {
    flex-shrink: 0;
}

/* Minimized Job Card */
.job-card.minimized {
    margin-bottom: 8px;
}

.job-card.minimized .job-card-header {
    padding: 10px 12px;
}

/* Job Card with Color Border */
.job-card {
    background: #ffffff;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.job-card:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Process Item with Job Color */
.job-process-item {
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.job-process-item:hover {
    transform: translateX(2px);
}

/* Process Block with Job Colors */
.process-block-colored {
    margin: 2px;
    padding: 6px 8px;
    min-height: 40px;
    border: 2px solid;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-weight: 600;
    font-size: 12px;
    transition: all 0.2s;
}

.process-block-colored:hover {
    transform: scale(1.02);
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.process-block-name-colored {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    font-size: 11px;
    line-height: 1.3;
}

.capacity-indicator-colored {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 9px;
    background: rgba(255,255,255,0.9);
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 500;
}

/* Room Header with Sub-slots */
.timeline-room-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 10px 4px;
    font-weight: 600;
    font-size: 12px;
    text-align: center;
    border-right: 2px solid #e5e7eb;
    border-bottom: 2px solid #cbd5e1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Sub-slot Dividers */
.timeline-cell-flipped {
    border-bottom: 1px solid #e5e7eb;
    min-height: 50px;
    position: relative;
    transition: all 0.2s;
}

.timeline-cell-flipped:hover {
    background: rgba(59, 130, 246, 0.05);
}

.timeline-cell-flipped.drag-over {
    background: rgba(16, 185, 129, 0.1);
    box-shadow: inset 0 0 0 2px #10b981;
}

/* Time Label */
.timeline-time-label {
    font-size: 11px;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
}

/* Collapse Button */
.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    color: #6b7280;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #f3f4f6;
    color: #111827;
}

/* Status Section Styles */
.status-section {
    border-radius: 8px;
    overflow: hidden;
}

.status-header {
    transition: all 0.2s;
    user-select: none;
}

.status-header:hover {
    filter: brightness(0.95);
}

.status-jobs {
    padding: 0 4px;
}

/* Week Info */
.week-info {
    position: sticky;
    top: 0;
    z-index: 5;
    font-weight: 500;
}

/* Job Card with Thicker Borders for Extended Colors */
.job-card {
    border-left-style: solid;
    border-left-width: 4px;
}

/* Process Block with Variable Border Width */
.process-block-colored {
    margin: 2px;
    padding: 6px 8px;
    min-height: 40px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-weight: 600;
    font-size: 12px;
    transition: all 0.2s;
}

.process-block-colored:hover {
    transform: scale(1.02);
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.process-block-name-colored {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    font-size: 11px;
    line-height: 1.3;
}

.capacity-indicator-colored {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 9px;
    background: rgba(255,255,255,0.9);
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 500;
}


/* ============================================
   PRODUCTION USERS & SKILLS MANAGEMENT
   ============================================ */

/* Production Users Section */
.prod-user-card {
    transition: all 0.2s ease;
}

.prod-user-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.prod-user-card.selected {
    box-shadow: 0 0 0 3px rgba(59,130,246,0.3);
}

.prod-user-card.dragging {
    opacity: 0.5;
}

/* Skill Tags */
.skill-tag {
    transition: all 0.2s;
}

.skill-tag:hover {
    transform: scale(1.05);
}

/* Skills List */
.skill-item {
    transition: all 0.2s;
}

.skill-item:hover {
    background: #f3f4f6 !important;
}

.skill-item.selected {
    border-color: #3b82f6 !important;
    background: #eff6ff !important;
}

/* Skill Color Buttons */
.skill-color-btn {
    transition: all 0.2s;
}

.skill-color-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Room View User Panel */
#roomViewUserPanel {
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.room-view-user-item {
    transition: all 0.2s;
}

.room-view-user-item:active {
    cursor: grabbing;
}

/* Process Drop Target */
.process-drop-target {
    border: 2px dashed transparent;
    transition: all 0.2s;
}

.process-drop-target.drag-over {
    border-color: #3b82f6 !important;
    background: rgba(59,130,246,0.1) !important;
    transform: scale(1.02);
}

/* User Assignment Tags in Room View */
.user-assignment-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: rgba(255,255,255,0.95);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    color: #374151;
    border: 1px solid #e5e7eb;
    margin-right: 4px;
    margin-bottom: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.user-assignment-tag:hover {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.user-assignment-tag .remove-icon {
    margin-left: 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.user-assignment-tag:hover .remove-icon {
    opacity: 1;
    color: #ef4444;
}

/* Edit Mode Styles */
.edit-mode-active .process-box {
    border: 2px dashed #3b82f6;
    background: rgba(59,130,246,0.05);
}

.edit-mode-active .process-box:hover {
    border-style: solid;
    background: rgba(59,130,246,0.1);
}

/* Production Users Container Grid */
.production-users-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
    height: calc(100vh - 200px);
}

@media (max-width: 1024px) {
    .production-users-container {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
    }
}

/* Section Headers */
.section-header {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

/* Filter Bar in Production Users */
.users-section .filter-bar {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

/* Skills Info Footer */
.skills-info {
    background: linear-gradient(135deg, #f9fafb 0%, #eff6ff 100%);
    border-top: 1px solid #dbeafe;
}

/* Modal Enhancements */
#prodUserModal .modal-content,
#skillModal .modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

/* Skills Display in User Modal */
#prodUserSkillsDisplay {
    min-height: 44px;
    transition: all 0.2s;
}

#prodUserSkillsDisplay:empty::before {
    content: 'Select skills from the right panel';
    color: #9ca3af;
    font-size: 13px;
}

/* Drag and Drop Visual Feedback */
[draggable="true"] {
    cursor: grab;
}

[draggable="true"]:active {
    cursor: grabbing;
}

/* Assigned User Initials Badge */
.user-initials-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 10px;
}


/* ============================================
   INVOICE & CREDIT NOTE MODULE STYLES
   ============================================ */

/* Invoice List Page */
.invoice-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.invoice-filters .filter-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
}

.invoice-filters .filter-select {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    min-width: 180px;
}

/* Invoice Detail Grid */
.invoice-detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.detail-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.detail-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-card h3 i {
    color: var(--primary);
}

/* Status Card */
.status-card .status-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.status-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.invoice-dates {
    text-align: right;
}

.invoice-dates label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
}

.invoice-dates value {
    font-weight: 500;
}

/* Detail Grid */
.detail-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.detail-grid-2 > div {
    display: flex;
    flex-direction: column;
}

.detail-grid-2 label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.detail-grid-2 value {
    font-weight: 500;
}

/* Summary Card */
.summary-card {
    background: linear-gradient(135deg, var(--primary-light), #f3f4f6);
    border: 1px solid var(--primary-light);
}

.summary-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border);
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row.total {
    font-size: 16px;
    font-weight: 600;
    border-bottom: 2px solid var(--border-dark);
    padding-bottom: 12px;
}

.summary-row.credit-note {
    color: var(--success);
}

.summary-row.net-payable {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    background: var(--bg-white);
    padding: 12px;
    border-radius: var(--radius);
    margin-top: 8px;
}

.summary-row.amount-due {
    color: var(--danger);
    font-weight: 600;
}

.amount-display {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    padding: 20px 0;
}

.applied-amount {
    text-align: center;
    color: var(--success);
    font-size: 14px;
}

/* Credit Notes List in Invoice */
.credit-notes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.credit-note-item {
    background: var(--bg-hover);
    border-radius: var(--radius);
    padding: 16px;
    border-left: 4px solid var(--warning);
}

.credit-note-item.applied {
    border-left-color: var(--success);
}

.credit-note-item.rejected {
    border-left-color: var(--danger);
}

.cn-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cn-details {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* Finance Actions */
.finance-actions {
    background: var(--info-light);
    border: 1px solid var(--info-light);
}

.finance-actions h3 {
    color: var(--info);
}

.finance-actions .btn {
    margin-bottom: 8px;
}

.finance-actions .btn-block {
    width: 100%;
    justify-content: center;
}

/* Actions Card */
.actions-card {
    background: var(--warning-light);
    border: 1px solid var(--warning-light);
}

.actions-card h3 {
    color: var(--warning);
}

/* Edit Invoice Form */
.linked-credit-notes {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid var(--border);
}

.linked-credit-notes h3 {
    margin-bottom: 8px;
}

.credit-note-edit-card {
    background: var(--bg-hover);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 12px;
    border-left: 4px solid var(--warning);
}

.credit-note-edit-card .cn-amount {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary);
    margin: 8px 0;
}

.credit-note-edit-card .cn-reason {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* Credit Note Detail */
.cn-detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.status-display {
    font-size: 24px;
    margin-bottom: 16px;
}

.dispute-alert {
    background: var(--warning-light);
    border: 1px solid var(--warning);
    border-radius: var(--radius);
    padding: 16px;
}

.dispute-alert i {
    color: var(--warning);
    margin-right: 8px;
}

/* Form Grid */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.loading i {
    font-size: 24px;
    margin-bottom: 12px;
}

/* Alert Styles */
.alert {
    padding: 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.alert-error {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid var(--danger);
}

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

/* Badge Styles Enhancement */
.badge-primary {
    background: var(--primary);
    color: white;
}

.badge-dark {
    background: #374151;
    color: white;
}

/* Responsive */
@media (max-width: 1024px) {
    .invoice-detail-grid,
    .cn-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-sidebar {
        order: -1;
    }
    
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .invoice-filters {
        flex-direction: column;
    }
    
    .status-card .status-header {
        flex-direction: column;
        gap: 16px;
    }
    
    .invoice-dates {
        text-align: left;
    }
    
    .detail-grid-2 {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
}
