* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: transparent;
    color: #ffffff;
    overflow: hidden;
}

.hidden {
    display: none !important;
}

/* === TEMA BASE (POLIZIA) === */
#dispatch-container {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    width: 400px;
    height: 85vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #0f3460;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s ease-out;
}

.dispatch-header {
    background: linear-gradient(90deg, #0f3460 0%, #533483 100%);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #0f3460;
    border-radius: 13px 13px 0 0;
}

.header-title i {
    font-size: 20px;
    color: #4fc3f7;
}

.tab-button.active::after {
    background: #4fc3f7;
}

.tab-button:hover {
    background: rgba(79, 195, 247, 0.1);
    color: #4fc3f7;
}

.tab-button.active {
    background: rgba(79, 195, 247, 0.2);
    color: #4fc3f7;
}

.section-header i {
    color: #4fc3f7;
}

.count {
    background: #4fc3f7;
    color: #1a1a2e;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    margin-left: auto;
}

.officer-item:hover {
    background: rgba(79, 195, 247, 0.2);
    border-color: #4fc3f7;
    transform: translateX(5px);
}

.officer-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #4fc3f7, #29b6f6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    color: #1a1a2e;
}

.officer-id {
    background: #4fc3f7;
    color: #1a1a2e;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
}

.notification-gps {
    background: #4fc3f7;
}

.notification-gps:hover {
    background: #29b6f6;
    transform: scale(1.05);
}

.officers-container::-webkit-scrollbar-thumb,
.notifications-container::-webkit-scrollbar-thumb {
    background: #4fc3f7;
    border-radius: 3px;
}

/* === TEMA CRI/CROCE ROSSA === */
#dispatch-container.cri-theme {
    background: linear-gradient(135deg, #2e1a1a 0%, #3e1616 100%);
    border: 2px solid #8B0000;
}

#dispatch-container.cri-theme .dispatch-header {
    background: linear-gradient(90deg, #8B0000 0%, #DC143C 100%);
    border-bottom: 2px solid #8B0000;
}

#dispatch-container.cri-theme .header-title i {
    color: #FFB6C1;
}

#dispatch-container.cri-theme .tab-button:hover {
    background: rgba(220, 20, 60, 0.1);
    color: #FFB6C1;
}

#dispatch-container.cri-theme .tab-button.active {
    background: rgba(220, 20, 60, 0.2);
    color: #FFB6C1;
}

#dispatch-container.cri-theme .tab-button.active::after {
    background: #DC143C;
}

#dispatch-container.cri-theme .section-header {
    background: rgba(139, 0, 0, 0.8);
}

#dispatch-container.cri-theme .section-header i {
    color: #FFB6C1;
}

#dispatch-container.cri-theme .count {
    background: #DC143C;
    color: #ffffff;
}

#dispatch-container.cri-theme .officer-item:hover {
    background: rgba(220, 20, 60, 0.2);
    border-color: #DC143C;
}

#dispatch-container.cri-theme .officer-avatar {
    background: linear-gradient(135deg, #DC143C, #B22222);
    color: #ffffff;
}

#dispatch-container.cri-theme .officer-id {
    background: #DC143C;
    color: #ffffff;
}

#dispatch-container.cri-theme .notification-gps {
    background: #DC143C;
}

#dispatch-container.cri-theme .notification-gps:hover {
    background: #B22222;
}

#dispatch-container.cri-theme .officers-container::-webkit-scrollbar-thumb,
#dispatch-container.cri-theme .notifications-container::-webkit-scrollbar-thumb {
    background: #DC143C;
}

#dispatch-container.cri-theme .dispatch-footer {
    background: rgba(139, 0, 0, 0.8);
}

