/* ===== STAT CARDS ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card { background: var(--bg-card); backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: 16px; padding: 25px; transition: all 0.3s ease; transform-style: preserve-3d; animation: fadeIn 0.5s ease; }
.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:hover { transform: translateY(-5px) rotateX(5deg); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3); border-color: var(--primary); }
.stat-card.clickable.active-filter { border-color: var(--accent); box-shadow: 0 0 30px rgba(0, 212, 255, 0.3); background: rgba(0, 212, 255, 0.05); }
.stat-card .stat-icon { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 15px; }
.stat-card .stat-value { font-size: 2rem; font-weight: 700; margin-bottom: 5px; }
.stat-card .stat-label { color: var(--text-muted); font-size: 0.85rem; }
.stat-card .stat-hint { font-size: 0.7rem; color: var(--accent); margin-top: 8px; opacity: 0; transition: opacity 0.3s; }
.stat-card.clickable:hover .stat-hint { opacity: 1; }

.table-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 25px; border-bottom: 1px solid rgba(255,255,255,0.05); flex-wrap: wrap; gap: 10px; }
.table-header h3 { font-size: 1.1rem; }
.table-header .results-count { color: var(--text-muted); font-size: 0.85rem; margin-left: 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 25px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.03); }
th { background: rgba(108, 99, 255, 0.05); color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; }
tr:hover td { background: rgba(255, 255, 255, 0.02); }
.badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.badge-open { background: rgba(255, 165, 2, 0.2); color: var(--warning); }
.badge-resolved { background: rgba(46, 213, 115, 0.2); color: var(--success); }
.badge-progress { background: rgba(0, 212, 255, 0.2); color: var(--accent); }
.action-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.icon-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 5px; border-radius: 6px; transition: all 0.3s ease; font-size: 1.1rem; }
.icon-btn:hover { color: var(--primary); background: rgba(108, 99, 255, 0.1); }
.icon-btn.delete:hover { color: var(--danger); background: rgba(255, 71, 87, 0.1); }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 4rem; margin-bottom: 20px; opacity: 0.3; }
.resolved-label { color: var(--success); font-size: 0.75rem; font-weight: 600; white-space: nowrap; }

/* ===== FILTERS ===== */
.filter-panel { background: var(--bg-card); backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: 16px; padding: 20px 25px; margin-bottom: 20px; animation: fadeIn 0.5s ease; }
.filter-panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.filter-panel-header h3 { font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.filter-row { display: flex; gap: 15px; flex-wrap: wrap; align-items: flex-end; }
.filter-group { flex: 1; min-width: 180px; }
.filter-group label { display: block; margin-bottom: 6px; color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; }
.filter-group select { width: 100%; padding: 10px 14px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 10px; color: var(--text); font-size: 0.9rem; outline: none; transition: all 0.3s ease; }
.filter-group select:focus { border-color: var(--primary); box-shadow: 0 0 15px rgba(108, 99, 255, 0.2); }
.filter-group select option { background: #1a1a2e; color: var(--text); }
.active-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 15px; padding-top: 15px; border-top: 1px solid rgba(255,255,255,0.05); }
.filter-tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: rgba(108, 99, 255, 0.15); border: 1px solid var(--border); border-radius: 20px; font-size: 0.8rem; color: var(--accent); animation: fadeIn 0.3s ease; }
.filter-tag .remove-filter { cursor: pointer; opacity: 0.7; transition: opacity 0.2s; font-size: 1rem; line-height: 1; }
.filter-tag .remove-filter:hover { opacity: 1; color: var(--danger); }
.btn-clear-filters { background: rgba(255, 71, 87, 0.1); border: 1px solid rgba(255, 71, 87, 0.3); color: var(--danger); padding: 8px 16px; border-radius: 10px; font-size: 0.8rem; cursor: pointer; transition: all 0.3s ease; }
.btn-clear-filters:hover { background: rgba(255, 71, 87, 0.2); transform: translateY(-1px); }

