/* ProstyPrzetarg.pl - Main Styles */

/* === CSS Variables === */
:root {
    /* Colors - jasny motyw z akcentami */
    --color-primary: #1e40af;
    --color-primary-dark: #1e3a8a;
    --color-primary-light: #3b82f6;
    --color-secondary: #64748b;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    
    /* Neutrals - ROZSZERZONE dla lepszego kontrastu */
    --color-bg: #ffffff;
    --color-bg-secondary: #f8fafc;
    --color-bg-tertiary: #f1f5f9;
    --color-bg-quaternary: #e2e8f0; /* Nowy - jeszcze ciemniejszy */
    --color-bg-accent: #eff6ff; /* Nowy - niebieski akcent */
    --color-bg-success: #f0fdf4; /* Nowy - zielony akcent */
    --color-border: #e2e8f0;
    --color-border-dark: #cbd5e1; /* Nowy - ciemniejszy border */
    --color-text: #1e293b;
    --color-text-secondary: #64748b;
    --color-text-light: #94a3b8;
    
    /* Shadows - MOCNIEJSZE dla lepszej separacji */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 12px 20px -3px rgba(0, 0, 0, 0.18);
    --shadow-xl: 0 24px 32px -5px rgba(0, 0, 0, 0.2);
    --shadow-colored: 0 4px 12px rgba(30, 64, 175, 0.15); /* Nowy - kolorowy cień */
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
    
    /* Layout */
    --sidebar-width: 240px;
    --topnav-height: 100px;
    --mobile-nav-height: 64px;
}

/* === 🌙 DARK MODE === */
body.dark-theme {
    /* Colors - ciemny motyw */
    --color-primary: #60a5fa;
    --color-primary-dark: #3b82f6;
    --color-primary-light: #93c5fd;
    --color-secondary: #94a3b8;
    --color-success: #34d399;
    --color-warning: #fbbf24;
    --color-danger: #f87171;
    
    /* Neutrals - CIEMNE */
    --color-bg: #0f172a;
    --color-bg-secondary: #1e293b;
    --color-bg-tertiary: #334155;
    --color-bg-quaternary: #475569;
    --color-bg-accent: #1e3a8a;
    --color-bg-success: #064e3b;
    --color-border: #334155;
    --color-border-dark: #475569;
    --color-text: #f1f5f9;
    --color-text-secondary: #cbd5e1;
    --color-text-light: #94a3b8;
    
    /* Shadows - MOCNIEJSZE dla ciemnego tła */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 12px 20px -3px rgba(0, 0, 0, 0.7);
    --shadow-xl: 0 24px 32px -5px rgba(0, 0, 0, 0.8);
    --shadow-colored: 0 4px 12px rgba(96, 165, 250, 0.3);
}

/* 🌙 Dark mode - WSZYSTKIE NAGŁÓWKI BIAŁE! */
body.dark-theme h1,
body.dark-theme h2,
body.dark-theme h3,
body.dark-theme h4,
body.dark-theme h5 {
    color: #ffffff !important;
}

/* 🌙 Dark mode - WSZYSTKIE TEKSTY JASNE! */
body.dark-theme p,
body.dark-theme span,
body.dark-theme div {
    color: inherit; /* Dziedziczy z parent (będzie #f1f5f9 z --color-text) */
}

