/* Kocamanlar Alüminyum - Professional Corporate Theme */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css');

:root {
    --primary-red: #dc2626;
    --primary-red-dark: #b91c1c;
    --primary-red-light: #ef4444;
    --secondary-red: rgba(220, 38, 38, 0.08);
    --text-primary: #1a1a1a;
    --text-secondary: #525252;
    --text-light: #737373;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.95);
    --shadow-light: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 1px 2px 0 rgba(0, 0, 0, 0.24);
    --shadow-medium: 0 4px 6px -1px rgba(0, 0, 0, 0.15), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-large: 0 10px 25px -3px rgba(0, 0, 0, 0.18), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-corporate: 0 2px 8px rgba(0, 0, 0, 0.15);
    --border-radius: 0px;
    --border-radius-large: 0px;
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    --gradient-corporate: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    --gradient-red: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-dark) 100%);
}
.invoice-row.paid-row {
    background-color: rgba(16, 185, 129, 0.18) !important; /* More vibrant green - Paid */
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gradient-corporate);
    color: var(--text-primary);
    line-height: 1.6;
    font-weight: 400;
    overflow-x: hidden;
    min-height: 100vh;
    padding-bottom: 60px; /* Space for fixed status bar */
}

/* Professional Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(10px);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--secondary-red);
    border-top: 3px solid var(--primary-red);
    animation: corporateSpinner 1s linear infinite;
}

@keyframes corporateSpinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Page Transition Effects */
.page-transition-enter {
    opacity: 0;
    transform: translateY(20px);
    animation: pageEnter 0.4s ease-out forwards;
}

@keyframes pageEnter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.header {
    background: var(--bg-primary);
    border-bottom: 2px solid var(--secondary-red);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-corporate);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition-smooth);
}

.logo:hover {
    transform: translateX(4px);
}

.logo img {
    height: 42px;
    width: auto;
    box-shadow: var(--shadow-light);
    transition: var(--transition-smooth);
}

.logo:hover img {
    box-shadow: var(--shadow-medium);
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-red);
    letter-spacing: -0.5px;
    text-transform: uppercase;
}

/* Header User Info - More specific selector */
.header .user-info {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto; /* Ensure it's pushed to the right */
}

/* Grouped print buttons in header */
.print-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .header .user-info {
        flex-wrap: wrap;
        gap: 12px;
    }
    .print-buttons {
        width: 100%;
        justify-content: flex-end;
    }
}

.header .user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.logout-btn {
    padding: 12px 24px;
    background: var(--gradient-red);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.logout-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition-smooth);
}

.logout-btn:hover::before {
    left: 100%;
}

.logout-btn:hover {
    background: var(--primary-red-dark);
    box-shadow: var(--shadow-medium);
    transform: translateY(-1px);
}

/* Üst bar: yan yana ikon kısayolları (Yönetici / Finans / Araçlar vb.) */
.header-toolbar-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.header-toolbar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: var(--gradient-red);
    color: white !important;
    text-decoration: none;
    font-size: 16px;
    cursor: pointer;
    box-shadow: var(--shadow-light);
    transition: var(--transition-smooth);
    font-family: inherit;
    line-height: 1;
}

.header-toolbar-icon:hover {
    background: var(--primary-red-dark);
    box-shadow: var(--shadow-medium);
    transform: translateY(-1px);
    color: white !important;
}

button.header-toolbar-icon {
    -webkit-appearance: none;
    appearance: none;
}

/* Main Content */
.main-content {
    padding: 40px 0;
    animation: fadeInUp 0.4s ease-out;
}

/* Prevent main content animation in specific contexts */
.invoices-content .main-content {
    animation: none !important;
}

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

/* Main Layout */
.main-layout {
    display: flex;
    gap: 32px;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
}

/* Responsive Layout for Larger Screens */
@media (min-width: 1401px) {
    .main-layout {
        max-width: 100%;
        padding: 0 32px;
    }
}

@media (min-width: 1600px) {
    .main-layout {
        max-width: 100%;
        padding: 0 40px;
    }
}

@media (min-width: 1920px) {
    .main-layout {
        max-width: 100%;
        padding: 0 48px;
    }
}

@media (min-width: 2560px) {
    .main-layout {
        max-width: 100%;
        padding: 0 64px;
    }
}

/* Left Sidebar */
.sidebar {
    width: 280px;
    min-width: 280px;
    position: sticky;
    top: 120px;
    height: fit-content;
}

.sidebar-nav {
    background: var(--bg-card);
    padding: 24px;
    box-shadow: var(--shadow-corporate);
    backdrop-filter: blur(10px);
    border: 1px solid var(--secondary-red);
}

.sidebar-nav h3 {
    color: var(--primary-red);
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav h3::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 20px;
    background: var(--primary-red);
}

.sidebar-tabs {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-tab {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition-smooth);
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sidebar-tab::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background: var(--primary-red);
    transition: var(--transition-smooth);
}

.sidebar-tab.active::before {
    width: 4px;
}

.sidebar-tab.active {
    background: var(--secondary-red);
    color: var(--primary-red);
    font-weight: 600;
}

.sidebar-tab:hover:not(.active) {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-primary);
    transform: translateX(4px);
}

.tab-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.tab-text {
    font-size: 13px;
}

/* Content Area */
.content-area {
    flex: 1;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Enhanced responsive behavior for content area */
@media (min-width: 1200px) {
    .content-area {
        min-width: 800px;
        max-width: 100%;
    }
}

@media (min-width: 1600px) {
    .content-area {
        min-width: 1000px;
        max-width: 100%;
    }
}

@media (min-width: 1920px) {
    .content-area {
        min-width: 1200px;
        max-width: 100%;
    }
}

@media (min-width: 2560px) {
    .content-area {
        min-width: 1400px;
        max-width: 100%;
    }
}

/* Content Tabs */
.content-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 32px;
    background: var(--bg-card);
    padding: 6px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-corporate);
    border: 1px solid var(--secondary-red);
}

.tab-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    transition: var(--transition-smooth);
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tab-item.active {
    background: var(--primary-red);
    color: white;
    box-shadow: var(--shadow-light);
    font-weight: 600;
}

.tab-item:hover:not(.active) {
    background: var(--secondary-red);
    color: var(--primary-red);
}

.tab-item .tab-icon {
    font-size: 14px;
    width: 16px;
}

/* Tab Content Loading Animation - Disabled to prevent flickering */
.tab-content-loading {
    position: relative;
    overflow: hidden;
}

/* Smooth transitions for tab content */
.orders-table,
.toolbar,
.table-toolbar,
.tab-content-wrapper,
.site-header-buttons {
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

/* Stats Content */
.stats-content {
    padding: 32px 0;
}

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

.stat-card {
    background: var(--bg-card);
    padding: 28px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-corporate);
    border: 1px solid var(--secondary-red);
    transition: var(--transition-smooth);
    backdrop-filter: blur(10px);
    position: relative;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-red);
    opacity: 0;
    transition: var(--transition-smooth);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-large);
}

.stat-icon {
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: var(--secondary-red);
    color: var(--primary-red);
    border: 2px solid var(--primary-red);
}

.stat-info h3 {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.stat-number {
    color: var(--primary-red);
    font-size: 32px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    margin: 0;
}

/* Tab Content Wrapper */
.tab-content-wrapper {
    animation: tabContentEnter 0.4s ease-out forwards;
}

/* Reduce spacing for settings tab content */
.tab-content-wrapper:has(.settings-content) {
    margin-top: 0;
    padding-top: 0;
}

/* Report Styles */
.report-filters {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
}

.report-summary {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.summary-item {
    text-align: center;
    padding: 16px;
    border-radius: 8px;
    transition: var(--transition-smooth);
}

.summary-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

.report-invoices {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
}

.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-red);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

@keyframes tabContentEnter {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Corporate Card Styles */
.card {
    background: var(--bg-card);
    padding: 32px;
    box-shadow: var(--shadow-corporate);
    border: 1px solid var(--secondary-red);
    backdrop-filter: blur(10px);
    transition: var(--transition-smooth);
}

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

/* Professional Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--gradient-red);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    position: relative;
    overflow: hidden;
    min-width: 120px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition-smooth);
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    background: var(--primary-red-dark);
    box-shadow: var(--shadow-medium);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-light);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--text-secondary);
    box-shadow: none;
}

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

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

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

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

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

.btn-small {
    padding: 8px 16px;
    font-size: 12px;
    min-width: 80px;
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid #e5e7eb;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-smooth);
    font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* Grid System */
.grid {
    display: grid;
    gap: 24px;
}

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

/* Table Styles */
.table-container {
    position: relative;
    background: var(--bg-card);
    box-shadow: var(--shadow-corporate);
    border: 1px solid var(--secondary-red);
    overflow: hidden;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Allow dropdown to show when filter is active */
.table-container.dropdown-active {
    overflow: visible;
    z-index: 1;
}

/* Enhanced table responsiveness */
@media (min-width: 1200px) {
    .table-container {
        overflow-x: visible;
    }
}

@media (max-width: 1199px) {
    .table-container {
        overflow-x: scroll;
    }
    
    .table {
        min-width: 800px;
    }
}

@media (max-width: 768px) {
    .table-container {
        font-size: 13px;
    }
    
    .table {
        min-width: 600px;
    }
    
    .table th,
    .table td {
        padding: 12px 8px;
        font-size: 13px;
    }
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th {
    background: var(--secondary-red);
    padding: 16px 12px;
    text-align: left;
    font-weight: 700;
    color: var(--primary-red);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--primary-red);
}

.table td {
    padding: 16px 12px;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 500;
}

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

.table tbody tr:hover {
    background: rgba(220, 38, 38, 0.05);
}

/* Status Indicators */
.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid white;
    animation: statusPulse 3s ease-in-out infinite;
    animation-delay: var(--animation-delay, 0s);
    transition: var(--transition-smooth);
}

/* Reduce animation frequency when user is not actively viewing */
@media (prefers-reduced-motion: reduce) {
    .status-indicator {
        animation: none;
    }
    
    .tab-content-loading::before {
        animation: none;
    }
    
    .tab-transition-loading::after {
        animation: none;
    }
    
    .message-badge {
        animation: none;
    }
    
    .unread-indicator {
        animation: none;
    }
    
    .animate-in {
        animation: none;
    }
    
    .loading-spinner {
        animation: none;
    }
}

/* Reduce animations when user is inactive */
.user-inactive .status-indicator {
    animation-duration: 5s !important;
}

.user-inactive .message-badge {
    animation-duration: 4s !important;
}

.user-inactive .unread-indicator {
    animation-duration: 4s !important;
}

.user-inactive .loading-spinner {
    animation-duration: 2s !important;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Professional Modal Animation - SaaS Style */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.status-green { background: #10b981; }
.status-yellow { background: #f59e0b; }
.status-red { background: #ef4444; }
.status-white { background: #e5e7eb; border-color: #d1d5db; }

/* Modal Styles - Professional positioning */
.modal {
    /* Position is set dynamically via JS (absolute with top offset) */
    /* This ensures modal appears at user's scroll position */
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    min-height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999 !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-out, visibility 0.2s ease-out;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 20px;
    box-sizing: border-box;
    /* Hardware accelerated */
    transform: translateZ(0);
    will-change: opacity;
}

.modal.active {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
}

/* Prevent body scroll when modal is active - Modern overflow approach */
body.modal-open {
    overflow: hidden !important;
    /* No position: fixed needed - keeps body at current scroll position */
    /* Padding-right is set dynamically via JS to prevent scrollbar jump */
}

/* Keep sidebar in place when modal is open */
body.modal-open .sidebar {
    position: sticky !important;
    /* Sidebar keeps its sticky behavior even when body has overflow:hidden */
}

/* Modal scrolling behavior - No scroll needed, positioned at user location */
.modal.active {
    overflow: visible !important;
}

.modal.active .modal-content {
    max-height: 90vh !important;
    overflow-y: auto !important;
}

.modal-content {
    background: var(--bg-primary);
    padding: 32px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-large);
    transform: scale(0.9) translateY(-20px);
    transition: var(--transition-smooth);
    border: 2px solid var(--secondary-red);
    border-radius: 12px;
    margin: auto;
    position: relative;
}

/* Enhanced modal responsiveness */
@media (min-width: 1200px) {
    .modal-content {
        max-width: 800px;
        width: 85%;
    }
}

@media (min-width: 1600px) {
    .modal-content {
        max-width: 1000px;
        width: 80%;
    }
}

@media (max-width: 768px) {
    .modal-content {
        padding: 20px;
        width: 95%;
        max-height: 95vh;
    }
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

/* Corporate Professional Icons */
.professional-icon {
    font-family: 'Font Awesome 6 Pro', 'Font Awesome 6 Free';
    font-style: normal;
    font-weight: 900;
}

/* Icon replacements for business context */
.icon-dashboard::before { content: '\f0e4'; } /* fa-dashboard */
.icon-building::before { content: '\f1ad'; } /* fa-building */
.icon-industry::before { content: '\f275'; } /* fa-industry */
.icon-users::before { content: '\f0c0'; } /* fa-users */
.icon-envelope::before { content: '\f0e0'; } /* fa-envelope */
.icon-chart::before { content: '\f080'; } /* fa-bar-chart */
.icon-calendar::before { content: '\f073'; } /* fa-calendar */
.icon-truck::before { content: '\f0d1'; } /* fa-truck */
.icon-file::before { content: '\f15b'; } /* fa-file */
.icon-search::before { content: '\f002'; } /* fa-search */
.icon-filter::before { content: '\f0b0'; } /* fa-filter */
.icon-download::before { content: '\f019'; } /* fa-download */
.icon-upload::before { content: '\f093'; } /* fa-upload */
.icon-settings::before { content: '\f013'; } /* fa-cog */
.icon-plus::before { content: '\f067'; } /* fa-plus */
.icon-edit::before { content: '\f044'; } /* fa-edit */
.icon-delete::before { content: '\f1f8'; } /* fa-trash */
.icon-eye::before { content: '\f06e'; } /* fa-eye */
.icon-check::before { content: '\f00c'; } /* fa-check */
.icon-times::before { content: '\f00d'; } /* fa-times */

/* Mobile Responsive */
@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
        padding: 0 16px;
        gap: 24px;
    }
    
    .sidebar {
        width: 100%;
        position: static;
    }
    
    .sidebar-tabs {
        flex-direction: row;
        gap: 2px;
    }
    
    .sidebar-tab {
        flex: 1;
        justify-content: center;
        padding: 12px 8px;
    }
    
    .tab-text {
    display: none;
}

    .content-tabs {
        flex-wrap: wrap;
    }
    
    .tab-item {
        min-width: 120px;
        font-size: 11px;
        padding: 12px 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 16px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .btn {
        padding: 12px 20px;
    font-size: 12px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(220, 38, 38, 0.3);
    border-radius: 3px;
    transition: var(--transition-smooth);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(220, 38, 38, 0.5);
}

/* Loading States */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    animation: spin 1s linear infinite;
}

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

/* Professional Animations */
.animate-in {
    animation: slideInUp 0.6s ease-out forwards;
}

/* Prevent animation on marked elements */
[data-no-animation] .animate-in,
[data-no-animation].animate-in,
.invoices-content .animate-in,
.invoices-content.animate-in,
.accounting-table .animate-in,
.accounting-table.animate-in,
.invoices-table .animate-in,
.invoices-table.animate-in,
.invoices-table-container .animate-in,
.invoices-table-container.animate-in {
    animation: none !important;
}

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

/* High-Quality Professional Styles */
.corporate-header {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    border-bottom: 3px solid var(--primary-red);
}

.enterprise-card {
    background: var(--bg-card);
    border-left: 4px solid var(--primary-red);
    box-shadow: var(--shadow-corporate);
    transition: var(--transition-smooth);
}

.enterprise-card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-large);
}

.professional-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--secondary-red);
    color: var(--primary-red);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.corporate-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-red), transparent);
    margin: 32px 0;
}