/* Custom Notification Popup CRI Theme */
.custom-notification.cri-theme .notification-popup {
    background: linear-gradient(135deg, #2e1a1a 0%, #3e1616 100%);
    border: 2px solid #8B0000;
}

.custom-notification.cri-theme .notification-popup-header {
    background: linear-gradient(90deg, #ff4757 0%, #ff3838 100%);
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

.notification-popup-icon {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.notification-popup-title {
    flex: 1;
    font-weight: bold;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.notification-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 6px 8px;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.notification-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.notification-popup-content {
    padding: 15px;
}

.notification-popup-category {
    margin-bottom: 12px;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: bold;
    color: white;
}

.notification-popup-message {
    margin-bottom: 12px;
}

.message-title {
    font-size: 15px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 6px;
}

.message-text {
    font-size: 13px;
    color: #e0e0e0;
    line-height: 1.4;
    margin: 0;
}

.notification-popup-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 11px;
    color: #b0bec5;
}

.notification-popup-time {
    font-weight: 500;
}

.notification-popup-officer {
    font-style: italic;
}

.notification-popup-actions {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.popup-action-btn {
    background: #4fc3f7;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    justify-content: center;
}

.popup-action-btn:hover {
    background: #29b6f6;
    transform: scale(1.02);
}

.popup-action-btn.gps-btn {
    background: linear-gradient(90deg, #4fc3f7 0%, #29b6f6 100%);
}

/* Responsive */
@media (max-width: 768px) {
    #dispatch-container {
        width: 350px;
        right: 10px;
        height: 90vh;
    }
    
    .officer-info-panel {
        width: 320px;
        right: 370px;
    }
    
    .header-title {
        font-size: 16px;
    }
    
    .tab-button {
        font-size: 12px;
        padding: 10px 12px;
    }
    
    .custom-notification {
        width: 320px;
        right: 10px;
    }
    
    .notification-popup-header {
        padding: 10px 12px;
    }
    
    .notification-popup-content {
        padding: 12px;
    }
    
    .officer-panel-body {
        padding: 15px;
    }
    
    .officer-large-avatar {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    
    .panel-action-btn {
        padding: 10px 12px;
        font-size: 12px;
    }
}

.custom-notification.cri-theme .notification-popup-icon {
    background: rgba(255, 255, 255, 0.2);
}

.custom-notification.cri-theme .notification-close-btn {
    background: rgba(255, 255, 255, 0.2);
}

.custom-notification.cri-theme .notification-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.custom-notification.cri-theme .popup-action-btn {
    background: #DC143C;
}

.custom-notification.cri-theme .popup-action-btn:hover {
    background: #B22222;
}

.custom-notification.cri-theme .popup-action-btn.gps-btn {
    background: linear-gradient(90deg, #DC143C 0%, #B22222 100%);
}

/* === PANNELLO INFORMAZIONI AGENTE === */
.officer-info-panel {
    position: fixed;
    top: 50%;
    right: 440px;
    transform: translateY(-50%);
    width: 350px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #0f3460;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
    animation: slideInLeft 0.3s ease-out;
    z-index: 1000;
}

.officer-info-panel.cri-theme {
    background: linear-gradient(135deg, #2e1a1a 0%, #3e1616 100%);
    border: 2px solid #8B0000;
}

.officer-panel-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.officer-panel-header {
    background: linear-gradient(90deg, #0f3460 0%, #533483 100%);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #0f3460;
    border-radius: 13px 13px 0 0;
}

.officer-info-panel.cri-theme .officer-panel-header {
    background: linear-gradient(90deg, #8B0000 0%, #DC143C 100%);
    border-bottom: 2px solid #8B0000;
}

.officer-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: bold;
    color: #ffffff;
}

.officer-panel-title i {
    font-size: 18px;
    color: #4fc3f7;
}

.officer-info-panel.cri-theme .officer-panel-title i {
    color: #FFB6C1;
}

.officer-panel-close {
    background: #ff4757;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.officer-panel-close:hover {
    background: #ff3742;
    transform: scale(1.05);
}

.officer-panel-body {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.officer-panel-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 10px;
}

.officer-large-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #4fc3f7, #29b6f6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 28px;
    color: #1a1a2e;
    box-shadow: 0 8px 20px rgba(79, 195, 247, 0.3);
}

.officer-info-panel.cri-theme .officer-large-avatar {
    background: linear-gradient(135deg, #DC143C, #B22222);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(220, 20, 60, 0.3);
}

.officer-status-indicator {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid #1a1a2e;
}

.officer-status-indicator.online {
    background: #4caf50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

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

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid #4fc3f7;
}

.officer-info-panel.cri-theme .detail-row {
    border-left-color: #DC143C;
}

.detail-label {
    font-size: 12px;
    color: #b0bec5;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
    text-align: right;
}

.officer-panel-actions {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.panel-action-btn {
    background: linear-gradient(90deg, #4fc3f7 0%, #29b6f6 100%);
    border: none;
    padding: 12px 15px;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.panel-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 195, 247, 0.3);
}

.officer-info-panel.cri-theme .panel-action-btn {
    background: linear-gradient(90deg, #DC143C 0%, #B22222 100%);
}

.officer-info-panel.cri-theme .panel-action-btn:hover {
    box-shadow: 0 5px 15px rgba(220, 20, 60, 0.3);
}

.contact-btn {
    background: linear-gradient(90deg, #4caf50 0%, #43a047 100%) !important;
}

.contact-btn:hover {
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3) !important;
}

.locate-btn {
    background: linear-gradient(90deg, #ff9800 0%, #f57c00 100%) !important;
}

.locate-btn:hover {
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.3) !important;
}

.priority-btn {
    background: linear-gradient(90deg, #f44336 0%, #d32f2f 100%) !important;
}

.priority-btn:hover {
    box-shadow: 0 5px 15px rgba(244, 67, 54, 0.3) !important;
}

/* Pulsante info agente nella lista */
.officer-info-btn {
    width: 30px;
    height: 30px;
    background: rgba(79, 195, 247, 0.2);
    border: 1px solid #4fc3f7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 8px;
}

.officer-info-btn:hover {
    background: #4fc3f7;
    color: #1a1a2e;
    transform: scale(1.1);
}

.officer-info-btn i {
    font-size: 12px;
}

#dispatch-container.cri-theme .officer-info-btn {
    background: rgba(220, 20, 60, 0.2);
    border-color: #DC143C;
}

#dispatch-container.cri-theme .officer-info-btn:hover {
    background: #DC143C;
    color: #ffffff;
}

/* Aggiustamenti alla lista agenti per il nuovo pulsante */
.officer-item {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.officer-info {
    flex: 1;
}

.officer-name {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 2px;
}

.officer-details {
    font-size: 12px;
    color: #b0bec5;
}

/* === RESTO DEL CSS INVARIATO === */

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

.header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: bold;
    color: #ffffff;
}

.btn-close {
    background: #ff4757;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-close:hover {
    background: #ff3742;
    transform: scale(1.05);
}

.dispatch-content {
    flex: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tab-navigation {
    display: flex;
    background: rgba(15, 52, 96, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-button {
    flex: 1;
    padding: 12px 15px;
    background: transparent;
    border: none;
    color: #b0bec5;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.tab-content {
    flex: 1;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.tab-content.active {
    display: flex;
}

.section {
    flex: 1;
    background: transparent;
    border-radius: 0;
    border: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.section-header {
    background: rgba(15, 52, 96, 0.8);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.officers-container,
.notifications-container {
    flex: 1;
    padding: 20px 15px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #4fc3f7 transparent;
}

.officers-container::-webkit-scrollbar,
.notifications-container::-webkit-scrollbar {
    width: 6px;
}

.officers-container::-webkit-scrollbar-track,
.notifications-container::-webkit-scrollbar-track {
    background: transparent;
}

.notification-item {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.12);
}

.notification-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.notification-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.notification-title {
    flex: 1;
    font-weight: bold;
    font-size: 14px;
}

.notification-time {
    font-size: 11px;
    color: #b0bec5;
}

.notification-message {
    font-size: 13px;
    color: #e0e0e0;
    margin-bottom: 8px;
    line-height: 1.4;
}

.notification-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #b0bec5;
    gap: 10px;
}

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

.notification-clear,
.notification-gps {
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-size: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.notification-clear {
    background: #ff4757;
}

.notification-clear:hover {
    background: #ff3742;
    transform: scale(1.05);
}

.notification-officer-info {
    flex: 1;
    font-size: 11px;
}

.dispatch-footer {
    background: rgba(15, 52, 96, 0.8);
    padding: 12px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 0 13px 13px;
    text-align: center;
}

.footer-info {
    font-size: 12px;
    color: #b0bec5;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #b0bec5;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 5px;
}

.empty-state small {
    font-size: 12px;
    opacity: 0.7;
}

/* Categorie colori */
.category-robbery { background-color: #ff4757; }
.category-shooting { background-color: #ff3838; }
.category-accident { background-color: #ffa726; }
.category-disturbance { background-color: #ffeb3b; color: #1a1a2e; }
.category-drugs { background-color: #4caf50; }
.category-medical { background-color: #2196f3; }
.category-general { background-color: #9e9e9e; }

/* Custom Notification Popup */
.custom-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 350px;
    z-index: 9999;
    animation: slideInNotification 0.4s ease-out;
}

.custom-notification.hidden {
    display: none;
}

@keyframes slideInNotification {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutNotification {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.notification-popup {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #0f3460;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7);
    overflow: hidden;
}

.notification-popup-header {
    background: linear-gradient(90deg, #DC143C 0%, #B22222 100%);
}