/* 🌙 Dark mode - dodatkowe style dla gradientów */
body.dark-theme .sidebar {
    background: linear-gradient(180deg, #1e293b 0%, #1e3a8a 100%);
}

body.dark-theme .stats-sidebar {
    background: linear-gradient(180deg, #064e3b 0%, #1e293b 100%);
}

body.dark-theme .top-nav {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
}

body.dark-theme .search-section {
    background: linear-gradient(135deg, #1e293b 0%, #1e3a8a 100%);
}

/* 🌙 Dark mode - Tender Cards */
body.dark-theme .tender-card {
    background: #1e293b;
    border-color: #475569;
}

body.dark-theme .tender-card:hover {
    background: #334155;
    border-color: #60a5fa;
}

/* 🌙 Dark mode - Badges & Labels */
body.dark-theme .tender-source,
body.dark-theme .cpv-code-badge,
body.dark-theme .badge-cpv {
    background: #334155;
    color: #cbd5e1;
}

body.dark-theme .deadline-badge {
    background: #334155;
    color: #cbd5e1;
}

body.dark-theme .deadline-badge.urgent {
    background: #7f1d1d;
    color: #fecaca;
}

body.dark-theme .deadline-badge.warning {
    background: #78350f;
    color: #fed7aa;
}

body.dark-theme .deadline-badge.safe {
    background: #064e3b;
    color: #a7f3d0;
}
/* 🌙 Dark mode - Filter Sections */
body.dark-theme .filter-section {
    background: #1e293b;
    border-color: #475569;
}

body.dark-theme .filter-header {
    background: #334155;
    border-color: #475569;
}

body.dark-theme .filter-header:hover {
    background: #475569;
}

body.dark-theme .filter-body {
    background: #1e293b;
}

/* 🌙 Dark mode - Inputs */
body.dark-theme .search-input,
body.dark-theme input[type="text"],
body.dark-theme input[type="number"],
body.dark-theme select,
body.dark-theme textarea {
    background: #334155;
    border-color: #475569;
    color: #f1f5f9;
}

body.dark-theme .search-input:focus,
body.dark-theme input:focus,
body.dark-theme select:focus,
body.dark-theme textarea:focus {
    background: #475569;
    border-color: #60a5fa;
}

/* 🌙 Dark mode - Buttons */
body.dark-theme .btn-secondary {
    background: #334155;
    border-color: #475569;
    color: #f1f5f9;
}

body.dark-theme .btn-secondary:hover {
    background: #475569;
}

/* 🌙 Dark mode - Results Section */
body.dark-theme .results-section {
    background: #1e293b;
    border-color: #475569;
}

/* 🌙 Dark mode - Results Header TEXT - BIAŁY! */
body.dark-theme .results-header h2,
body.dark-theme .results-header h3,
body.dark-theme .results-header {
    color: #ffffff !important;
}

body.dark-theme .results-section h2,
body.dark-theme .results-section h3,
body.dark-theme .results-section h4 {
    color: #ffffff !important;
}

/* 🌙 Dark mode - Stats Cards */
body.dark-theme .stats-card {
    background: #1e293b;
    border-color: #475569;
}

body.dark-theme .stats-card:hover {
    background: #334155;
    border-color: #60a5fa;
}

/* 🌙 Dark mode - Popular Searches Tags */
body.dark-theme .popular-tag {
    background: #334155;
    color: #cbd5e1;
}

body.dark-theme .popular-tag:hover {
    background: #475569;
}

/* 🌙 Dark mode - RADIUS SEARCH PANEL */
body.dark-theme .radius-search-panel {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%) !important;
    border: 2px solid #475569 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6) !important;
}

body.dark-theme .radius-search-content h3 {
    color: #ffffff !important;
}

body.dark-theme .radius-search-description {
    color: #cbd5e1 !important;
}

body.dark-theme .radius-input-group label,
body.dark-theme .radius-slider-group label {
    color: #ffffff !important;
    font-weight: 600 !important;
}

body.dark-theme .radius-input-group input[type="text"] {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #ffffff !important;
}

body.dark-theme .radius-input-group input[type="text"]::placeholder {
    color: #94a3b8 !important;
}

body.dark-theme .radius-input-group input[type="text"]:focus {
    background: #475569 !important;
    border-color: #60a5fa !important;
}

body.dark-theme .radius-slider {
    background: linear-gradient(to right, #60a5fa, #34d399) !important;
}

body.dark-theme .radius-slider::-webkit-slider-thumb {
    background: #60a5fa !important;
    box-shadow: 0 2px 8px rgba(96, 165, 250, 0.5) !important;
}

body.dark-theme .radius-slider::-moz-range-thumb {
    background: #60a5fa !important;
    box-shadow: 0 2px 8px rgba(96, 165, 250, 0.5) !important;
}

body.dark-theme .radius-slider-labels {
    color: #cbd5e1 !important;
}

body.dark-theme .radius-search-hint {
    background: rgba(96, 165, 250, 0.1) !important;
    border-color: #1e3a8a !important;
    color: #93c5fd !important;
}

body.dark-theme .radius-search-hint i {
    color: #60a5fa !important;
}

/* 🌙 Dark mode - Radius Value Display */
body.dark-theme .radius-slider-group span,
body.dark-theme .radius-value {
    color: #60a5fa !important;
    font-weight: 700 !important;
}

/* 🌙 Dark mode - Radius Search Button */
body.dark-theme .radius-search-panel .btn-primary {
    background: linear-gradient(135deg, #60a5fa 0%, #34d399 100%) !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.4) !important;
}

body.dark-theme .radius-search-panel .btn-primary:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #10b981 100%) !important;
    box-shadow: 0 6px 16px rgba(96, 165, 250, 0.6) !important;
}

/* 🌙 Dark mode - View Switcher */
body.dark-theme .view-switcher {
    background: #334155;
}

body.dark-theme .view-btn.active {
    background: #475569;
    color: #f1f5f9;
}

/* 🌙 Dark mode - Dropdown */
body.dark-theme .dropdown {
    background: #1e293b;
    border-color: #475569;
}

body.dark-theme .dropdown a:hover {
    background: #334155;
}

/* 🌙 Dark mode - Nav Items */
body.dark-theme .nav-item:hover {
    background: #334155;
}

body.dark-theme .nav-item.active {
    background: #1e40af;
}

/* 🌙 Dark mode - Table */
body.dark-theme .tenders-table {
    background: #1e293b;
}

body.dark-theme .tenders-table th {
    background: #334155;
    border-color: #475569;
}

body.dark-theme .tenders-table td {
    background: #1e293b;
    border-color: #475569;
}

body.dark-theme .tenders-table tbody tr:hover {
    background: #334155;
}

/* 🌙 Dark mode - Modals */
body.dark-theme .modal-content {
    background: #1e293b;
    border-color: #475569;
}

body.dark-theme .modal-header {
    background: #334155;
    border-color: #475569;
}

/* 🌙 Dark mode - Scrollbars */
body.dark-theme ::-webkit-scrollbar-track {
    background: #1e293b;
}

body.dark-theme ::-webkit-scrollbar-thumb {
    background: #475569;
}

body.dark-theme ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* 🌙 Dark mode - Table Deadline Badges - BIAŁY TEKST! */
body.dark-theme .table-deadline-badge.green {
    background: #064e3b;
    color: #ffffff;  /* BIAŁY zamiast #a7f3d0 */
    font-weight: 700;
}

body.dark-theme .table-deadline-badge.yellow {
    background: #78350f;
    color: #ffffff;  /* BIAŁY zamiast #fed7aa */
    font-weight: 700;
}

body.dark-theme .table-deadline-badge.orange {
    background: #9a3412;
    color: #ffffff;  /* BIAŁY zamiast #fed7aa */
    font-weight: 700;
}

body.dark-theme .table-deadline-badge.red {
    background: #7f1d1d;
    color: #ffffff;  /* BIAŁY zamiast #fecaca */
    font-weight: 700;
}

body.dark-theme .table-deadline-badge.gray {
    background: #475569;
    color: #ffffff;  /* BIAŁY zamiast #cbd5e1 */
    font-weight: 700;
}

/* 🌙 Dark mode - Table CPV Code */
body.dark-theme .table-cpv-code {
    background: #4c1d95;
    color: #e9d5ff;
}

/* 🌙 Dark mode - Table BZP Number */
body.dark-theme .table-bzp-number {
    color: #e2e8f0;
}

/* 🌙 Dark mode - Table Tender Title */
body.dark-theme .table-tender-title {
    color: #f1f5f9;
}

/* 🌙 Dark mode - Table Contracting Authority */
body.dark-theme .table-contracting-authority {
    color: #f1f5f9;
}

/* 🌙 Dark mode - Table Deadline Date */
body.dark-theme .table-deadline-date {
    color: #cbd5e1;
}

/* 🌙 Dark mode - Table Calendar Buttons */
body.dark-theme .table-calendar-btn {
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    color: #e9d5ff;
}

body.dark-theme .table-calendar-btn:hover {
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.5);
}

body.dark-theme .table-calendar-added {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%) !important;
    color: #064e3b;
}

body.dark-theme .table-calendar-added:hover {
    box-shadow: 0 4px 12px rgba(52, 211, 153, 0.5);
}

body.dark-theme .table-calendar-loading {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    color: #dbeafe;
}

body.dark-theme .table-calendar-success {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    color: #064e3b;
}

body.dark-theme .table-calendar-error {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    color: #fef2f2;
}

/* 🌙 Dark mode - CPV Codes */
body.dark-theme .cpv-code,
body.dark-theme .cpv-badge {
    background: #1e3a8a;
    color: #93c5fd;
}

/* 🌙 Dark mode - Tender Metadata */
body.dark-theme .tender-meta,
body.dark-theme .tender-info {
    color: #cbd5e1;
}

/* 🌙 Dark mode - Icons */
body.dark-theme .fa,
body.dark-theme .fas,
body.dark-theme .far {
    color: #cbd5e1;
}

body.dark-theme .tender-title {
    color: #f1f5f9;
}

/* 🌙 POPRAWKI DARK MODE - Wszystkie elementy kart */

/* 1. Deadline Badge "2 DNI" - BIAŁY TEKST DLA KONTRASTU! */
body.dark-theme .deadline-badge,
body.dark-theme .tender-deadline,
body.dark-theme .deadline-label {
    background: #7f1d1d !important;
    color: #ffffff !important;  /* BIAŁY zamiast #fecaca */
    border-color: #991b1b !important;
    font-weight: 700 !important;  /* Pogrubienie */
}

body.dark-theme .deadline-badge.urgent,
body.dark-theme .deadline-urgent {
    background: #7f1d1d !important;
    color: #ffffff !important;  /* BIAŁY zamiast #fecaca */
    border-color: #991b1b !important;
    font-weight: 700 !important;
}

body.dark-theme .deadline-badge.warning,
body.dark-theme .deadline-warning {
    background: #78350f !important;
    color: #ffffff !important;  /* BIAŁY zamiast #fed7aa */
    border-color: #92400e !important;
    font-weight: 700 !important;
}

body.dark-theme .deadline-badge.safe,
body.dark-theme .deadline-safe {
    background: #064e3b !important;
    color: #ffffff !important;  /* BIAŁY zamiast #a7f3d0 */
    border-color: #065f46 !important;
    font-weight: 700 !important;
}

/* 2. Ikony w header - JAŚNIEJSZE */
body.dark-theme .tender-header-icons i,
body.dark-theme .tender-actions i,
body.dark-theme .tender-card-actions i {
    color: #cbd5e1 !important;
}

body.dark-theme .tender-header-icons button:hover i,
body.dark-theme .tender-actions button:hover i {
    color: #f1f5f9 !important;
}

/* 3. Metadata labels - BARDZO JASNE DLA KONTRASTU! */
body.dark-theme .tender-meta-item,
body.dark-theme .tender-info-item,
body.dark-theme .tender-detail-item {
    color: #f1f5f9 !important;  /* Bardziej jasny niż #cbd5e1 */
}

body.dark-theme .tender-meta-item strong,
body.dark-theme .tender-meta-label {
    color: #ffffff !important;  /* BIAŁY zamiast #e2e8f0 */
    font-weight: 600 !important;
}

body.dark-theme .tender-meta-item i {
    color: #cbd5e1 !important;  /* Ikony jaśniejsze */
}

/* 3a. Wartości metadata (ID, daty, miasta) - BARDZO JASNE */
body.dark-theme .tender-meta-value,
body.dark-theme .meta-value {
    color: #f1f5f9 !important;
}

/* 4. Nazwa zamawiającego - BARDZO JASNA */
body.dark-theme .tender-authority,
body.dark-theme .tender-contracting-authority,
body.dark-theme .tender-organization {
    color: #ffffff !important;  /* BIAŁY zamiast #e2e8f0 */
    font-weight: 500 !important;
}

/* 5. Kategoria/CPV Tag - BIAŁY TEKST DLA KONTRASTU! */
body.dark-theme .tender-category,
body.dark-theme .badge-category,
body.dark-theme .category-badge {
    background: #334155 !important;
    color: #ffffff !important;  /* BIAŁY zamiast #cbd5e1 */
    font-weight: 600 !important;
}

/* 6. Separator - WIDOCZNY */
body.dark-theme .tender-footer {
    border-top-color: #475569 !important;
}

body.dark-theme .tender-divider,
body.dark-theme hr {
    border-color: #475569 !important;
}

/* 7. CPV Box - BIAŁY TEKST DLA KONTRASTU! */
body.dark-theme .cpv-list,
body.dark-theme .cpv-codes,
body.dark-theme .tender-cpv {
    color: #ffffff !important;  /* BIAŁY zamiast #93c5fd */
    font-weight: 500 !important;
}

body.dark-theme .cpv-item,
body.dark-theme .cpv-code {
    color: #ffffff !important;  /* BIAŁY zamiast #93c5fd */
    font-weight: 500 !important;
}

/* 8. Meta background - CIEMNIEJSZE */
body.dark-theme .tender-meta {
    background: #334155 !important;
}

/* 9. Description - BARDZO JASNA DLA KONTRASTU! */
body.dark-theme .tender-description {
    color: #f1f5f9 !important;  /* Bardziej jasny niż #cbd5e1 */
}

/* 10. Source badge - BIAŁY TEKST */
body.dark-theme .tender-source {
    background: #475569 !important;
    color: #ffffff !important;  /* BIAŁY zamiast #cbd5e1 */
    font-weight: 600 !important;
}

/* 11. Przyciski header w kartach - WIDOCZNE */
body.dark-theme .tender-card-header {
    background: linear-gradient(135deg, #1e293b 0%, #2d3748 50%, #334155 100%) !important;
    padding: 12px 16px !important;
    margin: -20px -20px 12px -20px !important; /* Rozciąga do krawędzi */
    border-radius: 12px 12px 0 0 !important; /* Zaokrąglenie tylko góra */
}

body.dark-theme .tender-card .btn-icon,
body.dark-theme .tender-card-header button {
    background: rgba(51, 65, 85, 0.5) !important;
    color: #cbd5e1 !important;
    border: 1px solid #475569 !important;
}

body.dark-theme .tender-card .btn-icon:hover,
body.dark-theme .tender-card-header button:hover {
    background: #475569 !important;
    color: #f1f5f9 !important;
    border-color: #60a5fa !important;
}

body.dark-theme .tender-card .btn-icon i,
body.dark-theme .tender-card-header button i {
    color: #cbd5e1 !important;
}

/* 12. Gwiazdka - ZŁOTA gdy watched */
body.dark-theme .tender-card .fa-star.watched,
body.dark-theme .fa-star.active {
    color: #fbbf24 !important;
}

/* 13. Wszystkie ikony w kartach - JAŚNIEJSZE */
body.dark-theme .tender-card i {
    color: #cbd5e1 !important;
}

body.dark-theme .tender-card .fa-calendar,
body.dark-theme .tender-card .fa-star,
body.dark-theme .tender-card .fa-times {
    font-size: 1rem !important;
}

/* 14. Hover na ikonach - JESZCZE JAŚNIEJSZE */
body.dark-theme .tender-card button:hover i {
    color: #f1f5f9 !important;
}

/* 15. Link buttons - LEPSZY KONTRAST */
body.dark-theme .btn-link {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #cbd5e1 !important;
}

body.dark-theme .btn-link:hover {
    background: #475569 !important;
    border-color: #60a5fa !important;
    color: #93c5fd !important;
}

/* 🌙 Dark mode - Card Action Buttons */
body.dark-theme .tender-card .btn-calendar {
    border-color: #34d399;
    color: #34d399;
}

body.dark-theme .tender-card .btn-calendar:hover {
    background: #34d399;
    color: #064e3b;
}

body.dark-theme .tender-card .btn-calendar.in-calendar {
    background: #34d399;
    color: #064e3b;
}

body.dark-theme .btn-source {
    border-color: #a78bfa;
    color: #a78bfa;
}

body.dark-theme .btn-source:hover {
    background: #a78bfa;
    color: #1e293b;
}

body.dark-theme .btn-share {
    border-color: #22d3ee;
    color: #22d3ee;
}

body.dark-theme .btn-share:hover {
    background: #22d3ee;
    color: #1e293b;
}

body.dark-theme .btn-hide-header {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

body.dark-theme .btn-hide-header:hover {
    background: #7f1d1d;
    color: #fecaca;
}

/* 🌙 Dark mode - Watch/Star Icons */
body.dark-theme .fa-star {
    color: #cbd5e1 !important;  /* 🔥 JASNY SZARY! */
}

body.dark-theme .fa-star.watched,
body.dark-theme .fa-star.active {
    color: #fbbf24 !important;  /* 🔥 ŻÓŁTY! */
}

/* 🌙 Dark mode - Tender Distance Bar */
body.dark-theme .tender-distance {
    background: #334155;
    border-color: #475569;
    color: #cbd5e1;
}

/* 🌙 Dark mode - Notice Type Filters */
body.dark-theme .notice-type-btn {
    background: #334155;
    border-color: #475569;
    color: #cbd5e1;
}

body.dark-theme .notice-type-btn:hover {
    background: #60a5fa;
    color: #0f172a;
    border-color: #60a5fa;
}

body.dark-theme .notice-type-btn.active {
    background: #60a5fa;
    color: #0f172a;
    border-color: #60a5fa;
}

body.dark-theme .notice-type-filters-container {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

/* 🌙 Dark mode - Search Tags */
body.dark-theme .search-tag {
    background: #334155;
    color: #cbd5e1;
}

body.dark-theme .search-tag:hover {
    background: #475569;
    color: #f1f5f9;
}

/* 🌙 Dark mode - Pagination */
body.dark-theme .pagination {
    background: #1e293b;
}

body.dark-theme .pagination button {
    background: #334155;
    border-color: #475569;
    color: #cbd5e1;
}

body.dark-theme .pagination button:hover:not(:disabled) {
    background: #475569;
}

body.dark-theme .pagination button.active {
    background: #60a5fa;
    color: #0f172a;
}

/* 🌙 Dark mode - Sort Select */
body.dark-theme .sort-select {
    background: #334155;
    border-color: #475569;
    color: #cbd5e1;
}

body.dark-theme .sort-select:hover {
    background: #475569;
}

body.dark-theme .sort-select:focus {
    border-color: #60a5fa;
}

/* 🌙 Dark mode - Checkboxes & Radio */
body.dark-theme input[type="checkbox"],
body.dark-theme input[type="radio"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #475569;
    background: #334155;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
}

body.dark-theme input[type="checkbox"]:checked,
body.dark-theme input[type="radio"]:checked {
    background: #3b82f6;
    border-color: #3b82f6;
}

body.dark-theme input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* 🌙 Dark mode - Labels */
body.dark-theme label {
    color: #cbd5e1;
}

/* 🌙 Dark mode - Hints & Help Text */
body.dark-theme .hint,
body.dark-theme .help-text,
body.dark-theme .description {
    color: #94a3b8;
}

/* 🌙 Dark mode - Alerts */
body.dark-theme .alert {
    background: #334155;
    border-color: #475569;
    color: #cbd5e1;
}

body.dark-theme .alert.alert-info {
    background: #1e3a8a;
    border-color: #1e40af;
    color: #93c5fd;
}

body.dark-theme .alert.alert-success {
    background: #064e3b;
    border-color: #065f46;
    color: #a7f3d0;
}

body.dark-theme .alert.alert-warning {
    background: #78350f;
    border-color: #92400e;
    color: #fed7aa;
}

body.dark-theme .alert.alert-danger {
    background: #7f1d1d;
    border-color: #991b1b;
    color: #fecaca;
}

/* 🌙 Dark mode - CPV Accordion */
body.dark-theme .cpv-accordion {
    background: #1e293b;
    border-color: #475569;
}

body.dark-theme .cpv-accordion-item {
    border-color: #334155;
}

body.dark-theme .cpv-category-header {
    background: #334155;
}

body.dark-theme .cpv-category-header:hover {
    background: #475569;
}

body.dark-theme .cpv-category-header.expanded {
    background: #1e3a8a;
    border-color: #1e40af;
}

body.dark-theme .cpv-subcategories {
    background: #1e293b;
    border-color: #334155;
}

body.dark-theme .cpv-checkbox-label.subcategory:hover {
    background: #334155;
}

body.dark-theme .cpv-code-badge {
    background: #1e3a8a;
    color: #93c5fd;
}

body.dark-theme .cpv-checkbox-label.subcategory .cpv-code-badge {
    background: #78350f;
    color: #fed7aa;
}

body.dark-theme .cpv-name {
    color: #cbd5e1;
}

/* 🌙 Dark mode - Loading & Messages */
body.dark-theme .loading-msg,
body.dark-theme .no-results-msg {
    color: #94a3b8;
}

body.dark-theme .loading-spinner {
    border-color: #475569;
    border-top-color: #60a5fa;
}

/* 🌙 Dark mode - Tooltips */
body.dark-theme .tooltip {
    background: #0f172a;
    color: #f1f5f9;
    border: 1px solid #475569;
}

/* 🌙 Dark mode - Breadcrumbs */
body.dark-theme .breadcrumb {
    background: #1e293b;
}

body.dark-theme .breadcrumb a {
    color: #60a5fa;
}

body.dark-theme .breadcrumb a:hover {
    color: #93c5fd;
}

/* 🌙 Dark mode - Footer */
body.dark-theme .sidebar-footer {
    background: #1e293b;
    border-color: #475569;
}

body.dark-theme .legal-link {
    color: #94a3b8;
}

body.dark-theme .legal-link:hover {
    color: #60a5fa;
}

/* Dark mode - Active filters bar */
body.dark-theme .active-filters {
    background: #334155;
    border: 1px solid #475569;
}

body.dark-theme .active-filters-label {
    color: #60a5fa;
}

body.dark-theme .filter-tag {
    background: #3b82f6;
    color: white;
}

body.dark-theme .filter-tag:hover {
    background: #2563eb;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* === Typography === */
h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
}

h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--spacing-lg);
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
}

h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
}

p {
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-md);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-dark);
}

