/* Import bardziej "przyjemnej" czcionki */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

/* Definicja kolorów */
:root {
		--primary-color: #28a745; /* Główny zielony */
		--primary-dark-color: #1e7e34; /* Ciemniejszy zielony (hover) */
		--secondary-color: #ffc107; /* Żółty (zbiorcze) */
		--secondary-dark-color: #e0a800; /* Ciemniejszy żółty */
		--background-light: #f8f9fa; /* Jaśniejsze tło */
		--menu-bg: #343a40; /* Ciemny kolor tła menu */
		--menu-item-bg: #495057; /* Tło dla przycisków menu */
		--menu-sub-bg: #212529; /* Tło dla podmenu */
		--table-confirmed: #d4edda; /* Jasny zielony (potwierdzono) */
		--table-unconfirmed: #f8d7da; /* Jasny czerwony (niepotwierdzono) */
		--text-color: #333;
		--border-color: #dee2e6;

		/* Kolory dla przycisków użytkownika/admina */
		--danger-color: #dc3545; /* Czerwony (Wyloguj / Usuń) */
		--danger-dark-color: #c82333;
		--warning-color: #ff9800; /* Pomarańczowy (Administracja) */
		--warning-dark-color: #f57c00;
		
		/* Kolory dla dashboardu */
		--info-color: #17a2b8; /* Jasny niebieski */
}

/* Podstawowe style i layout */
body {
		font-family: 'Roboto', Arial, sans-serif; 
		font-weight: 400;
		margin: 0;
		background-color: var(--background-light);
		display: flex; 
		color: var(--text-color);
}

/* --- PANEL BOCZNY (MENU) --- */
.sidebar {
		width: 250px;
		background-color: var(--menu-bg);
		color: white;
		height: 100vh; 
		position: fixed; 
		top: 0;
		left: 0;
		display: flex;
		flex-direction: column;
		overflow-y: hidden; 
		box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3); 
		z-index: 1000;
}

.menu-logo-container {
		background-color: #212529; 
		padding: 15px 10px; 
		margin-bottom: 0;
		text-align: center; 
		border-bottom: 1px solid #495057;
		flex-shrink: 0;
}

.menu-logo-container img {
		max-width: 100%; 
		height: auto;
		display: block; 
		margin: 0 auto; 
}

.menu-container {
		flex-grow: 1; 
		overflow-y: auto; 
		padding-top: 5px; 
		padding-bottom: 10px;
}

.menu-item-dashboard {
		display: block;
		padding: 12px 20px;
		text-decoration: none;
		color: white;
		font-weight: 500;
		background-color: var(--menu-item-bg); 
		transition: background-color 0.3s ease, color 0.3s ease;
		border-bottom: 1px solid var(--menu-bg); 
		margin: 5px 10px; 
		border-radius: 4px;
}
.menu-item-dashboard:hover {
		background-color: #5a6268;
		color: var(--secondary-color);
}

.menu-item-parent {
		cursor: pointer;
		padding: 10px 40px 10px 20px; 
		transition: background-color 0.3s ease;
		position: relative;
		font-weight: 400;
		color: white;
		font-size: 0.95em;
		margin: 8px 10px; 
		border-radius: 4px; 
		background-color: var(--menu-item-bg); 
		border: 1px solid var(--menu-bg);
}

.menu-item-parent:hover {
		background-color: #5a6268;
}

.menu-item-parent::after {
		content: '►';
		position: absolute;
		right: 15px; 
		top: 50%;
		transform: translateY(-50%);
		transition: transform 0.3s ease;
		font-size: 0.8em;
}

.menu-item-parent.active::after {
		content: '▼'; 
}

.menu-children {
		max-height: 0; 
		overflow: hidden;
		background-color: var(--menu-sub-bg);
		transition: max-height 0.4s ease-out; 
		margin: -8px 10px 8px 10px; 
		border-radius: 0 0 4px 4px;
		border: 1px solid var(--menu-sub-bg);
		border-top: none;
}

.menu-children.open {
		max-height: 500px; 
		transition: max-height 0.4s ease-in; 
}

.menu-children a {
		display: block;
		padding: 8px 20px 8px 35px;
		text-decoration: none;
		color: #adb5bd;
		transition: background-color 0.3s ease, color 0.3s ease;
		font-size: 0.9em;
}

.menu-children a:hover {
		background-color: #343a40;
		color: white; 
}
.menu-children a.active-link {
		color: var(--primary-color);
		font-weight: 500;
		background-color: var(--menu-item-bg); 
}
.menu-item-dashboard.active-link {
		background-color: var(--primary-color);
		color: white;
}

/* --- SEKCJA UŻYTKOWNIKA --- */
.user-info {
		border-top: 1px solid #495057;
		padding: 15px 10px;
		background-color: #212529; 
		flex-shrink: 0; 
}

.user-info-text {
		font-size: 0.85em; 
		color: #adb5bd;
		margin-bottom: 10px;
		padding: 0 10px;
		line-height: 1.3; 
}

.user-info-text strong {
		color: white;
		font-weight: 500;
		display: block;
}

.user-info-details {
		display: block;
		font-size: 0.8em;
		color: #999;
		margin-top: 3px;
		font-weight: 300;
}

.user-info-btn {
		display: block;
		text-decoration: none;
		text-align: center;
		padding: 10px 20px;
		margin: 5px 0;
		border-radius: 4px;
		transition: background-color 0.3s ease, color 0.3s ease, filter 0.3s ease;
		font-weight: 400;
		font-size: 0.95em;
}

.user-info-btn:hover {
		filter: brightness(1.15);
}

.btn-my-data {
		background-color: var(--menu-item-bg);
		color: white;
}
.btn-logout {
		background-color: var(--danger-color); 
		color: white;
}
.btn-admin {
		background-color: var(--warning-color); 
		color: #212529; 
		font-weight: 500;
}

/* --- GŁÓWNA TREŚĆ --- */
.main-content {
		margin-left: 250px; 
		flex-grow: 1;
		padding: 20px;
		position: relative; 
}

/* --- ŁADOWANIE --- */
#loader {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background-color: rgba(255, 255, 255, 0.9); 
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		z-index: 1000;
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.3s ease, visibility 0.3s ease;
		pointer-events: none; 
}

#loader.visible {
		opacity: 1;
		visibility: visible;
		pointer-events: all; 
}

.spinner {
		border: 6px solid #f3f3f3;
		border-top: 6px solid var(--primary-color);
		border-radius: 50%;
		width: 50px;
		height: 50px;
		animation: spin 1s linear infinite;
		margin-bottom: 15px;
}

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

#dynamic-content-container {
		opacity: 1;
		transition: opacity 0.3s ease;
}

#dynamic-content-container.fading-out {
		opacity: 0;
}

/* --- TREŚĆ --- */
.container {
		max-width: 1400px;
		margin: 0 auto;
		background: white;
		padding: 24px;
		border-radius: 8px;
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); 
}