/* Tab Transition Effects */
.tab-transition-enter {
    animation: tabSlideIn 0.3s ease-out forwards;
}

@keyframes tabSlideIn {
    from {
    opacity: 0;
        transform: translateX(30px);
}
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.tab-transition-loading {
    position: relative;
    overflow: hidden;
}

.tab-transition-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: var(--primary-red);
    animation: loadingBar 1.2s ease-in-out 1;
}

@keyframes loadingBar {
    0% { left: -100%; }
    50% { left: 0; }
    100% { left: 100%; }
}

/* Additional Professional Order Modal Styles */
.order-modal {
    max-width: 900px !important;
    width: 95% !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    max-height: 90vh !important;
    overflow: hidden !important;
}

.order-modal .modal-header {
    background: var(--gradient-red);
    color: white;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--primary-red-dark);
}

.order-modal .modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
}

.order-modal .modal-header h2 .professional-icon {
    color: white !important;
}

.order-modal .close-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 2px solid transparent;
}

.order-modal .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

/* Professional Progress Steps */
.order-steps {
    display: flex;
    justify-content: center;
    padding: 32px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--secondary-red);
}

.step {
    display: flex;
    align-items: center;
    position: relative;
    margin: 0 20px;
    transition: var(--transition-smooth);
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    right: -40px;
    width: 40px;
    height: 2px;
    background: #e5e7eb;
    transition: var(--transition-smooth);
}

.step.completed::after {
    background: var(--primary-red);
}

.step-number {
    width: 40px;
    height: 40px;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    transition: var(--transition-smooth);
    margin-right: 12px;
    border: 2px solid transparent;
}

.step.active .step-number {
    background: var(--primary-red);
    color: white;
    transform: scale(1.1);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-red-dark);
}

.step.completed .step-number {
    background: var(--primary-red);
    color: white;
    border-color: var(--primary-red-dark);
}

.step.completed .step-number::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 14px;
}

.step-label {
    font-weight: 600;
    color: #6b7280;
    transition: var(--transition-smooth);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
}

.step.active .step-label {
    color: var(--primary-red);
    font-weight: 700;
}

.step.completed .step-label {
    color: var(--primary-red);
}

/* Professional Step Content */
.step-content {
    display: none;
    padding: 32px;
    animation: fadeInUp 0.4s ease-out;
}

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

/* Order modal form should be scrollable */
.order-modal form {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.step-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-red);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--secondary-red);
    padding-bottom: 12px;
}

.step-title .professional-icon {
    font-size: 24px;
}

/* Advanced Section Styling */
.advanced-section {
    margin: 24px 0;
    border: 2px solid var(--secondary-red);
    overflow: hidden;
}

.toggle-advanced {
    width: 100%;
    background: var(--bg-secondary);
    border: none;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    color: var(--primary-red);
    transition: var(--transition-smooth);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toggle-advanced:hover {
    background: var(--secondary-red);
}

.toggle-icon {
    font-size: 14px;
    transition: var(--transition-smooth);
}

.advanced-content {
    padding: 20px;
    background: var(--bg-primary);
    border-top: 1px solid var(--secondary-red);
    animation: slideDown 0.3s ease-out;
}

/* Price Section Styling */
.price-section {
    margin: 24px 0;
    padding: 20px;
    background: var(--bg-secondary);
    border: 2px solid #10b981;
    border-left: 6px solid #10b981;
}

/* Modal Footer */
.order-modal .modal-footer {
    background: var(--bg-secondary);
    padding: 24px 32px;
    border-top: 2px solid var(--secondary-red);
    position: sticky;
    bottom: 0;
    z-index: 10;
    margin-top: auto;
}

.step-navigation {
    display: flex;
    justify-content: flex-end; /* Changed from space-between */
    align-items: center;
    gap: 12px;
}

.step-navigation .btn {
    min-width: 120px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Professional Message Modal */
.message-modal {
    background: var(--bg-primary) !important;
    backdrop-filter: none !important;
    border: 2px solid var(--secondary-red);
    box-shadow: var(--shadow-large);
    max-width: 900px !important;
    width: 95% !important;
    padding: 0 !important;
}

.message-modal-header {
    background: var(--bg-secondary);
    padding: 24px 32px;
    border-bottom: 2px solid var(--secondary-red);
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
}

.message-avatar {
    width: 50px;
    height: 50px;
    background: var(--gradient-red);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-medium);
    border: 2px solid var(--primary-red-dark);
}

.avatar-icon {
    color: white;
    font-size: 20px;
    font-weight: 700;
}

.message-header-info {
    flex: 1;
    min-width: 0;
}

.message-title {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.message-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sender-info {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
}

.sender-info strong {
    color: var(--primary-red);
    text-transform: uppercase;
}

.message-date {
    color: var(--text-light);
    font-size: 13px;
    font-weight: 500;
}

.message-modal .close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: 2px solid var(--text-secondary);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.message-modal .close-btn:hover {
    background: var(--primary-red);
    color: white;
    border-color: var(--primary-red);
    transform: scale(1.1);
}

.message-modal-body {
    padding: 32px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.message-content {
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 24px;
    font-size: 15px;
    font-weight: 500;
}

.message-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    border-top: 2px solid var(--secondary-red);
    background: rgba(220, 38, 38, 0.05);
    gap: 16px;
}

.message-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.message-actions .btn {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 110px;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.message-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.message-actions .btn .professional-icon {
    font-size: 16px;
}

/* Contact Card Styles */
.contacts-content {
    padding: 32px 0;
}

.contacts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--secondary-red);
}

.contacts-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-red);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contacts-header .btn {
    white-space: nowrap;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.contact-card {
    background: var(--bg-card);
    padding: 24px;
    box-shadow: var(--shadow-corporate);
    border: 1px solid var(--secondary-red);
    transition: var(--transition-smooth);
    position: relative;
    border-left: 4px solid var(--primary-red);
}

.contact-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-large);
}

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

.contact-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-red);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.contact-position {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
}

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

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-detail {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.contact-detail .professional-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: var(--primary-red);
}

.contact-phone {
    font-weight: 700;
    color: var(--primary-red);
}

.contact-email {
    color: var(--text-secondary);
}

.contact-notes {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid var(--secondary-red);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    font-style: italic;
}

/* Demirbase Card Styles */
.demirbase-content {
    margin-top: 24px;
}

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

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

.demirbase-card {
    background: var(--bg-card);
    padding: 24px;
    box-shadow: var(--shadow-corporate);
    border: 1px solid var(--secondary-red);
    transition: var(--transition-smooth);
    position: relative;
    border-left: 4px solid var(--primary-red);
}

.demirbase-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-large);
}

.demirbase-card .demirbase-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.demirbase-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.demirbase-quantity {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.demirbase-price {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-red);
    font-weight: 600;
}

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

.empty-demirbase,
.loading-demirbase {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* Site Card Enhanced Styles */
.site-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.site-card {
    background: var(--bg-card);
    padding: 28px;
    box-shadow: var(--shadow-corporate);
    border: 1px solid var(--secondary-red);
    transition: var(--transition-smooth);
    cursor: pointer;
    position: relative;
    border-left: 4px solid var(--primary-red);
}

.site-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-large);
    border-left-width: 6px;
}

.site-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-red);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.site-location {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-weight: 600;
    font-size: 15px;
}

.site-description {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.6;
    font-weight: 500;
}

/* Company Card Enhanced Styles */
.company-card {
    background: var(--bg-card);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-corporate);
    border: 1px solid var(--secondary-red);
    transition: var(--transition-smooth);
    cursor: pointer;
    border-left: 4px solid var(--primary-red);
}

.company-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-large);
}

.company-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-red);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.company-stats {
    display: flex;
    gap: 20px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
}

.company-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.company-stats .professional-icon {
    color: var(--primary-red);
}

/* Enhanced Loading States */
.tab-content-loading {
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-content-loading::before {
    content: 'Yükleniyor...';
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Professional Floating Action Button */
.floating-btn {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 64px;
    height: 64px;
    background: var(--gradient-red);
    color: white;
    border: none;
    font-size: 24px;
    box-shadow: var(--shadow-large);
    cursor: pointer;
    transition: var(--transition-smooth);
    z-index: 50;
    border: 3px solid var(--primary-red-dark);
}

.floating-btn:hover {
    transform: scale(1.15);
    background: var(--primary-red-dark);
    box-shadow: 0 12px 32px rgba(220, 38, 38, 0.4);
}

/* Enhanced Message Badge */
.message-badge {
    background: var(--primary-red);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 7px;
    margin-left: 8px;
    border: 2px solid white;
    box-shadow: var(--shadow-light);
    animation: badgePulse 2.5s ease-in-out infinite;
}

/* Sidebar badge - round version */
.sidebar-tab .message-badge {
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    margin-left: auto;
    margin-right: 0;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

@keyframes badgePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.05); }
}

/* Professional Table Enhancements */
.table-container {
    border: 2px solid var(--secondary-red);
}

.table th {
    font-size: 13px;
    border-bottom: 3px solid var(--primary-red);
}

.table tbody tr:nth-child(even) {
    background: rgba(220, 38, 38, 0.02);
}

/* Enhanced Shipment Styles */
.shipments-list {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 20px;
}