/* ===== MODAL ===== */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(5px); z-index: 1000; justify-content: center; align-items: center; animation: fadeIn 0.3s ease; }
.modal-overlay.active { display: flex; }
.modal { background: var(--bg-card); backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: 20px; padding: 35px; width: 90%; max-width: 550px; max-height: 85vh; overflow-y: auto; animation: modalSlide 0.4s ease; transform-style: preserve-3d; }
.modal h2 { margin-bottom: 25px; font-size: 1.4rem; }
.modal-actions { display: flex; gap: 10px; margin-top: 25px; justify-content: flex-end; }
.ticket-detail { background: rgba(255, 255, 255, 0.03); border-radius: 12px; padding: 20px; margin-top: 15px; }
.ticket-detail p { margin-bottom: 10px; }
.ticket-detail strong { color: var(--accent); }
.ticket-form textarea { min-height: 120px; resize: vertical; }

/* ===== NOTIFICATION ===== */
.notification { 
    position: fixed !important; 
    top: 20px !important; 
    right: 20px !important; 
    padding: 15px 25px; 
    border-radius: 12px; 
    background: var(--bg-card); 
    border: 1px solid var(--border); 
    backdrop-filter: blur(20px); 
    z-index: 9999 !important; 
    animation: slideIn 0.4s ease; 
    display: none; 
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.notification.show {
    display: block !important;
}
.notification.success { border-color: var(--success); }
.notification.error { border-color: var(--danger); }



/* ===== SETTINGS ===== */
.sidebar-footer {
    flex-shrink: 0;
    margin-top: auto;
    padding: 30px 15px;
    background: var(--bg-card);
    border-top: 1px solid rgba(255,255,255,0.05);
}
.settings-wrapper { position: relative; margin-bottom: 10px; }
.settings-btn { width: 100%; background: rgba(108, 99, 255, 0.1); border: 1px solid rgba(108, 99, 255, 0.3); color: var(--primary); padding: 12px 16px; border-radius: 12px; cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center; justify-content: space-between; font-size: 0.95rem; font-weight: 600; }
.settings-btn:hover { background: rgba(108, 99, 255, 0.2); transform: translateY(-1px); box-shadow: 0 5px 15px rgba(108, 99, 255, 0.2); }
.settings-btn .gear-icon { font-size: 1.2rem; transition: transform 0.4s ease; }
.settings-btn.open .gear-icon { transform: rotate(180deg); }
.settings-dropdown { position: absolute; bottom: calc(100% + 8px); left: 0; right: 0; background: var(--bg-card); backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: 12px; padding: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); opacity: 0; visibility: hidden; transform: translateY(10px); transition: all 0.3s ease; z-index: 200; }
.settings-dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }

.settings-dropdown-item {
    display: flex;           /* ?? Flexbox eliminuje problemy z bia?ymi znakami */
    align-items: center;     /* ?? Wyrównuje ikon? i tekst w pionie */
    /*gap: 10px;               /* ?? Jednolity odst?p mi?dzy ikon? a tekstem */
    width: 100%;
    padding: 10px 15px;
    background: transparent;
    border: none;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.settings-dropdown-item:hover {
    background: var(--bg-hover);
}

.settings-dropdown-item .item-icon {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;          /* ?? Zapobiega ?ciskaniu ikony */
}
.settings-dropdown-divider { height: 1px; background: rgba(255,255,255,0.05); margin: 6px 0; }
.settings-dropdown-item.disabled { opacity: 0.4; cursor: not-allowed; }
.settings-dropdown-item.disabled:hover { background: transparent; color: var(--text); transform: none; }
.settings-dropdown-item .coming-soon { margin-left: auto; font-size: 0.65rem; background: rgba(255, 165, 2, 0.2); color: var(--warning); padding: 2px 8px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.logout-btn .btn { width: 100%; background: rgba(255, 71, 87, 0.1); border: 1px solid rgba(255, 71, 87, 0.3); color: var(--danger); }
.logout-btn .btn:hover { background: rgba(255, 71, 87, 0.2); }

/* ===== HARMONOGRAM ===== */
.schedule-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 15px; }
.schedule-worker-selector { display: flex; align-items: center; gap: 10px; background: var(--bg-card); padding: 12px 20px; border-radius: 12px; border: 1px solid var(--border); margin-bottom: 20px; }
.schedule-worker-selector label { color: var(--text-muted); font-size: 0.9rem; }
.schedule-worker-selector select { padding: 8px 14px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; color: var(--text); font-size: 0.9rem; outline: none; cursor: pointer; }
.schedule-legend { display: flex; gap: 15px; align-items: center; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--text-muted); }
.legend-color { width: 12px; height: 12px; border-radius: 3px; }
.schedule-calendar { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; overflow-x: auto; }
.schedule-grid { display: grid; grid-template-columns: 80px repeat(7, 1fr); gap: 1px; background: rgba(255,255,255,0.05); border-radius: 8px; overflow: hidden; min-width: 900px; }
.schedule-corner { background: var(--bg-dark); padding: 12px 8px; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; text-align: center; font-weight: 600; }
.schedule-day-header { background: var(--bg-dark); padding: 12px 8px; text-align: center; font-weight: 600; }
.schedule-day-header.today { background: rgba(108, 99, 255, 0.2); border-top: 3px solid var(--primary); }
.schedule-day-header .day-name { font-size: 1.1rem; color: var(--primary); }
.schedule-day-header .day-full { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }
.schedule-hour-label { background: var(--bg-dark); padding: 8px; font-size: 0.8rem; color: var(--text-muted); text-align: center; min-height: 100px; display: flex; align-items: flex-start; justify-content: center; }
.schedule-cell { background: rgba(255,255,255,0.02); padding: 4px; min-height: 100px; position: relative; transition: background 0.2s; cursor: pointer; }
.schedule-cell:hover { background: rgba(108, 99, 255, 0.05); }
.schedule-cell.today { background: rgba(108, 99, 255, 0.03); }
.schedule-entry { background: rgba(108, 99, 255, 0.1); border-radius: 6px; padding: 6px 8px; margin-bottom: 4px; cursor: pointer; transition: all 0.2s; font-size: 0.75rem; }
.schedule-entry:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.schedule-entry .entry-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.schedule-entry .entry-header strong { color: var(--text); font-size: 0.8rem; }
.schedule-entry .entry-time { color: var(--text-muted); font-size: 0.65rem; }
.schedule-entry .entry-company { color: var(--text-muted); font-size: 0.65rem; margin-bottom: 4px; }
.entry-tickets { margin-top: 4px; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 4px; }
.entry-ticket { padding: 3px 6px; margin-bottom: 2px; background: rgba(0,0,0,0.2); border-radius: 3px; font-size: 0.65rem; display: flex; gap: 4px; align-items: center; }
.entry-ticket .ticket-id { color: var(--accent); font-weight: 600; }
.entry-ticket .ticket-title { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.more-tickets { color: var(--text-muted); font-size: 0.6rem; text-align: center; margin-top: 2px; }
.no-tickets { color: var(--text-muted); font-size: 0.6rem; font-style: italic; margin-top: 4px; text-align: center; }

/* ===== MODAL SZCZEG脫艁Y ===== */
.schedule-detail .detail-row { display: flex; gap: 10px; margin-bottom: 10px; padding: 8px; background: rgba(255,255,255,0.02); border-radius: 8px; }
.schedule-detail .detail-row strong { color: var(--accent); min-width: 120px; }
.active-tickets-list { display: flex; flex-direction: column; gap: 8px; }
.active-ticket-item { background: rgba(255,255,255,0.03); padding: 10px; border-radius: 8px; border-left: 3px solid var(--primary); }
.active-ticket-item .ticket-header { display: flex; gap: 8px; align-items: center; margin-bottom: 5px; }
.active-ticket-item .ticket-id { color: var(--accent); font-weight: 600; }
.active-ticket-item .ticket-title { color: var(--text); font-size: 0.9rem; }

/* ===== FORM ROW ===== */
.form-row { display: flex; gap: 15px; }
.form-row .form-group { flex: 1; }

/* ===== COLOR PICKER ===== */
.color-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.color-option { width: 32px; height: 32px; border-radius: 8px; cursor: pointer; transition: transform 0.2s; border: 2px solid transparent; }
.color-option:hover { transform: scale(1.1); }
.color-option.selected { border-color: white; box-shadow: 0 0 0 2px var(--primary); }

/* ===== CALENDAR ===== */
.calendar-container { background: var(--bg-card); backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: 16px; padding: 25px; animation: fadeIn 0.5s ease; }
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.calendar-header h3 { font-size: 1.2rem; }
.calendar-nav { display: flex; gap: 10px; }
.calendar-nav button { background: rgba(108, 99, 255, 0.1); border: 1px solid var(--border); color: var(--text); padding: 8px 15px; border-radius: 8px; cursor: pointer; transition: all 0.3s ease; }
.calendar-nav button:hover { background: rgba(108, 99, 255, 0.3); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.calendar-day-header { text-align: center; padding: 10px; font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; }
.calendar-day { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 12px; cursor: pointer; transition: all 0.3s ease; position: relative; font-size: 0.9rem; }
.calendar-day:hover { background: rgba(108, 99, 255, 0.1); transform: scale(1.1); }
.calendar-day.today { background: rgba(108, 99, 255, 0.2); border: 1px solid var(--primary); }
.calendar-day.has-tickets { border: 1px solid var(--warning); }
.calendar-day .ticket-count { position: absolute; bottom: 5px; font-size: 0.65rem; background: var(--warning); color: #000; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.calendar-day.other-month { opacity: 0.3; }

/* ===== CHARTS ===== */
.chart-container { background: var(--bg-card); backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: 16px; padding: 25px; margin-bottom: 20px; }
.chart-container h3 { margin-bottom: 20px; font-size: 1.1rem; }
.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(500px, 1fr)); gap: 20px; margin-bottom: 30px; }

/* ===== QUICK RESOLVE ===== */
.quick-resolve-btn { color: var(--success) !important; animation: pulse-glow 2s infinite; }
.quick-resolve-btn:hover { background: rgba(46, 213, 115, 0.2) !important; color: var(--success) !important; transform: scale(1.2); }

/* ===== PASSWORD STRENGTH ===== */
.password-strength { margin-top: 8px; height: 4px; background: rgba(255,255,255,0.05); border-radius: 2px; overflow: hidden; }
.password-strength-bar { height: 100%; width: 0%; transition: all 0.3s ease; border-radius: 2px; }
.password-strength-label { font-size: 0.75rem; margin-top: 4px; color: var(--text-muted); }

/* ===== MENU TOGGLE ===== */
.menu-toggle { display: none; position: fixed; top: 15px; left: 15px; z-index: 200; background: var(--bg-card); border: 1px solid var(--border); color: var(--text); padding: 10px 15px; border-radius: 8px; cursor: pointer; }

.loading-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(5px); z-index: 3000; display: none; justify-content: center; align-items: center; }
.loading-spinner { width: 50px; height: 50px; border: 4px solid rgba(108, 99, 255, 0.2); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== DRAG & DROP ===== */
.schedule-entry[draggable="true"] { cursor: grab; }
.schedule-entry[draggable="true"]:active { cursor: grabbing; }
.schedule-entry.dragging { opacity: 0.4; transform: rotate(2deg); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5); }
.schedule-cell.drag-over { background: rgba(108, 99, 255, 0.15) !important; border: 2px dashed var(--primary) !important; animation: pulse-border 1s infinite; }
@keyframes pulse-border { 0%, 100% { border-color: var(--primary); } 50% { border-color: var(--accent); } }
.schedule-cell.drag-over::before { content: '馃搷 Upu艣膰 tutaj'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: var(--primary); font-size: 0.75rem; font-weight: 600; pointer-events: none; z-index: 10; }