h1 { color: #212529; margin-bottom: 0; font-weight: 300; } 
.subtitle { font-size: 1em; color: #6c757d; margin-top: 5px; margin-bottom: 25px; }
h2 { color: #343a40; border-bottom: 1px solid var(--border-color); padding-bottom: 8px; margin-top: 30px; font-weight: 400; }
label { display: block; margin-top: 12px; font-weight: 500; color: #495057; }

input[type="date"],
input[type="number"],
input[type="text"],
input[type="email"],
select { 
		padding: 10px; 
		width: 100%; 
		box-sizing: border-box; 
		margin-top: 5px; 
		border: 1px solid var(--border-color); 
		border-radius: 4px; 
		transition: border-color 0.3s ease;
}
input:focus,
select:focus {
		border-color: var(--primary-color);
		outline: none;
}

#wyniki, #status, #lokalna-lista-status { 
		margin-top: 20px; 
		padding: 15px; 
		border: 1px solid #cce5ff; 
		background-color: #e9f7ff; 
		border-radius: 4px; 
		font-weight: 400;
		color: #004085;
}
.db-info { 
		background-color: var(--table-confirmed); 
		padding: 15px; 
		border: 1px solid var(--primary-color); 
		border-radius: 4px; 
		margin-bottom: 20px; 
		color: #155724;
}

/* --- Przyciski --- */
button { 
		background-color: var(--primary-color); 
		color: white; 
		padding: 10px 18px; 
		border: none; 
		border-radius: 5px; 
		cursor: pointer; 
		margin-top: 10px; 
		margin-right: 10px; 
		font-size: 1em;
		transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.1s ease;
		box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15); 
}
button:hover:not(:disabled) { 
		background-color: var(--primary-dark-color); 
		box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
		transform: translateY(-1px);
}
button:active:not(:disabled) {
		transform: translateY(1px);
		box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
button:disabled { 
		background-color: #ced4da; 
		color: #6c757d;
		cursor: not-allowed; 
		box-shadow: none;
		transform: none;
}

.btn-secondary {
		background-color: #6c757d;
}
.btn-secondary:hover:not(:disabled) {
		background-color: #5a6268;
}
.btn-success {
		background-color: #28a745;
		color: #ffffff;
}
.btn-success:hover:not(:disabled) {
		background-color: #218838;
}

.btn-info {
		background-color: #007bff;
		color: #ffffff;
}
.btn-info:hover:not(:disabled) {
		background-color: #0069d9;
}

.btn-warning {
		background-color: #fd7e14;
		color: #ffffff;
}
.btn-warning:hover:not(:disabled) {
		background-color: #e56700;
}

.btn-danger {
		background-color: #dc3545;
		color: #ffffff;
}
.btn-danger:hover:not(:disabled) {
		background-color: #c82333;
}
.btn-danger {
		background-color: var(--danger-color);
}
.btn-danger:hover:not(:disabled) {
		background-color: var(--danger-dark-color);
}

/* trochę większe przyciski akcji */
.btn-sm {
		padding: 6px 14px;
		font-size: 0.9em;
		margin-top: 0;
}

/* Specjalne przyciski */
.zbiorcze-btn { 
		background-color: var(--secondary-color); 
		color: #212529; 
		font-weight: 500;
}
.zbiorcze-btn:hover:not(:disabled) { 
		background-color: var(--secondary-dark-color); 
		color: #212529; 
}
.pobierz-btn-male { 
		padding: 6px 10px; 
		font-size: 0.85em; 
		margin: 0; 
		box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* =================================================================
 * UJEDNOLICONE STYLE TABEL (wzór z FAKTUR)
 * Stosowane dla: faktury, egib, kontrahenci
 * ================================================================= */

/* --- Tabela faktur --- */
#faktury-results-table {
		margin-top: 10px;
		width: 100%;
		border-collapse: collapse;
		table-layout: fixed;
		border-radius: 8px;
		overflow: hidden;
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
		border: 1px solid var(--border-color);
		font-size: 0.82em;
}

#faktury-results-table th {
		background-color: var(--primary-color);
		color: white;
		font-weight: 500;
		font-size: 12pt; /* 12pt czcionka */
		height: 40px; /* 40px wysokość */
		vertical-align: middle;
		text-align: center; /* WYŚRODKOWANIE NAGŁÓWKÓW */
}

#faktury-results-table th,
#faktury-results-table td {
		border: 1px solid var(--border-color);
		padding: 8px 6px;
		text-align: left;
		overflow: hidden;
		text-overflow: ellipsis;
}

/* Wyśrodkowanie nagłówków nr dokumentu i kwota */
#faktury-results-table th:nth-child(6),
#faktury-results-table th:nth-child(9) {
		text-align: center;
}

/* nr dokumentu i kwota – do prawej */
#faktury-results-table td:nth-child(6),
#faktury-results-table td:nth-child(9) {
		text-align: right;
}

/* Nazwa i nr dokumentu mogą się zawijać */
#faktury-results-table td:nth-child(5),
#faktury-results-table td:nth-child(6),
#faktury-results-table td:nth-child(7) {
		white-space: normal;
}

/* reszta: jednowierszowa */
#faktury-results-table th:nth-child(1),
#faktury-results-table td:nth-child(1),
#faktury-results-table th:nth-child(2),
#faktury-results-table td:nth-child(2),
#faktury-results-table th:nth-child(3),
#faktury-results-table td:nth-child(3),
#faktury-results-table th:nth-child(4),
#faktury-results-table td:nth-child(4),
#faktury-results-table th:nth-child(8),
#faktury-results-table td:nth-child(8),
#faktury-results-table th:nth-child(9),
#faktury-results-table td:nth-child(9),
#faktury-results-table th:nth-child(10),
#faktury-results-table td:nth-child(10) {
		white-space: nowrap;
}

/* stała wysokość wiersza – 100px, wyśrodkowanie w pionie */
#faktury-results-table tbody tr {
		height: 100px;
		vertical-align: middle;
}

#faktury-results-table tbody tr:nth-child(even) {
		background-color: #f8f9fa;
}
#faktury-results-table tbody tr:hover {
		background-color: #e9f7ef;
}

/* Szerokości / wyrównanie kolumn (10 kolumn) */
#faktury-results-table th:nth-child(1),
#faktury-results-table td:nth-child(1) { width: 36px;	text-align: center; }

#faktury-results-table th:nth-child(2),
#faktury-results-table td:nth-child(2) { width: 60px;	text-align: center; }

#faktury-results-table th:nth-child(3),
#faktury-results-table td:nth-child(3) { width: 90px;	text-align: center; }

#faktury-results-table th:nth-child(4),
#faktury-results-table td:nth-child(4) { width: 95px;	text-align: center; }

#faktury-results-table th:nth-child(5),
#faktury-results-table td:nth-child(5) { width: 95px;	text-align: center; }

#faktury-results-table th:nth-child(6),
#faktury-results-table td:nth-child(6) { width: 140px; }

#faktury-results-table th:nth-child(7),
#faktury-results-table td:nth-child(7) { width: 230px; }

#faktury-results-table th:nth-child(8),
#faktury-results-table td:nth-child(8) { width: 150px; text-align: center; }

#faktury-results-table th:nth-child(9),
#faktury-results-table td:nth-child(9) { width: 110px; }

#faktury-results-table th:nth-child(10),
#faktury-results-table td:nth-child(10) { width: 110px; text-align: center; }

/* Badge NIP/PESEL w komórce kontrahenta */
.id-badge {
		margin-top: 3px;
		display: inline-flex;
		align-items: center;
		gap: 4px;
		font-size: 0.78em;
		background-color: #e9ecef;
		border-radius: 10px;
		padding: 2px 6px;
}
.id-badge-label {
		font-weight: 600;
		color: #495057;
}
.id-badge-value {
		color: #495057;
}

/* Grupa przycisków "Zaznaczone" */
.faktury-bulk-group {
		display: inline-flex;
		align-items: center;
		flex-wrap: wrap;
		gap: 4px;
		border: 1px solid var(--border-color);
		border-radius: 6px;
		padding: 4px 6px;
		background-color: #f8f9fa;
}
.faktury-bulk-label {
		font-size: 0.8em;
		color: #495057;
		margin-right: 2px;
}

/* Filtry faktur – czytelniejszy układ + przyciski w ramce */
.faktury-filters {
		background-color: #f8f9fa;
		border: 1px solid var(--border-color);
		border-radius: 6px;
		padding: 12px 14px;
		margin-bottom: 8px;
}
.faktury-filters-row {
		display: flex;
		flex-wrap: wrap;
		gap: 8px 16px;
}
.faktury-filters .filter-field {
		display: flex;
		flex-direction: column;
		min-width: 180px;
}
.faktury-filters .filter-field-short {
		min-width: 130px;
		max-width: 150px;
}
.faktury-filters label {
		font-size: 0.82em;
		font-weight: 500;
		margin-bottom: 3px;
}
.faktury-filters input[type="text"],
.faktury-filters input[type="date"],
.faktury-filters select,
.faktury-filters textarea {
		font-size: 0.85em;
		padding: 4px 8px;
}

.faktury-filters-actions {
		margin-top: 10px;
		display: flex;
		justify-content: flex-end;
		gap: 6px;
}

/* --- Tabela historii zmian (EGiB) - STYL JAK FAKTURY --- */
#lokalna-lista-zmian { 
		margin-top: 20px; 
		width: 100%; 
		border-collapse: collapse; 
		table-layout: fixed; 
		border-radius: 8px; 
		overflow: hidden; 
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); 
		border: 1px solid var(--border-color);
		font-size: 0.82em;
}
#lokalna-lista-zmian th { 
		background-color: var(--primary-color); 
		color: white; 
		font-weight: 500;
		font-size: 12pt; /* 12pt czcionka */
		height: 40px; /* 40px wysokość */
		vertical-align: middle;
		text-align: center; /* WYŚRODKOWANIE NAGŁÓWKÓW */
		border: 1px solid var(--border-color);
		border-right: 1px solid #ffffff; /* PIONOWY PODZIAŁ */
		padding: 8px 6px;
		overflow: hidden;
		text-overflow: ellipsis;
}
#lokalna-lista-zmian th:last-child {
		border-right: none;
}
#lokalna-lista-zmian td { 
		border: 1px solid var(--border-color); 
		padding: 8px 6px; 
		text-align: left; 
		overflow: hidden; 
		text-overflow: ellipsis;
}