.shipment-item {
    background: var(--bg-secondary);
    padding: 16px;
    margin-bottom: 12px;
    border-left: 4px solid var(--primary-red);
    border: 1px solid var(--secondary-red);
    transition: var(--transition-smooth);
}

.shipment-item:hover {
    background: var(--bg-card);
    border-left-width: 6px;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .order-modal {
        width: 98% !important;
        margin: 10px;
    }
    
    .order-steps {
        padding: 20px 16px;
    }
    
    .step {
        margin: 0 8px;
    }
    
    .step-label {
        display: none;
    }
    
    .step-content {
        padding: 20px 16px;
    }
    
    .order-modal .modal-header,
    .order-modal .modal-footer {
        padding: 20px 16px;
    }
    
    .step-navigation {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .step-navigation .btn {
        min-width: auto;
        flex: 1;
    }
    
    .message-modal {
        margin: 20px;
        max-width: calc(100vw - 40px);
    }
    
    .message-modal-header {
        padding: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .message-avatar {
        width: 40px;
        height: 40px;
    }
    
    .avatar-icon {
        font-size: 16px;
    }
    
    .message-title {
        font-size: 18px;
    }
    
    .message-modal-body {
        padding: 16px;
    }
    
    .message-modal-footer {
        padding: 16px;
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .message-actions {
        flex-direction: column;
        gap: 8px;
        order: 2;
    }
    
    .message-actions .btn {
        width: 100%;
        min-width: auto;
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .message-modal-footer > .btn {
        order: 1;
        width: 100%;
        padding: 12px 16px;
        font-size: 14px;
        font-weight: 700;
    }
    
    .contacts-grid,
    .site-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .contact-card,
    .site-card,
    .company-card {
        padding: 16px;
    }
    
    .contacts-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        text-align: left;
        padding-bottom: 12px;
    }
    
    .contacts-header h2 {
        font-size: 18px;
        margin-bottom: 0;
    }
    
    .contacts-header .btn {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 14px;
    }
    
    .contact-header {
        flex-direction: column;
        gap: 12px;
    }
    
    .contact-actions {
        justify-content: flex-start;
    }
    
    .company-stats {
        flex-direction: column;
        gap: 8px;
    }
}

/* Final Professional Touch */
.professional-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--secondary-red);
    color: var(--primary-red);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border: 1px solid var(--primary-red);
}

.corporate-divider {
    height: 3px;
    background: var(--gradient-red);
    margin: 40px 0;
    position: relative;
}

.corporate-divider::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 5px;
    background: var(--primary-red-dark);
}

/* Animation Keyframes - Unified definition */

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 400px;
    }
}

/* Professional Mail Tab Styles */
.mailbox-container {
    position: relative;
    min-height: 400px;
}

.mail-content {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.mail-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Professional Message List Styles */
.messages-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message-item {
    padding: 20px;
    border: 2px solid #e5e7eb;
    margin-bottom: 16px;
    cursor: pointer;
    transition: var(--transition-smooth);
    background: var(--bg-card);
    border-left: 4px solid transparent;
    position: relative;
}

.message-item:hover {
    border-color: var(--secondary-red);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    border-left-color: var(--primary-red);
}

.message-item.unread {
    border-left-color: var(--primary-red);
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.02), rgba(220, 38, 38, 0.05));
    border-color: var(--secondary-red);
}

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

.sender-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sender-info strong {
    color: var(--primary-red);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.username {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    text-transform: none;
}

.message-date {
    color: var(--text-light);
    font-size: 13px;
    font-weight: 600;
}

.message-subject {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.message-preview {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
}

.unread-indicator {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 10px;
    height: 10px;
    background: var(--primary-red);
    animation: unreadPulse 2.5s ease-in-out infinite;
    animation-delay: var(--unread-delay, 0s);
    border: 2px solid white;
    box-shadow: var(--shadow-light);
}

@keyframes unreadPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.03); }
}

.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state h3 {
    margin-bottom: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.empty-state p {
    font-weight: 500;
}

/* Professional Jobs Section in Messages */
.jobs-section {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--primary-red);
    border-left: 6px solid var(--primary-red);
}

.jobs-section h4 {
    color: var(--primary-red);
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.job-reference {
    background: var(--bg-primary);
    padding: 12px 16px;
    border-left: 3px solid var(--primary-red);
    font-size: 14px;
    color: var(--text-primary);
    box-shadow: var(--shadow-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-smooth);
    font-weight: 500;
}

.job-reference:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
    border-left-width: 5px;
}

.job-reference-text {
    flex: 1;
    margin-right: 12px;
}

.job-goto-btn {
    background: var(--gradient-red);
    color: white;
    border: none;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 80px;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.job-goto-btn:hover {
    background: var(--primary-red-dark);
    transform: scale(1.05);
    box-shadow: var(--shadow-medium);
}

/* Professional Attachments Section */
.attachments-section {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-secondary);
    border: 2px solid #10b981;
    border-left: 6px solid #10b981;
}

.attachments-section h4 {
    color: #10b981;
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.attachment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid rgba(16, 185, 129, 0.2);
    transition: var(--transition-smooth);
    border-left: 3px solid #10b981;
}

.attachment-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    border-left-width: 5px;
}

.attachment-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid #10b981;
    border-radius: 8px;
    position: relative;
}

.attachment-icon i {
    font-size: 20px;
    line-height: 1;
}

.attachment-icon .professional-icon {
    color: inherit !important;
}

/* FontAwesome fallback for attachment icons */
.attachment-icon .fas,
.attachment-icon .far,
.attachment-icon .fab {
    font-family: 'Font Awesome 6 Free', 'Font Awesome 6 Pro', 'Font Awesome 5 Free', 'Font Awesome 5 Pro' !important;
    font-weight: 900 !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    line-height: 1 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Backup emoji icons if FontAwesome fails */
.attachment-icon:empty::before {
    content: '📄';
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* File type specific fallback icons */
.attachment-icon[data-file-type="pdf"]:empty::before { content: '📕'; }
.attachment-icon[data-file-type="doc"]:empty::before,
.attachment-icon[data-file-type="docx"]:empty::before { content: '📘'; }
.attachment-icon[data-file-type="xls"]:empty::before,
.attachment-icon[data-file-type="xlsx"]:empty::before { content: '📗'; }
.attachment-icon[data-file-type="txt"]:empty::before { content: '📝'; }
.attachment-icon[data-file-type="jpg"]:empty::before,
.attachment-icon[data-file-type="jpeg"]:empty::before,
.attachment-icon[data-file-type="png"]:empty::before,
.attachment-icon[data-file-type="gif"]:empty::before { content: '🖼️'; }
.attachment-icon[data-file-type="xml"]:empty::before { content: '📋'; }

.attachment-info {
    flex: 1;
    min-width: 0;
}

.attachment-name {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
    word-wrap: break-word;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-size: 13px;
}

.attachment-size {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.attachment-download {
    padding: 8px 12px;
    background: #10b981;
    color: white;
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    border: 2px solid #059669;
    font-weight: 600;
}

.attachment-download:hover {
    background: #059669;
    transform: scale(1.05);
    border-color: #047857;
    color: white;
}

/* Tab Content Loading Animation for Mail */
.tab-content-wrapper.loading {
    position: relative;
    overflow: hidden;
}

.tab-content-wrapper.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(220, 38, 38, 0.1), transparent);
    animation: contentLoading 0.8s ease-in-out 1;
}

/* Professional Message Badge Animation */
.message-badge {
    border-radius: 0;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive Mail Layout */
@media (max-width: 768px) {
    .message-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .sender-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .message-item {
        padding: 16px;
    }
    
    .message-subject {
        font-size: 14px;
    }
    
    .message-preview {
        font-size: 13px;
    }
    
    .attachment-item {
        padding: 12px;
    }
    
    .attachment-icon {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
    
    .attachment-download {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .job-reference {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .job-goto-btn {
        align-self: flex-end;
    }
}

/* Professional Custom Selectors */
.custom-selector {
    position: relative;
    width: 100%;
}

.selector-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 9998;
    display: none;
}

.custom-selector.open .selector-overlay {
    display: block;
}

.selector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    background: var(--background-light);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: var(--border-radius);
    min-height: 48px;
}

.selector-header:hover {
    border-color: var(--primary-red);
    background: #ffffff;
}

.selected-value {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-weight: 500;
}

.selected-value i {
    color: var(--text-secondary);
    font-size: 16px;
}

.selected-value span {
    font-size: 14px;
}

.selector-arrow {
    color: var(--text-secondary);
    font-size: 14px;
    transition: transform 0.3s ease;
}

.custom-selector.open .selector-arrow {
    transform: rotate(180deg);
}

.selector-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 2px solid var(--border-color);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    z-index: 9999;
    display: none;
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    margin-top: 2px;
    min-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.custom-selector.open .selector-dropdown {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: absolute !important;
    z-index: 9999 !important;
    background: #ffffff !important;
    border: 2px solid var(--border-color) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.1) !important;
    width: 100% !important;
    min-width: 300px !important;
    min-height: 100px !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    margin-top: 2px !important;
    overflow: hidden !important;
}

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

.selector-search {
    padding: 16px;
    border-bottom: 2px solid var(--border-light);
    position: relative;
    background: #f8f9fa;
}

.selector-search i {
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 14px;
}

.selector-search input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    border: 1px solid var(--border-light);
    background: var(--background-light);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
}

.selector-search input:focus {
    border-color: var(--primary-red);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.selector-options {
    max-height: 240px;
    overflow-y: auto;
    /* Prevent scroll bar from causing layout shifts */
    scrollbar-width: thin;
    scrollbar-color: rgba(220, 38, 38, 0.3) transparent;
    /* Ensure consistent padding to prevent layout shifts */
    padding-right: 4px;
}

/* Custom scrollbar for selector options */
.selector-options::-webkit-scrollbar {
    width: 6px;
}

.selector-options::-webkit-scrollbar-track {
    background: transparent;
}

.selector-options::-webkit-scrollbar-thumb {
    background: rgba(220, 38, 38, 0.3);
    border-radius: 3px;
}

.selector-options::-webkit-scrollbar-thumb:hover {
    background: rgba(220, 38, 38, 0.5);
}

.selector-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-light);
    /* Prevent layout shifts */
    border-left: 4px solid transparent;
    margin-left: 0;
}

.selector-option:last-child {
    border-bottom: none;
}

.selector-option:hover {
    background: rgba(220, 38, 38, 0.08);
    border-left-color: var(--primary-red);
    /* Remove transform to prevent layout shifts */
    margin-left: 0;
}

/* User Selector Specific */
.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
}

/* Message system user info - more specific */
.selector-option .user-info {
    flex: 1;
}

.selector-option .user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 4px;
}

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

.user-role-badge {
    background: var(--primary-red);
    color: white;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

/* Site Selector Specific */
.site-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
}

.site-info {
    flex: 1;
}

.site-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 4px;
}

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

/* Professional File Uploader */
.professional-file-uploader {
    width: 100%;
}

.file-input {
    display: none;
}

.upload-area {
    border: 2px dashed var(--border-color);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--background-light);
    position: relative;
    overflow: hidden;
}

.upload-area:hover {
    border-color: var(--primary-red);
    background: rgba(220, 38, 38, 0.02);
}

.upload-area.drag-over {
    border-color: var(--primary-red);
    background: rgba(220, 38, 38, 0.05);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 48px;
    color: var(--primary-red);
    margin-bottom: 16px;
}

.upload-text {
    margin-bottom: 12px;
}

.upload-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upload-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.browse-link {
    color: var(--primary-red);
    font-weight: 600;
    cursor: pointer;
}

.upload-formats {
    font-size: 12px;
    color: var(--text-light);
}

