        /* === POCZĄTEK BLOKU STYLÓW DLA MOTYWU === */

        :root {
            /* Kolory tła */
            --primary-color: #3b82f6;
            --table-header-bg: #f8fafc;
            --nav-bg: #f1f5f9;

            /* Kolory tekstu */
            --primary-text-color: #ffffff;
            --table-header-text-color: #475569;
            --nav-text-color: #4b5563;
        }

        body.role-operator .admin-only {
            display: none !important;
        }

        /* 1. Nawigacja - tło */
        nav.main-nav {
            background-color: var(--nav-bg);
        }

        /* 2. Nawigacja - linki (tekst) */
        .nav-link {
            padding: 0.75rem 1.5rem;
            border-bottom: 3px solid transparent;
            font-weight: 500;
            transition: all 0.2s;
            color: var(--nav-text-color) !important;
            /* Dodajemy !important dla pewności */
        }

        /* 3. Nawigacja - aktywny link */
        .nav-link.active {
            background-color: var(--primary-color);
            /* Tło w kolorze motywu */
            color: var(--primary-text-color) !important;
            /* Tekst w kolorze kontrastowym dla przycisków */
            border-bottom-color: transparent;
            /* Ukrywamy dolną linię, bo mamy już tło */
            border-radius: 0.375rem 0.375rem 0 0;
            /* Zaokrąglamy górne rogi dla ładniejszego efektu */
            font-weight: 600;
        }
		
		/* 1. Ukrywanie paska przewijania w menu (dla estetyki) */
        #nav-container {
            -ms-overflow-style: none;  /* IE and Edge */
            scrollbar-width: none;  /* Firefox */
            overflow-x: auto;       /* Pozwól na przewijanie */
            display: flex;          /* Upewnij się, że to flexbox */
            white-space: nowrap;    /* Zapobiegaj zawijaniu */
            padding-bottom: 0;      /* Usuń dolny padding, który może odsłaniać pasek */
            margin-bottom: -1px;    /* Triki na ukrycie linii podziału, jeśli jest */
        }
        
        /* Ukrywanie paska w Webkit (Chrome, Safari, Opera) */
        #nav-container::-webkit-scrollbar {
            display: none; 
            width: 0;
            height: 0;
            background: transparent;
        }

        /* 2. Bardziej kompaktowe przyciski menu */
        .nav-link {
            padding: 8px 10px !important; /* Mniejsze odstępy (góra-dół / lewo-prawo) */
            font-size: 13px !important;   /* Mniejsza czcionka */
            white-space: nowrap;          /* Zakaz łamania tekstu */
        }
        
        /* Opcjonalnie: Zmniejszenie kontenera nawigacji na mniejszych ekranach */
        @media (max-width: 1280px) {
            .nav-link {
                padding: 6px 8px !important;
                font-size: 12px !important;
            }
        }
		
        /* 4. Nagłówki tabel (działało, ale zostawiamy dla spójności) */
        thead.table-header {
            background-color: var(--table-header-bg);
        }

        thead.table-header th {
            color: var(--table-header-text-color);
        }

        .table-header th.sortable-header {
            position: relative;
            padding-right: 1.5rem;
            text-align: center;
            transition: background-color 0.2s ease, color 0.2s ease;
        }

        .table-header th.sortable-header::after {
            content: '↕';
            position: absolute;
            top: 50%;
            right: 0.5rem;
            transform: translateY(-50%);
            font-size: 0.65rem;
            color: rgba(71, 85, 105, 0.8);
            pointer-events: none;
        }

        .table-header th.sortable-header[data-sort-direction] {
            background-color: rgba(255, 255, 255, 0.12);
            color: #ffffff;
        }

        .table-header th.sortable-header[data-sort-direction='asc']::after {
            content: '▲';
            color: rgba(255, 255, 255, 0.95);
        }

        .table-header th.sortable-header[data-sort-direction='desc']::after {
            content: '▼';
            color: rgba(255, 255, 255, 0.95);
        }

        /* 5. Główne przyciski */
        .btn-primary {
            background-color: var(--primary-color);
            color: var(--primary-text-color);
        }

        .btn-primary:hover {
            filter: brightness(90%);
        }


        body {
            font-family: 'Inter', sans-serif;
            background-color: #f8fafc;
        }

        .toast-notification {
            position: fixed;
            bottom: 1.5rem;
            right: 1.5rem;
            min-width: 260px;
            padding: 0.9rem 1.1rem;
            border-radius: 0.75rem;
            background: rgba(15, 23, 42, 0.92);
            color: white;
            box-shadow: 0 10px 25px rgba(15, 23, 42, 0.35);
            font-size: 0.95rem;
            display: flex;
            align-items: center;
            gap: 0.6rem;
            animation: toast-appear 0.3s ease;
            z-index: 999;
        }

        .toast-notification.info { background: rgba(15, 23, 42, 0.9); }
        .toast-notification.warn { background: rgba(220, 38, 38, 0.95); }
        .toast-notification.success { background: rgba(16, 185, 129, 0.95); }

        .toast-notification button {
            border: none;
            background: transparent;
            color: white;
            font-weight: 600;
            cursor: pointer;
        }

        .order-price {
            font-size: 1rem !important;
            line-height: 1.5rem;
            text-align: right;
        }

        .order-price::placeholder {
            font-size: 0.72rem;
        }

        .order-price:placeholder-shown {
            text-align: center !important;
        }

        .order-price:not(:placeholder-shown) {
            text-align: right !important;
        }

        .btn-feedback {
            background-color: #16a34a !important;
            border-color: #16a34a !important;
            box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.4);
        }

        @keyframes toast-appear {
            from { transform: translateY(12px); opacity: 0; }
            to { transform: translateY(0); opacity: 1; }
        }

        .modal-backdrop {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(4px);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 50;
            transition: opacity 0.3s ease;
        }

        .modal-content {
            background-color: white;
            padding: 2rem;
            border-radius: 0.75rem;
            width: 90%;
            max-width: 950px;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
            transform: scale(0.95);
            transition: transform 0.3s ease;
            max-height: 90vh;
            overflow-y: auto;
        }

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

        .status-badge {
            padding: 0.2rem 0.5rem;
            border-radius: 9999px;
            font-size: 0.65rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .status-do-realizacji {
            background-color: #fee2e2;
            color: #991b1b;
        }

        .status-wykonane {
            background-color: #e0e7ff;
            color: #4338ca;
        }

        .status-zakończone {
            background-color: #dcfce7;
            color: #166534;
        }

        .status-anulowane {
            background-color: #e0f2fe;
            color: #0c4a6e;
        }

        .status-zapas {
            background-color: #fef9c3;
            color: #854d0e;
        }
		
		/* Styl dla statusu "W trakcie" */
		.status-w-trakcie {
			background-color: #2563eb;
			color: white;
		}
		
        .nav-link {
            padding: 0.75rem 1.5rem;
            border-bottom: 3px solid transparent;
            color: #4b5563;
            font-weight: 500;
            transition: all 0.2s;
        }

        .kpi-card {
            background-color: white;
            padding: 1.5rem;
            border-radius: 0.75rem;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
        }

        .chart-container {
            position: relative;
            width: 100%;
            max-width: 600px;
            margin-left: auto;
            margin-right: auto;
            height: 320px;
        }

        #ordersTableBody td {
            font-size: 0.8rem;
            white-space: nowrap;
        }

        input:not(:disabled),
        select:not(:disabled),
        textarea:not(:disabled) {
            background-color: #f1f5f9 !important;
        }


        #logsContainer {
            background-color: #1e293b;
            color: #e2e8f0;
            font-family: 'Courier New', Courier, monospace;
            padding: 1rem;
            border-radius: 0.5rem;
            max-height: 500px;
            overflow-y: auto;
            white-space: pre-wrap;
            word-wrap: break-word;
            font-size: 0.8rem;
        }

        @media (min-width: 768px) {
            .chart-container {
                height: 350px;
            }
        }

        @media print {
            body>*:not(#protocolModal) {
                display: none !important;
            }

            #protocolModal,
            #protocolModal>.modal-content {
                position: static !important;
                display: block !important;
                width: 100% !important;
                max-width: 100% !important;
                height: auto !important;
                margin: 0 !important;
                padding: 0 !important;
                box-shadow: none !important;
                border: none !important;
                background: transparent !important;
                backdrop-filter: none !important;
                overflow: visible !important;
            }

            #protocolModal .modal-content>*:not(#protocolPrintArea) {
                display: none !important;
            }

            .no-print {
                display: none !important;
            }

            html,
            body {
                margin: 0 !important;
                padding: 0 !important;
                height: auto !important;
                background-color: white !important;
            }

            #protocolPrintArea {
                display: block !important;
                box-shadow: none !important;
                margin: 0;
                padding: 1cm !important;
                box-sizing: border-box;
                font-size: 8.5pt !important;
                line-height: 1.2 !important;
            }

            #protocolPrintArea h2 {
                font-size: 14pt !important;
                margin-bottom: 0.4rem !important;
            }

            #protocolPrintArea h3 {
                font-size: 9pt !important;
                margin-bottom: 0.2rem !important;
            }

            /* Zmniejszenie czcionki dla etykiet w górnej sekcji (np. "Nazwa Firmy") */
            #protocolPrintArea .grid-cols-5 .text-slate-500 {
                font-size: 6.5pt !important;
            }

            /* Zmniejszenie czcionki dla etykiet w sekcji "Data produkcji", "Operator" itd. */
            #protocolForm label.text-slate-700 {
                font-size: 6.5pt !important;
            }

            #protocolPrintArea>div,
            #protocolPrintArea>form>div,
            #protocolPrintArea>form>.flex {
                margin-bottom: 0.3rem !important;
            }

            #protocolPrintArea .p-4 {
                padding: 0.5rem !important;
            }

            #protocolPrintArea .p-2 {
                padding: 0.25rem !important;
            }

            #protocolPrintArea .mb-2 {
                margin-bottom: 0.25rem !important;
            }

            #protocolPrintArea .gap-4 {
                gap: 0.5rem !important;
            }

            #protocolPrintArea .gap-2 {
                gap: 0.25rem !important;
            }

            #protocolPrintArea .border {
                padding: 0.5rem !important;
                margin-bottom: 0 !important;
            }

            #protocolPrintArea .mt-4 {
                margin-top: 0.5rem !important;
            }

            #protocolPrintArea img[alt="Logo Firmy"] {
                height: 2.5rem !important;
            }

            #protocolPrintArea #qrcode-container img {
                width: 50px !important;
                height: 50px !important;
                image-rendering: pixelated;
                image-rendering: crisp-edges;
            }

            #protocolPrintArea input,
            #protocolPrintArea select {
                padding: 1px 3px !important;
                font-size: 8.5pt !important;
            }

            #protocolMaterialsContainer input,
            #protocolMaterialsContainer select {
                font-size: 8pt !important;
            }

            #protocolMaterialsContainer .grid {
                margin-bottom: 1px !important;
            }

            #protocolMaterialsContainer input,
            #protocolMaterialsContainer select {
                padding: 1px 2px !important;
                /* Zmniejsza wewnętrzny margines pól */
                font-size: 7.5pt !important;
                /* Ustawia jednolitą, mniejszą czcionkę dla wydruku */
                border: none !important;
                /* Usuwa ramki, które zajmują cenne miejsce */
                background-color: transparent !important;
                /* Ustawia przezroczyste tło */
                box-shadow: none !important;
                /* Usuwa cienie */
                text-align: right;
                /* Wyrównuje tekst do prawej dla lepszej czytelności liczb */
            }

            /* Specjalne wyrównanie dla daty i listy surowców do lewej */
            #protocolMaterialsContainer .protocol-delivery-date,
            #protocolMaterialsContainer .protocol-material-select {
                text-align: left !important;
            }

            /* Ukrycie strzałek we WSZYSTKICH listach rozwijanych na wydruku */
            #protocolPrintArea select {
                -webkit-appearance: none !important;
                appearance: none !important;
            }

            #protocolForm {
                margin-top: 0.5rem !important;
                /* Standardowo jest tu mt-6 (1.5rem), zmniejszamy go */
            }

            /* Ujednolicenie pionowych odstępów między wszystkimi głównymi sekcjami protokołu */
            #protocolForm>div {
                margin-bottom: 0.8rem !important;
                /* Odstęp PO każdej głównej sekcji (np. po "Data produkcji", po "Użyte surowce") */
                margin-top: 0 !important;
            }

            /* Wyzerowanie marginesu dla ostatniego bloku, aby nie było pustego miejsca na dole strony */
            #protocolForm>div:not(:first-child) {
                margin-top: 0.8rem !important;
            }
        }

        #main-app {
            display: none;
        }

        #login-view {
            display: flex;
        }

        input[type=number]::-webkit-inner-spin-button,
        input[type=number]::-webkit-outer-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

        input[type=number] {
            -moz-appearance: textfield;
        }

        #protocol-summary-container {
            display: flex !important;
            flex-direction: row !important;
            /* Ustawia elementy obok siebie */
            gap: 0.5rem !important;
            /* Zmniejsza odstęp między nimi */
            width: 100%;
        }

        #protocol-summary-container>div {
            width: 50% !important;
            /* Każdy element zajmuje połowę szerokości */
        }

        .protocol-input-small {
            font-size: 0.7rem !important;
            /* Mniejsza czcionka (ok. 11px) */
            padding-top: 2px !important;
            padding-bottom: 2px !important;
            height: auto !important;
        }

        #protocolForm>div {
            margin-top: 1rem;
            /* Ustawia spójny górny margines dla wszystkich sekcji */
        }

        #kurs-euro-nav-container {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            padding: 0.25rem 1.5rem;
            cursor: pointer;
            color: var(--nav-text-color);
            white-space: nowrap;
            transition: background-color 0.2s;
            border-radius: 0.375rem;
        }

        #kurs-euro-nav-container:hover {
            background-color: rgba(0, 0, 0, 0.05);
        }

        .kurs-euro-label {
            font-size: 0.8rem;
            font-weight: 500;
        }

        #kursEuroDisplayNav {
            font-size: 0.9rem;
            font-weight: 700;
            color: var(--nav-text-color);
        }

		.order-card {
			cursor: grab;
			transition: all 0.2s;
			user-select: none;
		}
		.order-card:active {
			cursor: grabbing;
			transform: scale(1.02);
		}
		.calendar-day {
			min-height: 100px;
			transition: background-color 0.2s;
		}
		.calendar-day.drag-over {
			background-color: #e2e8f0 !important; /* Kolor podświetlenia przy upuszczaniu */
			
		}

        .order-quantity::placeholder {
            font-size: 0.72rem;
        }

        .order-quantity:placeholder-shown {
            text-align: center !important;
        }

        .order-quantity:not(:placeholder-shown) {
            text-align: right !important;
        }