/* ===== TICKET TIMESTAMPS ===== */
.ticket-timestamps { background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 12px; padding: 15px; margin: 15px 0; }
.ticket-timestamps h3 { font-size: 1rem; margin-bottom: 12px; color: var(--accent); }
.timestamp-item { display: flex; gap: 12px; padding: 10px; margin-bottom: 8px; background: rgba(255, 255, 255, 0.03); border-radius: 8px; border-left: 3px solid var(--primary); transition: all 0.2s; }
.timestamp-item:hover { background: rgba(255, 255, 255, 0.05); transform: translateX(2px); }
.timestamp-item.resolved { border-left-color: var(--success); }
.timestamp-item:last-child { margin-bottom: 0; }
.timestamp-icon { font-size: 1.5rem; flex-shrink: 0; }
.timestamp-content { flex: 1; }
.timestamp-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.timestamp-value { font-size: 0.95rem; color: var(--text); font-weight: 500; }
.timestamp-duration { font-size: 0.8rem; color: var(--accent); margin-top: 4px; font-style: italic; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .schedule-grid { grid-template-columns: 60px repeat(7, minmax(120px, 1fr)); }
    .form-row { flex-direction: column; }
}

/* ===== NAPRAWA WY艢RODKOWANIA TABELI DODATKOWYCH AWARII ===== */