.files-preview {
    margin-top: 16px;
    border: 2px solid var(--border-light);
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.files-list {
    max-height: 200px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.file-item:last-child {
    border-bottom: none;
}

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

.file-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #10b981, #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
}

.file-icon.pdf { background: linear-gradient(135deg, #ef4444, #dc2626); }
.file-icon.doc { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.file-icon.image { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.file-icon.excel { background: linear-gradient(135deg, #10b981, #059669); }

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 4px;
    word-break: break-all;
}

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

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

.remove-file {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-file:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: scale(1.1);
}

/* Job Selection Modal Styles */
.job-selection-modal {
    position: relative;
    margin: 20px auto 0 auto;
    max-height: calc(100vh - 120px);
    width: 90%;
    max-width: 900px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border-radius: 12px;
    border: 2px solid var(--primary-red);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.job-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 2px solid var(--border-color);
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
    flex-shrink: 0;
}

.job-modal-header h2 {
    color: var(--primary-red);
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modern-close-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    color: var(--primary-red);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 16px;
    border: 2px solid transparent;
}

.modern-close-btn:hover {
    background: var(--primary-red);
    color: white;
    border-color: var(--primary-red);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.job-selection-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-primary));
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-container {
    position: relative;
}

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

.search-icon {
    position: absolute;
    left: 16px;
    color: var(--text-secondary);
    font-size: 16px;
    z-index: 1;
}

.professional-search {
    width: 100%;
    padding: 16px 16px 16px 48px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.professional-search:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.professional-search::placeholder {
    color: var(--text-secondary);
    font-weight: 400;
    font-style: italic;
}

 .selection-controls {
     display: flex;
     gap: 16px;
     flex-wrap: wrap;
 }
 
 .btn-professional {
     padding: 12px 24px;
     font-size: 14px;
     font-weight: 600;
     border-radius: 8px;
     text-transform: uppercase;
     letter-spacing: 0.5px;
     transition: all 0.3s ease;
     display: flex;
     align-items: center;
     gap: 8px;
     font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
     border: 2px solid transparent;
     min-width: 140px;
     justify-content: center;
 }
 
 .btn-professional:hover {
     transform: translateY(-2px);
     box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
 }
 
 .btn-secondary.btn-professional {
     background: linear-gradient(135deg, #6b7280, #4b5563);
     color: white;
     border-color: #6b7280;
 }
 
 .btn-secondary.btn-professional:hover {
     background: linear-gradient(135deg, #4b5563, #374151);
     border-color: #4b5563;
 }
 
 .btn-primary.btn-professional {
     background: linear-gradient(135deg, var(--primary-red), #dc2626);
     color: white;
     border-color: var(--primary-red);
 }
 
 .btn-primary.btn-professional:hover {
     background: linear-gradient(135deg, #dc2626, #b91c1c);
     border-color: #dc2626;
 }
 
 .jobs-list {
     max-height: 400px;
     overflow-y: auto;
     padding: 8px 0;
     flex: 1;
 }
 
 .jobs-list::-webkit-scrollbar {
     width: 10px;
 }
 
 .jobs-list::-webkit-scrollbar-track {
     background: var(--bg-secondary);
     border-radius: 5px;
 }
 
 .jobs-list::-webkit-scrollbar-thumb {
     background: linear-gradient(135deg, rgba(220, 38, 38, 0.3), rgba(220, 38, 38, 0.5));
     border-radius: 5px;
     border: 2px solid var(--bg-secondary);
 }
 
 .jobs-list::-webkit-scrollbar-thumb:hover {
     background: linear-gradient(135deg, rgba(220, 38, 38, 0.5), rgba(220, 38, 38, 0.7));
 }
 
 .job-item {
     padding: 16px !important;
     border: 2px solid var(--border-color) !important;
     border-radius: 12px !important;
     margin-bottom: 12px !important;
     cursor: pointer !important;
     transition: all 0.3s ease !important;
     background: var(--card-bg) !important;
     box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
 }
 
 .job-item:hover {
     border-color: var(--primary-red) !important;
     transform: translateY(-2px);
     box-shadow: 0 8px 20px rgba(220, 38, 38, 0.15) !important;
 }
 
 .job-item.selected {
     border-color: var(--primary-red) !important;
     background: rgba(220, 38, 38, 0.05) !important;
     box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2) !important;
 }
 
 .job-modal-footer {
     display: flex;
     justify-content: space-between;
     align-items: center;
     padding: 20px 32px;
     border-top: 2px solid var(--border-color);
     background: linear-gradient(135deg, var(--bg-secondary), var(--bg-primary));
     flex-shrink: 0;
 }
 
 .selected-count {
     font-size: 16px;
     color: var(--text-primary);
     font-weight: 600;
     display: flex;
     align-items: center;
     gap: 8px;
     text-transform: uppercase;
     letter-spacing: 0.5px;
 }
 
 .selected-count i {
     color: var(--primary-red);
 }
 
 .modal-actions {
     display: flex;
     gap: 16px;
 }
 
 .modal-actions .btn-professional {
     min-width: 120px;
     padding: 12px 20px;
     font-size: 14px;
 }
 
 /* Selected Jobs Display */
 .selected-jobs-list {
     margin-top: 8px;
     min-height: 40px;
     max-height: 120px;
     overflow-y: auto;
     padding: 12px;
     border: 2px solid var(--border-color);
     border-radius: 8px;
     background: var(--bg-secondary);
     box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
 }
 
 .selected-job-tag {
     display: inline-flex;
     align-items: center;
     gap: 8px;
     background: linear-gradient(135deg, var(--primary-red), #dc2626);
     color: white;
     padding: 8px 16px;
     border-radius: 25px;
     font-size: 13px;
     margin: 4px 8px 4px 0;
     font-weight: 600;
     text-transform: uppercase;
     letter-spacing: 0.3px;
     box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
 }
 
 .selected-job-tag button {
     background: rgba(255, 255, 255, 0.2);
     border: none;
     color: white;
     cursor: pointer;
     padding: 4px;
     width: 20px;
     height: 20px;
     display: flex;
     align-items: center;
     justify-content: center;
     border-radius: 50%;
     font-size: 12px;
     transition: all 0.3s ease;
     font-weight: bold;
 }
 
 .selected-job-tag button:hover {
     background: rgba(255, 255, 255, 0.3);
     transform: scale(1.1);
 }
 
 /* Modal positioning fix - REMOVED DUPLICATE - using main modal styles above */
 
 .modal.active {
     opacity: 1;
     visibility: visible;
 }
 
 /* Responsive design for job selection modal */
@media (max-width: 768px) {
    .modal {
        padding: 20px 10px 10px 10px;
    }
    
    .job-selection-modal {
        margin: 10px auto 0 auto;
        max-height: calc(100vh - 60px);
        width: 95%;
    }
    
    .job-modal-header {
        padding: 16px 20px;
    }
    
    .job-modal-header h2 {
        font-size: 20px;
    }
    
    .job-selection-controls {
        padding: 16px;
        gap: 16px;
    }
    
    .selection-controls {
        flex-direction: column;
    }
    
    .selection-controls .btn-professional {
        width: 100%;
        min-width: auto;
    }
    
    .job-item {
        padding: 12px !important;
    }
    
    .job-modal-footer {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
        padding: 16px 20px;
    }
    
    .modal-actions {
        width: 100%;
    }
    
    .modal-actions .btn-professional {
        flex: 1;
        min-width: auto;
    }
    
    .selected-jobs-list {
        max-height: 80px;
    }
    
    .professional-search {
        padding: 14px 14px 14px 44px;
        font-size: 14px;
    }
    
    .search-icon {
        left: 14px;
        font-size: 14px;
    }
}

.jobs-list.loading::before {
    content: "";
    width: 32px;
    height: 32px;
    border: 3px solid var(--bg-secondary);
    border-top: 3px solid var(--primary-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
} 

/* Date Input Enhanced Styles */
.date-input-enhanced {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.date-input-enhanced input[type="date"] {
    border: 2px solid #e5e7eb;
    transition: var(--transition-smooth);
    background: var(--bg-primary);
}

.date-input-enhanced.focused input[type="date"] {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.date-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    padding: 8px 0;
}

.date-quick-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--secondary-red);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    border-radius: 0px;
}

.date-quick-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(220, 38, 38, 0.1), transparent);
    transition: var(--transition-smooth);
}

.date-quick-btn:hover {
    background: var(--secondary-red);
    color: var(--primary-red);
    border-color: var(--primary-red);
    transform: translateY(-1px);
    box-shadow: var(--shadow-light);
}

.date-quick-btn:hover::before {
    left: 100%;
}

.date-quick-btn:active {
    transform: translateY(0);
    background: var(--primary-red);
    color: white;
}

/* Date Input Validation States */
.date-input-enhanced input[type="date"].date-past {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

.date-input-enhanced input[type="date"].date-today {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.date-input-enhanced input[type="date"].date-future {
    border-color: var(--primary-red);
    background: rgba(220, 38, 38, 0.05);
}

/* Date Range Indicator */
.date-range-indicator {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    padding: 6px 12px;
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #059669;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    z-index: 10;
    animation: slideDown 0.3s ease-out;
    border-radius: 0px;
}

/* Date Confirmation Animation */
@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(10px) scale(0.8);
    }
    20% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    80% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px) scale(0.9);
    }
}

/* Enhanced Date Input for Mobile */
@media (max-width: 768px) {
    .date-quick-actions {
        gap: 4px;
    }
    
    .date-quick-btn {
        font-size: 10px;
        padding: 5px 8px;
        flex: 1;
        justify-content: center;
        min-width: 80px;
    }
    
    .date-input-enhanced {
        gap: 6px;
    }
    
    .date-range-indicator {
        font-size: 10px;
        padding: 4px 8px;
    }
}

/* Date input styling improvements */
.date-input-enhanced input[type="date"]::-webkit-calendar-picker-indicator {
    background: var(--primary-red);
    color: white;
    border-radius: 2px;
    cursor: pointer;
    padding: 2px;
}

.date-input-enhanced input[type="date"]::-webkit-calendar-picker-indicator:hover {
    background: var(--primary-red-dark);
}

/* Date confirmation tooltip */
.date-confirmation {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    z-index: 1000;
    animation: fadeInOut 2s ease-out forwards;
    pointer-events: none;
    white-space: nowrap;
}

/* Order Attachments Styles */
.attachments-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}

.attachment-item:hover {
    background: rgba(220, 38, 38, 0.05);
    border-color: var(--primary-red);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.attachment-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.attachment-icon.pdf { background: linear-gradient(135deg, #ef4444, #dc2626); }
.attachment-icon.doc { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.attachment-icon.image { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.attachment-icon.excel { background: linear-gradient(135deg, #10b981, #059669); }
.attachment-icon.txt { background: linear-gradient(135deg, #6b7280, #4b5563); }
.attachment-icon.default { background: linear-gradient(135deg, #64748b, #475569); }

.attachment-info {
    flex: 1;
    min-width: 0;
}

.attachment-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.attachment-details span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.attachment-details .file-size::before {
    content: '\f3cd';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 4px;
}

.attachment-details .upload-date::before {
    content: '\f133';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 4px;
}

.attachment-details .uploaded-by::before {
    content: '\f007';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 4px;
}

.attachment-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--primary-red);
    border-color: var(--primary-red);
    color: white;
    transform: scale(1.1);
}

.btn-icon.btn-danger {
    border-color: #ef4444;
    color: #ef4444;
}

.btn-icon.btn-danger:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

/* Add File Modal Close Button */
#addFileModal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-primary);
}

#addFileModal .modal-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

#addFileModal .close-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-light);
    color: var(--text-secondary);
    font-size: 20px;
    font-weight: 300;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#addFileModal .close-btn:hover {
    background: var(--primary-red);
    color: white;
    transform: scale(1.1);
}

#addFileModal .modal-content {
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-height: 90vh;
    overflow-y: auto;
}

#addFileModal .modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 24px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

#addFileModal form {
    padding: 24px;
}

#addFileModal .form-group {
    margin-bottom: 0;
}

#addFileModal .form-label {
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Mobile responsive for add file modal */
@media (max-width: 768px) {
    #addFileModal .modal-content {
        margin: 20px;
        max-height: calc(100vh - 40px);
    }
    
    #addFileModal .modal-header {
        padding: 16px;
    }
    
    #addFileModal .modal-header h2 {
        font-size: 18px;
    }
    
    #addFileModal .close-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    #addFileModal form {
        padding: 16px;
    }
    
    #addFileModal .modal-footer {
        padding: 16px;
        flex-direction: column;
    }
    
    #addFileModal .modal-footer .btn {
        width: 100%;
    }
}

.no-attachments {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.no-attachments i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.error-message {
    padding: 20px;
    text-align: center;
    color: var(--error-color);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--border-radius);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .attachment-item {
        padding: 12px;
        gap: 8px;
    }
    
    .attachment-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .attachment-details {
        flex-direction: column;
        gap: 4px;
    }
    
    .attachment-actions {
        flex-direction: column;
        gap: 4px;
    }
    
    .btn-icon {
        width: 32px;
        height: 32px;
    }
}

/* Column Toggle Buttons Grid Layout */
.toggle-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toggle-btn:hover {
    background: rgba(220, 38, 38, 0.1);
    border-color: var(--primary-red);
    color: var(--primary-red);
}

.toggle-btn.active {
    background: var(--primary-red);
    border-color: var(--primary-red);
    color: white;
}

.toggle-btn.active:hover {
    background: var(--primary-red-dark);
    border-color: var(--primary-red-dark);
}

.toggle-btn i {
    font-size: 12px;
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}

/* Column control buttons */
.column-control-buttons {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.control-btn {
    flex: 1;
    padding: 10px 12px;
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.control-btn:hover {
    background: var(--primary-red);
    border-color: var(--primary-red);
    color: white;
}

/* Mobile responsive for toggle buttons */
@media (max-width: 768px) {
    .toggle-buttons {
        grid-template-columns: 1fr;
    }
    
    .toggle-btn {
        padding: 12px;
        font-size: 14px;
    }
    
    .toggle-btn i {
        font-size: 14px;
        width: 16px;
    }
    
    .column-control-buttons {
        flex-direction: column;
    }
    
    .control-btn {
        padding: 12px;
        font-size: 13px;
    }
}

/* Table Row Selection Styles */
.table tbody tr.order-row {
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

/* Yellow background for completed orders (green and over) */
.table tbody tr.order-row .status-badge.status-green,
.table tbody tr.order-row .status-badge.status-over {
    background: #fbbf24 !important;
    color: #92400e !important;
}

/* Yellow background for entire row when status is completed or over */
.table tbody tr.order-row:has(.status-badge.status-green),
.table tbody tr.order-row:has(.status-badge.status-over) {
    background: rgba(251, 191, 36, 0.15) !important;
}

.table tbody tr.order-row:has(.status-badge.status-green):hover,
.table tbody tr.order-row:has(.status-badge.status-over):hover {
    background: rgba(251, 191, 36, 0.25) !important;
}

.table tbody tr.order-row:hover {
    background: rgba(220, 38, 38, 0.05) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.1);
}

.table tbody tr.order-row.selected-row {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.1), rgba(220, 38, 38, 0.15)) !important;
    border-left: 4px solid var(--primary-red);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.table tbody tr.order-row.selected-row:hover {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.15), rgba(220, 38, 38, 0.2)) !important;
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.25);
}

/* Selection Summary Panel - Fixed Bottom Status Bar */
.selection-summary-panel {
    display: none !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-secondary));
    border-top: 3px solid var(--primary-red);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: slideUp 0.4s ease;
    backdrop-filter: blur(10px);
    border-radius: 0;
}