/* === Top Navigation === */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topnav-height);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 2px solid var(--color-border);
    z-index: 1000;
    box-shadow: var(--shadow-md); /* Mocniejszy cień */
}

.nav-container {
    height: 100%;
    padding: var(--spacing-sm) var(--spacing-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.logo-img {
    width: 88px;
    height: 88px;
    padding: 4px 0;
}

.logo-text h1 {
    font-size: 1.75rem;
    font-weight: 600;
}

.logo-part-prosty {
    color: #1a1a2e;
}

.logo-part-przetarg {
    color: #1a1a2e;
}

.logo-part-pl {
    color: #1a1a2e;
}

/* Dark mode - logo białe */
body.dark-theme .logo-part-prosty,
body.dark-theme .logo-part-przetarg,
body.dark-theme .logo-part-pl {
    color: #f1f5f9;
}

.subtitle {
    font-size: 0.875rem;
    color: var(--color-text-light);
    font-weight: 400;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.btn-icon {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

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

/* === 🌙 Theme Toggle Button === */
#theme-toggle {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    font-size: 1.25rem;
}

#theme-toggle:hover {
    background: var(--color-bg-tertiary);
    color: var(--color-warning);
    transform: rotate(180deg);
}

#theme-toggle .fa-sun {
    display: none;
}

#theme-toggle .fa-moon {
    display: block;
}