/* Wymu艣 wyr贸wnanie do lewej na WSZYSTKICH elementach w kontenerze */
.extra-visits-container,
.extra-visits-container *,
.extra-visits-container .table-container,
.extra-visits-container .table-header,
.extra-visits-container .table-header h3,
.extra-visits-container .table-header button,
.extra-visits-container table,
.extra-visits-container thead,
.extra-visits-container tbody,
.extra-visits-container tr,
.extra-visits-container th,
.extra-visits-container td {
    text-align: left !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Tabela - pe艂na szeroko艣膰, bez wy艣rodkowania */
.extra-visits-container .table-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 20px 0 0 0 !important;
    padding: 0 !important;
    display: block !important;
    text-align: left !important;
}

.extra-visits-container .table-container table {
    width: 100% !important;
    min-width: 1400px !important;
    max-width: none !important;
    margin: 0 !important;
    display: table !important;
    table-layout: auto !important;
}

/* Nag艂贸wek tabeli - flexbox z wyr贸wnaniem do lewej */
.extra-visits-container .table-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    margin: 0 0 20px 0 !important;
    padding: 20px 0 !important;
    text-align: left !important;
}

.extra-visits-container .table-header h3 {
    margin: 0 !important;
    text-align: left !important;
    flex: 1 !important;
}

.extra-visits-container .table-header button {
    margin: 0 0 0 auto !important;
    text-align: left !important;
}

/* Statystyki - normalny grid */
.extra-visits-container .stats-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
    gap: 20px !important;
    margin: 0 0 30px 0 !important;
    width: 100% !important;
    text-align: left !important;
}

/* Nag艂贸wek strony */
.extra-visits-container .page-header {
    text-align: left !important;
    margin: 0 0 30px 0 !important;
}

/* Karty statystyk - wyr贸wnanie do lewej */
.extra-visits-container .stat-card {
    text-align: left !important;
}

/* ??? ZABEZPIECZENIE: Dzwonek powiadomień widoczny TYLKO w panelu dashboardu 
.notification-bell-wrapper {
    display: none !important;
}
*/
/* Poka? dzwonek TYLKO wtedy, gdy kontener dashboardu ma klas? 'active' 
.dashboard.active .notification-bell-wrapper {
    display: block !important; 
}
*/
/* Badge z liczb? nieprzeczytanych */
.notification-badge {
    background: var(--danger);
    color: white;
    border-radius: 50%;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -5px;
    right: -5px;
}

/* ==================== NOTIFICATION BELL - FIXED W PRAWYM GóRNYM ROGU ==================== */

/* Wrapper przycisku - fixed pozycja */
.notification-bell-wrapper-fixed {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 9999 !important;
}

