/* ==========================================================================
   SPARE PARTS SYSTEM - MASTER STYLESHEET
   Version: 4.9 (Optimized, Globally Safe, Mobile MasterTable Fixed)
   ========================================================================== 
   
   TABLE OF CONTENTS:
   1. GLOBAL STYLES & TYPOGRAPHY
   2. NAVBAR & NAVIGATION
   3. TABLES, ROWS & 3D HOVER EFFECTS
   4. UI COMPONENTS (BADGES, FORMS, SELECT2, HIGHLIGHTS, BULK BAR)
   5. PAGE-SPECIFIC STYLES (DASHBOARD, KPI, ETC)
   6. GLOBAL MOBILE OPTIMIZATION
   ========================================================================== */

/* =========================================
   1. GLOBAL STYLES & TYPOGRAPHY
   ========================================= */
body { 
    background-color: #f8f9fa; 
    font-family: 'Segoe UI', system-ui, sans-serif; 
    -webkit-tap-highlight-color: transparent;
}

.card { 
    border-radius: 15px; 
    border: none; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); 
}

.form-label { 
    font-weight: 600; 
    font-size: 0.85rem; 
    color: #555; 
}

/* =========================================
   2. NAVBAR & NAVIGATION
   ========================================= */
.navbar-main { padding: 0.7rem 1rem; background: #0d6efd; box-shadow: 0 2px 10px rgba(0,0,0,0.1); z-index: 1050; position: relative; }
.navbar-sub { background: #0a58ca; border-top: 1px solid rgba(255,255,255,0.1); box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
.sub-link { color: rgba(255,255,255,0.8); text-decoration: none; padding: 0.8rem 1rem; font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; transition: all 0.2s; display: block; }
.sub-link:hover, .sub-link:focus { color: #fff; background: rgba(255,255,255,0.05); }

.sub-nav-dropdown .dropdown-menu { border: 1px solid rgba(0,0,0,0.05); border-radius: 12px; box-shadow: 0 12px 35px rgba(0,0,0,0.12); margin-top: 0.5rem; padding: 0.5rem 0; }
.sub-nav-dropdown .dropdown-item { font-size: 0.85rem; font-weight: 500; padding: 0.7rem 1.5rem; color: #495057; transition: all 0.15s ease-in-out; display: flex; align-items: center; }
.sub-nav-dropdown .dropdown-item i { color: #6c757d; transition: color 0.15s ease-in-out; width: 20px; }
.sub-nav-dropdown .dropdown-item:hover:not(.active) { background-color: #f0f7ff; color: #0d6efd; transform: translateX(4px); }
.sub-nav-dropdown .dropdown-item:hover:not(.active) i { color: #0d6efd; }
.sub-nav-dropdown .dropdown-item.active { background-color: #0d6efd; color: #fff; border-radius: 6px; margin: 0 0.5rem; width: calc(100% - 1rem); }
.sub-nav-dropdown .dropdown-item.active i { color: #fff; }
.sub-nav-dropdown .dropdown-divider { border-color: rgba(0,0,0,0.05); }

.notif-dropdown { min-width: 320px; max-height: 400px; overflow-y: auto; border: none; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); }
.notif-item { font-size: 0.85rem; border-bottom: 1px solid #f0f0f0; white-space: normal !important; line-height: 1.5; }
.notif-item:hover { background: #f8f9fa; }
.notif-item:last-child { border-bottom: none; }
.notif-time { font-size: 0.7rem; color: #888; display: block; margin-top: 4px; }
.user-name-text { font-weight: 600; font-size: 0.9rem; color: #fff; margin-right: 15px; }

@media (min-width: 992px) {
    .sub-link { border-bottom: 3px solid transparent; }
    .sub-link.active { color: #fff; background: rgba(255,255,255,0.1); border-bottom: 3px solid #fff; }
    .notif-dropdown { right: 0; left: auto; }
}
@media (max-width: 991px) {
    .navbar-collapse { background-color: #0d6efd; padding: 1rem; border-radius: 8px; margin-top: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); z-index: 1060; }
    .navbar-nav .nav-link { color: rgba(255,255,255,0.9) !important; }
    .navbar-nav .nav-link.active { color: #fff !important; font-weight: bold; }
    .sub-link { padding: 1rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
    .sub-link.active { color: #fff; background: rgba(255,255,255,0.1); border-left: 4px solid #fff; }
    .sub-nav-dropdown .dropdown-menu { position: static !important; transform: none !important; width: 100% !important; background-color: rgba(0,0,0,0.15); border: none; box-shadow: inset 0 4px 6px rgba(0,0,0,0.1); margin: 0; padding: 0; }
    .sub-nav-dropdown .dropdown-item { color: rgba(255,255,255,0.85); padding: 0.8rem 1.5rem 0.8rem 2.5rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
    .sub-nav-dropdown .dropdown-item i { color: rgba(255,255,255,0.6); }
    .sub-nav-dropdown .dropdown-item:hover:not(.active) { background-color: rgba(255,255,255,0.1); color: #fff; transform: none; }
    .sub-nav-dropdown .dropdown-item.active { margin: 0; width: 100%; border-radius: 0; border-left: 3px solid #0dcaf0; background-color: rgba(255,255,255,0.15); }
    .notif-dropdown { position: absolute !important; right: -65px !important; left: auto !important; width: 310px; max-width: 95vw; }
    .navbar-brand { font-size: 1.4rem !important; line-height: 1.2; display: flex; align-items: center; flex-wrap: nowrap; }
    .navbar-brand .badge { font-size: 0.6rem !important; padding: 0.35em 0.65em; white-space: nowrap; flex-shrink: 0; }
}

/* =========================================
   3. TABLES, ROWS & 3D HOVER EFFECTS
   ========================================= */
.table thead { background-color: #e9ecef; font-size: 0.85rem; text-transform: uppercase; }
.table tbody tr { background-color: #fff; } 
.table tbody tr.table-light { background-color: #f8f9fa; }

.sticky-action-col { position: sticky; left: 0; background-color: inherit; z-index: 2; box-shadow: 3px 0 6px rgba(0,0,0,0.05); border-right: 1px solid #dee2e6; }
.table thead th.sticky-action-col { background-color: #f0f4f8; z-index: 3; }

th.sortable { cursor: pointer; user-select: none; transition: background 0.2s; }
th.sortable:hover { background-color: #e9ecef !important; }

/* THE 3D POP-OUT EFFECT */
.table-hover > tbody > tr.clickable-row {
    cursor: pointer;
    position: relative; 
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}
.table-hover > tbody > tr.clickable-row > td {
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    box-shadow: inset 0 0 0 9999px transparent;
}
.table-hover > tbody > tr.clickable-row > td:first-child {
    box-shadow: inset 4px 0 0 transparent, inset 0 0 0 9999px transparent;
}

.table-hover > tbody > tr.clickable-row:hover {
    transform: translateY(-3px) scale(1.008);
    z-index: 10;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(13, 110, 253, 0.15) !important;
    background-color: #ffffff !important;
}
.table-hover > tbody > tr.clickable-row:hover > td {
    background-color: #ffffff !important; 
    box-shadow: inset 0 0 0 9999px rgba(13, 110, 253, 0.05) !important; 
    border-bottom-color: transparent !important; 
}
.table-hover > tbody > tr.clickable-row:hover > td:first-child {
    box-shadow: inset 4px 0 0 #0d6efd, inset 0 0 0 9999px rgba(13, 110, 253, 0.05) !important;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}
.table-hover > tbody > tr.clickable-row:hover > td:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.table-hover > tbody:hover > tr.clickable-row:not(:hover) {
    opacity: 0.4; 
    transform: scale(0.995); 
}

/* Row Action Icons (Native Bootstrap Approach - UNIFORM 32PX EVERYWHERE) */
.action-icon {
    width: 32px !important; 
    height: 32px !important;
    transition: all 0.2s ease;
}
.action-icon:hover { transform: scale(1.15); box-shadow: 0 4px 8px rgba(0,0,0,0.1); opacity: 1; }
.action-icon:active { transform: scale(0.95); }

/* Special Offer Row Styling (Seamless Orange/Amber Gradient) */
tr.row-offer-gradient {
    background: linear-gradient(120deg, #fff4e6 0%, #ffffff 100%) !important;
    border-left: 4px solid #fd7e14 !important; /* Bootstrap Orange */
}

/* Κάνουμε τα κελιά διάφανα για να φανεί το ενιαίο background της γραμμής */
tr.row-offer-gradient > td {
    background-color: transparent !important;
}

/* Ομαλό Hover Effect για την γραμμή της προσφοράς */
.table-hover > tbody > tr.row-offer-gradient.clickable-row:hover {
    background: linear-gradient(120deg, #ffe5d0 0%, #ffffff 100%) !important;
}
.table-hover > tbody > tr.row-offer-gradient.clickable-row:hover > td {
    background-color: transparent !important;
}

/* Διόρθωση για Mobile Views */
@media (max-width: 768px) {
    #requestsTable tr.row-offer-gradient, 
    #warehouseTable tr.row-offer-gradient, 
    #logisticsTable tr.row-offer-gradient {
        border: 1px solid rgba(253, 126, 20, 0.3) !important;
        border-left: 5px solid #fd7e14 !important;
        background: linear-gradient(120deg, #fff4e6 0%, #ffffff 100%) !important;
    }
}

/* =========================================
   4. UI COMPONENTS (BADGES, FORMS, BULK)
   ========================================= */

/* Core Field Highlights (New Request) */
.highlight-customer { background-color: #f4fbf8 !important; border: 2px solid #198754 !important; box-shadow: 0 4px 12px rgba(25, 135, 84, 0.12) !important; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); }
.highlight-customer:focus, .highlight-customer:active { background-color: #ffffff !important; box-shadow: 0 6px 16px rgba(25, 135, 84, 0.25) !important; transform: translateY(-2px); border-color: #157347 !important; }
.highlight-part { background-color: #f0f9fc !important; border: 2px solid #0dcaf0 !important; box-shadow: 0 4px 12px rgba(13, 202, 240, 0.12) !important; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); }
.highlight-part:focus, .highlight-part:active { background-color: #ffffff !important; box-shadow: 0 6px 16px rgba(13, 202, 240, 0.25) !important; transform: translateY(-2px); border-color: #0bacbe !important; }

/* Segmented Control (Pill Toggle) */
.segmented-control {
    background: #f1f3f5;
    padding: 4px;
    border-radius: 50px;
    display: flex;
    position: relative;
}
.segmented-control input[type="radio"] {
    display: none;
}
.segmented-control label {
    flex: 1;
    text-align: center;
    padding: 10px 15px;
    margin: 0;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    color: #6c757d;
    transition: all 0.3s ease;
    z-index: 2;
    font-size: 0.9rem;
}
.segmented-control input[type="radio"]:checked + label {
    background: #ffffff;
    color: #0d6efd;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* Locked Master Data Fields */
.locked-field {
    background-color: #e9ecef !important;
    border-color: #dee2e6 !important;
    color: #495057 !important;
    cursor: not-allowed;
    opacity: 0.8;
    transition: all 0.3s ease;
}
.locked-field:focus {
    box-shadow: none !important;
    border-color: #dee2e6 !important;
}

/* Custom Clear Equipment Button */
.clear-equip-btn {
    border-radius: 50px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.clear-equip-btn:hover {
    background-color: #dc3545 !important;
    color: #fff !important;
}
#unlockEquipBtn:hover {
    background-color: #ffc107 !important;
    color: #000 !important;
    border-color: #ffc107 !important;
}

/* Desktop Remove Part Button Hover */
.remove-part-btn { 
    position: absolute; 
    top: -15px; 
    right: -10px; 
    background: #dc3545; 
    color: white; 
    border: none; 
    border-radius: 50%; 
    width: 34px; 
    height: 34px; 
    font-size: 1.2rem; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    box-shadow: 0 3px 6px rgba(0,0,0,0.3); 
    z-index: 10; 
    transition: all 0.2s ease;
}
.remove-part-btn:hover {
    background-color: #b02a37;
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.4);
}

/* Mobile Remove Part Button */
.remove-part-btn-mobile {
    background-color: #fff1f0;
    color: #dc3545;
    border: 1px dashed rgba(220, 53, 69, 0.4);
    border-radius: 10px;
    font-weight: 700;
    padding: 12px;
    width: 100%;
    margin-top: 15px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.05);
}
.remove-part-btn-mobile:hover {
    background-color: #dc3545 !important;
    color: #ffffff !important;
    border-style: solid !important;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.25);
}
.remove-part-btn-mobile:active {
    background-color: #b02a37 !important;
    transform: scale(0.98);
}

/* Status Badges */
.badge-status { font-size: 0.85rem; padding: 6px 10px; border-radius: 6px; font-weight: 600; }
.bg-pending, .status-pending { background-color: #ffc107 !important; color: #000 !important; }
.bg-processing, .status-processing { background-color: #0dcaf0 !important; color: #000 !important; }
.bg-shipped, .status-shipped { background-color: #198754 !important; color: #fff !important; }
.bg-delivered, .status-delivered { background-color: #20c997 !important; color: #fff !important; }
.bg-cancelled, .status-cancelled { background-color: #dc3545 !important; color: #fff !important; }
.bg-new, .status-new { background-color: #0d6efd !important; color: #fff !important; }

.status-new-order { background-color: #dc3545 !important; color: #fff !important; border: 1px solid #dc3545; box-shadow: 0 0 10px rgba(220, 53, 69, 0.5); animation: pulse-red 1.5s infinite; }
@keyframes pulse-red { 0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); } 70% { box-shadow: 0 0 0 8px rgba(220, 53, 69, 0); } 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); } }

/* Filter Pills */
.filter-btn { transition: all 0.3s ease; opacity: 0.6; cursor: pointer; border-width: 2px !important; }
.filter-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.filter-btn.active-filter { opacity: 1; box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important; transform: translateY(-2px); }
.filter-btn.btn-outline-primary:hover, .filter-btn.btn-outline-primary.active-filter { background-color: #0d6efd !important; color: white !important; }
.filter-btn.btn-outline-secondary:hover, .filter-btn.btn-outline-secondary.active-filter { background-color: #6c757d !important; color: white !important; }
.filter-btn.btn-outline-info:hover, .filter-btn.btn-outline-info.active-filter { background-color: #0dcaf0 !important; color: #000 !important; }
.filter-btn.btn-outline-dark:hover, .filter-btn.btn-outline-dark.active-filter { background-color: #212529 !important; color: white !important; }

/* Utilities */
.priority-high, .priority-urgent { color: #dc3545; font-weight: bold; }
.priority-medium { color: #0d6efd; font-weight: 500; }
.priority-low { color: #198754; }
.tooltip-icon { cursor: help; color: #6c757d; transition: color 0.2s; font-size: 1.1rem; vertical-align: middle; }
.tooltip-icon:hover { color: #0d6efd; }
.search-box { background-color: #fff; border-radius: 10px; border: 1px solid #e0e0e0; }
.cursor-pointer { cursor: pointer; }
.font-size-sm { font-size: 0.8rem; }
.letter-spacing-sm { letter-spacing: 0.5px; }

/* Select2 & Dropdowns */
.select2-container { width: 100% !important; }
.select2-container--bootstrap-5 .select2-selection--multiple { min-height: 42px; }
.select2-container--bootstrap-5 .select2-selection { border-radius: 8px; display: flex; align-items: center; }
.was-validated select:invalid + .select2-container .select2-selection { border-color: #dc3545 !important; }
.was-validated select:invalid + .select2-container.select2-container--focus .select2-selection { box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25) !important; }

.custom-dropdown-menu { z-index: 1050; max-height: 250px; overflow-y: auto; top: 100%; box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important; border-radius: 12px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.custom-dropdown-menu .dropdown-item { padding: 12px 15px; border-bottom: 1px solid #f0f0f0; cursor: pointer; white-space: normal; transition: background-color 0.2s; }
.custom-dropdown-menu .dropdown-item:active, .custom-dropdown-menu .dropdown-item:hover { background-color: #f0f7ff; }
.custom-dropdown-menu .dropdown-item:last-child { border-bottom: none; }
.dropdown-suggest-header { background-color: #f8f9fa; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: #6c757d; padding: 8px 15px; border-bottom: 1px solid #e9ecef; }

/* Modal Dynamic Themes */
.transition-bg { transition: background-color 0.3s ease, color 0.3s ease; }
.transition-border { transition: border-color 0.3s ease, box-shadow 0.3s ease; }
#modal_comments:focus.border-danger, #bulk_modal_comments:focus.border-danger, #modal_comments_single:focus.border-danger { box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25) !important; }
#modal_comments:focus.border-warning, #bulk_modal_comments:focus.border-warning { box-shadow: 0 0 0 0.25rem rgba(255, 193, 7, 0.25) !important; }

/* BULK ACTION CONTAINER */
#bulkActionContainer { margin-bottom: 15px; }
@media (min-width: 769px) {
    #bulkActionContainer { position: sticky; top: 85px; z-index: 1040; }
    .bulk-action-bar { background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%); border-radius: 12px; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 6px 20px rgba(79, 70, 229, 0.25); color: white; }
    .bulk-clear-btn { background: rgba(255, 255, 255, 0.15); color: white; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 50px; padding: 4px 12px; font-size: 0.85rem; font-weight: 500; cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; margin-left: 15px; outline: none; }
    .bulk-clear-btn:hover { background: rgba(255, 255, 255, 0.25); border-color: rgba(255, 255, 255, 0.5); }
    .bulk-clear-btn:active { transform: scale(0.95); }
    .bulk-action-btn { background-color: white; color: #4f46e5; border: none; padding: 8px 20px; border-radius: 8px; font-weight: bold; transition: all 0.2s; }
    .bulk-action-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
    .bulk-action-btn:active { transform: scale(0.95); }
}

/* =========================================
   5. PAGE-SPECIFIC STYLES
   ========================================= */

/* --- Manager Dashboard (KPIs) --- */
.kpi-card { border: none; border-radius: 15px; transition: transform 0.2s, box-shadow 0.2s; cursor: pointer; border-left: 5px solid transparent; }
.kpi-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important; }
.icon-circle { width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.dashboard-section { background: #fff; border-radius: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); padding: 20px; border: 1px solid #eee; margin-bottom: 25px; }
.dashboard-header { border-bottom: 2px solid #f8f9fa; padding-bottom: 12px; margin-bottom: 15px; font-weight: 700; color: #333; }
.kpi-detail-panel { display: none; background: #fff; border-radius: 12px; box-shadow: 0 5px 20px rgba(0,0,0,0.1); margin-bottom: 25px; border-top: 5px solid #0d6efd; padding: 20px; }
.table-wrapper { max-height: 400px; overflow-y: auto; }
.delay-badge { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-weight: bold; }
.bg-orange { background-color: #fd7e14; color: white; }

/* --- Gate (Login) Page --- */
.gate-body { background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); min-height: 100vh; display: flex; flex-direction: column; margin: 0; }
.gate-body .login-wrapper { flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px; }
.gate-body .login-card { border-radius: 20px; box-shadow: 0 15px 35px rgba(0,0,0,0.1); border: none; overflow: hidden; width: 100%; max-width: 400px; background: #fff; }
.gate-body .login-header { background: #0d6efd; color: white; padding: 40px 20px 30px; text-align: center; position: relative; }
.gate-body .login-header::after { content: ''; position: absolute; bottom: -20px; left: 0; width: 100%; height: 40px; background: #fff; border-radius: 50% 50% 0 0; }
.gate-body .form-floating > label { color: #6c757d; font-size: 0.95rem; }
.gate-body .form-control:focus { border-color: #0d6efd; box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15); }
.gate-body .password-toggle { cursor: pointer; color: #6c757d; }
.gate-body .app-footer { text-align: center; padding: 15px; color: #6c757d; font-size: 0.85rem; font-weight: 500; }
.gate-body .link-custom { text-decoration: none; font-weight: 600; font-size: 0.85rem; }

/* --- Index (New Request) Page --- */
.stock-mode-active { background-color: #f4f9ff !important; border: 2px solid #0d6efd !important; box-shadow: 0 0 15px rgba(13, 110, 253, 0.08) !important; }
.dept-section { background: #fff; padding: 20px; border-radius: 12px; border: 1px solid #eee; margin-bottom: 25px; }
.asset-box { background-color: #f0f7ff; border-radius: 12px; padding: 20px; border: 1px solid #cfe2ff; margin-bottom: 25px; }
.part-row { background: #fff; border: 1px solid #dee2e6; border-radius: 12px; padding: 20px; margin-bottom: 15px; position: relative; }

.section-divider { border-bottom-width: 2px !important; }
.type-icon { font-size: 2rem; }
.btn-dashed { border-style: dashed; background-color: #f8fcfd; }
.search-input-wrapper { flex: 1; min-width: 0; }

.offer-alert-box { border-left: 5px solid #dc3545; background-color: #fff8f8; }
.offer-box-height { min-height: 45px; }
.offer-switch-input { transform: scale(1.4); cursor: pointer; }
.offer-switch-input:checked { background-color: #dc3545; border-color: #dc3545; }

.was-validated .form-control:invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + .75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(.375em + .1875rem) center;
    background-size: calc(.75em + .375rem) calc(.75em + .375rem);
}
.scan-pulse { animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(13, 110, 253, 0); } 100% { box-shadow: 0 0 0 0 rgba(13, 110, 253, 0); } }
#reader { border-radius: 12px; overflow: hidden; border: 2px solid #0d6efd !important; width: 100%; }
#reader video { border-radius: 12px; }

.type-card { cursor: pointer; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.27); border: 2px solid transparent; box-shadow: 0 4px 10px rgba(0,0,0,0.04); position: relative; z-index: 1; }
.type-card[data-type="bank"] { background-color: #f0f4fa; color: #5a728c; }
.type-card[data-type="retail"] { background-color: #f0f9fa; color: #5a858c; }
.type-card[data-type="stock"] { background-color: #f4f5f7; color: #6c757d; }
.type-card:not(.locked):hover { transform: translateY(-8px) scale(1.03); z-index: 10; }
.type-card[data-type="bank"]:not(.locked):hover { border-color: rgba(13, 110, 253, 0.4); color: #0d6efd; box-shadow: 0 20px 40px rgba(13, 110, 253, 0.15) !important; }
.type-card[data-type="retail"]:not(.locked):hover { border-color: rgba(13, 202, 240, 0.4); color: #0dcaf0; box-shadow: 0 20px 40px rgba(13, 202, 240, 0.15) !important; }
.type-card[data-type="stock"]:not(.locked):hover { border-color: rgba(108, 117, 125, 0.4); color: #495057; box-shadow: 0 20px 40px rgba(108, 117, 125, 0.15) !important; }
.type-card.locked { cursor: not-allowed; background-color: #e9ecef !important; border-color: transparent; opacity: 0.6; color: #adb5bd !important; }
.type-card.active-card.bank-card { border-color: #0d6efd; background-color: #e6f0ff !important; color: #0d6efd; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(13, 110, 253, 0.12) !important; }
.type-card.active-card.retail-card { border-color: #0dcaf0; background-color: #e6f9fc !important; color: #0dcaf0; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(13, 202, 240, 0.12) !important; }
.type-card.active-card.stock-card { border-color: #6c757d; background-color: #ebeef0 !important; color: #212529; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(108, 117, 125, 0.12) !important; }
.submit-wrapper { margin-top: 3rem; }

/* --- Admin Dashboard & Master Data Tabs --- */
.nav-tabs .nav-link { font-weight: bold; color: #6c757d; border: none; border-bottom: 3px solid transparent; }
.nav-tabs .nav-link.active { color: #0d6efd; background: transparent; border-bottom: 3px solid #0d6efd; }
.nav-tabs .nav-link:hover { border-bottom: 3px solid #dee2e6; }
.action-btn { padding: 4px 8px; border-radius: 6px; }
.role-badge { font-size: 0.75rem; margin-right: 4px; margin-bottom: 4px; display: inline-block; }

#adminTabs { border-bottom: 2px solid #dee2e6; gap: 10px; }
#adminTabs .nav-item { margin-bottom: -2px; }
#adminTabs .nav-link { color: #495057; background-color: #f8f9fa; border: 1px solid #dee2e6; border-bottom: none; border-radius: 8px 8px 0 0; padding: 12px 20px; font-weight: 600; transition: all 0.3s ease; box-shadow: inset 0 -3px 5px rgba(0,0,0,0.02); }
#adminTabs .nav-link:hover:not(.active) { background-color: #e9ecef; color: #0d6efd; transform: translateY(-2px); }
#adminTabs .nav-link.active { background-color: #0d6efd; color: white; border-color: #0d6efd; box-shadow: 0 -4px 10px rgba(13, 110, 253, 0.2); }
#adminTabs .nav-link.active i { color: white !important; }

/* --- Import Data (Conflicts) Tabs --- */
#conflict_badge { box-shadow: 0 2px 5px rgba(0,0,0,0.2); border: 2px solid transparent; transition: all 0.2s; }
.conflict-tab-btn.active { background-color: #dc3545 !important; color: #ffffff !important; border-color: #dc3545 !important; }
.conflict-tab-btn.active #conflict_badge { background-color: #ffffff !important; color: #dc3545 !important; border-color: #dc3545 !important; }
.conflict-tab-btn:not(.active) { background-color: rgba(220, 53, 69, 0.1) !important; color: #dc3545 !important; border-color: #dc3545 !important; }
.reset-tab-btn.active { background-color: #212529 !important; color: #ffffff !important; border-color: #212529 !important; }
.reset-tab-btn:not(.active) { background-color: rgba(33, 37, 41, 0.1) !important; color: #212529 !important; border-color: #212529 !important; }

/* --- Backorders & Shipments --- */
.accordion-button:not(.collapsed) { background-color: #f4f9ff; color: #0d6efd; box-shadow: inset 0 -1px 0 rgba(0,0,0,.125); }
.accordion-button::after { margin-left: auto; }
.pick-qty-badge { font-size: 1.2rem; min-width: 45px; text-align: center; }
.detail-row:hover { background-color: #f8f9fa; }
.shipment-card { border: none; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); overflow: hidden; margin-bottom: 20px; }
.shipment-header { background-color: #0d6efd; color: white; padding: 15px 20px; }
.shipment-header.completed { background-color: #198754; } 
.item-row { padding: 15px 20px; border-bottom: 1px solid #eee; background: #fff; }
.item-row:last-child { border-bottom: none; }
.qty-badge { background: #e9ecef; color: #333; font-weight: bold; padding: 5px 10px; border-radius: 8px; font-size: 0.9rem; }
.warehouse-comment-box { background-color: #fff8e1; border-left: 4px solid #ffc107; padding: 8px 12px; border-radius: 4px; margin-top: 10px; }

/* --- About Page --- */
.about-hero { background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%); color: white; padding: 60px 20px; border-radius: 20px; margin-bottom: 40px; text-align: center; box-shadow: 0 10px 30px rgba(13, 110, 253, 0.2); }
@media (min-width: 768px) { .about-hero { padding: 80px 40px; } }
.ai-card { background: #000; color: #fff; border-radius: 15px; padding: 25px; position: relative; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.15); border: 1px solid rgba(255,255,255,0.1); }
@media (min-width: 768px) { .ai-card { padding: 40px; } }
.ai-card::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle, rgba(138,43,226,0.3) 0%, rgba(0,0,0,0) 70%); animation: pulse 5s infinite; }
.feature-icon { width: 50px; height: 50px; background: rgba(13, 110, 253, 0.1); color: #0d6efd; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 15px; flex-shrink: 0; }
.contact-link { color: inherit; text-decoration: none; transition: color 0.2s; word-break: break-all; }
.contact-link:hover { color: #0d6efd; }

/* =========================================
   6. GLOBAL MOBILE OPTIMIZATION
   ========================================= */
@media (max-width: 768px) {
    /* Εφαρμογή μεγάλων πεδίων ΜΟΝΟ στη φόρμα της Νέας Παραγγελίας */
    body.new-request-page .btn, 
    body.new-request-page .form-control, 
    body.new-request-page .form-select { 
        min-height: 50px !important; 
        font-size: 16px !important; 
    }
    body.new-request-page .select2-container .select2-selection--single { 
        height: 50px !important; 
        padding-top: 10px; 
    }
    body.new-request-page .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered { 
        font-size: 16px; 
    }
    
    .container-fluid { padding-left: 10px !important; padding-right: 10px !important; }

    /* Transforms the clear button into a perfect circle on mobile */
    .clear-equip-btn {
        width: 38px !important;
        height: 38px !important;
        padding: 0 !important;
        border-radius: 50% !important;
    }
    .clear-equip-btn i {
        margin: 0 !important;
        font-size: 1.1rem;
    }

    /* --- MOBILE TABLES UNIFIED --- */
    #requestsTable thead, #masterTable thead, #warehouseTable thead, #logisticsTable thead { display: none; }
    
    #requestsTable, #requestsTable tbody, #requestsTable tr, #requestsTable td,
    #masterTable, #masterTable tbody, #masterTable tr, #masterTable td,
    #warehouseTable, #warehouseTable tbody, #warehouseTable tr, #warehouseTable td,
    #logisticsTable, #logisticsTable tbody, #logisticsTable tr, #logisticsTable td {
        display: block; width: 100%; box-sizing: border-box;
    }

    #requestsTable tr.clickable-row, #masterTable tr.clickable-row, 
    #warehouseTable tr.clickable-row, #logisticsTable tr.clickable-row {
        background-color: #f6fafe !important; margin-bottom: 16px; border-radius: 16px;
        border: 1px solid #d3e2f7 !important; padding: 16px; position: relative;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important; 
        transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
        overflow: hidden; min-height: 140px;
    }

    #requestsTable tr.clickable-row > td, #masterTable tr.clickable-row > td, 
    #warehouseTable tr.clickable-row > td, #logisticsTable tr.clickable-row > td {
        border: none !important; padding: 0 !important; box-shadow: none !important;
        background: transparent !important; background-color: transparent !important;
        text-align: left !important;
    }

    #warehouseTable > tbody > tr.clickable-row > td, #logisticsTable > tbody > tr.clickable-row > td {
        padding: 8px 0 !important; min-height: auto !important;
    }
    
    #warehouseTable > tbody > tr.clickable-row > td::before, #logisticsTable > tbody > tr.clickable-row > td::before { display: none !important; }

    #warehouseTable > tbody > tr.clickable-row > td > div, #warehouseTable > tbody > tr.clickable-row > td > span,
    #logisticsTable > tbody > tr.clickable-row > td > div, #logisticsTable > tbody > tr.clickable-row > td > span {
        text-align: left !important; float: none !important; margin-left: 0 !important;
    }

    /* ACTION BUTTONS ALIGNMENT (Top Right) */
    #warehouseTable > tbody > tr.clickable-row > td:nth-child(1), 
    #logisticsTable > tbody > tr.clickable-row > td:nth-child(1),
    #masterTable > tbody > tr.clickable-row > td.action-td {
        position: absolute !important; top: 16px !important; right: 16px !important;
        width: auto !important; padding: 0 !important; z-index: 10;
        display: flex !important; justify-content: flex-end !important; gap: 12px !important;
    }

    #warehouseTable > tbody > tr.clickable-row > td:nth-child(2), 
    #logisticsTable > tbody > tr.clickable-row > td:nth-child(2),
    #masterTable > tbody > tr.clickable-row > td:nth-child(2) {
        padding-top: 0 !important; padding-right: 90px !important;
    }
    
    /* Anchors the Status badge to the bottom-right corner for Requests/Warehouse/Logistics */
    /* ΑΦΑΙΡΕΘΗΚΕ ΤΟ #masterTable ΑΠΟ ΕΔΩ - ΑΥΤΟ ΗΤΑΝ ΤΟ ΛΑΘΟΣ! */
    #requestsTable > tbody > tr.clickable-row > td:last-child,
    #warehouseTable > tbody > tr.clickable-row > td:last-child, 
    #logisticsTable > tbody > tr.clickable-row > td:last-child {
        position: absolute !important; 
        bottom: 16px !important; 
        right: 16px !important;
        text-align: right !important; 
        padding: 0 !important;
        width: auto !important;
    }

    #requestsTable tr.clickable-row > td:nth-child(1) { position: absolute; top: 15px; right: 15px; width: auto; z-index: 10; }
    #requestsTable tr.clickable-row > td:nth-child(1) .d-flex { gap: 8px !important; }
    
    /* Uniform Mobile 32px Action Icons applied to all tables */
    #requestsTable tr.clickable-row > td:nth-child(1) .action-icon,
    #warehouseTable tr.clickable-row > td:nth-child(1) .action-icon,
    #logisticsTable tr.clickable-row > td:nth-child(1) .action-icon,
    #masterTable tr.clickable-row > td.action-td .action-icon { 
        width: 32px !important; 
        height: 32px !important; 
        box-shadow: 0 4px 8px rgba(0,0,0,0.08) !important; 
        opacity: 0.95; 
        border-radius: 50% !important;
    }
    
    #requestsTable tr.clickable-row > td:nth-child(1) .action-icon:active,
    #warehouseTable tr.clickable-row > td:nth-child(1) .action-icon:active,
    #logisticsTable tr.clickable-row > td:nth-child(1) .action-icon:active,
    #masterTable tr.clickable-row > td.action-td .action-icon:active { transform: scale(0.9); }
    
    #requestsTable tr.clickable-row > td:nth-child(2) { padding-right: 90px !important; margin-bottom: 15px; }
    #requestsTable tr.clickable-row > td:nth-child(5) { margin-bottom: 12px; padding-bottom: 12px !important; border-bottom: 1px dashed rgba(13, 110, 253, 0.15) !important; }
    #requestsTable tr.clickable-row > td:nth-child(6) { margin-bottom: 15px; }

    #bulkActionContainer { position: fixed; bottom: 30px; left: 20px; z-index: 9999; margin-bottom: 0; }
    .bulk-action-bar { background: transparent; padding: 0; box-shadow: none; }
    .bulk-action-bar .desktop-text { display: none; }
    .bulk-action-btn { width: 56px; height: 56px; border-radius: 50%; background-color: #0d6efd; color: white; border: none; box-shadow: 0 6px 15px rgba(13, 110, 253, 0.4); display: flex; align-items: center; justify-content: center; position: relative; }
    .bulk-action-btn .btn-text { display: none; }
    .bulk-action-btn i { font-size: 1.5rem; margin: 0 !important; }
    .bulk-badge-mobile { position: absolute; top: -2px; right: -2px; background-color: #ef4444; color: white; border: 2px solid white; border-radius: 50px; font-size: 0.75rem; padding: 0.2em 0.5em; font-weight: bold; }

    .page-title { font-size: 1.45rem !important; }
    .badge-status { font-size: 0.75rem !important; padding: 6px 12px !important; max-width: none; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
    .small.text-muted { font-size: 0.8rem !important; }
    
    .submit-wrapper { position: fixed; bottom: 0; left: 0; width: 100%; background: #ffffff; padding: 15px; box-shadow: 0 -5px 15px rgba(0,0,0,0.1); z-index: 1000; border-top: 1px solid #e9ecef; margin-top: 0; }
    .submit-wrapper .btn { border-radius: 50rem !important; }
    body.new-request-page { padding-bottom: 100px; }
}

@media (max-width: 380px) {
    .badge-status { font-size: 0.7rem !important; padding: 4px 8px !important; }
}