#lokalna-lista-zmian th:nth-child(1), #lokalna-lista-zmian td:nth-child(1) { width: 70px; white-space: nowrap; } 
#lokalna-lista-zmian th:nth-child(2), #lokalna-lista-zmian td:nth-child(2) { width: 90px; white-space: nowrap; } 
#lokalna-lista-zmian th:nth-child(3), #lokalna-lista-zmian td:nth-child(3) { width: 100px; white-space: nowrap; } 
#lokalna-lista-zmian th:nth-child(4), #lokalna-lista-zmian td:nth-child(4) { width: auto; white-space: normal; } 
#lokalna-lista-zmian th:nth-child(5), #lokalna-lista-zmian td:nth-child(5) { width: 80px; white-space: nowrap; } 
#lokalna-lista-zmian th:nth-child(6), #lokalna-lista-zmian td:nth-child(6) { width: 120px; white-space: nowrap; } 
#lokalna-lista-zmian th:nth-child(7), #lokalna-lista-zmian td:nth-child(7) { width: 120px; white-space: nowrap; }
#lokalna-lista-zmian td:nth-child(1),
#lokalna-lista-zmian td:nth-child(2),
#lokalna-lista-zmian td:nth-child(3),
#lokalna-lista-zmian td:nth-child(5),
#lokalna-lista-zmian td:nth-child(6),
#lokalna-lista-zmian td:nth-child(7) { text-align: center; } 

#lokalna-lista-zmian tbody tr {
		height: 50px; /* POPRAWIONA WYSOKOŚĆ WIERSZA */
		vertical-align: middle;
}

#lokalna-lista-zmian tr:nth-child(even) {
		background-color: #f8f9fa;
}
#lokalna-lista-zmian tbody tr:hover {
		background-color: #e9f7ef;
}
.potwierdzono-true { background-color: var(--table-confirmed); }
.potwierdzono-false { background-color: var(--table-unconfirmed); }

/* --- Tabela kontrahentów - STYL JAK FAKTURY --- */
#kontrahent-results-table {
		width: 100%;
		border-collapse: collapse;
		margin-top: 8px;
		border-radius: 8px;
		overflow: hidden;
		box-shadow: 0 4px 12px rgba(0,0,0,0.05);
		border: 1px solid var(--border-color);
		font-size: 0.82em;
}
#kontrahent-results-table thead tr {
		background-color: var(--primary-color);
}
#kontrahent-results-table th {
		color: #fff;
		font-weight: 500;
		font-size: 12pt; /* 12pt czcionka */
		padding: 8px 10px;
		text-align: center; /* WYŚRODKOWANIE NAGŁÓWKÓW */
		border-right: 1px solid #ffffff; /* PIONOWY PODZIAŁ */
		height: 40px; /* 40px wysokość */
		vertical-align: middle;
}
#kontrahent-results-table th:last-child {
		border-right: none;
}
#kontrahent-results-table td {
		padding: 8px 10px;
		border-bottom: 1px solid var(--border-color);
		border-right: 1px solid var(--border-color); /* PIONOWY PODZIAŁ */
		vertical-align: middle;
		background-color: #ffffff;
		overflow: hidden;
		text-overflow: ellipsis;
}
#kontrahent-results-table td:last-child {
		border-right: none;
}
#kontrahent-results-table tbody tr {
		height: 50px; /* POPRAWIONA WYSOKOŚĆ WIERSZA */
}
#kontrahent-results-table tr:nth-child(even) td {
		background-color: #f8f9fa;
}
#kontrahent-results-table tbody tr:hover td {
		background-color: #e9f7ef;
}

/* nazwiska jako link – ale w kolorze tekstu */
#kontrahent-results-table a {
		color: inherit;
		text-decoration: none;
}
#kontrahent-results-table a:hover {
		text-decoration: underline;
		cursor: pointer;
}

/* małe info o typie w komórce identyfikatora */
.kontr-identyfikator-typ {
		font-size: 0.8em;
		color: #f8f9fa;
		font-weight: 500;
		display: inline-block;
		background-color: #28a745;
		padding: 1px 6px;
		border-radius: 10px;
		margin-bottom: 2px;
}

/* animacja fade-in przy zmianie stron */
#kontrahent-results-list.fade-in {
		animation: kontrFadeIn 0.25s ease-in-out;
}
@keyframes kontrFadeIn {
		from { opacity: 0; }
		to	 { opacity: 1; }
}

/* Wspólne style dla filtrów */
.filter-grid { 
		display: grid; 
		grid-template-columns: repeat(3, 1fr); 
		gap: 20px; 
		margin-top: 15px; 
		padding: 20px; 
		border: 1px solid var(--border-color); 
		border-radius: 6px; 
		background-color: #f8f9fa;
}
.filter-grid > div:nth-child(9) { 
		grid-column: 3; 
		align-self: end; 
		padding-bottom: 0; 
}
.filter-grid > div:nth-child(9) button {
		margin-top: 0; 
		width: 100%;
}

.pagination-controls { 
		display: flex;
		justify-content: flex-end;
		align-items: center;
		gap: 6px;
		margin-top: 10px; 
		font-size: 0.9em; 
}
.pagination-controls button { 
		padding: 6px 12px; 
		font-size: 0.9em; 
		margin: 0 5px; 
}

.error-message { color: #dc3545; font-size: 0.85em; margin-top: 5px; font-weight: 500; }

/* =================================================================
 * DASHBOARD, LOGIN
 * ================================================================= */

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

.stat-box {
		background-color: #fff;
		padding: 20px;
		border-radius: 8px;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
		text-align: center;
		border-left: 5px solid; 
		transition: transform 0.2s, box-shadow 0.2s;
		cursor: pointer;
}

.stat-box:hover {
		transform: translateY(-3px);
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-value {
		display: block;
		font-size: 2.5em;
		font-weight: 700;
		margin-bottom: 5px;
}

.stat-label {
		display: block;
		font-size: 0.9em;
		color: #6c757d;
}

.stat-box-primary { border-left-color: var(--primary-color); }
.stat-box-primary .stat-value { color: var(--primary-color); }

.stat-box-secondary { border-left-color: var(--secondary-dark-color); }
.stat-box-secondary .stat-value { color: var(--secondary-dark-color); }

.stat-box-info { border-left-color: var(--info-color); }
.stat-box-info .stat-value { color: var(--info-color); }

.stat-box-danger { border-left-color: var(--danger-color); }
.stat-box-danger .stat-value { color: var(--danger-color); }

.login-box {
		background: #fff;
		padding: 30px 40px;
		border-radius: 8px;
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); 
		width: 100%;
		max-width: 400px;
		text-align: center;
}

.login-box h1 {
		font-size: 1.8em;
		color: var(--menu-bg); 
		margin-bottom: 10px;
}

.login-box .subtitle {
		color: #6c757d;
		margin-bottom: 25px;
}

.login-box label {
		display: block;
		text-align: left;
		margin-top: 15px;
		margin-bottom: 5px;
		font-weight: 500;
}

.login-box input[type="text"],
.login-box input[type="password"] {
		width: 100%;
		padding: 10px;
		border: 1px solid var(--border-color);
		border-radius: 4px;
		box-sizing: border-box;
		font-size: 1em;
}

.login-box button {
		margin-top: 25px;
		padding: 12px;
		font-size: 1.1em;
}

.info-links {
		margin-top: 20px;
		font-size: 0.9em;
}

.info-links a {
		color: var(--primary-color);
		text-decoration: none;
		transition: color 0.2s;
}

.info-links a:hover {
		color: var(--primary-dark-color);
		text-decoration: underline;
}

.login-box .error-message {
		color: var(--danger-color);
		background-color: var(--table-unconfirmed); 
		border: 1px solid var(--danger-color);
		padding: 8px;
		border-radius: 4px;
		text-align: center;
}

/* =================================================================
 * MODALE KONTRAHENTÓW – identyczny styl jak faktury
 * ================================================================= */

.modal {
		position: fixed;
		inset: 0;
		background: rgba(0,0,0,0.4);
		display: flex;
		align-items: center;
		justify-content: center;
		z-index: 2000;
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transition: opacity 0.2s ease-out, visibility 0.2s ease-out;
}

.modal.visible {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
}

.modal-content {
		position: relative;
		background: #fff;
		border-radius: 8px;
		max-width: 1000px;
		width: 92%;
		max-height: 85vh;
		display: flex;
		flex-direction: column;
		box-shadow: 0 8px 24px rgba(0,0,0,0.25);
		transform: scale(0.9);
		opacity: 0;
		transition: transform 0.2s ease-out, opacity 0.2s ease-out;
		overflow-y: auto;
}

.modal.visible .modal-content {
		transform: scale(1);
		opacity: 1;
}

/* Header modala */
.modal-content > h2:first-child,
#modal-title {
		margin: 0;
		padding: 16px 20px;
		font-size: 1.3em;
		font-weight: 500;
		color: #212529;
		border-bottom: none;
		background-color: #fff;
		border-radius: 8px 8px 0 0;
		display: flex;
		justify-content: space-between;
		align-items: center;
}