body.dark-theme #theme-toggle .fa-sun {
    display: block;
    color: var(--color-warning);
}

body.dark-theme #theme-toggle .fa-moon {
    display: none;
}

.badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--color-danger);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.user-menu {
    position: relative;
}

.btn-user {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg);
    color: var(--color-text);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-user:hover {
    background: var(--color-bg-tertiary);
    border-color: var(--color-primary-light);
}

.btn-user i:first-child {
    font-size: 1.5rem;
    color: var(--color-text-secondary);
}

.dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    padding: var(--spacing-sm);
}

.dropdown.active {
    display: flex;
}

.dropdown a {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    transition: background var(--transition-fast);
}

.dropdown a:hover {
    background: var(--color-bg-tertiary);
}

.dropdown hr {
    margin: var(--spacing-sm) 0;
    border: none;
    border-top: 1px solid var(--color-border);
}

/* === Main Layout === */
.main-layout {
    display: flex;
    margin-top: var(--topnav-height);
    min-height: calc(100vh - var(--topnav-height));
}

/* === Sidebar === */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #f8fafc 0%, #eff6ff 100%); /* Gradient niebieski */
    border-right: 2px solid var(--color-border-dark);
    padding: var(--spacing-xl) 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: var(--topnav-height);
    bottom: 0;
    overflow-y: auto;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.05); /* Dodany cień */
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    padding: 0 var(--spacing-md);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.nav-item:hover {
    background: var(--color-bg-tertiary);
    color: var(--color-text);
}

.nav-item.active {
    background: var(--color-primary);
    color: white;
}

.nav-item i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: var(--spacing-md);
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.legal-link {
    font-size: 0.875rem;
    color: var(--color-text-light);
    padding: var(--spacing-xs);
}

.legal-link:hover {
    color: var(--color-primary);
}

/* === Content Area === */
.content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: var(--spacing-2xl);
}

/* === Stats Sidebar === */
.stats-sidebar {
    width: 280px;
    padding: var(--spacing-2xl) var(--spacing-lg);
    background: linear-gradient(180deg, #f0fdf4 0%, #f8fafc 100%); /* Gradient zielony */
    border-left: 2px solid var(--color-border-dark);
    position: sticky;
    top: calc(var(--topnav-height) + 20px);
    height: calc(100vh - var(--topnav-height) - 40px);
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.05); /* Dodany cień */
}

.stats-sidebar::-webkit-scrollbar {
    width: 6px;
}

.stats-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.stats-sidebar::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}

.stats-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-secondary);
}

.stats-card {
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-md); /* Mocniejszy cień */
    border: 2px solid var(--color-border);
    transition: all var(--transition-base);
}

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

.stats-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 var(--spacing-md) 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
}

.stat-item {
    text-align: center;
    padding: var(--spacing-sm);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 4px;
}

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

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stats-loading {
    text-align: center;
    padding: var(--spacing-lg);
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.stats-loading i {
    margin-right: 8px;
}

.stats-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    transition: all var(--transition-fast);
    cursor: pointer;
    gap: 8px;
}

.stats-item:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    transform: translateX(4px);
}

.stats-item-label {
    font-size: 0.75rem;
    color: var(--color-text);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.stats-item:hover .stats-item-label {
    color: white;
}

.stats-item-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.stats-item:hover .stats-item-value {
    color: white;
}

.stats-expand-btn {
    width: 100%;
    margin-top: var(--spacing-sm);
    padding: 8px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

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

.stats-expand-btn i {
    transition: transform var(--transition-fast);
}

.stats-expand-btn.expanded i {
    transform: rotate(180deg);
}

/* === Search Section === */
.search-section {
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%); /* Gradient */
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-lg); /* Mocniejszy cień */
    border: 2px solid var(--color-border);
}

.search-form {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

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

.search-icon {
    position: absolute;
    left: var(--spacing-md);
    color: var(--color-text-light);
    font-size: 1.125rem;
}

.search-input {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-xl) var(--spacing-md) 3rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.btn-clear {
    position: absolute;
    right: var(--spacing-md);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--color-text-light);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-clear:hover {
    background: var(--color-bg-tertiary);
    color: var(--color-text);
}

.search-input:not(:placeholder-shown) + .btn-clear {
    display: flex;
}

/* === Buttons === */
.btn-primary,
.btn-secondary {
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--radius-lg);
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: var(--color-primary-dark);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

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

.btn-secondary:hover {
    background: var(--color-border);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-sm {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.875rem;
}

/* === Popular Searches === */
.popular-searches {
    margin: var(--spacing-lg) 0;
}

.popular-searches h4 {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
}

.search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.search-tag {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.9rem;
    color: var(--color-text);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.search-tag:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Notice Type Buttons */
.notice-type-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.9rem;
    color: var(--color-text);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.notice-type-btn:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.notice-type-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    font-weight: 600;
}

/* SVG Icon Styles */
.notice-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    transition: all 0.3s;
}

.notice-type-btn:hover .notice-icon {
    transform: scale(1.1);
}

.notice-type-btn.active .notice-icon {
    animation: iconPulse 2s ease-in-out infinite;
}

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

/* ✅ NOWE: Notice Type Filters Container (nad wynikami) */
.notice-type-filters-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #dee2e6;
}

.notice-type-filters-container .popular-searches {
    margin: 0;
}

.notice-type-filters-container h4 {
    font-size: 0.95rem;
    color: #495057;
    margin-bottom: 12px;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .notice-type-filters-container {
        padding: 15px;
        margin: 15px 0 !important;
    }
    
    .notice-type-filters-container .search-tags {
        gap: 8px;
    }
    
    .notice-type-filters-container .notice-type-btn {
        font-size: 0.85rem;
        padding: 8px 12px;
    }
}

/* === Filters Panel === */
.filters-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    margin-top: var(--spacing-md);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
}

.filter-group input,
.filter-group select {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}

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

/* === Results Section === */
.results-section {
    background: var(--color-bg);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-lg); /* Mocniejszy cień */
    border: 2px solid var(--color-border); /* Dodany border */
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
}

.results-actions {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.results-actions .btn-sm {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    min-width: auto;
}

/* View Switcher */
.view-switcher {
    display: flex;
    gap: 4px;
    background: var(--color-bg-tertiary);
    padding: 4px;
    border-radius: var(--radius-md);
}

.view-btn {
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 16px;
}

.view-btn:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

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

.view-btn i {
    display: block;
}

/* === Sort Dropdown === */
.sort-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 15px;
}

.sort-dropdown label {
    color: var(--color-text-secondary);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.sort-dropdown label i {
    color: var(--color-primary);
}

.sort-select {
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.sort-select:hover {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.sort-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .sort-dropdown {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }
    
    .sort-dropdown label {
        display: none;
    }
    
    .sort-select {
        width: 100%;
    }
}

/* === Tenders Grid === */
.tenders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--spacing-lg);
}

.tender-card {
    background: var(--color-bg);
    border: 2px solid var(--color-border); /* Grubszy border */
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all var(--transition-base);
    cursor: pointer;
    position: relative;
    padding-bottom: 55px; /* Rezerwujemy miejsce na pasek odległości */
    min-height: 340px; /* Minimalna wysokość karty */
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md); /* Dodany podstawowy cień */
}

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

.tender-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: var(--spacing-md);
}

.tender-source {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    background: var(--color-bg-tertiary);
    color: var(--color-text-secondary);
}

.tender-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--spacing-sm);
    line-height: 1.4;
}

.tender-description {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-sm);
    line-height: 1.5;
    font-style: italic;
}

.tender-authority {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-md);
}

.tender-meta {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
}

.tender-meta-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.tender-meta-item i {
    color: var(--color-primary);
    width: 16px;
}

.tender-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-sm);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-border);
    margin-top: var(--spacing-md);
}

.btn-link {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    text-align: center;
}