.selection-summary-header {
    display: none; /* Hide header in status bar mode */
}

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

.selection-summary-header h3 i {
    font-size: 14px;
}

.clear-selection-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 14px;
}

.clear-selection-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.selection-summary-content {
    padding: 8px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 44px;
    position: relative;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: none;
    white-space: nowrap;
}

.summary-item:not(:last-child)::after {
    content: "•";
    color: var(--primary-red);
    margin-left: 8px;
    font-weight: bold;
}

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

.summary-value {
    font-weight: 700;
    color: var(--primary-red);
    font-size: 13px;
}

.unit-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.unit-summary .summary-label {
    font-size: 11px;
    color: var(--text-secondary);
}

.unit-summary .summary-value {
    font-size: 12px;
    font-weight: 600;
}

/* Clear button positioning */
.selection-summary-content .clear-selection-btn {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.selection-summary-content .clear-selection-btn:hover {
    background: rgba(220, 38, 38, 0.2) !important;
    transform: translateY(-50%) scale(1.05) !important;
}

/* Selected order numbers styling */
.selected-order-numbers {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    font-weight: 500;
}

/* Responsive Design for Selection Panel */
@media (max-width: 768px) {
    .selection-summary-content {
        padding: 6px 12px;
        flex-direction: row;
        justify-content: center;
        gap: 8px;
        min-height: auto;
    }
    
    .selection-summary-content .selected-order-numbers {
        display: none; /* Hide order numbers on mobile */
    }
    
    .selection-summary-content > div:nth-child(2) {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }
    
    .selection-summary-content .clear-selection-btn {
        position: static;
        transform: none;
        right: auto;
        top: auto;
    }
    
    .summary-label,
    .summary-value {
        font-size: 11px;
    }
    
    .unit-summary .summary-label,
    .unit-summary .summary-value {
        font-size: 10px;
    }
    
    .clear-selection-btn {
        font-size: 8px !important;
        padding: 3px 6px !important;
    }
}

/* Animation for selection panel */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Selection count indicator */
.selection-count-badge {
    background: var(--primary-red);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
    animation: badgePulse 2s infinite;
}

/* Keyboard shortcuts hint */
.selection-hint {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    padding: 8px;
    background: rgba(220, 38, 38, 0.05);
    border-radius: 6px;
    margin-top: 8px;
}

.selection-hint kbd {
    background: var(--bg-card);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 3px;
    padding: 2px 4px;
    font-size: 10px;
    font-family: monospace;
    margin: 0 2px;
}

/* Order Detail Modal - Modern Design */
.order-detail-modal {
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-secondary));
    border-bottom: 2px solid rgba(220, 38, 38, 0.1);
    position: relative;
}

.detail-title h2 {
    margin: 0 0 4px 0;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
}

.order-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-red);
    letter-spacing: 1px;
}

.status-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.status-badge-large {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    color: white;
    font-weight: 600;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.completion-info {
    text-align: right;
}

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

.completion-bar {
    width: 120px;
    height: 6px;
    background: rgba(220, 38, 38, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.completion-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-red), #10b981);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.detail-header .close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(220, 38, 38, 0.1);
    color: var(--primary-red);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
}

.detail-header .close-btn:hover {
    background: var(--primary-red);
    color: white;
    transform: scale(1.1);
}

.detail-header .modal-actions {
    position: absolute;
    top: 16px;
    right: 20px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.detail-header .print-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
}

.detail-header .print-btn:hover {
    background: #10b981;
    color: white;
    transform: scale(1.1);
}

/* Content */
.detail-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

/* Info Cards */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.info-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid rgba(220, 38, 38, 0.1);
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.card-icon.company { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.card-icon.site { background: linear-gradient(135deg, #10b981, #059669); }
.card-icon.date { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.card-icon.deadline { background: linear-gradient(135deg, #f59e0b, #d97706); }
.card-icon.user { background: linear-gradient(135deg, #ef4444, #dc2626); }

.card-content {
    flex: 1;
}

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

.card-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Detail Sections */
.detail-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-section {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid rgba(220, 38, 38, 0.1);
    overflow: hidden;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.05), rgba(220, 38, 38, 0.1));
    border-bottom: 1px solid rgba(220, 38, 38, 0.1);
}

.section-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-header h3 i {
    color: var(--primary-red);
}

.section-badge {
    background: var(--primary-red);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

.section-content {
    padding: 20px;
}

/* Detail Grid */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.detail-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.detail-value.highlight {
    color: var(--primary-red);
    font-weight: 600;
}

.detail-value.warning {
    color: #f59e0b;
    font-weight: 600;
}

.detail-value.success {
    color: #10b981;
    font-weight: 600;
}

/* Dimensions Grid */
.dimensions-grid {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.dimension-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    background: rgba(220, 38, 38, 0.05);
    border-radius: 8px;
    min-width: 80px;
}

.dimension-item span:first-child {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.dimension-item span:last-child {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-red);
}

/* Price Grid */
.price-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.price-item {
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    background: rgba(220, 38, 38, 0.05);
    border-radius: 8px;
    min-width: 150px;
}

.price-item.total {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.1), rgba(220, 38, 38, 0.15));
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.price-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.price-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-red);
}

/* Description */
.description-text {
    padding: 16px;
    background: rgba(220, 38, 38, 0.05);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Shipments Timeline */
.shipments-timeline {
    position: relative;
    padding-left: 40px;
}

.shipments-timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-red), rgba(220, 38, 38, 0.3));
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -32px;
    top: 0;
    width: 24px;
    height: 24px;
    background: var(--primary-red);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.timeline-content {
    background: rgba(220, 38, 38, 0.05);
    border-radius: 8px;
    padding: 16px;
}

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

.timeline-date {
    font-weight: 600;
    color: var(--text-primary);
}

.timeline-quantity {
    font-weight: 700;
    color: var(--primary-red);
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.timeline-details {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.timeline-details span {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.timeline-details i {
    color: var(--primary-red);
}

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

.loading-state i {
    color: var(--primary-red);
    margin-right: 8px;
}

/* Footer */
.detail-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    background: var(--bg-secondary);
    border-top: 1px solid rgba(220, 38, 38, 0.1);
}

.detail-footer .btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
}

/* Icon Buttons */
.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
}

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

.btn-icon.btn-primary:hover {
    background: #b91c1c;
    transform: scale(1.1);
}

.btn-icon.btn-primary i {
    color: white !important;
}

.btn-icon.btn-primary:hover i {
    color: white !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .order-detail-modal {
        margin: 10px;
        width: calc(100% - 20px);
        max-height: calc(100vh - 20px);
    }
    
    .detail-header {
        padding: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .status-info {
        align-items: flex-start;
        width: 100%;
    }
    
    .detail-header .modal-actions {
        top: 12px;
        right: 16px;
    }
    
    .detail-content {
        padding: 16px;
    }
    
    .info-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .info-card {
        padding: 12px;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .dimensions-grid,
    .price-grid {
        flex-direction: column;
        gap: 12px;
    }
    
    .timeline-details {
        flex-direction: column;
        gap: 8px;
    }
    
    .detail-footer {
        padding: 16px;
        flex-direction: column;
    }
    
    .detail-footer .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Excel-Style Column Filtering System */

/* Table Header Enhancements */
.th-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    padding: 2px 0;
}

.filter-arrow {
    font-size: 10px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    opacity: 0.6;
}

.th-content:hover .filter-arrow {
    opacity: 1;
    color: var(--primary-red);
}

.th-content.active .filter-arrow {
    color: var(--primary-red);
    transform: rotate(180deg);
}

.th-content.filtered {
    background: rgba(220, 38, 38, 0.1);
    border-radius: 4px;
    padding: 4px 8px;
}

.th-content.filtered .filter-arrow {
    color: var(--primary-red);
    opacity: 1;
}

/* Active Filters Container */
.active-filters-container {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.05), rgba(220, 38, 38, 0.1));
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 12px 16px;
}

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

.active-filters-header span {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-red);
}

.clear-all-filters {
    background: var(--primary-red);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-all-filters:hover {
    background: #b91c1c;
    transform: scale(1.05);
}

.active-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: white;
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: 16px;
    padding: 4px 12px;
    font-size: 12px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-badge:hover {
    background: rgba(220, 38, 38, 0.1);
    transform: translateY(-1px);
}

.filter-badge .remove-filter {
    color: var(--primary-red);
    font-size: 10px;
    cursor: pointer;
    padding: 2px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.filter-badge .remove-filter:hover {
    background: var(--primary-red);
    color: white;
}

/* Filter Dropdown */
.filter-dropdown {
    position: fixed;
    background: white;
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 10000 !important;
    width: 280px;
    max-height: 400px;
    overflow: hidden;
    display: none;
    flex-direction: column;
    transform: translateY(-5px);
    opacity: 0;
    transition: all 0.2s ease;
}

.filter-dropdown[style*="display: flex"] {
    transform: translateY(0);
    opacity: 1;
}

.filter-dropdown-header {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.05), rgba(220, 38, 38, 0.1));
    border-bottom: 1px solid rgba(220, 38, 38, 0.1);
    padding: 12px;
}

.filter-search {
    position: relative;
    margin-bottom: 8px;
}

.filter-search input {
    width: 100%;
    padding: 8px 12px 8px 32px;
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.3s ease;
}

.filter-search input:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.1);
}

.filter-search i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 12px;
}

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

.filter-select-all,
.filter-select-none {
    flex: 1;
    padding: 6px 12px;
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: 4px;
    background: white;
    color: var(--text-primary);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select-all:hover,
.filter-select-none:hover {
    background: rgba(220, 38, 38, 0.1);
    border-color: var(--primary-red);
}

.filter-dropdown-content {
    flex: 1;
    overflow-y: auto;
    max-height: 250px;
}

.filter-items-list {
    padding: 8px 0;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
}

.filter-item:hover {
    background: rgba(220, 38, 38, 0.05);
}

.filter-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-red);
}

.filter-item-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-item-count {
    color: var(--text-secondary);
    font-size: 11px;
    background: rgba(220, 38, 38, 0.1);
    padding: 2px 6px;
    border-radius: 10px;
}