/* Subtitle */
.modal-content .subtitle {
		padding: 0 20px;
		margin-top: 0;
		margin-bottom: 20px;
}

/* Body content */
.modal-body-content {
		padding: 0 20px;
}

/* Footer */
.modal-footer-content {
		padding: 0 20px 20px 20px;
		text-align: right;
}

/* Formularz */
.modal-content form {
		padding: 0 20px 20px 20px;
}

/* Przycisk X - identyczny jak w fakturach */
.modal .close-btn,
.close-btn {
		background-color: #dc3545;
		color: white;
		border: none;
		border-radius: 4px;
		width: 32px;
		height: 32px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		font-size: 1.4em;
		line-height: 1;
		cursor: pointer;
		transition: background-color 0.2s ease;
		position: static;
		flex-shrink: 0;
}

.modal .close-btn:hover,
.close-btn:hover {
		background-color: #c82333;
}

/* Modal podglądu faktury */
.faktura-modal-overlay {
		position: fixed;
		inset: 0;
		background: rgba(0,0,0,0.4);
		display: flex;
		align-items: center;
		justify-content: center;
		z-index: 2000;
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transition: opacity 0.2s ease-out, visibility 0.2s ease-out;
}
.faktura-modal-overlay.active {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
}
.faktura-modal-window {
		position: relative;
		background: #fff;
		border-radius: 8px;
		max-width: 1100px;
		width: 92%;
		max-height: 85vh;
		display: flex;
		flex-direction: column;
		box-shadow: 0 8px 24px rgba(0,0,0,0.25);
		transform: scale(0.9);
		opacity: 0;
		transition: transform 0.2s ease-out, opacity 0.2s ease-out;
}
.faktura-modal-overlay.active .faktura-modal-window {
		transform: scale(1);
		opacity: 1;
}
.faktura-modal-header {
		padding: 16px 20px;
		border-bottom: none;
		display: flex;
		justify-content: space-between;
		align-items: center;
		background-color: #fff;
		border-radius: 8px 8px 0 0;
}
.faktura-modal-header h2 {
		font-size: 1.3em;
		margin: 0;
		font-weight: 500;
		color: #212529;
}
.faktura-modal-header .close-btn {
		position: static;
		background-color: #dc3545;
		color: white;
		border: none;
		border-radius: 4px;
		width: 32px;
		height: 32px;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 1.4em;
		cursor: pointer;
		transition: background-color 0.2s ease;
}
.faktura-modal-header .close-btn:hover {
		background-color: #c82333;
}

.faktura-modal-body {
		padding: 20px 24px;
		overflow-y: auto;
		flex: 1;
}
.faktura-modal-footer {
		padding: 12px 20px;
		border-top: 1px solid var(--border-color);
		text-align: right;
}
.faktury-badge-toggle {
		border: 1px solid #ced4da;
		border-radius: 999px;
		padding: 6px 14px;
		font-size: 0.85em;
		color: #495057;
		background: #f8f9fa;
		cursor: pointer;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: 6px;
		user-select: none;
		transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

/* ukrywamy klasyczne kółko radio, klik działa po etykiecie */
.faktury-badge-toggle input {
		margin: 0;
		opacity: 0;
		position: absolute;
		pointer-events: none;
}

/* stan aktywny – kompatybilny z dotychczasową klasą */
.faktury-badge-toggle-active {
		background: #e7f1ff;
		border-color: #0d6efd;
		color: #0d6efd;
}

/* automatyczne podświetlenie zaznaczonego przycisku (nowoczesne przeglądarki) */
.faktury-badge-toggle:has(input:checked) {
		background: #e7f1ff;
		border-color: #0d6efd;
		color: #0d6efd;
		box-shadow: 0 0 0 1px rgba(13, 110, 253, 0.15);
}

.faktury-vat-badge {
		display: inline-block;
		margin-top: 2px;
		padding: 1px 6px;
		border-radius: 999px;
		border: 1px solid #ffc107;
		font-size: 10px;
		color: #856404;
		background-color: #fff3cd;
}
.faktura-amounts-row {
		display: flex;
		gap: 10px;
		flex-wrap: wrap;
}

.faktura-amount-box {
		flex: 1 1 0;
		min-width: 120px;
		border: 1px solid #dee2e6;
		border-radius: 4px;
		padding: 4px 8px;
		background-color: #f8f9fa;
}

.faktura-amount-label {
		font-size: 11px;
		font-weight: 600;
		text-transform: uppercase;
		letter-spacing: 0.03em;
		color: #495057;
		margin-bottom: 2px;
}

.faktura-amount-value {
		font-size: 13px;
		font-weight: 600;
		color: #212529;
}
/* lepsze wyrównanie linii "Rodzaj kontrahenta" */
#faktury-kont-rodzaj-row {
		align-items: center;
}
/* stała wysokość wierszy NIP/PESEL, żeby kolumna nie skakała */
.faktury-nip-pesel-row {
		min-height: 64px;
		align-items: center; /* wyśrodkuj w pionie input + przyciski */
}
/* Wewnątrz modala – layout */
.faktura-modal-sections {
		display: flex;
		flex-wrap: wrap;
		gap: 24px;
		margin-bottom: 20px;
}
.faktura-section {
		flex: 1 1 280px;
		min-width: 260px;
}
.faktura-section h3 {
		font-size: 1.05em;
		margin-bottom: 10px;
		font-weight: 500;
		color: #343a40;
		padding-bottom: 6px;
}
.faktura-dl {
		margin: 0;
		font-size: 0.92em;
		line-height: 1.6;
}

/* każdy wiersz: etykieta + pole, wyrównane w pionie */
.faktura-dl > div {
		display: flex;
		align-items: center;				/* WYŚRODKOWANIE W PIONIE etykiety i pola */
		gap: 10px;
		margin-bottom: 8px;
		padding: 6px 0;
		border-bottom: 1px solid #f1f3f5;
}

.faktura-dl > div:last-child {
		border-bottom: none;
}

.faktura-dl dt {
		min-width: 140px;
		font-weight: 600;
		color: #495057;
}

.faktura-dl dd {
		margin: 0;
		color: #212529;
		flex: 1;
}

/* Nagłówki sekcji w podglądzie / modalu faktury (np. "Dane kontrahenta", "Dane dokumentu") */
.faktura-section-title {
		margin: 0 0 8px 0;
		font-size: 14px;
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: 0.03em;
		color: #333;
		border-bottom: 1px solid #dee2e6;
		padding-bottom: 3px;
}

/* linkowy przycisk dla ID faktury */
.link-button {
		background: none;
		border: none;
		padding: 0;
		color: var(--primary-color);
		cursor: pointer;
		font-size: inherit;
		text-decoration: underline;
}
.link-button:hover {
		color: var(--primary-dark-color);
		text-decoration: none;
}

/* Klikalne ID faktury - zwykły tekst, pogrubiony */
.faktura-id-clickable {
		cursor: pointer;
		font-weight: bold;
		color: inherit;
}
.faktura-id-clickable:hover {
		text-decoration: underline;
}

/* Dodatkowe style dla tabeli powiązanych kontrahentów */
.kontrahent-multi-table {
		width: 100%;
		border-collapse: collapse;
		margin-top: 10px;
}
.kontrahent-multi-table th {
		background-color: #f8f9fa;
		padding: 8px;
		text-align: left;
		border: 1px solid var(--border-color);
		font-weight: 500;
}
.kontrahent-multi-table td {
		padding: 8px;
		border: 1px solid var(--border-color);
}
.kontrahent-multi-table tr:nth-child(even) {
		background-color: #f8f9fa;
}

/* GUS message */
.gus-message {
		margin-top: 10px;
		padding: 8px;
		border-radius: 4px;
		font-size: 0.9em;
}

.faktura-history-wrapper {
		margin-top: 6px;
		padding-top: 6px;
		border-top: 1px solid #dee2e6;
}

/* mniejsza czcionka w historii (ok. 11pt) */
.faktura-history-table th,
.faktura-history-table td {
		font-size: 12px;
}
/* --- MINI HISTORIA FAKTURY (OPCJA B) --- */

.faktura-history-wrapper {
		margin-top: 6px;
		padding-top: 6px;
		border-top: 1px solid #dee2e6;
}

.faktura-history-table {
		width: 100%;
		border-collapse: collapse;
		font-size: 11px;
}

.faktura-history-table th,
.faktura-history-table td {
		padding: 4px 6px;
		border-bottom: 1px solid #e9ecef;
		text-align: left;
		font-size: 11px;
}

/* Data/czas wyśrodkowana */
.faktura-history-table th:first-child,
.faktura-history-table td:first-child {
		text-align: center;
		white-space: nowrap;
}

/* opis rozciąga się */
.faktura-history-table th:last-child,
.faktura-history-table td:last-child {
		width: 100%;
}