.btn-link:hover {
    background: var(--color-bg-tertiary);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* === Tender Card Header === */
.tender-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

/* === Tender Card Body === */
.tender-card-body {
    flex: 1; /* Wypełnia dostępną przestrzeń */
    padding-bottom: 10px;
}

/* === Pasek odległości ZAWSZE na dole === */
.tender-distance {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 !important;
    background: linear-gradient(135deg, #3498db 0%, #2ecc71 100%);
    color: white;
    padding: 10px 15px;
    border-radius: 0 0 12px 12px; /* Zaokrąglenie tylko na dole */
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 -2px 8px rgba(52, 152, 219, 0.2);
    z-index: 1;
}

.tender-distance i {
    font-size: 16px;
}

/* === Poprawka dla meta items === */
.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 14px;
}

.meta-item i {
    width: 20px;
    color: #667eea;
    text-align: center;
}

.meta-label {
    font-weight: 500;
    color: #6c757d;
    min-width: 60px;
}

.meta-value {
    color: #2c3e50;
    font-weight: 400;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* === Specjalne ikony dla nowych pól === */
.fa-hashtag {
    color: #9b59b6 !important; /* Fioletowy dla ID */
}

.fa-city {
    color: #3498db !important; /* Niebieski dla miasta */
}

/* === Responsywność === */
@media (max-width: 768px) {
    .tender-card {
        min-height: 320px;
        padding-bottom: 50px;
    }
    
    .tender-distance {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .meta-item {
        font-size: 13px;
    }
}

/* === Hover effect dla karty === */
.tender-card:hover .tender-distance {
    background: linear-gradient(135deg, #2980b9 0%, #27ae60 100%);
}

/* === Loading State === */
.loading {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--color-text-secondary);
}

.loading i {
    font-size: 2rem;
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
}

.empty-state i {
    font-size: 4rem;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-lg);
}

.empty-state h4 {
    margin-bottom: var(--spacing-sm);
}

/* === Initial State (przed wyszukaniem) === */
.initial-state {
    text-align: center;
    padding: var(--spacing-2xl);
    max-width: 600px;
    margin: 0 auto;
}

.initial-state i {
    display: block;
    margin-bottom: var(--spacing-lg);
}

.initial-state h3 {
    margin-bottom: var(--spacing-md);
    color: var(--color-text);
}

.initial-state p {
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-lg);
}

.initial-state ul {
    list-style: none;
    padding: 0;
}

.initial-state ul li {
    padding: var(--spacing-sm) 0;
    color: var(--color-text-secondary);
}

.initial-state ul li::before {
    content: "✓ ";
    color: var(--color-success);
    font-weight: bold;
    margin-right: var(--spacing-sm);
}

/* === Pagination === */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
}

/* === Mobile Navigation === */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mobile-nav-height);
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    padding: var(--spacing-sm);
    z-index: 1000;
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--color-text-secondary);
    font-size: 0.75rem;
    transition: color var(--transition-fast);
}

.mobile-nav-item.active {
    color: var(--color-primary);
}

.mobile-nav-item i {
    font-size: 1.25rem;
}

/* === Modal === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--color-bg);
    border-radius: var(--radius-xl);
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
}

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

.btn-close {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-close:hover {
    background: var(--color-bg-tertiary);
    color: var(--color-text);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-xl);
}

.modal-footer {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-xl);
    border-top: 1px solid var(--color-border);
}

/* === Tender Detail Styles === */
.tender-detail {
    padding: var(--spacing-lg);
}

.detail-section {
    margin-bottom: var(--spacing-xl);
}

.detail-section h4 {
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
    font-size: 1.125rem;
    font-weight: 600;
}

.detail-section p {
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-md);
}

.detail-grid div {
    color: var(--color-text-secondary);
}

.detail-grid strong {
    color: var(--color-text);
    font-weight: 600;
}

.description-html {
    max-height: 500px;
    overflow-y: auto;
    padding: var(--spacing-md);
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-md);
    line-height: 1.6;
}

.description-html p {
    margin-bottom: var(--spacing-md);
}

.description-html ul,
.description-html ol {
    margin-left: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.description-html li {
    margin-bottom: var(--spacing-sm);
}

.description-html h1,
.description-html h2,
.description-html h3 {
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.description-html table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--spacing-md);
}

.description-html td,
.description-html th {
    border: 1px solid var(--color-border);
    padding: var(--spacing-sm);
}

.cpv-codes {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.cpv-badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--color-primary-light);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
}

.documents-list {
    list-style: none;
    padding: 0;
}

.documents-list li {
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.source-link {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--color-primary);
    font-weight: 500;
}

.source-link:hover {
    color: var(--color-primary-dark);
}

/* === Responsive === */
/* Hide stats sidebar on smaller screens */
@media (max-width: 1280px) {
    .stats-sidebar {
        display: none;
    }
    
    .content {
        max-width: 100%;
    }
}

@media (max-width: 1024px) {
    .content {
        margin-left: 0;
        padding: var(--spacing-lg);
    }
    
    .sidebar {
        display: none;
    }
    
    .tenders-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .mobile-nav {
        display: flex;
    }
    
    .main-layout {
        margin-bottom: var(--mobile-nav-height);
    }
    
    .nav-container {
        padding: 0 var(--spacing-md);
    }
    
    .logo-text h1 {
        font-size: 1rem;
    }
    
    .subtitle {
        display: none;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .results-header {
        flex-direction: column;
        gap: var(--spacing-md);
        align-items: stretch;
    }
    
    .results-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .results-actions .btn-sm {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
    }
    
    .modal-content {
        max-height: 100vh;
        border-radius: 0;
    }
}
/* ============================================ */
/* NOWE STYLE - Zaawansowana Wyszukiwarka */
/* Do dodania do assets/css/main.css */
/* ============================================ */

/* Presety Bar (Quick Filters) */
.presets-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    padding: 0 20px;
}

.preset-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    color: #333;
    font-family: inherit;
}

.preset-btn:hover {
    background: #f8f9fa;
    border-color: #0056b3;
    color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.preset-btn i {
    margin-right: 6px;
}

.preset-btn:active {
    transform: translateY(0);
}

/* Filter Actions - wrapper dla przycisków w filtrach */
.filter-actions {
    display: flex;
    gap: 10px;
    grid-column: 1 / -1;
    margin-top: 10px;
}

/* Przycisk secondary */
.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

/* Responsive - dla mniejszych ekranów */
@media (max-width: 768px) {
    .presets-bar {
        padding: 0 10px;
        gap: 8px;
    }
    
    .preset-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .filter-actions {
        flex-direction: column;
    }
    
    .filter-actions button {
        width: 100%;
    }
}

/* Dodatkowe style dla filter-input (jeśli nie istnieją) */
.filter-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.filter-input:focus {
    outline: none;
    border-color: #0056b3;
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

/* CPV Checkboxes Styles */
.cpv-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkbox-label:hover {
    background: #e3f2ff;
    transform: translateX(4px);
}

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

.checkbox-label span {
    font-size: 14px;
    color: #666;
    user-select: none;
}

.checkbox-label input[type="checkbox"]:checked + span {
    color: #0056b3;
    font-weight: 500;
}

#dateRangeFilter {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .cpv-checkboxes {
        max-height: 200px;
    }
    
    .checkbox-label span {
        font-size: 12px;
    }
}

/* === NOWE STYLE === */

/* Tender reference number */
.tender-ref {
    background: var(--color-bg-tertiary);
    color: var(--color-text-secondary);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: auto;
}

/* Contact details in modal */
.contact-details {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
}

.contact-details p {
    margin: var(--spacing-sm) 0;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.contact-details i {
    width: 20px;
    color: var(--color-primary);
    margin-right: var(--spacing-sm);
}

.contact-details a {
    color: var(--color-primary);
    text-decoration: none;
}

.contact-details a:hover {
    text-decoration: underline;
}

/* Criteria list */
.criteria-list {
    list-style: none;
    padding: 0;
}

.criteria-list li {
    padding: var(--spacing-sm) var(--spacing-md);
    margin: var(--spacing-xs) 0;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--color-primary);
}

.criteria-list strong {
    color: var(--color-text);
}

/* Lots (części zamówienia) */
.lots-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.lot-item {
    padding: var(--spacing-md);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

.lot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--color-border);
}

.lot-header strong {
    color: var(--color-primary);
    font-size: 1rem;
}

.lot-value {
    background: var(--color-success);
    color: white;
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
}

.lot-description {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Enhanced detail grid */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.detail-grid > div {
    padding: var(--spacing-sm);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-sm);
}

.detail-grid strong {
    display: block;
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    margin-bottom: 2px;
}