.filter-dropdown-footer {
    border-top: 1px solid rgba(220, 38, 38, 0.1);
    padding: 12px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.filter-dropdown-footer .btn {
    padding: 8px 16px;
    font-size: 12px;
    border-radius: 4px;
}

/* Hidden Rows */
.order-row.filtered-hidden {
    display: none !important;
}

.invoice-row.accounting-filtered-hidden {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

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

.filter-loading i {
    color: var(--primary-red);
    margin-right: 8px;
}

/* Empty State */
.filter-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .filter-dropdown {
        width: 260px;
        max-height: 350px;
    }
    
    .active-filters-container {
        padding: 8px 12px;
    }
    
    .active-filters-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .filter-badge {
        font-size: 11px;
        padding: 3px 8px;
    }
    
    .th-content {
        font-size: 12px;
    }
    
    .filter-arrow {
        font-size: 8px;
    }
}

/* Invoice Styles */
.invoices-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.invoices-table-container {
    margin-top: 20px;
}

.company-input-container {
    position: relative;
}

.company-input-container input[type="text"],
.company-input-container input.form-input,
.company-input-container .form-input {
    text-transform: uppercase;
}

.company-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-large);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.company-option {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition-smooth);
}

.company-option:hover {
    background: var(--bg-hover);
}

.company-option.new-company {
    color: var(--primary-red);
    font-weight: 600;
}

.company-option.new-company:hover {
    background: rgba(220, 38, 38, 0.1);
}

/* Ordered by dropdown styles */
.ordered-by-input-container {
    position: relative;
}

.ordered-by-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-large);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.ordered-by-option {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition-smooth);
}

.ordered-by-option:hover {
    background: var(--bg-hover);
}

.ordered-by-option:last-child {
    border-bottom: none;
}

.invoice-calculation {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 24px 0;
}

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

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

.calculation-row.total {
    border-top: 2px solid var(--primary-red);
    margin-top: 12px;
    padding-top: 16px;
    font-size: 18px;
    color: var(--primary-red);
}

@media (max-width: 768px) {
    .invoices-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .invoices-header h2 {
        text-align: center;
        margin-bottom: 0;
    }
}

/* Settings Tab Styles */
.settings-content {
    padding: 0;
}

.settings-section {
    margin-bottom: 32px;
}

.settings-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.settings-header {
    padding: 24px;
    background: linear-gradient(135deg, var(--primary-red), #b91c1c);
    color: white;
}

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

.settings-title i {
    font-size: 20px;
}

.settings-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.settings-body {
    padding: 0;
}

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

.setting-item:last-child {
    border-bottom: none;
}

.setting-item.danger {
    background: rgba(220, 38, 38, 0.02);
    border-left: 4px solid #dc2626;
}

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

.setting-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.setting-item.danger .setting-info h4 {
    color: #dc2626;
}

.settings-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0;
}

.btn-warning {
    background: #f59e0b;
    color: white;
    border: none;
}

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

@media (max-width: 768px) {
    .setting-item {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
        text-align: left;
    }
    
    .setting-item .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Site Link Styling */
.site-link {
    color: var(--primary-red);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-smooth);
    position: relative;
    display: inline-block;
}

.site-link:hover {
    color: var(--primary-red-dark);
    text-decoration: none;
    transform: translateX(2px);
}

.site-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: var(--primary-red);
    transition: var(--transition-smooth);
}

.site-link:hover::after {
    width: 100%;
}

/* Company Orders Table Site Link */
.company-orders-table .site-link {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--transition-smooth);
}

.company-orders-table .site-link:hover {
    background: var(--secondary-red);
    transform: translateX(0);
}

.company-orders-table .site-link:hover::after {
    width: 0;
}

/* Company Orders Table Text Alignment */
.company-orders-table td[data-column="3"] {
    text-align: left !important;
}

/* Tabs styling */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 10px;
}

.tab-btn {
    padding: 8px 16px;
    border: none;
    background: none;
    color: #666;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: #f3f4f6;
}

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

/* Tab content - only hide if not in a wrapper (for backward compatibility) */
.tab-content:not(.tab-content-wrapper .tab-content) {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content:not(.tab-content-wrapper .tab-content).active {
    display: block;
}

/* Ensure tab-content-wrapper children are properly displayed - THIS IS THE MAIN RULE */
.tab-content-wrapper .tab-content {
    display: none !important;
}

.tab-content-wrapper .tab-content.active {
    display: block !important;
}

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

/* Timeline details styling */
.timeline-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.timeline-details span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: #f3f4f6;
    border-radius: 4px;
    color: #666;
    font-size: 0.9em;
}

.timeline-details i {
    color: var(--primary-red);
}

.timeline-details .delivery-notes {
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    color: #666;
    font-size: 0.9em;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.timeline-details .delivery-notes i {
    margin-top: 3px;
}

/* Shipment modal styling */
.shipment-modal {
    max-width: 800px !important;
}

/* Invoice section styling */
.invoices-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.invoice-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
}

.invoice-item:hover {
    background: #f1f3f5;
    border-color: var(--primary-red);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.1);
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

.invoice-number {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-red);
    font-weight: 600;
}

.invoice-number i {
    font-size: 1.1em;
}

.invoice-date {
    color: #666;
    font-size: 0.9em;
}

.invoice-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: center;
}

.invoice-company {
    font-weight: 500;
    color: #374151;
}

.invoice-description {
    color: #6b7280;
    font-size: 0.9em;
}

.invoice-amount,
.invoice-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.amount-label,
.total-label {
    color: #6b7280;
    font-size: 0.9em;
}

.amount-value {
    font-weight: 500;
    color: #374151;
}

.total-value {
    font-weight: 600;
    color: var(--primary-red);
    font-size: 1.1em;
}

@media (max-width: 768px) {
    .invoice-details {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .invoice-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary-red);
    margin: 0;
}

.modal-header h2 i {
    font-size: 1.2em;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.2s;
}

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

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    color: white;
}

.status-badge.good {
    background: linear-gradient(135deg, #10b981, #059669);
}

.status-badge.damaged {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.status-badge.incomplete {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Full width grid items */
.detail-item.full-width {
    grid-column: 1 / -1;
}

/* Table styles */
.table-responsive {
    overflow-x: auto;
    margin: 0 -16px;
    padding: 0 16px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

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

.table th {
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-secondary);
}

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

/* Column visibility toggle */
.col-hidden {
    display: none !important;
    width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
}

/* Specific overrides for accounting table */
.accounting-table th.col-hidden,
.accounting-table td.col-hidden {
    display: none !important;
    width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
}

/* Force hidden columns to not take up space */
#accountingTable th[style*="display: none"],
#accountingTable td[style*="display: none"] {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    overflow: hidden !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
}

/* Delivery Notes Table Filter Dropdown Styles */
.column-filter-dropdown {
    position: absolute;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    min-width: 280px;
    max-width: 350px;
    max-height: 400px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: filterDropdownSlide 0.2s ease-out;
}

@keyframes filterDropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.column-filter-dropdown .filter-header {
    background: var(--bg-secondary);
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.column-filter-dropdown .close-filter {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--transition-fast);
}

.column-filter-dropdown .close-filter:hover {
    background: #f3f4f6;
    color: var(--text-primary);
}

.column-filter-dropdown .filter-search {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.column-filter-dropdown .filter-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: var(--transition-fast);
}

.column-filter-dropdown .filter-search input:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.column-filter-dropdown .filter-controls {
    padding: 8px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
}

.column-filter-dropdown .filter-controls button {
    background: none;
    border: 1px solid #d1d5db;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-secondary);
}

.column-filter-dropdown .filter-controls button:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-red);
    color: var(--primary-red);
}

.column-filter-dropdown .filter-items {
    flex: 1;
    overflow-y: auto;
    max-height: 200px;
    padding: 8px 0;
}

.column-filter-dropdown .filter-items::-webkit-scrollbar {
    width: 6px;
}

.column-filter-dropdown .filter-items::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.column-filter-dropdown .filter-items::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.column-filter-dropdown .filter-items::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.column-filter-dropdown .filter-item {
    display: flex;
    align-items: center;
    padding: 6px 16px;
    cursor: pointer;
    transition: var(--transition-fast);
    gap: 8px;
    font-size: 14px;
}

.column-filter-dropdown .filter-item:hover {
    background: var(--bg-secondary);
}

.column-filter-dropdown .filter-item input[type="checkbox"] {
    margin: 0;
    accent-color: var(--primary-red);
}

.column-filter-dropdown .filter-item span {
    flex: 1;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.column-filter-dropdown .filter-actions {
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    background: var(--bg-secondary);
}

.column-filter-dropdown .filter-actions button {
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-fast);
    background: white;
    color: var(--text-primary);
}

.column-filter-dropdown .filter-actions button:first-child {
    background: var(--primary-red);
    border-color: var(--primary-red);
    color: white;
}

.column-filter-dropdown .filter-actions button:first-child:hover {
    background: var(--primary-red-dark);
    border-color: var(--primary-red-dark);
}

.column-filter-dropdown .filter-actions button:last-child:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-red);
    color: var(--primary-red);
}

/* Delivery Notes Table Toolbar Styles */
.delivery-notes-table .table-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.delivery-notes-table .toolbar-container {
    position: relative;
}

.delivery-notes-table .toolbar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-primary);
    font-weight: 500;
}

.delivery-notes-table .toolbar-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-red);
    color: var(--primary-red);
}

/* Toolbar container needs position:relative for absolute dropdowns */
.toolbar-container {
    position: relative;
}

.column-toggles {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: var(--shadow-large);
    padding: 16px;
    min-width: 300px;
    z-index: 1000;
    display: none;
    animation: filterDropdownSlide 0.2s ease-out;
}

/* Show class for column toggles panel */
.column-toggles.show {
    display: block;
}

.column-toggles h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-dropdown,
.filter-dropdown {
    position: relative;
}

.sort-menu,
.filter-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: var(--shadow-large);
    min-width: 200px;
    z-index: 1000;
    display: none;
    animation: filterDropdownSlide 0.2s ease-out;
}

/* Show class for sort and filter menus */
.sort-menu.show,
.filter-menu.show {
    display: block;
}

.sort-item,
.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition-fast);
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}

.sort-item:last-child,
.filter-item:last-child {
    border-bottom: none;
}

.sort-item:hover,
.filter-item:hover {
    background: var(--bg-secondary);
}

.sort-item i,
.filter-item i {
    color: var(--primary-red);
    width: 16px;
}

.delivery-notes-table .search-box {
    position: relative;
    margin-left: auto;
}

.delivery-notes-table .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 14px;
}

.delivery-notes-table .search-input {
    padding: 8px 12px 8px 36px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    width: 250px;
    outline: none;
    transition: var(--transition-fast);
}

.delivery-notes-table .search-input:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.delivery-notes-table .search-input::placeholder {
    color: var(--text-light);
}