.faktura-history-table thead th {
		background-color: #f8f9fa;
		font-weight: 600;
}
/* Badge typu kontrahenta (jak statusy w fakturach) */
.kontrahent-type-badge {
		display: inline-block;
		padding: 1px 6px;
		margin-top: 2px;
		margin-right: 3px;
		font-size: 10px;
		border-radius: 999px;
		font-weight: 500;
		color: #fff;
		background-color: #6c757d;
}

.kontrahent-type-badge.firma {
		background-color: #007bff; /* niebieski */
}

.kontrahent-type-badge.osoba {
		background-color: #28a745; /* zielony */
}

.kontrahent-type-badge.multi {
		background-color: #ffc107; /* żółty */
		color: #212529;
}
/* KONTRAHENCI – paginacja nad listą */
.kontrahenci-pagination-top-wrapper {
		margin: 8px 0 10px;
		display: flex;
		justify-content: flex-end;
}

/* Poprzednio: input + select miały height:32px – select ucinał tekst.
	 Tu przywracamy naturalną wysokość selectów. */
.faktury-filters .filter-field input {
		height: 32px;
		line-height: 32px;
}

/* select: pozwalamy przeglądarce dobrać wysokość, tylko delikatny padding */
.faktury-filters .filter-field select {
		height: 32px;
	width: 200px;
		line-height: normal;
		padding: 2px 24px 2px 6px; /* góra/dół 2px, trochę miejsca na strzałkę */
		font-size: 13px;
}


.faktury-filters .filter-field label {
		display: block;
		margin-bottom: 2px;
		font-size: 13px;
}

.faktury-filters-actions .btn {
		height: 32px;
		display: inline-flex;
		align-items: center;
		padding: 4px 10px;
		font-size: 13px;
}
/* Zamówienia – pola w tabelach jak w fakturach / modalach */
#zam-wn-warunki-body input[type="text"],
#zam-wn-warunki-body textarea,
#zam-wn-kryteria-body input[type="text"],
#zam-wn-kryteria-body input[type="number"] {
		width: 100%;
		box-sizing: border-box;
		font-size: 0.85em;
		padding: 4px 8px;
		border-radius: 4px;
		border: 1px solid var(--border-color);
}

/* Wiersze w tabelach – środek w pionie, trochę więcej „oddechu” */
#zam-wn-warunki-body td,
#zam-wn-kryteria-body td {
		padding: 6px 8px;
		vertical-align: middle;
}

/* jednolity wygląd tabel „Warunki” / „Kryteria” */
.zam-wn-table {
		width: 100%;
		border-collapse: collapse;
		border-radius: 6px;
		overflow: hidden;
		border: 1px solid var(--border-color);
		background-color: #ffffff;
		font-size: 0.85em;
}

/* Stała szerokość kolumny "Akcje" w obu tabelach */
#zam-wn-warunki-table th:last-child,
#zam-wn-warunki-table td:last-child,
#zam-wn-kryteria-table th:last-child,
#zam-wn-kryteria-table td:last-child {
		width: 15%;
		text-align: center;
}

/* Lp. – delikatniejsza czcionka */
.zam-wn-lp {
		white-space: nowrap;
		font-size: 0.8em;
		color: #6c757d;
}

.zam-wn-table thead th {
		background-color: #f8f9fa;
		font-weight: 500;
		padding: 6px 8px;
}

.zam-wn-table tbody td,
.zam-wn-table tfoot td {
		border-top: 1px solid var(--border-color);
		padding: 6px 8px;
}
/* Zamówienia: listy użytkowników jako checkboxy (komisja / osoby) */
.zam-wn-users-list {
		border: 1px solid var(--border-color);
		border-radius: 4px;
		padding: 6px 8px;
		max-height: 180px;
		overflow-y: auto;
		background-color: #ffffff;
}

.zam-wn-user-checkbox {
		display: flex;
		align-items: center;
		gap: 6px;
		font-size: 0.85em;
		padding: 2px 0;
}

.zam-wn-user-checkbox input[type="checkbox"] {
		margin: 0;
}

/* Zamówienia – lista użytkowników (komisja / osoby) */
.zam-wn-users-list {
		border: 1px solid #ced4da;
		border-radius: 4px;
		padding: 8px 10px;
		background: #ffffff;
		max-height: none;				/* wyłącza przewijanie, pokazuje wszystkich */
		overflow-y: visible;		 /* na wszelki wypadek */
}

/* Pojedynczy wiersz z checkboxem i nazwą osoby */
.zam-wn-user-row {
		display: flex;
		align-items: center;
		gap: 6px;
		padding: 2px 0;
		font-size: 0.9em;
}

/* Sam checkbox – bez zbędnych marginesów */
.zam-wn-user-row input[type="checkbox"] {
		margin: 0;
}

/* Opcjonalnie lekkie odseparowanie sekcji komisji / osób */
#zam-wn-komisja-section .filter-field .zam-wn-users-list {
		margin-top: 4px;
}

/* Zamówienia – pole z wyborem komisji / osób (podsumowanie + przycisk) */
.zam-wn-users-list {
		border: 1px solid var(--border-color);
		border-radius: 4px;
		padding: 8px 10px;
		background: #ffffff;
		font-size: 0.9em;
}

.zam-wn-users-summary {
		margin-top: 4px;
		font-size: 0.85em;
		color: #495057;
		line-height: 1.3;
}

/* Lp. w tabelach warunków / kryteriów */
.zam-wn-lp {
		white-space: nowrap;
		font-size: 0.8em;
		color: #6c757d;
}

/* Zamówienia – Osoby akceptujące i zatwierdzające: wszystkie pola na pełną szerokość kolumny */
#zam-wn-sporzadzil,
#zam-wn-skarbnik,
#zam-wn-kierownik {
		width: 100%;
}

/* Zamówienia – minimalnie wyższe pola input/select (ok. +10%) */
#zamowienia input[type="text"],
#zamowienia input[type="date"],
#zamowienia input[type="number"],
#zamowienia select {
		padding-top: 7px;
		padding-bottom: 7px; /* było ~4–6px, więc wizualnie ~+10–15% wysokości */
}

/* Zamówienia – textarea jak pozostałe pola, min. wysokość 200px */
#zamowienia textarea {
		font-size: 0.9em;							/* jak filtry / inputy */
		line-height: 1.4;
		min-height: 200px;
		padding: 7px 8px;
		border-radius: 4px;
		border: 1px solid var(--border-color);
		box-sizing: border-box;
		resize: vertical;							/* można zmieniać wysokość, ale nie rozwala szerokości */
}

/* --- Tabela umów (styl jak faktury) --- */
#umowy-results-table {
		margin-top: 10px;
		width: 90%;
	margin-left: auto;
		margin-right: auto;
		border-collapse: collapse;
		table-layout: fixed;
		border-radius: 8px;
		overflow: hidden;
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
		border: 1px solid var(--border-color);
		font-size: 0.82em;
}

#umowy-results-table th {
		background-color: var(--primary-color);
		color: white;
		font-weight: 500;
		font-size: 12pt;
		height: 40px;
		vertical-align: middle;
		text-align: center;
}

#umowy-results-table th,
#umowy-results-table td {
		border: 1px solid var(--border-color);
		padding: 8px 6px;
		text-align: left;
		overflow: hidden;
		text-overflow: ellipsis;
}

/* Kolumny, które mogą się zawijać (kontrahent, przedmiot) */
#umowy-results-table td:nth-child(3),
#umowy-results-table td:nth-child(4) {
		white-space: normal;
}

/* Pozostałe – jednowierszowe */
#umowy-results-table th:nth-child(1),
#umowy-results-table td:nth-child(1),
#umowy-results-table th:nth-child(2),
#umowy-results-table td:nth-child(2),
#umowy-results-table th:nth-child(5),
#umowy-results-table td:nth-child(5),
#umowy-results-table th:nth-child(6),
#umowy-results-table td:nth-child(6),
#umowy-results-table th:nth-child(7),
#umowy-results-table td:nth-child(7) {
		white-space: nowrap;
}

/* Wyrównanie kolumn */
#umowy-results-table th:nth-child(1),
#umowy-results-table td:nth-child(1) { width: 140px; text-align: center; }

#umowy-results-table th:nth-child(2),
#umowy-results-table td:nth-child(2) { width: 120px; text-align: center; }

#umowy-results-table th:nth-child(3),
#umowy-results-table td:nth-child(3) { width: 260px; }

#umowy-results-table th:nth-child(4),
#umowy-results-table td:nth-child(4) { width: 420px; }

#umowy-results-table th:nth-child(5),
#umowy-results-table td:nth-child(5) { width: 150px; text-align: right; }

#umowy-results-table th:nth-child(6),
#umowy-results-table td:nth-child(6) { width: 120px; text-align: center; }