/* Przycisk dzwonka */
.notification-bell-btn {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.notification-bell-btn:hover {
    background: rgba(108, 99, 255, 0.2);
    border-color: var(--primary);
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(108, 99, 255, 0.4);
}

/* Badge z liczb? nieprzeczytanych */
.notification-badge {
    position: absolute !important;
    top: -5px !important;
    right: -5px !important;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-dark);
}

/* Ukryj badge gdy jest 0 */
.notification-badge:empty,
.notification-badge[style*="display: none"] {
    display: none !important;
}

/* Dropdown powiadomień - pod przyciskiem */
.notification-bell-dropdown {
    position: fixed !important;
    top: 80px !important;
    right: 20px !important;
    left: auto !important;
    bottom: auto !important;
    width: 400px !important;
    max-width: calc(100vw - 40px) !important;
    max-height: 600px !important;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 9998 !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.notification-bell-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-bell-dropdown .notification-header {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    background: rgba(108,99,255,0.05);
}

.notification-bell-dropdown .notification-header strong {
    font-size: 1rem;
    color: var(--text);
}

.notification-bell-dropdown .notification-header button {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 5px 10px;
    border-radius: 6px;
    transition: background 0.2s;
}

.notification-bell-dropdown .notification-header button:hover {
    background: rgba(0,212,255,0.1);
}

.notification-bell-dropdown .notification-list {
    max-height: 500px;
    overflow-y: auto;
    flex: 1;
}

.notification-bell-dropdown .notification-item-bell {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    transition: background 0.2s;
}

.notification-bell-dropdown .notification-item-bell:hover {
    background: rgba(108,99,255,0.1);
}

.notification-bell-dropdown .notification-item-bell.unread {
    background: rgba(108,99,255,0.05);
}

/* ??? USU? STARE ZABEZPIECZENIE - dzwonek jest teraz zawsze widoczny gdy dashboard jest aktywny */
.dashboard:not(.active) ~ .notification-bell-wrapper-fixed,
.dashboard:not(.active) ~ .notification-bell-dropdown {
    display: none !important;
}

/* ==================== GLOBAL SEARCH ==================== */
.global-search-input {
    transition: all 0.3s ease;
}

.global-search-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 15px rgba(108, 99, 255, 0.2);
    background: rgba(255, 255, 255, 0.08) !important;
}

.global-search-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* Przycisk wyczy?? - hover */
.global-search-input + button:hover {
    background: rgba(255,71,87,0.3) !important;
    transform: translateY(-50%) scale(1.1);
}

/* Animacja pod?wietlenia wierszy po wyszukiwaniu */
@keyframes searchHighlight {
    0% { background: rgba(108, 99, 255, 0.15); }
    100% { background: transparent; }
}

.global-search-active tbody tr {
    animation: searchHighlight 0.6s ease;
}

/* ==================== COMPACT FILTERS - DODATKOWE AWARIE ==================== */

/* Wymu? kompaktowy wygl?d dla wszystkich pól filtrów */
.compact-filter-select,
.compact-filter-input,
#extraVisitsFilterClient,
#extraVisitsFilterDay,
#extraVisitsFilterDateFrom,
#extraVisitsFilterDateTo {
    box-sizing: border-box !important;
    -webkit-box-sizing: border-box !important;
    -moz-box-sizing: border-box !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    padding: 4px 8px !important;
    font-size: 0.85rem !important;
    line-height: 1.2 !important;
    min-width: 120px !important;
    max-width: 200px !important;
    width: auto !important;
    border-radius: 6px !important;
    background: rgba(255,255,255,0.05) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    outline: none !important;
    transition: all 0.2s ease !important;
}

/* Hover i focus */
.compact-filter-select:hover,
.compact-filter-input:hover,
#extraVisitsFilterClient:hover,
#extraVisitsFilterDay:hover,
#extraVisitsFilterDateFrom:hover,
#extraVisitsFilterDateTo:hover {
    border-color: var(--primary) !important;
    background: rgba(255,255,255,0.08) !important;
}