/* NUTS badge styling */
.tender-meta-item span[title] {
    color: var(--color-text-light);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Icon for bid opening */
.fa-door-open {
    color: var(--color-warning);
}

/* Icon for lots */
.fa-layer-group {
    color: var(--color-primary);
}

/* Responsive adjustments for new elements */
@media (max-width: 768px) {
    .lot-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-xs);
    }
    
    .lot-value {
        align-self: flex-start;
    }
    
    .contact-details {
        padding: var(--spacing-sm);
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

/* Tender Sections - sekcje z treścią ogłoszenia */
.tender-sections {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* NOWE: Kluczowe informacje */
.key-info {
    background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.05), rgba(var(--color-accent-rgb), 0.05));
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg) !important;
}

.key-info h4 {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-md);
    color: var(--color-primary);
}

.key-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.key-info-item {
    background: white;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--color-border);
}

.key-info-item.highlight {
    border-left-color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.02);
}

.key-info-item strong {
    display: block;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
}

.key-info-item span {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
}

.bzp-number {
    color: var(--color-primary);
    font-family: 'Courier New', monospace;
    font-size: 1.1rem !important;
}

.deadline, .value, .wadium {
    color: var(--color-accent);
}

/* NOWE: Scrollowalna treść ogłoszenia */
.full-content {
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg) !important;
}

.full-content h4 {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-md);
    color: var(--color-text);
}

.tender-sections-scrollable {
    max-height: 500px;
    overflow-y: auto;
    padding: var(--spacing-sm);
    background: white;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}

.tender-sections-scrollable::-webkit-scrollbar {
    width: 8px;
}

.tender-sections-scrollable::-webkit-scrollbar-track {
    background: var(--color-bg-secondary);
    border-radius: 4px;
}

.tender-sections-scrollable::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 4px;
}

.tender-sections-scrollable::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}

.section-item {
    background: white;
    border-left: 4px solid var(--color-primary);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-md);
    overflow: hidden;
    transition: all 0.2s ease;
}