#umowy-results-table th:nth-child(7),
#umowy-results-table td:nth-child(7) { width: 120px; text-align: center; }

/* stała wysokość wiersza + hover jak w fakturach */
#umowy-results-table tbody tr {
		height: 100px;
		vertical-align: middle;
}

#umowy-results-table tbody tr:nth-child(even) {
		background-color: #f8f9fa;
}

#umowy-results-table tbody tr:hover {
		background-color: #e9f7ef;
}
/* ============================================
	 Animacje modali (fadeIn + lekki slide-up)
	 ============================================ */

/* Stan ukryty */
.modal {
		opacity: 0;
		visibility: hidden;
		transform: translateY(10px);
		transition:
				opacity 0.25s ease-out,
				transform 0.25s ease-out,
				visibility 0s linear 0.25s;
}

/* Stan widoczny */
.modal.visible {
		opacity: 1;
		visibility: visible;
		transform: translateY(0);
		transition:
				opacity 0.25s ease-out,
				transform 0.25s ease-out,
				visibility 0s;
}

/* Dodatkowy efekt: sam "window" delikatnie się skaluje */
.modal .modal-window,
.modal .modal-content {
		transform: scale(0.98);
		transition: transform 0.25s ease-out;
}

.modal.visible .modal-window,
.modal.visible .modal-content {
		transform: scale(1);
}

/* Overlay w modalu podglądu (faktura/umowa) — zachowujemy kompatybilność */
.faktura-modal-overlay {
		opacity: 0;
		visibility: hidden;
		transform: translateY(10px);
		transition:
				opacity 0.25s ease-out,
				transform 0.25s ease-out,
				visibility 0s linear 0.25s;
}

.faktura-modal-overlay.active {
		opacity: 1;
		visibility: visible;
		transform: translateY(0);
		transition:
				opacity 0.25s ease-out,
				transform 0.25s ease-out,
				visibility 0s;
}
/* =====================================================================
 * Rejestr Umów – tabela listy (styl bliźniaczy do rejestru faktur)
 * ===================================================================== */
#umowy-results-table {
		margin-top: 10px;
		width: 100%;
		border-collapse: collapse;
		table-layout: fixed;
		border-radius: 8px;
		overflow: hidden;
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
		border: 1px solid var(--border-color);
		font-size: 0.82em;
}

#umowy-results-table th {
		background-color: var(--primary-color);
		color: white;
		font-weight: 500;
		text-align: left;
		padding: 8px 10px;
		border-bottom: 1px solid var(--border-color);
}

#umowy-results-table td {
		padding: 8px 10px;
		border-bottom: 1px solid var(--border-color);
		background-color: #ffffff;
		vertical-align: middle;
}

/* Zawijanie tekstu w całej tabeli – żeby nic nie wypychało szerokości */
#umowy-results-table th,
#umowy-results-table td {
		white-space: normal;
		word-wrap: break-word;
}

#umowy-results-table tbody tr:nth-child(even) td {
		background-color: #fdfdfd;
}

#umowy-results-table tbody tr:hover td {
		background-color: #f1f8ff;
}

/* Szerokości kolumn – bardziej „ciasno”, żeby się mieściło */
#umowy-results-table th:nth-child(1),
#umowy-results-table td:nth-child(1) {
		width: 50px;
		text-align: center;
}

#umowy-results-table th:nth-child(2),
#umowy-results-table td:nth-child(2) {
		width: 110px;
		text-align: center;
}

#umowy-results-table th:nth-child(3),
#umowy-results-table td:nth-child(3) {
		width: 90px;
		text-align: center;
}

/* Kontrahent – trochę zawężamy, reszta treści ma się zawijać */
#umowy-results-table th:nth-child(4),
#umowy-results-table td:nth-child(4) {
		width: 140px;
}

/* Przedmiot – elastyczna kolumna na treść, bez sztywnej szerokości */

/* Wartość brutto */
#umowy-results-table th:nth-child(6),
#umowy-results-table td:nth-child(6) {
		width: 120px;
		text-align: right;
}

/* Okres obowiązywania */
#umowy-results-table th:nth-child(7),
#umowy-results-table td:nth-child(7) {
		width: 120px;
}

/* Akcje – przyciski mogą się zawijać w dwie linie */
#umowy-results-table th:nth-child(8),
#umowy-results-table td:nth-child(8) {
		width: 160px;
		text-align: center;
}

/* ID jako „klikany link” do podglądu */
.umowa-id-clickable {
		cursor: pointer;
}

/* Filtry umów – jedna linia, wyrównanie w pionie */
.umowy-filters-row {
		align-items: flex-end;
}
.umowy-filters-row .filter-field-actions {
		display: flex;
		gap: 8px;
		align-items: flex-end;
}
.umowy-filters-row .filter-field-actions button {
		margin-top: 0;
}
/* Vertis – wyrównanie pionowe całej sekcji formularzy */
.form-group,
.form-group > label,
.form-group > input,
.form-group > textarea {
		display: flex;
		flex-direction: column;
		justify-content: center;
}

label {
		margin-bottom: 4px !important;
}
/* >>> STYLE: zamówienia - krok 3a1 (dostawa) <<< */
.zamowienie-dostawa-container {
		display: flex;
		flex-direction: column;
		gap: 20px;
}

.zamowienie-dostawa-row {
		display: flex;
		flex-wrap: wrap;
		gap: 20px;
}

.zamowienie-dostawa-col {
		flex: 1;
		min-width: 250px;
}

.zamowienie-dostawa-small {
		max-width: 120px;
}

.zamowienie-dostawa-btn-abs {
		position: absolute;
		right: 10px;
		bottom: 10px;
}

.pozycje-zamowienia table {
		width: 100%;
}

.pozycje-zamowienia th,
.pozycje-zamowienia td {
		vertical-align: middle;
}

.pozycje-zamowienia .remove-row {
		font-weight: bold;
		color: white;
		background-color: red;
		border: none;
		padding: 4px 10px;
		cursor: pointer;
}

/* Layout 30/70 + separator sekcji + hinty */
.form-2col{
	display:grid;
	grid-template-columns: 30% 70%;
	gap: 8px 12px;
}
.form-2col .label{
	font-weight:600;
	padding-top:8px;
}
.form-2col .field .form-control,
.form-2col .field .btn,
.input-group .form-control,
.input-group .input-group-text{
	min-height:40px;
}
.hint{
	font-weight:400;
	font-size:.85em;
	color:#6c757d;
	margin-top:2px;
}
.form-sep{
	grid-column: 1 / -1;
	font-weight:700;
	margin: 8px 0 4px;
	padding-top:4px;
	border-top:1px solid #e6e6e6;
}

/* Nawigacja kroku */
.btn-40{
	height:40px;
	display:inline-flex;
	align-items:center;
	justify-content:center;
}
.form-nav{
	display:flex;
	justify-content:space-between;
	gap:8px;
	margin-top:12px;
}