.compact-filter-select:focus,
.compact-filter-input:focus,
#extraVisitsFilterClient:focus,
#extraVisitsFilterDay:focus,
#extraVisitsFilterDateFrom:focus,
#extraVisitsFilterDateTo:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 10px rgba(108, 99, 255, 0.15) !important;
}

/* Opcje w select - kompaktowe */
.compact-filter-select option,
#extraVisitsFilterClient option,
#extraVisitsFilterDay option {
    padding: 6px 8px !important;
    font-size: 0.85rem !important;
    background: #1a1a2e !important;
    color: var(--text) !important;
}

/* Label nad polami - mniejszy */
.filter-panel label {
    font-size: 0.7rem !important;
    margin-bottom: 3px !important;
    line-height: 1 !important;
}

/* Przycisk "Wyczy?? filtry" - kompaktowy */
.filter-panel .btn-danger.btn-small {
    box-sizing: border-box !important;
    height: 32px !important;
    min-height: 32px !important;
    padding: 4px 12px !important;
    font-size: 0.8rem !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

/* Wyszukiwarka - kompaktowa */
#globalSearch_extraVisits {
    box-sizing: border-box !important;
    height: 32px !important;
    min-height: 32px !important;
    padding: 4px 28px 4px 10px !important;
    font-size: 0.85rem !important;
    line-height: 1.2 !important;
    min-width: 150px !important;
    max-width: 250px !important;
}

/* Przycisk "Szukaj" obok wyszukiwarki */
.filter-panel .btn-primary.btn-small {
    box-sizing: border-box !important;
    height: 32px !important;
    min-height: 32px !important;
    padding: 4px 12px !important;
    font-size: 0.8rem !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

/* Zmniejsz odst?py w panelu filtrów */
.filter-panel > div {
    gap: 8px !important;
    align-items: flex-end !important;
}

.filter-panel > div > div {
    gap: 3px !important;
}

/* Input date - specjalne style */
input[type="date"].compact-filter-input,
#extraVisitsFilterDateFrom,
#extraVisitsFilterDateTo {
    box-sizing: border-box !important;
    height: 32px !important;
    padding: 4px 8px !important;
    font-size: 0.85rem !important;
    line-height: 1.2 !important;
}

/* Select - strza?ka */
select.compact-filter-select,
#extraVisitsFilterClient,
#extraVisitsFilterDay {
    appearance: auto !important;
    -webkit-appearance: auto !important;
    -moz-appearance: auto !important;
    cursor: pointer !important;
}

/* ==================== FILTRY DATY W ANALITYCE ==================== */
#analyticsDateFrom,
#analyticsDateTo {
    box-sizing: border-box !important;
    -webkit-box-sizing: border-box !important;
    -moz-box-sizing: border-box !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    padding: 4px 8px !important;
    font-size: 0.85rem !important;
    line-height: 1.2 !important;
    min-width: 130px !important;
    max-width: 160px !important;
    border-radius: 6px !important;
    background: rgba(255,255,255,0.05) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    outline: none !important;
    transition: all 0.2s ease !important;
}

#analyticsDateFrom:hover,
#analyticsDateTo:hover {
    border-color: var(--primary) !important;
    background: rgba(255,255,255,0.08) !important;
}

#analyticsDateFrom:focus,
#analyticsDateTo:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 10px rgba(108, 99, 255, 0.15) !important;
}

/* Przyciski w panelu filtrów analityki */
.filter-panel .btn-primary.btn-small,
.filter-panel .btn-danger.btn-small {
    box-sizing: border-box !important;
    height: 32px !important;
    min-height: 32px !important;
    padding: 4px 12px !important;
    font-size: 0.8rem !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

/* Etykiety w panelu filtrów analityki */
.filter-panel label {
    font-size: 0.7rem !important;
    margin-bottom: 3px !important;
    line-height: 1 !important;
}

/* Zmniejsz odst?py w panelu filtrów */
.filter-panel > div {
    gap: 8px !important;
    align-items: flex-end !important;
}

.filter-panel > div > div {
    gap: 3px !important;
}