.section-item:hover {
    border-left-color: var(--color-accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.section-header {
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(var(--color-primary-rgb), 0.05);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.section-header strong {
    color: var(--color-primary);
    font-size: 0.95rem;
    font-weight: 600;
}

.section-content {
    padding: var(--spacing-md);
    color: var(--color-text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.section-content:empty {
    display: none;
}

/* Accordion dla sekcji (opcjonalne) */
.section-item.collapsed .section-content {
    display: none;
}

.section-header::after {
    content: '▼';
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--color-text-light);
    transition: transform 0.2s ease;
}

.section-item.collapsed .section-header::after {
    transform: rotate(-90deg);
}


/* ===== ADDITIONAL STYLES FOR v2.3 ===== */

/* Filter sections with collapse */
.filter-section {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 12px; /* Większy radius */
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); /* Dodany cień */
    transition: all 0.2s ease;
}

.filter-section:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: #cbd5e1;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

/* ✅ NOWY: Hover effect - cały header reaguje na hover */
.filter-header:hover {
    background: #f3f4f6;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.1);
}

.filter-header:active {
    background: #e5e7eb;
}

.filter-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.filter-header h3 i {
    margin-right: 8px;
    color: #2563eb;
}

.btn-collapse {
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    padding: 5px;
    transition: transform 0.2s;
}

.btn-collapse:hover {
    color: #2563eb;
}

.filter-body {
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
    transition: max-height 0.3s ease-out;
}

.filter-body.collapsed {
    max-height: 0;
    padding: 0;
    overflow: hidden;
}

/* Checkbox and radio groups */
.checkbox-group,
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-label,
.radio-label {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.checkbox-label:hover,
.radio-label:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.checkbox-label input,
.radio-label input {
    margin-right: 10px;
    cursor: pointer;
}

.checkbox-label span,
.radio-label span {
    font-size: 14px;
    color: #374151;
}

/* Active filters display */
.active-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #eff6ff;
    border-radius: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.active-filters-label {
    font-weight: 600;
    color: #1e40af;
    font-size: 14px;
}

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

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #2563eb;
    color: #fff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.filter-tag i {
    font-size: 12px;
}

.filter-tag button {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0;
    margin-left: 4px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.filter-tag button:hover {
    opacity: 1;
}

/* Filter count badge */
.filter-count {
    display: inline-block;
    background: #ef4444;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    margin-left: 5px;
}

/* Date range inputs */
.date-range-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 10px;
}

/* ✅ FIXED: Favorite filters - usunięte specjalne style, teraz wygląda jak reszta sekcji */
/* Usunięte: gradient, border, specjalne tło - teraz używa standardowych stylów .filter-section */

.favorite-filters-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.favorite-filters-controls select {
    flex: 1;
}

.btn-icon-sm {
    padding: 8px 12px;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-icon-sm:hover:not(:disabled) {
    background: #dc2626;
}

.btn-icon-sm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.favorite-filters-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Button text (no background) */
.btn-text {
    background: none;
    border: none;
    color: #2563eb;
    cursor: pointer;
    font-size: 14px;
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.btn-text:hover {
    color: #1e40af;
    text-decoration: underline;
}

.btn-text i {
    font-size: 16px;
}

/* Filter hint */
.filter-hint {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-top: 5px;
    font-style: italic;
}

/* Modal improvements */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

/* Tender detail */
.tender-detail {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-section {
    border-left: 3px solid #2563eb;
    padding-left: 15px;
}

.detail-section h4 {
    margin: 0 0 10px 0;
    color: #1f2937;
    font-size: 16px;
}

.detail-section p {
    margin: 5px 0;
    color: #4b5563;
}

.cpv-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.tender-description {
    background: #f9fafb;
    padding: 15px;
    border-radius: 6px;
    line-height: 1.6;
    color: #4b5563;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .date-range-inputs {
        grid-template-columns: 1fr;
    }
    
    .filter-body {
        max-height: 300px;
    }
    
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
}

/* STYLE DLA ULEPSZONEGO MODALU SZCZEGÓŁÓW */

/* Główny kontener */
.tender-detail-modern {
    max-height: 80vh;
    overflow-y: auto;
    padding: 0;
}

/* Alert deadline */
.detail-alert {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    margin: -20px -20px 20px -20px;
    border-radius: 8px 8px 0 0;
}

.alert-urgent {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
    color: white;
}

.alert-warning {
    background: linear-gradient(135deg, #ffa726 0%, #ff9800 100%);
    color: white;
}

.alert-info {
    background: linear-gradient(135deg, #42a5f5 0%, #2196f3 100%);
    color: white;
}

.alert-icon {
    font-size: 32px;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.alert-subtitle {
    font-size: 13px;
    opacity: 0.9;
}

/* Przyciski akcji */
.detail-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.btn-action {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    background: #f5f5f5;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

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

.btn-action.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-action.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

/* Zakładki */
.detail-tabs {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.tabs-header {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.tab-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s;
    border-right: 1px solid #e0e0e0;
}

.tab-btn:last-child {
    border-right: none;
}

.tab-btn:hover {
    background: #fff;
    color: #333;
}

.tab-btn.active {
    background: white;
    color: #667eea;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.tab-content {
    display: none;
    padding: 20px;
    background: white;
    min-height: 300px;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

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

/* Grid informacji */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.info-card {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.info-label {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.info-value {
    font-size: 15px;
    color: #212529;
    font-weight: 600;
}

.info-value.large {
    font-size: 18px;
    color: #667eea;
}

.info-value.highlight {
    color: #ff6b6b;
}

/* Status badge */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.closed {
    background: #f8d7da;
    color: #721c24;
}

/* Informacje o zamawiającym */
.contractor-info {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.contractor-name {
    margin: 0 0 20px 0;
    color: #212529;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.contractor-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.detail-row i {
    width: 20px;
    color: #6c757d;
    text-align: center;
}

.detail-row a {
    color: #667eea;
    text-decoration: none;
}

.detail-row a:hover {
    text-decoration: underline;
}

/* Kody CPV */
.cpv-container {
    padding: 10px;
}

.cpv-main {
    margin-bottom: 25px;
}

.cpv-main h4,
.cpv-additional h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cpv-card {
    padding: 12px 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 10px;
}

.cpv-card.primary {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 2px solid #667eea;
}

.cpv-code {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 4px;
}

.cpv-name {
    font-size: 13px;
    color: #495057;
}

.cpv-list {
    display: grid;
    gap: 10px;
}

/* Opis */
.description-container {
    padding: 10px;
}

.description-text {
    font-size: 14px;
    line-height: 1.6;
    color: #495057;
    white-space: pre-wrap;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    max-height: 400px;
    overflow-y: auto;
}

.additional-info {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.additional-info h4 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
}

/* Stopka */
.detail-footer {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.footer-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #6c757d;
}

.footer-info span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Brak danych */
.no-data {
    text-align: center;
    color: #6c757d;
    padding: 40px;
    font-size: 14px;
}

/* Scrollbar */
.tender-detail-modern::-webkit-scrollbar {
    width: 8px;
}

.tender-detail-modern::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.tender-detail-modern::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.tender-detail-modern::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsywność */
@media (max-width: 768px) {
    .tabs-header {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1 0 50%;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-actions {
        flex-direction: column;
    }
    
    .btn-action {
        width: 100%;
        justify-content: center;
    }
}/* STYLE DLA KOMPLETNEGO MODALU PRZETARGU */

/* Overlay i kontener */
.tender-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tender-modal-container {
    width: 95%;
    max-width: 1800px;
    max-height: 90vh;
    background: white;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.tender-modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Header */
.tender-modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.tender-modal-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    max-width: 80%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tender-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.tender-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Body */
.tender-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 30px;
}

/* Alert Deadline */
.deadline-alert {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 4px solid;
}

.deadline-alert.alert-critical {
    background: linear-gradient(to right, #fee2e2, #fecaca);
    border-color: #dc2626;
    color: #991b1b;
}

.deadline-alert.alert-urgent {
    background: linear-gradient(to right, #fef3c7, #fde68a);
    border-color: #f59e0b;
    color: #92400e;
}

.deadline-alert.alert-warning {
    background: linear-gradient(to right, #dbeafe, #bfdbfe);
    border-color: #3b82f6;
    color: #1e40af;
}

.deadline-alert.alert-info {
    background: linear-gradient(to right, #e0e7ff, #c7d2fe);
    border-color: #6366f1;
    color: #3730a3;
}

.alert-icon {
    font-size: 32px;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 4px;
}

.alert-subtitle {
    font-size: 14px;
    opacity: 0.8;
}

/* Przyciski akcji */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.btn-action {
    padding: 10px 20px;
    border: 2px solid;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    background: white;
}

.btn-calendar {
    border-color: #10b981;
    color: #10b981;
}

.btn-calendar:hover {
    background: #10b981;
    color: white;
}

.btn-calendar.in-calendar {
    background: #10b981;
    color: white;
}

.btn-source {
    border-color: #8b5cf6;
    color: #8b5cf6;
}

.btn-source:hover {
    background: #8b5cf6;
    color: white;
}

.btn-share {
    border-color: #06b6d4;
    color: #06b6d4;
}

.btn-share:hover {
    background: #06b6d4;
    color: white;
}

.btn-print {
    border-color: #6b7280;
    color: #6b7280;
}

.btn-print:hover {
    background: #6b7280;
    color: white;
}

/* Zakładki */
.tender-tabs {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 25px;
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #6b7280;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #374151;
    background: #f9fafb;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: #f0f4ff;
}

/* Zawartość zakładek */
.tab-content {
    min-height: 400px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s;
}

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

/* Grid informacji w przeglądzie */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.info-section {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
}

.info-section.full-width {
    grid-column: 1 / -1;
}

.info-section h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-content {
    font-size: 14px;
    color: #6b7280;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
}

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

.info-row .label {
    color: #6b7280;
}

.info-row .value {
    font-weight: 600;
    color: #1f2937;
}

.deadline-row .value {
    color: #dc2626 !important;
}

.text-primary {
    color: #667eea !important;
}

.text-danger {
    color: #dc2626 !important;
}

.monospace {
    font-family: 'Courier New', monospace;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Status box */
.status-box {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-active {
    background: linear-gradient(135deg, #d4f4dd, #bbf0d1);
    border: 2px solid #10b981;
}

.status-inactive {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border: 2px solid #ef4444;
}

.status-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6b7280;
}

.status-value {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-active .status-value {
    color: #059669;
}

.status-inactive .status-value {
    color: #dc2626;
}

/* Kody CPV */
.cpv-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cpv-tag {
    display: inline-flex;
    flex-direction: column;
    background: white;
    border: 1px solid #e5e7eb;
    padding: 8px 12px;
    border-radius: 8px;
}

.cpv-tag strong {
    color: #8b5cf6;
    font-size: 14px;
}

.cpv-tag small {
    color: #9ca3af;
    font-size: 11px;
    margin-top: 2px;
}

/* Szczegóły */
.details-sections {
    padding: 10px;
}

.detail-section {
    background: #f9fafb;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.detail-section h4 {
    margin: 0 0 15px 0;
    color: #374151;
    font-size: 16px;
}

.detail-section p {
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}

/* Dokumenty */
.documents-list {
    padding: 10px;
}

.document-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 15px;
}

.document-item i {
    font-size: 32px;
    color: #ef4444;
}

.doc-info {
    flex: 1;
}

.doc-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.doc-meta {
    font-size: 13px;
    color: #6b7280;
}

.doc-actions button {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.doc-actions button:hover {
    background: #5a67d8;
}

/* CZYTNIK DOKUMENTÓW */
.document-reader {
    height: 600px;
    display: flex;
    flex-direction: column;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.reader-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
}

.doc-selector {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    min-width: 250px;
}

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

.reader-actions button {
    width: 36px;
    height: 36px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.2s;
}

.reader-actions button:hover {
    background: #f3f4f6;
    color: #374151;
}

.reader-content {
    flex: 1;
    position: relative;
    background: white;
}

#documentFrame {
    width: 100%;
    height: 100%;
    border: none;
}

/* Footer */
.tender-modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9fafb;
    border-radius: 0 0 12px 12px;
}

.btn-secondary,
.btn-primary {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary {
    background: white;
    border: 2px solid #d1d5db;
    color: #6b7280;
}

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

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

/* Responsywność */
@media (max-width: 768px) {
    .tender-modal-container {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    .tender-modal-header {
        border-radius: 0;
    }
    
    .overview-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn-action {
        width: 100%;
        justify-content: center;
    }
    
    .tender-tabs {
        overflow-x: auto;
    }
    
    .tab-btn {
        white-space: nowrap;
    }
}

/* Print styles */
@media print {
    .tender-modal-overlay {
        position: static;
        background: white;
    }
    
    .tender-modal-close,
    .action-buttons,
    .tender-tabs,
    .tender-modal-footer {
        display: none;
    }
    
    .tender-modal-container {
        max-width: 100%;
        box-shadow: none;
    }
}

/* ================ GWIAZDKI OBSERWOWANIA ================ */

/* Gwiazdka obserwowania */
.watch-star {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #95a5a6;
    font-size: 18px;
    margin-right: 8px;
}

.watch-star:hover {
    color: #7f8c8d;
    transform: scale(1.15);
}

.watch-star.active {
    color: #f39c12;
}

.watch-star.active:hover {
    color: #e67e22;
    transform: scale(1.15) rotate(15deg);
}

/* Gwiazdka w nagłówku kafelka */
.tender-header-icons {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

/* Gwiazdka w tabeli */
.table-watch-cell {
    text-align: center;
    width: 50px;
    padding: 8px !important;
}

.table-watch-cell .watch-star {
    margin: 0;
}

/* ================ PRZYCISK HIDE W HEADERZE ================ */

/* Przycisk "TO NIE DLA MNIE" - małe czerwone kółko z X */
.btn-hide-header {
    width: 32px;
    height: 32px;
    border: none;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.3);
    margin-right: 8px; /* Odstęp od przycisku kalendarza */
}

.btn-hide-header:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.4);
}

.btn-hide-header i {
    font-size: 16px;
}

/* 🎨 Przyciski kalendarza w kafelkach */
.calendar-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.calendar-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

/* Stany przycisku kalendarza */
.calendar-btn-loading {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    cursor: not-allowed;
    opacity: 0.8;
}

.calendar-btn-loading:hover {
    transform: none;
    box-shadow: none;
}

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

.calendar-btn-success:hover {
    transform: none;
}

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

.calendar-btn-error:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

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

.calendar-btn-added:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Przycisk "Pokaż ukryte" */
#showHiddenBtn {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    border: none;
    color: white;
}

#showHiddenBtn:hover {
    background: linear-gradient(135deg, #7f8c8d 0%, #6c7a7b 100%);
}

#showHiddenBtn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#showHiddenBtn.active:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Toast Notifications */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

.toast {
    animation: slideIn 0.3s ease-out;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast::before {
    content: '✓';
    font-size: 18px;
    font-weight: 700;
}

.toast.toast-success {
    background: #28a745;
}

.toast.toast-info {
    background: #007bff;
}

.toast.toast-error {
    background: #dc3545;
}

/* Ukryte przetargi */
.tender-card.hidden-tender {
    opacity: 0.5;
    border: 2px dashed #e0e0e0;
}

.tender-card.hidden-tender::before {
    content: '🚫 UKRYTY';
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    z-index: 10;
}

.tender-card.hidden-tender .btn-hide-header {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
}

.tender-card.hidden-tender .btn-hide-header:hover {
    background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
    transform: scale(1.1) rotate(0deg);
}

/* Mobile */
@media (max-width: 768px) {
    .btn-hide-header {
        width: 28px;
        height: 28px;
        font-size: 12px;
        margin-right: 6px;
    }
    
    .btn-hide-header i {
        font-size: 14px;
    }
}
/* ================ TABLE VIEW STYLES ================ */
.tenders-grid.table-view {
    display: block;
    overflow-x: auto;
}

.tenders-table {
    width: 100%;
    min-width: 1200px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border-collapse: collapse;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 20px 0;
}

.tenders-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tenders-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Szerokości kolumn */
.tenders-table th:nth-child(1) { min-width: 120px; } /* Termin */
.tenders-table th:nth-child(2) { min-width: 140px; } /* Numer BZP */
.tenders-table th:nth-child(3) { min-width: 350px; } /* Tytuł */
.tenders-table th:nth-child(4) { min-width: 250px; } /* Zamawiający */
.tenders-table th:nth-child(5) { min-width: 120px; } /* Miasto */
.tenders-table th:nth-child(6) { min-width: 100px; } /* CPV */
.tenders-table th:nth-child(7) { min-width: 100px; } /* Status */
.tenders-table th:nth-child(8) { min-width: 80px; text-align: center; } /* Ukryj */
.tenders-table th:nth-child(9) { min-width: 140px; text-align: center; } /* Kalendarz */

.tenders-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: all 0.2s;
    cursor: pointer;
}

.tenders-table tbody tr:hover {
    background: #f9fafb;
}

.tenders-table tbody tr.hidden-row {
    opacity: 0.5;
    background: #f3f4f6;
}

.tenders-table td {
    padding: 16px 20px;
    font-size: 14px;
    vertical-align: top;
}

.table-deadline-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.table-deadline-badge.green {
    background: #d1fae5;
    color: #065f46;
}

.table-deadline-badge.yellow {
    background: #fef3c7;
    color: #92400e;
}

.table-deadline-badge.orange {
    background: #fed7aa;
    color: #9a3412;
}

.table-deadline-badge.red {
    background: #fee2e2;
    color: #991b1b;
}

.table-deadline-badge.gray {
    background: #e5e7eb;
    color: #6b7280;
}

.table-bzp-number {
    font-family: 'Courier New', monospace;
    color: #4b5563;
    font-weight: 600;
}

.table-tender-title {
    font-weight: 500;
    color: #1f2937;
    line-height: 1.5;
}

.table-cpv-code {
    background: #ede9fe;
    color: #6b21a8;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-family: monospace;
    font-weight: 600;
}

.table-status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.table-status-badge.active {
    background: #d1fae5;
    color: #065f46;
}

.table-status-badge.closed {
    background: #e5e7eb;
    color: #6b7280;
}

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

.table-hide-btn,
.table-calendar-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.table-calendar-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.table-calendar-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 🆕 Stany przycisków kalendarza w tabeli */
.table-calendar-loading {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    cursor: not-allowed;
    opacity: 0.8;
}

.table-calendar-loading:hover {
    transform: none;
    box-shadow: none;
}

.table-calendar-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    cursor: not-allowed;
}

.table-calendar-success:hover {
    transform: none;
}

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

.table-calendar-error:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

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

.table-calendar-added:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* 🆕 Style dla przycisku TO NIE DLA MNIE w tabeli */
.table-hide-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.3);
}

.table-hide-btn:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    transform: scale(1.15) rotate(90deg);
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.5);
}

.table-hide-undo {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
}

.table-hide-undo:hover {
    background: linear-gradient(135deg, #7f8c8d 0%, #6c7a7b 100%);
    transform: scale(1.15) rotate(-90deg);
}

/* 🆕 Wyśrodkowanie przycisków w kolumnach */
.table-hide-cell,
.table-calendar-cell,
.table-watch-cell {
    text-align: center;
    vertical-align: middle !important;
}

/* Responsive */
@media (max-width: 768px) {
    .tenders-table {
        min-width: 100%;
        font-size: 12px;
    }
    
    .tenders-table th,
    .tenders-table td {
        padding: 10px 12px;
    }
}

/* ===============================================
   PROFILE BUILDER ACCORDION
   =============================================== */

/* Search box */
.cpv-search-box {
    margin-bottom: 15px;
}

.cpv-search-box input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}

.cpv-search-box input:focus {
    outline: none;
    border-color: var(--primary-color, #007bff);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Accordion container */
.cpv-accordion {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    background: white;
}

/* Accordion item */
.cpv-accordion-item {
    border-bottom: 1px solid var(--border-color, #f0f0f0);
}

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

/* Category header */
.cpv-category-header {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #fafafa;
    cursor: pointer;
    transition: background-color 0.2s;
}

.cpv-category-header:hover {
    background: #f0f0f0;
}

.cpv-category-header.expanded {
    background: #e8f4ff;
    border-bottom: 1px solid #d0e8ff;
}

/* Accordion toggle button */
.accordion-toggle {
    display: inline-block;
    width: 20px;
    text-align: center;
    margin-right: 8px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    user-select: none;
}

.accordion-spacer {
    display: inline-block;
    width: 20px;
    margin-right: 8px;
}

/* Checkbox label */
.cpv-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    cursor: pointer;
    user-select: none;
}

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

/* CPV code badge */
.cpv-code-badge {
    display: inline-block;
    padding: 3px 8px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* CPV name */
.cpv-name {
    flex: 1;
    font-size: 14px;
    color: #333;
}

/* Subcategories */
.cpv-subcategories {
    background: #f9f9f9;
    border-top: 1px solid #e0e0e0;
    padding: 8px 0;
}

.cpv-checkbox-label.subcategory {
    padding: 8px 15px 8px 50px;
}

.cpv-checkbox-label.subcategory:hover {
    background: #f0f0f0;
}

.cpv-checkbox-label.subcategory .cpv-code-badge {
    background: #fff3cd;
    color: #856404;
}

/* Messages */
.loading-msg,
.no-results-msg {
    padding: 40px 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* Scrollbar styling */
.cpv-accordion::-webkit-scrollbar {
    width: 8px;
}

.cpv-accordion::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.cpv-accordion::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.cpv-accordion::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Responsive */
@media (max-width: 768px) {
    .cpv-accordion {
        max-height: 400px;
    }
    
    .cpv-category-header {
        padding: 10px 12px;
    }
    
    .cpv-checkbox-label.subcategory {
        padding-left: 40px;
    }
    
    .cpv-name {
        font-size: 13px;
    }
}

/* ===============================================
   SEARCH CPV FILTER - Active Badge
   =============================================== */

.search-cpv-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

/* ✅ FIXED: Label text musi być ciemny i czytelny - z !important */
.search-cpv-header label {
    color: #1f2937 !important;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Dodatkowe selektory dla pewności */
.search-cpv-filter .search-cpv-header label {
    color: #1f2937 !important;
}

.filter-body .search-cpv-header label {
    color: #1f2937 !important;
}

/* 🔧 FIX: Dark mode dla search-cpv labels */
body.dark-theme .search-cpv-header label,
body.dark-theme .search-cpv-filter .search-cpv-header label,
body.dark-theme .filter-body .search-cpv-header label,
body.dark-theme .search-cpv-label {
    color: #e2e8f0 !important;
}

/* Light mode dla search-cpv-label */
.search-cpv-label {
    color: #1f2937;
}

.search-cpv-header label i {
    color: #2563eb !important;
    font-size: 16px;
}

.search-cpv-active-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

.search-cpv-active-badge i {
    font-size: 14px;
}

.search-cpv-active-count {
    font-weight: 700;
    font-size: 13px;
}

/* Subtle pulse animation */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 2px 12px rgba(102, 126, 234, 0.5);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .search-cpv-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .search-cpv-active-badge {
        align-self: flex-end;
    }
}
/* ========== MOBILE FIX: Filters Panel as Overlay ========== */
@media (max-width: 768px) {
    #filtersPanel.filters-panel[style*="display: block"],
    .filters-panel#filtersPanel[style*="display: block"],
    div.filters-panel[style*="display: block"] {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        z-index: 9999 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        overflow-y: auto !important;
        padding: 0 !important;
        background: #0f172a !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .filters-panel-mobile-header {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
        background: #1e293b;
        border-bottom: 2px solid #334155;
        position: sticky;
        top: 0;
        z-index: 10000;
    }
    
    .filters-panel-mobile-header h3 {
        color: #e2e8f0;
        font-size: 1.1rem;
        margin: 0;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .filters-panel-mobile-header h3 i {
        color: #60a5fa;
    }
    
    .filters-panel-close {
        background: #ef4444;
        border: none;
        color: white;
        width: 40px;
        height: 40px;
        border-radius: 8px;
        font-size: 1.2rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        z-index: 10001;
        pointer-events: auto !important;
    }
    
    .filters-panel-close:hover {
        background: #dc2626;
    }
    
    #filtersPanel .filter-section {
        width: 100% !important;
        margin: 12px 16px !important;
        width: calc(100% - 32px) !important;
    }
    
    /* Ukryj tekst logo na mobile - zostaw samo logo */
    .logo-text {
        display: none !important;
    }
    
    .logo {
        gap: 0 !important;
    }
    
    .logo-img {
        width: 40px !important;
        height: 40px !important;
    }
}

/* Desktop - ukryj mobile header */
@media (min-width: 769px) {
    .filters-panel-mobile-header {
        display: none !important;
    }
}