/* Progress kryteriów (bez zależności od frameworka) */
.progress{
	width:100%;
	height:8px;
	background:#f1f3f5;
	border-radius:4px;
	overflow:hidden;
}
.progress .progress-bar{
	height:100%;
	background:#0d6efd; /* primary */
	width:0%;
	transition:width .2s ease;
	border-radius:4px;
}
.badge{
	display:inline-block;
	padding:.3em .5em;
	border-radius:.4rem;
	font-size:.75em;
	vertical-align:middle;
}
.badge-danger{ background:#dc3545; color:#fff; }
.badge-success{ background:#198754; color:#fff; }

/* Tabele w kroku 4 – pionowe centrowanie */
#zamowienia-step-4-wniosek table th,
#zamowienia-step-4-wniosek table td{
	vertical-align: middle;
}

/* Mobile */
@media (max-width: 768px){
	.form-2col{ grid-template-columns: 1fr; }
	.w-100-sm{ width:100%; }
}

/* 2 kolumny 30/70 + separator + hinty */
.form-2col{ display:grid; grid-template-columns:30% 70%; gap:8px 12px; }
.form-2col .label{ font-weight:600; padding-top:8px; }
.form-2col .field .form-control,
.form-2col .field .btn,
.input-group .form-control,
.input-group .input-group-text{ min-height:40px; }

/* Tekstowe pola na pełną szerokość i MAX 50px wysokości */
.form-2col .field textarea.form-control{
	width:100%;
	height:50px;
	max-height:50px;
	resize:none;
	overflow:auto;
}

.hint{ font-weight:400; font-size:.85em; color:#6c757d; margin-top:2px; }
.form-sep{ grid-column:1 / -1; font-weight:700; margin:8px 0 4px; padding-top:4px; border-top:1px solid #e6e6e6; }

/* Nawigacja */
.btn-40{ height:40px; display:inline-flex; align-items:center; justify-content:center; }
.form-nav{ display:flex; justify-content:space-between; gap:8px; margin-top:12px; }

/* Progress / badge */
.progress{ width:100%; height:8px; background:#f1f3f5; border-radius:4px; overflow:hidden; }
.progress .progress-bar{ height:100%; background:#0d6efd; width:0%; transition:width .2s ease; border-radius:4px; }
.badge{ display:inline-block; padding:.3em .5em; border-radius:.4rem; font-size:.75em; vertical-align:middle; }
.badge-danger{ background:#dc3545; color:#fff; }
.badge-success{ background:#198754; color:#fff; }

/* Zablokowanie interakcji z „Data wniosku” (bez zmiany value) */
#zam-wniosek-data[readonly]{ pointer-events:none; background:#f8f9fa; }

/* Mobile */
@media (max-width:768px){ .form-2col{ grid-template-columns:1fr; } .w-100-sm{ width:100%; } }

/* 2 kolumny 30/70, hinty */
.form-2col{ display:grid; grid-template-columns:30% 70%; gap:8px 12px; }
.form-2col .label{ font-weight:600; padding-top:8px; }

/* Rozciągnięte pola tekstowe + MAX 50px wysokości */
#zamowienia-step-4-wniosek .form-2col .field textarea.form-control{
	width:100%;
	height:50px !important;
	max-height:50px !important;
	resize:none;
	overflow:auto;
}

/* Oddzielenie wizualne KAŻDEGO wiersza */
#zamowienia-step-4-wniosek .form-2col .label,
#zamowienia-step-4-wniosek .form-2col .field{
	padding-top:8px;
	padding-bottom:8px;
	border-bottom:1px solid #e9ecef;
}

/* Sekcje (separatory) */
.form-sep{
	grid-column:1 / -1;
	font-weight:700;
	margin:8px 0 4px;
	padding-top:6px;
	border-top:2px solid #dee2e6;
}

/* Przyciski, progress, badge – spójnie */
.btn-40{ height:40px; display:inline-flex; align-items:center; justify-content:center; }
.progress{ width:100%; height:8px; background:#f1f3f5; border-radius:4px; overflow:hidden; }
.progress .progress-bar{ height:100%; background:#0d6efd; width:0%; transition:width .2s ease; border-radius:4px; }
.badge{ display:inline-block; padding:.3em .5em; border-radius:.4rem; font-size:.75em; vertical-align:middle; }
.badge-danger{ background:#dc3545; color:#fff; }
.badge-success{ background:#198754; color:#fff; }

/* Zablokowanie interakcji z „Data wniosku” */
#zam-wniosek-data[readonly]{ pointer-events:none; background:#f8f9fa; }

/* Mobile */
@media (max-width:768px){ .form-2col{ grid-template-columns:1fr; } .w-100-sm{ width:100%; } }

/* 2 kolumny 30/70, wyrównanie w pionie */
.form-2col{
	display:grid;
	grid-template-columns:30% 70%;
	gap:8px 12px;
	align-items:center;								/* wyśrodkowanie pionowe całych wierszy */
}
.form-2col .label,
.form-2col .field{
	display:flex;
	align-items:center;								/* wyśrodkowanie zawartości */
	gap:8px;
	padding:8px 0;
	border-bottom:1px solid #e9ecef;	 /* wizualne oddzielenie wierszy */
}
.form-2col .label{ font-weight:600; }

/* Kontrolki: równa wysokość */
.form-2col .form-control,
.form-2col .btn{
	min-height:40px;
}

/* Textarea: pełna szerokość kolumny, max 50px */
#zamowienia-step-4-wniosek .form-2col textarea.form-control{
	width:100%;
	height:50px !important;
	max-height:50px !important;
	resize:none;
	overflow:auto;
}

/* Separatory sekcji */
.form-sep{
	grid-column:1 / -1;
	font-weight:700;
	margin:8px 0 0;
	padding-top:8px;
	border-top:2px solid #dee2e6;
}

/* Tabele – pionowe centrowanie */
#zamowienia-step-4-wniosek table th,
#zamowienia-step-4-wniosek table td{
	vertical-align:middle;
}

/* Badge / progress */
.progress{ width:100%; height:8px; background:#f1f3f5; border-radius:4px; overflow:hidden; }
.progress .progress-bar{ height:100%; background:#0d6efd; width:0%; transition:width .2s ease; border-radius:4px; }
.badge{ display:inline-block; padding:.3em .5em; border-radius:.4rem; font-size:.75em; vertical-align:middle; }
.badge-danger{ background:#dc3545; color:#fff; }
.badge-success{ background:#198754; color:#fff; }

/* Data wniosku nieedytowalna – styl */
#zam-wniosek-data[readonly]{ pointer-events:none; background:#f8f9fa; }

/* Mobile */
@media (max-width:768px){
	.form-2col{ grid-template-columns:1fr; }
	.w-100-sm{ width:100%; }
}

/* ——— Krok 4: układ tabelowy (30/70) ——— */
.form-table{ width:100%; border-collapse:separate; border-spacing:0; }
.form-table th, .form-table td{ padding:8px 12px; vertical-align:middle; border-bottom:1px solid #e9ecef; }
.form-table th{ width:30%; font-weight:600; text-align:left; }
.form-table td{ width:70%; }
.form-table .sep th{ padding-top:10px; border-top:2px solid #dee2e6; border-bottom:none; font-weight:700; }

/* Kontrolki – równa wysokość */
.form-table .form-control,
.form-table .btn{ min-height:40px; }

/* Textarea – pełna szerokość, max 50px */
.form-table textarea.form-control{
	width:100%;
	height:50px !important;
	max-height:50px !important;
	resize:none;
	overflow:auto;
}

/* Nawigacja */
.btn-40{ height:40px; display:inline-flex; align-items:center; justify-content:center; }
.form-nav{ display:flex; justify-content:space-between; gap:8px; margin-top:12px; }

/* Progress/badge (kryteria) – już masz, zostawiamy kompatybilnie */

.wniosek-saved-card{
	border:1px solid #e9ecef;
	border-radius:8px;
	padding:16px;
	background:#f8fff5;
	margin:12px 0 16px;
}
.wniosek-saved-title{ font-weight:700; margin-bottom:6px; }
.wniosek-saved-number{ font-size:1.1rem; }
.wniosek-saved-actions{
	display:flex;
	flex-wrap:wrap;
	gap:8px;
}
.btn-40{ height:40px; display:inline-flex; align-items:center; justify-content:center; }

/* Protokół – tabela „Otrzymano oferty od” */
#prot-oferty-tbody, #prot-oferty-tbody + tfoot, #prot-oferty-tbody ~ tfoot { width: 100%; }
#prot-oferty-tbody .check-col,
table .check-col {
	width: 110px;
	text-align: center;
	white-space: nowrap;
}

/* Tabele w prawej kolumnie form-table mają 100% szerokości */
.form-table td > table.table {
	width: 100%;
	table-layout: fixed; /* pozwala wąskiej kolumnie mieć stałą szerokość */
}

/* Wąskie kolumny akcji/checkboxów */
.form-table td > table.table th.action-col,
.form-table td > table.table td.action-col,
.form-table td > table.table th.check-col,
.form-table td > table.table td.check-col {
	width: 110px;
	text-align: center;
	white-space: nowrap;
}

/* Inputy i textarea pełna szerokość komórki (dla pewności) */
.form-table .form-control {
	width: 100%;
}

/* Tabele w prawej kolumnie wypełniają całą szerokość */
.form-table td > table.table {
	width: 100%;
	table-layout: fixed; /* pozwala trzymać proporcje kolumn */
}

/* Proporcje: 4/5 (tekst) : 1/5 (checkbox/akcja) */
.form-table td > table.table th.text-col,
.form-table td > table.table td.text-col { width: 80%; }
.form-table td > table.table th.check-col,
.form-table td > table.table td.check-col,
.form-table td > table.table th.action-col,
.form-table td > table.table td.action-col { width: 20%; text-align: center; }

/* Zawijanie długich nazw firm/tekstów w komórkach */
.form-table td > table.table th,
.form-table td > table.table td {
	white-space: normal;
	overflow-wrap: anywhere;	 /* nowoczesne przeglądarki */
	word-break: break-word;		/* fallback */
}

/* Upewnijmy się, że pola formularza rozciągają się do szerokości komórki */
.form-table .form-control { width: 100%; }

/* ===== Moje zamówienia – layout jak w Rejestrze Faktur ===== */
#zamowienia-lista { max-width: 1280px; margin: 0 auto; }

/* wrapper na szeroką tabelę (pełna szerokość, przewijka pozioma przy małych oknach) */
.table-wrapper-wide {
	width: 100%;
	overflow-x: auto;
}

/* tabela listy zamówień – spójna z listą faktur */
#zamowienia-results-table, #ewidencja-results-table {
	width: 100%;
	border-collapse: collapse;
	table-layout: auto; /* pozwala kolumnie kontrahenta oddychać */
}

#zamowienia-results-table thead th, #ewidencja-results-table thead th {
	position: sticky; top: 0;
	background: #f8f9fa; /* jak w fakturach */
	z-index: 1;
}

#zamowienia-results-table th,
#zamowienia-results-table td {
	padding: 8px 10px;
	border: 1px solid #dee2e6;
	vertical-align: middle;
}

#zamowienia-results-table tbody tr:nth-child(even) {
	background: #fbfbfb;
}

/* Kontrahent może się łamać wierszami, nie ściskamy tabeli */
#zamowienia-results-table td:nth-child(7) {
	max-width: 420px;
	white-space: normal;
	overflow-wrap: anywhere;
	word-break: break-word;
}

/* Kwota i numer wyrównane do prawej jak w fakturach */
#zamowienia-results-table td:nth-child(3),
#zamowienia-results-table td:nth-child(8) {
	text-align: right;
}

/* ===== Moje zamówienia – wygląd jak Rejestr Faktur ===== */

/* pełna szerokość + przewijka na wąskich ekranach */
#zamowienia-results-table, #ewidencja-results-table {
	width: 100%;
	border-collapse: collapse;
	table-layout: auto;
}

/* zielony pasek nagłówka, jak w fakturach */
/* zaokrąglone rogi działają poprawnie bez “kwadratowej” górnej kreski */
#zamowienia-results-table, #ewidencja-results-table {
	border-collapse: separate; /* ważne przy radiusach */
	border-spacing: 0;
}

#zamowienia-results-table thead tr, #ewidencja-results-table thead tr { overflow: hidden; } /* przycina rogi */

#zamowienia-results-table thead th, #ewidencja-results-table thead th {
	background: #28a745;
	color: #fff;
	font-weight: 600;
	/* bez górnej ramki – ona dawała efekt “kwadratu” */
	border-top: 0;
	/* zostawiamy dół i boki w zieleni */
	border-left: 1px solid #1f8a37;
	border-right: 1px solid #1f8a37;
	border-bottom: 1px solid #1f8a37;
}

#zamowienia-results-table thead th:first-child, #ewidencja-results-table thead th:first-child {
	border-top-left-radius: 6px;
	border-left: 1px solid #1f8a37;
}

#zamowienia-results-table thead th:last-child, #ewidencja-results-table thead th:last-child {
	border-top-right-radius: 6px;
	border-right: 1px solid #1f8a37;
}

#zamowienia-results-table td, 
#zamowienia-results-table th,
#ewidencja-results-table td, 
#ewidencja-results-table th {
	padding: 10px 12px;
	border: 1px solid #dee2e6;
	vertical-align: middle;
}

/* zebra */
#zamowienia-results-table tbody tr:nth-child(even),
#ewidencja-results-table tbody tr:nth-child(even) { background: #fbfbfb; }

/* kolumna Kontrahent może się łamać wierszami */
#zamowienia-results-table td:nth-child(7) {
	max-width: 520px;
	white-space: normal;
	overflow-wrap: anywhere;
	word-break: break-word;
}