/* Active Filters for Delivery Notes */
.delivery-notes-table .active-filters-container {
    background: var(--bg-secondary);
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.delivery-notes-table .active-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.delivery-notes-table .active-filters-header span {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.delivery-notes-table .clear-all-filters {
    background: none;
    border: 1px solid var(--primary-red);
    color: var(--primary-red);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 4px;
}

.delivery-notes-table .clear-all-filters:hover {
    background: var(--primary-red);
    color: white;
}

.delivery-notes-table .active-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.delivery-notes-table .active-filter {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.delivery-notes-table .filter-name {
    font-weight: 600;
    color: var(--text-secondary);
}

.delivery-notes-table .filter-values {
    color: var(--text-primary);
}

.delivery-notes-table .remove-filter {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    transition: var(--transition-fast);
}

.delivery-notes-table .remove-filter:hover {
    background: #f3f4f6;
    color: var(--primary-red);
}

/* Responsive Design for Delivery Notes */
@media (max-width: 768px) {
    .delivery-notes-table .table-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .delivery-notes-table .search-box {
        margin-left: 0;
    }
    
    .delivery-notes-table .search-input {
        width: 100%;
    }
    
    .column-filter-dropdown {
        min-width: 250px;
        max-width: 300px;
    }
    
    .delivery-notes-table .column-toggles {
        min-width: 280px;
        left: auto;
        right: 0;
    }
    
    .delivery-notes-table .active-filters-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Toggle Advanced Item Button */
.toggle-advanced-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    margin-top: 8px;
}

.toggle-advanced-item:hover {
    background: var(--primary-red);
    border-color: var(--primary-red);
    color: white;
    text-decoration: none;
}

.toggle-advanced-item i {
    font-size: 11px;
    transition: transform 0.2s ease;
}

.toggle-advanced-item:hover i {
    transform: scale(1.1);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .toggle-advanced-item {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .toggle-advanced-item i {
        font-size: 12px;
    }
}

/* Form Validation Styles */
.form-input[required]:invalid,
.form-select[required]:invalid,
.form-textarea[required]:invalid {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.1);
}

.form-input[required]:valid,
.form-select[required]:valid,
.form-textarea[required]:valid {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}

/* Ensure form elements are always focusable */
.form-input, .form-select, .form-textarea {
    position: relative !important;
    z-index: 1 !important;
}

/* Modal form elements special handling */
.modal .form-input, 
.modal .form-select, 
.modal .form-textarea {
    transition: var(--transition-smooth);
}

.modal .form-input:focus,
.modal .form-select:focus,
.modal .form-textarea:focus {
    outline: 2px solid var(--primary-red);
    outline-offset: 2px;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

/* Unit select specific styling */
select[name="unit"] {
    cursor: pointer;
    position: relative !important;
    z-index: 10 !important;
}

select[name="unit"]:focus {
    outline: 2px solid var(--primary-red) !important;
    outline-offset: 2px !important;
    border-color: var(--primary-red) !important;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1) !important;
}

/* Ensure hidden elements are still focusable for validation */
.form-group[data-hidden="true"] {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.form-group[data-hidden="true"] .form-input,
.form-group[data-hidden="true"] .form-select,
.form-group[data-hidden="true"] .form-textarea {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Toast notification for validation errors */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 16px 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-large);
    z-index: 10000;
    transform: translateX(100%);
    transition: var(--transition-smooth);
    border-left: 4px solid var(--primary-red);
}

.toast.show {
    transform: translateX(0);
}

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

.toast.success {
    border-left-color: #10b981;
}

.toast.error {
    border-left-color: var(--primary-red);
}

/* Form validation error state */
.form-group.error .form-input,
.form-group.error .form-select,
.form-group.error .form-textarea {
    border-color: var(--primary-red);
    background-color: rgba(220, 38, 38, 0.05);
}

.form-group.error .form-label {
    color: var(--primary-red);
}

/* Ensure invoice modal form elements are properly styled */
#invoiceForm .form-input,
#invoiceForm .form-select,
#invoiceForm .form-textarea {
    transition: var(--transition-smooth);
}

#invoiceForm .form-input:focus,
#invoiceForm .form-select:focus,
#invoiceForm .form-textarea:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
    outline: none;
}

/* Ensure grid elements don't interfere with form validation */
.grid[data-hidden="true"] {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.grid[data-hidden="true"] .form-input,
.grid[data-hidden="true"] .form-select,
.grid[data-hidden="true"] .form-textarea {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Invoice Details Modal Styles */
.invoice-row {
    transition: var(--transition-fast);
}

.invoice-row:hover {
    background: rgba(220, 38, 38, 0.02);
    cursor: pointer;
}

.invoice-row.selected {
    background: rgba(220, 38, 38, 0.05);
    border-left: 3px solid var(--primary-red);
}

.order-detail-modal {
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-card);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-large);
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid rgba(220, 38, 38, 0.1);
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
}

.detail-title h2 {
    color: var(--primary-red);
    margin: 0 0 8px 0;
    font-size: 24px;
}

.invoice-number {
    font-size: 18px;
    color: var(--text-secondary);
    font-weight: 600;
}

.invoice-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    color: var(--text-secondary);
    background: white;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.invoice-date i {
    color: var(--primary-red);
}

.detail-content {
    padding: 24px;
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.info-card {
    background: white;
    padding: 16px;
    border-radius: var(--border-radius);
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition-smooth);
}

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

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

.card-icon.company { background: #3b82f6; }
.card-icon.site { background: #10b981; }
.card-icon.user { background: #ef4444; }
.card-icon.material { background: #f59e0b; }
.card-icon.tax { background: #ef4444; }

.card-content {
    flex: 1;
}

.card-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 4px;
}

.card-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.detail-section {
    background: white;
    border-radius: var(--border-radius);
    border: 1px solid #e5e7eb;
    margin-bottom: 16px;
    overflow: hidden;
}

.section-header {
    padding: 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-header i {
    color: var(--primary-red);
}

.section-content {
    padding: 16px;
}

.material-details {
    display: grid;
    gap: 12px;
}

.material-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.material-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 150px;
}

.material-value {
    color: var(--text-primary);
    font-weight: 500;
}

.price-breakdown {
    display: grid;
    gap: 8px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.price-row.total-row {
    background: #fef2f2;
    margin: 8px -16px -16px -16px;
    padding: 16px;
    border-top: 2px solid var(--primary-red);
    border-bottom: none;
}

.price-label {
    font-weight: 600;
    color: var(--text-secondary);
}

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

.total-row .price-label,
.total-row .price-value {
    color: var(--primary-red);
    font-size: 18px;
}

.notes-content {
    background: #f8fafc;
    padding: 16px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-red);
    font-style: italic;
    color: var(--text-secondary);
}

.detail-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.tax-rate {
    background: #fef2f2;
    color: var(--primary-red);
    padding: 4px 8px;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 12px;
}

.btn-info {
    background: #3b82f6;
    color: white;
    border: 1px solid #3b82f6;
}

.btn-info:hover {
    background: #2563eb;
    border-color: #2563eb;
}

/* Mobile responsiveness for invoice modal */
@media (max-width: 768px) {
    .order-detail-modal {
        max-width: 95%;
        width: 95%;
        max-height: 95vh;
    }
    
    .detail-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .detail-content {
        padding: 16px;
    }
    
    .info-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .material-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .material-label {
        min-width: auto;
    }
    
    .price-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .detail-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .detail-actions .btn {
        width: 100%;
    }
}

/* Action buttons container for invoice/order actions */
.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.action-buttons .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 35px;
    height: 35px;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
}

.action-buttons .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.action-buttons .btn i {
    font-size: 14px;
}

.action-buttons .btn-info {
    background: #3b82f6;
    color: white;
    border: 1px solid #3b82f6;
}

.action-buttons .btn-info:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.action-buttons .btn-secondary {
    background: #6b7280;
    color: white;
    border: 1px solid #6b7280;
}

.action-buttons .btn-secondary:hover {
    background: #4b5563;
    border-color: #4b5563;
}

.action-buttons .btn-danger {
    background: #ef4444;
    color: white;
    border: 1px solid #ef4444;
}

.action-buttons .btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

/* Mobile responsive action buttons */
@media (max-width: 768px) {
    .action-buttons {
        flex-direction: column;
        gap: 4px;
    }
    
    .action-buttons .btn {
        width: 100%;
        min-width: auto;
    }
}

/* Dashboard Styles */
.dashboard-content {
    padding: 0;
}

.dashboard-header {
    background: var(--bg-primary);
    padding: 24px;
    margin-bottom: 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.kpi-card {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition-smooth);
    border-left: 4px solid transparent;
    cursor: pointer;
}

.kpi-card:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
}

.kpi-card.urgent {
    border-left-color: #ef4444;
}

.kpi-card.partial {
    border-left-color: #f59e0b;
}

.kpi-card.completed {
    border-left-color: #10b981;
}

.kpi-card.pending {
    border-left-color: #e5e7eb;
}

.kpi-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.kpi-card.urgent .kpi-icon {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.kpi-card.partial .kpi-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.kpi-card.completed .kpi-icon {
    background: linear-gradient(135deg, #10b981, #059669);
}

.kpi-card.pending .kpi-icon {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
}

.kpi-content {
    flex: 1;
}

.kpi-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.kpi-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.dashboard-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.charts-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.chart-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    overflow: hidden;
    transition: var(--transition-smooth);
}

.chart-card:hover {
    box-shadow: var(--shadow-medium);
}

.chart-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--secondary-red);
    background: var(--gradient-corporate);
}

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

.chart-container {
    padding: 24px;
    height: 300px;
    position: relative;
}

.company-stats-list {
    padding: 0;
    max-height: 300px;
    overflow-y: auto;
}

.company-stat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #f1f3f4;
    transition: var(--transition-smooth);
}

.company-stat-item:last-child {
    border-bottom: none;
}

.company-stat-item:hover {
    background: var(--bg-secondary);
}

.company-info {
    flex: 1;
}

.company-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

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

.company-value {
    font-weight: 700;
    color: var(--primary-red);
    font-size: 14px;
}

.dashboard-activities {
    margin-bottom: 32px;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--secondary-red);
    background: var(--gradient-corporate);
}

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

.activities-list {
    padding: 0;
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid #f1f3f4;
    transition: var(--transition-smooth);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item:hover {
    background: var(--bg-secondary);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--secondary-red);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-red);
    font-size: 16px;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.activity-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.activity-site {
    color: var(--primary-red);
    font-weight: 500;
}

.activity-date {
    font-size: 12px;
    color: var(--text-light);
}

.activity-status {
    flex-shrink: 0;
}

.empty-state {
    text-align: center;
    padding: 40px 24px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    margin: 0;
    font-size: 14px;
}

/* Responsive Dashboard */
@media (max-width: 1200px) {
    .dashboard-charts-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-kpi-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .dashboard-kpi-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 24px;
    }
    
    .kpi-card {
        padding: 16px;
    }
    
    .kpi-number {
        font-size: 24px;
    }
    
    .kpi-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .dashboard-charts-grid {
        gap: 16px;
        margin-bottom: 24px;
    }
    
    .charts-column {
        gap: 16px;
    }
    
    .chart-container {
        height: 250px;
        padding: 16px;
    }
    
    .chart-header,
    .card-header {
        padding: 16px;
    }
    
    .activity-item,
    .company-stat-item {
        padding: 12px 16px;
    }
    
    .activity-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

/* Print Button Styles */
.btn-print {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    border: none;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-print::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition-smooth);
}

.btn-print:hover::before {
    left: 100%;
}