/* numer i kwota do prawej */
#zamowienia-results-table td:nth-child(3),
#zamowienia-results-table td:nth-child(8) { text-align: right; }

/* przyciski akcji – małe, jak „pigułki” */
.table-actions {
	display: inline-flex;
	gap: 6px;
	flex-wrap: wrap;
	justify-content: center;
}
.btn.btn-xs {
	height: 28px; line-height: 28px;
	padding: 0 10px;
	font-size: 12px;
	border-radius: 14px;
	border: 1px solid #c9ccd1;
	background: #fff;
}
.btn.btn-xs.btn-primary {
	border-color: #1d7f33;
	background: #28a745;
	color: #fff;
}
.btn.btn-xs.btn-outline {
	background: #fff;
	color: #495057;
}

/* mniejsza czcionka w tabeli */
#zamowienia-results-table, #ewidencja-results-table { font-size: 10pt; }

/* wyrównania po klasach – stabilne przy zmianie liczby kolumn */
#zamowienia-results-table td.col-number,
#zamowienia-results-table td.col-kwota { text-align: right; }

/* kolumna „Kontrahent” – zawijanie i szersza */
#zamowienia-results-table td.col-kontrahent {
	max-width: 520px;
	white-space: normal;
	overflow-wrap: anywhere;
	word-break: break-word;
}
/* ===== Moje zamówienia – layout wiersza 100px ===== */
#zamowienia-results-table tbody tr { height: 100px; }
#zamowienia-results-table tbody td { height: 100px; vertical-align: middle; overflow: hidden; }

/* Komórka kontrahenta – 3 linie: nazwa, adres, NIP */
#zamowienia-results-table td.cell-kontrahent {
	max-width: 520px;
	white-space: normal;
	overflow-wrap: anywhere;
	word-break: break-word;
}
.cell-kontrahent .k-name { font-weight: 700; line-height: 1.2; margin-bottom: 2px; }
.cell-kontrahent .k-addr { font-size: 0.9em; color: #555; line-height: 1.2; }
.cell-kontrahent .k-nip	{ font-size: 0.9em; color: #555; line-height: 1.2; }

/* Akcje: dwa rzędy – góra: szczegóły + druk, dół: dołącz umowę */
.table-actions-stack { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.table-actions-stack .row-top		{ display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.table-actions-stack .row-bottom { display: inline-flex; gap: 6px; justify-content: center; }

/* rozmiar czcionki */
#zamowienia-results-table,
#ewidencja-results-table { font-size: 10pt; }

/* układ thead / zaokrąglenia / border-collapse */
#zamowienia-results-table,
#ewidencja-results-table {
	border-collapse: separate;
	border-spacing: 0;
}
#zamowienia-results-table thead tr,
#ewidencja-results-table thead tr { overflow: hidden; }

/* wysokość wiersza + pionowe wyśrodkowanie */
#zamowienia-results-table tbody tr,
#ewidencja-results-table tbody tr { height: 100px; }
#zamowienia-results-table tbody td,
#ewidencja-results-table tbody td { height: 100px; vertical-align: middle; overflow: hidden; }

/* kolumny kwoty/numerów */
#zamowienia-results-table td.col-number,
#ewidencja-results-table td.col-number,
#zamowienia-results-table td.col-kwota,
#ewidencja-results-table td.col-kwota { text-align: right; }

/* 3-liniowy kontrahent */
#zamowienia-results-table td.cell-kontrahent,
#ewidencja-results-table td.cell-kontrahent {
	max-width: 520px;
	white-space: normal;
	overflow-wrap: anywhere;
	word-break: break-word;
}
.cell-kontrahent .k-name { font-weight: 700; line-height: 1.2; margin-bottom: 2px; }
.cell-kontrahent .k-addr,
.cell-kontrahent .k-nip	{ font-size: 0.9em; color: #555; line-height: 1.2; }

/* stos przycisków w 2 rzędach */
.table-actions-stack { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.table-actions-stack .row-top		{ display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.table-actions-stack .row-bottom { display: inline-flex; gap: 6px; justify-content: center; }

/* rozmiar czcionki tabeli */
#zamowienia-results-table,
#ewidencja-results-table { font-size: 10pt; }

/* border/zaokrąglenia nagłówka */
#zamowienia-results-table,
#ewidencja-results-table {
	border-collapse: separate;
	border-spacing: 0;
}
#zamowienia-results-table thead tr,
#ewidencja-results-table thead tr { overflow: hidden; }

/* wysokość wiersza + pionowe wyśrodkowanie */
#zamowienia-results-table tbody tr,
#ewidencja-results-table tbody tr { height: 100px; }
#zamowienia-results-table tbody td,
#ewidencja-results-table tbody td { height: 100px; vertical-align: middle; overflow: hidden; }

/* kolumny liczbowe */
#zamowienia-results-table td.col-number,
#ewidencja-results-table td.col-number,
#zamowienia-results-table td.col-kwota,
#ewidencja-results-table td.col-kwota { text-align: right; }

/* 3-liniowy kontrahent */
#zamowienia-results-table td.cell-kontrahent,
#ewidencja-results-table td.cell-kontrahent {
	max-width: 520px;
	white-space: normal;
	overflow-wrap: anywhere;
	word-break: break-word;
}
.cell-kontrahent .k-name { font-weight: 700; line-height: 1.2; margin-bottom: 2px; }
.cell-kontrahent .k-addr,
.cell-kontrahent .k-nip	{ font-size: 0.9em; color: #555; line-height: 1.2; }

/* stos przycisków akcji */
.table-actions-stack { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.table-actions-stack .row-top		{ display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.table-actions-stack .row-bottom { display: inline-flex; gap: 6px; justify-content: center; }