.btn-print:hover {
    background: linear-gradient(135deg, #047857, #059669);
    box-shadow: var(--shadow-medium);
    transform: translateY(-1px);
}

/* Print Styles */
.print-info {
    display: none;
}

@media print {
    /* Sayfa ayarları */
    @page {
        size: A4;
        margin: 1cm;
    }
    
    /* Genel stil ayarları */
    * {
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    body {
        font-size: 10pt;
        line-height: 1.4;
        background: white !important;
        color: black !important;
    }
    
    /* Print başlığı */
    .print-info {
        display: block !important;
        page-break-after: avoid;
        margin-bottom: 20px;
        border-bottom: 2px solid #dc2626;
        padding-bottom: 15px;
    }
    
    .print-header {
        text-align: center;
    }
    
    .print-title {
        font-size: 18pt;
        font-weight: bold;
        color: #dc2626 !important;
        margin-bottom: 8px;
        letter-spacing: 1px;
    }
    
    .print-subtitle {
        font-size: 14pt;
        font-weight: 600;
        color: #333 !important;
        margin-bottom: 4px;
    }
    
    .print-date {
        font-size: 10pt;
        color: #666 !important;
        font-style: italic;
    }
    
    /* Gizlenecek öğeler */
    .header,
    .btn,
    .btn-print,
    .logout-btn,
    .sidebar,
    .floating-btn,
    .message-badge,
    .chart-container canvas,
    .filter-dropdown,
    .modal,
    .loading-overlay {
        display: none !important;
    }
    
    /* Ana içerik */
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .container {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Dashboard başlığı */
    .dashboard-header {
        margin-bottom: 20px;
        text-align: center;
        page-break-after: avoid;
    }
    
    .dashboard-header h1 {
        font-size: 16pt;
        color: #dc2626 !important;
        margin-bottom: 8px;
    }
    
    .dashboard-header p {
        font-size: 11pt;
        color: #333 !important;
    }
    
    /* KPI kartları */
    .dashboard-kpi-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
        margin-bottom: 20px;
        page-break-inside: avoid;
    }
    
    .kpi-card {
        background: white !important;
        border: 1px solid #ddd !important;
        padding: 15px;
        box-shadow: none !important;
        border-radius: 0 !important;
        page-break-inside: avoid;
    }
    
    .kpi-icon {
        background: #f5f5f5 !important;
        color: #333 !important;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .kpi-number {
        font-size: 20pt;
        font-weight: bold;
        color: #dc2626 !important;
    }
    
    .kpi-label {
        font-size: 10pt;
        color: #666 !important;
    }
    
    /* Chart kartları */
    .chart-card {
        background: white !important;
        border: 1px solid #ddd !important;
        margin-bottom: 20px;
        padding: 15px;
        box-shadow: none !important;
        border-radius: 0 !important;
        page-break-inside: avoid;
    }
    
    .chart-header h3 {
        font-size: 12pt;
        color: #333 !important;
        margin-bottom: 10px;
        border-bottom: 1px solid #eee;
        padding-bottom: 5px;
    }
    
    /* Grafik alanı: canvas'ı gizle, varsa print imajını göster */
    .chart-container {
        display: block !important;
    }
    .chart-container canvas {
        display: none !important;
    }
    #hourlyChartPrint {
        display: block !important;
    }
    
    /* Aktivite listeleri */
    .activities-list {
        max-height: none !important;
        overflow: visible !important;
    }

    /* Daha sıkı dikey boşluklar */
    .chart-card,
    .kpi-card,
    .order-detail-card {
        margin: 8px 0 !important;
        padding: 8px !important;
    }
    .chart-header h3 { margin-bottom: 6px !important; }
    .order-header { padding: 10px !important; }
    .order-materials { padding: 8px !important; }
    
    .activity-item {
        background: white !important;
        border: none !important;
        border-bottom: 1px solid #eee !important;
        padding: 10px 0;
        margin: 0 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
    
    .activity-item:last-child {
        border-bottom: none !important;
    }
    
    .activity-icon {
        background: #f5f5f5 !important;
        color: #333 !important;
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .activity-title {
        font-size: 10pt;
        color: #333 !important;
        font-weight: 600;
    }
    
    .activity-description {
        font-size: 9pt;
        color: #666 !important;
    }
    
    .activity-date {
        font-size: 8pt;
        color: #999 !important;
    }
    
    .activity-site {
        color: #dc2626 !important;
        font-weight: 600;
    }
    
    /* Status göstergeleri */
    .status-indicator {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        display: inline-block;
        margin-right: 5px;
    }
    
    .status-green {
        background: #10b981 !important;
    }
    
    .status-yellow {
        background: #f59e0b !important;
    }
    
    .status-red {
        background: #ef4444 !important;
    }
    
    .status-white {
        background: #e5e7eb !important;
        border: 1px solid #d1d5db !important;
    }
    
    /* Charts grid */
    .dashboard-charts-grid {
        display: block !important;
    }
    
    .charts-column {
        width: 100% !important;
    }
    
    /* Empty state */
    .empty-state {
        text-align: center;
        padding: 20px;
        color: #666 !important;
    }
    
    .empty-state i {
        font-size: 24px;
        color: #999 !important;
    }
    
    /* Finansal özet */
    .company-stat-item {
        background: #f9f9f9 !important;
        border: 1px solid #ddd !important;
        border-left: 4px solid #dc2626 !important;
        padding: 15px;
        margin-bottom: 10px;
        page-break-inside: avoid;
    }
    
    .company-name {
        font-size: 11pt;
        font-weight: 600;
        color: #333 !important;
    }
    
    .company-orders {
        font-size: 9pt;
        color: #666 !important;
    }
    
    .company-value {
        font-size: 14pt;
        font-weight: bold;
        color: #dc2626 !important;
    }
    
    /* Sayfa kesimi */
    .page-break {
        page-break-before: always;
    }
    
    .no-page-break {
        page-break-inside: avoid;
    }
    
    /* Hover efektleri kaldır */
    *:hover {
        background: transparent !important;
        color: inherit !important;
        transform: none !important;
    }
    
    /* Font awesome ikonları */
    .fas,
    .far,
    .fab {
        font-family: 'Font Awesome 6 Free' !important;
        font-weight: 900 !important;
    }
    
    .professional-icon {
        color: #666 !important;
    }
    
    /* Responsive print için */
    @media print and (max-width: 768px) {
        .dashboard-kpi-grid {
            grid-template-columns: repeat(2, 1fr);
        }
        
        .kpi-number {
            font-size: 16pt;
        }
        
        .chart-header h3 {
            font-size: 11pt;
        }
    }
}

/* Approval System Styles */
.approval-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    text-align: center;
}

.approval-status.approved {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.approval-status.pending {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.approval-status.rejected {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.approval-status.paid {
    background: rgba(34, 197, 94, 0.1);
    color: #15803d;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

/* Invoice Row Colors */
.invoice-row.approved-row {
    background-color: rgba(59, 130, 246, 0.15) !important; /* Blue - Approved */
}

.invoice-row.paid-row {
    background-color: rgba(16, 185, 129, 0.18) !important; /* More vibrant green - Paid */
}

.invoice-row.pending-row {
    background-color: #ffffff !important; /* White - Pending */
}

.invoice-row.rejected-row {
    background-color: rgba(247, 16, 16, 0.08) !important; /* Red - Rejected */
}

.invoice-row.approved-row:hover {
    background-color: rgba(9, 100, 247, 0.2) !important;
}

.invoice-row.paid-row:hover {
    background-color: rgba(16, 185, 129, 0.28) !important;
}

.invoice-row.pending-row:hover {
    background-color: #f9fafb !important;
}

.invoice-row.rejected-row:hover {
    background-color: rgba(239, 68, 68, 0.12) !important;
}

/* Stock Request Row Colors */
.stock-req-row.rejected-row {
    background-color: rgba(239, 68, 68, 0.08) !important; /* Red - Rejected */
}

.stock-req-row.rejected-row:hover {
    background-color: rgba(239, 68, 68, 0.12) !important;
}

/* Karmaşık hesaplama stilleri kaldırıldı - artık otomatik hesaplama yapılıyor */

.accounting-table .action-buttons {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
    justify-items: center !important;
    align-items: center !important;
}

.accounting-table .action-buttons .btn {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
}

/* Enhanced Modal Centering and Positioning */
.modal {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh;
}

.modal-content {
    position: relative;
    margin: auto;
    display: block;
    max-height: 80vh;
    min-height: auto;
}

/* Ensure modal is always centered regardless of content size */
.modal.active {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Fix for very tall modals */
@media (max-height: 600px) {
    .modal {
        align-items: flex-start !important;
        padding-top: 20px;
    }
    
    .modal-content {
        max-height: 90vh;
    }
}

/* Floating drafts button inside order modal */
.floating-drafts-btn {
	position: absolute;
	left: 16px;
	bottom: 16px;
	z-index: 10;
	background: var(--primary-red);
	color: #fff;
	border: none;
	border-radius: 20px;
	padding: 8px 12px;
	cursor: pointer;
	font-size: 13px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.order-modal { position: relative; }

.floating-drafts-btn:hover { filter: brightness(0.95); }

/* Context Menu Styles */
.context-menu {
    position: fixed;
    background: var(--bg-primary);
    border: 1px solid var(--secondary-red);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-large);
    z-index: 10000;
    min-width: 200px;
    padding: 8px 0;
    display: none;
}

.context-menu-item {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    transition: var(--transition-fast);
    font-size: 14px;
}

.context-menu-item:hover {
    background: var(--secondary-red);
    color: var(--primary-red);
}

.context-menu-item.delete-item {
    color: #dc2626;
    border-top: 1px solid #f3f4f6;
}

.context-menu-item.delete-item:hover {
    background: rgba(220, 38, 38, 0.1);
    color: #b91c1c;
}

.context-menu-item i {
    width: 16px;
    text-align: center;
}

/* Summary Item Styles - Küçültülmüş yazı boyutları */
.summary-item {
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    transition: var(--transition-smooth);
}

.summary-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.summary-item > div:first-child {
    font-size: 18px !important; /* Ana sayı - 24px'den 20px'e küçültüldü */
    font-weight: bold;
    margin-bottom: 4px;
}

.summary-item > div:last-child {
    font-size: 12px !important; /* Açıklama metni - 14px'den 12px'e küçültüldü */
    color: var(--text-secondary);
    line-height: 1.3;
}

/* ŞANTİYE SEÇİMİ ZORUNLULUK STİLLERİ */
.site-selection-warning {
    animation: siteSelectionPulse 1.5s infinite;
    border: 2px solid #dc2626 !important;
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.5) !important;
}

@keyframes siteSelectionPulse {
    0% {
        background-color: rgba(220, 38, 38, 0.1);
        box-shadow: 0 0 10px rgba(220, 38, 38, 0.3);
    }
    50% {
        background-color: rgba(220, 38, 38, 0.2);
        box-shadow: 0 0 20px rgba(220, 38, 38, 0.6);
    }
    100% {
        background-color: rgba(220, 38, 38, 0.1);
        box-shadow: 0 0 10px rgba(220, 38, 38, 0.3);
    }
}

.site-selection-warning .selector-header {
    background: rgba(220, 38, 38, 0.05) !important;
    border-color: #dc2626 !important;
}

.site-selection-warning .selected-value span {
    color: #dc2626 !important;
    font-weight: 600 !important;
}

.site-selection-warning .selected-value i {
    color: #dc2626 !important;
}
/* ==================== STOCK MANAGEMENT STYLES ==================== */

/* Category Tree Styles */
.category-tree {
    padding: 20px;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    margin-bottom: 8px;
}

.category-content {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s;
}

.category-content:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
}

.category-content i.fa-folder {
    color: var(--primary-color);
    margin-right: 12px;
    font-size: 18px;
}

.category-content span {
    flex: 1;
    font-weight: 500;
    color: var(--text-color);
}

.category-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.category-content:hover .category-actions {
    opacity: 1;
}

.category-list .category-list {
    margin-left: 32px;
    margin-top: 8px;
}

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

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

/* Text color utilities */
.text-success {
    color: #10b981 !important;
}

.text-danger {
    color: #ef4444 !important;
}

/* Material cards and stock badges */
.stock-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.stock-badge.low {
    background: #fef3c7;
    color: #92400e;
}

.stock-badge.medium {
    background: #dbeafe;
    color: #1e40af;
}

.stock-badge.high {
    background: #d1fae5;
    color: #065f46;
}


/* ==================== BULK STOCK MANAGEMENT STYLES ==================== */

.stock-items-list {
    margin-top: 20px;
}

.stock-items-list .items-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.stock-items-list .no-items-message {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-radius: 8px;
}

.stock-items-list .table-wrapper {
    overflow-x: auto;
}

.stock-items-list .table {
    width: 100%;
    border-collapse: collapse;
}

.stock-items-list .table thead {
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 1;
}

.stock-items-list .table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    border-bottom: 2px solid #e5e7eb;
}

.stock-items-list .table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f3f4;
    font-size: 14px;
}

.stock-items-list .table tbody tr {
    transition: var(--transition-fast);
}

.stock-items-list .table tbody tr:hover {
    background: var(--bg-secondary);
}

.stock-items-list .table tbody tr:last-child td {
    border-bottom: none;
}

/* Form Grid for depo forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

/* Bulk submit section */
#entrySubmitSection,
#exitSubmitSection {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px solid #e5e7eb;
}

/* Success animation for bulk operations */
@keyframes bulkSuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.bulk-success-animation {
    animation: bulkSuccess 0.5s ease-in-out;
}

/* Stock warning styles */
#exit_stock_warning {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #dc2626;
}

/* Material count badges */
#entryItemCount,
#exitItemCount,
#entrySubmitCount,
#exitSubmitCount {
    display: inline-block;
    background: var(--primary-red);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

/* Enhanced add-item-section for stock management */
.add-item-section {
    position: relative;
    transition: var(--transition-smooth);
}

.add-item-section:hover {
    box-shadow: var(--shadow-medium);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .stock-items-list .table {
        font-size: 12px;
    }
    
    .stock-items-list .table th,
    .stock-items-list .table td {
        padding: 8px 12px;
    }
}

/* Enhanced button styles for bulk operations */
.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    transition: var(--transition-smooth);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.btn-success:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

/* Material Cell Hover Effect */
.material-cell-clickable {
    transition: var(--transition-smooth);
    padding: 8px 12px;
    border-radius: 4px;
}

.material-cell-clickable:hover {
    background-color: rgba(220, 38, 38, 0.08);
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.15);
    transform: translateX(2px);
}

.material-cell-clickable:active {
    background-color: rgba(220, 38, 38, 0.12);
    transform: translateX(0);
}

.material-cell-clickable i {
    transition: var(--transition-smooth);
}

.material-cell-clickable:hover i {
    transform: scale(1.1);
    color: var(--primary-red-dark);
}

/* View Toggle Container - Checkbox for item/grouped view */
.view-toggle-container {
    display: flex;
    align-items: center;
    margin-right: 12px;
}

.view-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    margin: 0;
    user-select: none;
    padding: 8px 14px;
    background: var(--bg-primary);
    border: 2px solid rgba(220, 38, 38, 0.2);
    border-radius: 8px;
    transition: var(--transition-smooth);
}

.view-toggle-label:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-red);
    color: var(--primary-red);
}

.view-toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary-red);
    flex-shrink: 0;
}

.view-toggle-label span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.view-toggle-label i {
    font-size: 14px;
    transition: var(--transition-fast);
}

.view-toggle-label:hover i {
    transform: scale(1.1);
}

/* Responsive adjustments for view toggle */
@media (max-width: 768px) {
    .view-toggle-container {
        margin-right: 8px;
    }
    
    .view-toggle-label {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .view-toggle-label span {
        gap: 4px;
    }
}