/**
 * Frontend CSS for WP Dispatcher
 */

/* Console Layout */
.ems-console {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ems-console-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e1e5e9;
}

.ems-console-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
}

.ems-console-content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Grid Layout */
.ems-console-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 20px;
    padding: 20px;
}

.ems-console-section {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

.ems-console-section h3 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 8px;
}

/* Map Styles */
.ems-map {
    height: 300px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.ems-map-section {
    grid-column: 1 / -1;
}

/* Teams and Scenarios Grid */
.ems-teams-grid,
.ems-scenarios-grid,
.ems-assignments-grid {
    display: grid;
    gap: 10px;
}

.ems-team-item,
.ems-scenario-item,
.ems-assignment-item {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
    transition: all 0.2s ease;
}

.ems-team-item:hover,
.ems-scenario-item:hover,
.ems-assignment-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* Status Colors */
.ems-status-free {
    border-left: 4px solid #28a745;
}

.ems-status-occupied {
    border-left: 4px solid #dc3545;
}

.ems-status-reset {
    border-left: 4px solid #ffc107;
}

.ems-status-break {
    border-left: 4px solid #6c757d;
}

.ems-status-available {
    border-left: 4px solid #17a2b8;
}

.ems-status-completed {
    border-left: 4px solid #6f42c1;
}

/* Team/Scenario Info */
.ems-team-name,
.ems-scenario-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.ems-team-status,
.ems-scenario-status {
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 8px;
}

.ems-scenario-location {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 10px;
}

/* Assignment Info */
.ems-assignment-team,
.ems-assignment-scenario {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.ems-assignment-time {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 10px;
}

/* Buttons */
.ems-team-actions,
.ems-assignment-actions {
    margin-top: 10px;
}

.button-small {
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1.4;
}

.ems-assign-btn,
.ems-complete-btn {
    background: #007cba;
    color: #fff;
    border: none;
    border-radius: 3px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ems-assign-btn:hover,
.ems-complete-btn:hover {
    background: #005a87;
}

/* Jury Console Specific */
.ems-jury-content {
    padding: 20px;
}

.ems-current-assignment {
    margin-bottom: 30px;
}

.ems-assignment-details {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 15px;
}

.ems-assignment-details > div {
    margin-bottom: 8px;
}

.ems-assignment-details > div:last-child {
    margin-bottom: 0;
}

/* Scoring Form */
.ems-scoring-form {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 20px;
}

.ems-scoring-items {
    margin-bottom: 20px;
}

.ems-scoring-item {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.ems-scoring-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.ems-scoring-item label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.ems-scoring-item input[type="number"] {
    width: 100px;
    padding: 6px 8px;
    border: 1px solid #ced4da;
    border-radius: 3px;
    margin-right: 8px;
}

.ems-max-score {
    color: #6c757d;
    font-size: 14px;
}

.ems-scoring-item textarea {
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 3px;
    resize: vertical;
    min-height: 60px;
}

.ems-scoring-actions {
    text-align: right;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

/* Team Console Specific */
.ems-team-content {
    padding: 20px;
}

.ems-team-status {
    margin-bottom: 30px;
}

.ems-status-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ems-status-controls select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 3px;
    background: #fff;
}

.ems-callout-section {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 15px;
    margin-top: 20px;
}

.ems-callout-voice {
    font-weight: 600;
    color: #856404;
    margin-bottom: 8px;
}

.ems-callout-message {
    color: #856404;
    line-height: 1.5;
}

/* Loading States */
.ems-loading {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ems-console-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }
    
    .ems-console-section {
        padding: 15px;
    }
    
    .ems-map {
        height: 250px;
    }
    
    .ems-status-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ems-status-controls select,
    .ems-status-controls button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .ems-console {
        padding: 10px;
    }
    
    .ems-console-header h2 {
        font-size: 20px;
    }
    
    .ems-console-section h3 {
        font-size: 16px;
    }
    
    .ems-map {
        height: 200px;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mb-0 {
    margin-bottom: 0;
}

.mt-20 {
    margin-top: 20px;
}

.hidden {
    display: none;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ems-console-section {
    animation: fadeIn 0.3s ease-out;
}

/* Focus States */
.ems-scoring-item input:focus,
.ems-scoring-item textarea:focus,
.ems-status-controls select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

/* Button States */
.button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Assignment Modal Styles */
.ems-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ems-modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.ems-modal-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ems-modal-header h3 {
    margin: 0;
    color: #333;
}

.ems-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ems-modal-close:hover {
    color: #333;
}

.ems-modal-body {
    padding: 20px;
}

.ems-scenario-option {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9f9f9;
    transition: background-color 0.2s;
}

.ems-scenario-option:hover {
    background: #f0f0f0;
}

.ems-scenario-title {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.ems-scenario-location {
    color: #666;
    font-size: 14px;
}

.ems-no-scenarios {
    text-align: center;
    color: #666;
    padding: 40px 20px;
    font-style: italic;
}

.ems-no-assignments {
    text-align: center;
    color: #666;
    padding: 20px;
    font-style: italic;
}

.ems-status-text {
    color: #666;
    font-style: italic;
    font-size: 14px;
}

.ems-recall-btn {
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 3px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-left: 5px;
}

.ems-recall-btn:hover {
    background: #c82333;
}

.ems-assignment-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

/* Modern Dispatcher Layout */
.ems-modern-dispatcher {
    display: flex;
    height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f9fa;
    overflow: hidden;
}

/* Left Sidebar */
.ems-modern-dispatcher .ems-sidebar {
    width: 80px;
    background: #fff;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.ems-modern-dispatcher .ems-profile {
    margin-bottom: 30px;
}

.ems-modern-dispatcher .ems-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #e9ecef;
}

.ems-modern-dispatcher .ems-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ems-modern-dispatcher .ems-nav {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
}

.ems-modern-dispatcher .ems-nav-item {
    position: relative;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    background: transparent;
    border: none;
    cursor: pointer;
}

.ems-modern-dispatcher .ems-nav-item:hover {
    background: #f8f9fa;
}

.ems-modern-dispatcher .ems-nav-item.active {
    background: #dc3545;
    color: white;
}

.ems-modern-dispatcher .ems-nav-icon {
    font-size: 20px;
}

.ems-modern-dispatcher .ems-nav-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.ems-modern-dispatcher .ems-status-indicator {
    margin-top: auto;
}

.ems-modern-dispatcher .ems-wifi-icon {
    font-size: 20px;
    color: #28a745;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Main Content */
.ems-modern-dispatcher .ems-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Control Panel */
.ems-modern-dispatcher .ems-control-panel {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 20px 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.ems-modern-dispatcher .ems-control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ems-modern-dispatcher .ems-control-title h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    color: #2c3e50;
}

.ems-modern-dispatcher .ems-control-actions {
    display: flex;
    gap: 20px;
    align-items: center;
}

.ems-modern-dispatcher .ems-notification,
.ems-modern-dispatcher .ems-location {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
    color: #6c757d;
}

.ems-modern-dispatcher .ems-bell-icon,
.ems-modern-dispatcher .ems-location-icon {
    font-size: 16px;
}

/* Statistics */
.ems-modern-dispatcher .ems-control-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
}

.ems-modern-dispatcher .ems-stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    min-width: 150px;
}

.ems-modern-dispatcher .ems-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.ems-modern-dispatcher .ems-stat-new {
    background: #e3f2fd;
    color: #1976d2;
}

.ems-modern-dispatcher .ems-stat-active {
    background: #fff3e0;
    color: #f57c00;
}

.ems-modern-dispatcher .ems-stat-completed {
    background: #e8f5e8;
    color: #388e3c;
}

.ems-modern-dispatcher .ems-stat-content {
    display: flex;
    flex-direction: column;
}

.ems-modern-dispatcher .ems-stat-label {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 2px;
}

.ems-modern-dispatcher .ems-stat-count {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
}

/* Filters */
.ems-modern-dispatcher .ems-control-filters {
    display: flex;
    gap: 10px;
}

.ems-modern-dispatcher .ems-filter-btn {
    padding: 10px 20px;
    border: 1px solid #e9ecef;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: #6c757d;
}

.ems-modern-dispatcher .ems-filter-btn:hover {
    background: #f8f9fa;
}

.ems-modern-dispatcher .ems-filter-btn.active {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* Content Area */
.ems-modern-dispatcher .ems-content-area {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.ems-modern-dispatcher .ems-assignments-panel {
    width: 400px;
    background: #fff;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
}

.ems-modern-dispatcher .ems-assignments-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.ems-modern-dispatcher .ems-assignments-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.ems-modern-dispatcher .ems-assignments-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

/* Map Panel */
.ems-modern-dispatcher .ems-map-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.ems-modern-dispatcher .ems-map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.ems-modern-dispatcher .ems-map-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.ems-modern-dispatcher .ems-map-controls {
    display: flex;
    gap: 8px;
}

.ems-modern-dispatcher .ems-map-btn {
    width: 35px;
    height: 35px;
    border: 1px solid #e9ecef;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
}

.ems-modern-dispatcher .ems-map-btn:hover {
    background: #f8f9fa;
}

.ems-modern-dispatcher .ems-map {
    flex: 1;
    min-height: 400px;
}

/* Assignment Items */
.ems-modern-dispatcher .ems-assignment-item {
    padding: 15px;
    margin-bottom: 10px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.ems-modern-dispatcher .ems-assignment-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.ems-modern-dispatcher .ems-assignment-item.new {
    border-left: 4px solid #17a2b8;
}

.ems-modern-dispatcher .ems-assignment-item.active {
    border-left: 4px solid #ffc107;
}

.ems-modern-dispatcher .ems-assignment-item.completed {
    border-left: 4px solid #28a745;
}

.ems-modern-dispatcher .ems-assignment-status {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.ems-modern-dispatcher .ems-assignment-status.new {
    background: #e3f2fd;
    color: #1976d2;
}

.ems-modern-dispatcher .ems-assignment-status.active {
    background: #fff3e0;
    color: #f57c00;
}

.ems-modern-dispatcher .ems-assignment-status.completed {
    background: #e8f5e8;
    color: #388e3c;
}

.ems-modern-dispatcher .ems-assignment-id {
    font-size: 14px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.ems-modern-dispatcher .ems-assignment-time {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 5px;
}

.ems-modern-dispatcher .ems-assignment-location {
    font-size: 13px;
    color: #495057;
    margin-bottom: 10px;
}

.ems-modern-dispatcher .ems-assignment-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.ems-modern-dispatcher .ems-assignment-actions .button {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Additional styling for modern look */
.ems-modern-dispatcher .ems-no-assignments {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
}

.ems-modern-dispatcher .ems-loading {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

/* Assignment item hover effects */
.ems-modern-dispatcher .ems-assignment-item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.ems-modern-dispatcher .ems-assignment-item:hover {
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

/* Status badges */
.ems-modern-dispatcher .ems-assignment-status {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Map controls styling */
.ems-modern-dispatcher .ems-map-controls {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Notification badge animation */
.ems-modern-dispatcher .ems-nav-badge {
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Practical Dispatcher Layout - Full Screen Override */
.ems-practical-dispatcher {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    width: 100vw !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f6fa !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 999999 !important;
    box-sizing: border-box !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure dispatcher is always visible and full screen */
.ems-practical-dispatcher {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure all dispatcher children are visible */
.ems-practical-dispatcher * {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Simple WordPress element hiding */
#wpadminbar,
.site-header,
.site-footer,
.site-navigation,
.widget-area,
.entry-header,
.entry-footer,
.comments-area,
.sidebar,
.widget,
.site-branding,
.site-title,
.site-description {
    display: none !important;
}

/* Fallback for browsers without :has() support */
.ems-practical-dispatcher {
    margin: 0 !important;
    padding: 0 !important;
}

/* Additional WordPress theme selectors to hide */
.site,
.site-content,
.site-inner,
.content,
.main,
.primary,
.secondary,
.page-wrapper,
.page-content,
.entry-wrapper,
.post-content,
.single-post,
.page-template,
.home,
.blog,
.archive {
    display: none !important;
}

/* Ensure full width on any container */
.ems-practical-dispatcher * {
    box-sizing: border-box;
}

/* Header */
.ems-practical-dispatcher .ems-dispatcher-header {
    background: #fff;
    border-bottom: 1px solid #e1e5e9;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
}

.ems-practical-dispatcher .ems-header-left h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    color: #2c3e50;
}

.ems-practical-dispatcher .ems-event-name {
    color: #6c757d;
    font-size: 16px;
    margin-left: 15px;
}

.ems-practical-dispatcher .ems-status-summary {
    display: flex;
    gap: 30px;
}

.ems-practical-dispatcher .ems-status-item {
    text-align: center;
}

.ems-practical-dispatcher .ems-status-label {
    display: block;
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 5px;
}

.ems-practical-dispatcher .ems-status-count {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
}

/* Main Content */
.ems-practical-dispatcher .ems-dispatcher-content {
    flex: 1;
    display: flex;
    gap: 20px;
    padding: 20px;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

/* Left Panel */
.ems-practical-dispatcher .ems-left-panel {
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Center Panel */
.ems-practical-dispatcher .ems-center-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Right Panel */
.ems-practical-dispatcher .ems-right-panel {
    width: 350px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Sections */
.ems-practical-dispatcher .ems-section {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ems-practical-dispatcher .ems-section-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.ems-practical-dispatcher .ems-section-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.ems-practical-dispatcher .ems-section-actions {
    display: flex;
    gap: 8px;
}

.ems-practical-dispatcher .ems-refresh-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #e9ecef;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
}

.ems-practical-dispatcher .ems-refresh-btn:hover {
    background: #f8f9fa;
    border-color: #007bff;
}

/* Map Container */
.ems-practical-dispatcher .ems-map-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ems-practical-dispatcher .ems-map-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.ems-practical-dispatcher .ems-map-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.ems-practical-dispatcher .ems-map-controls {
    display: flex;
    gap: 8px;
}

.ems-practical-dispatcher .ems-map-btn {
    width: 35px;
    height: 35px;
    border: 1px solid #e9ecef;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
}

.ems-practical-dispatcher .ems-map-btn:hover {
    background: #f8f9fa;
    border-color: #007bff;
}

.ems-practical-dispatcher .ems-map {
    flex: 1;
    min-height: 400px;
}

/* Lists */
.ems-practical-dispatcher .ems-teams-list,
.ems-practical-dispatcher .ems-scenarios-list,
.ems-practical-dispatcher .ems-assignments-list,
.ems-practical-dispatcher .ems-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

/* Team Items */
.ems-practical-dispatcher .ems-team-item {
    padding: 12px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.ems-practical-dispatcher .ems-team-item:hover {
    background: #e9ecef;
    border-color: #007bff;
}

.ems-practical-dispatcher .ems-team-item.free {
    border-left: 4px solid #28a745;
}

.ems-practical-dispatcher .ems-team-item.occupied {
    border-left: 4px solid #ffc107;
}

.ems-practical-dispatcher .ems-team-item.reset {
    border-left: 4px solid #17a2b8;
}

.ems-practical-dispatcher .ems-team-item.break {
    border-left: 4px solid #6f42c1;
}

.ems-practical-dispatcher .ems-team-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

.ems-practical-dispatcher .ems-team-status {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    font-weight: 500;
}

.ems-practical-dispatcher .ems-team-actions {
    position: absolute;
    top: 8px;
    right: 8px;
}

.ems-practical-dispatcher .ems-assign-btn {
    padding: 4px 8px;
    font-size: 11px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ems-practical-dispatcher .ems-assign-btn:hover {
    background: #0056b3;
}

/* Scenario Items */
.ems-practical-dispatcher .ems-scenario-item {
    padding: 12px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.ems-practical-dispatcher .ems-scenario-item.available {
    border-left: 4px solid #28a745;
}

.ems-practical-dispatcher .ems-scenario-item.occupied {
    border-left: 4px solid #ffc107;
}

.ems-practical-dispatcher .ems-scenario-item.completed {
    border-left: 4px solid #6c757d;
}

.ems-practical-dispatcher .ems-scenario-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

.ems-practical-dispatcher .ems-scenario-location {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 4px;
}

.ems-practical-dispatcher .ems-scenario-status {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    font-weight: 500;
}

/* Assignment Items */
.ems-practical-dispatcher .ems-assignment-item {
    padding: 12px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.ems-practical-dispatcher .ems-assignment-item.active {
    border-left: 4px solid #ffc107;
}

.ems-practical-dispatcher .ems-assignment-item.completed {
    border-left: 4px solid #28a745;
}

.ems-practical-dispatcher .ems-assignment-team {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

.ems-practical-dispatcher .ems-assignment-scenario {
    font-size: 14px;
    color: #495057;
    margin-bottom: 4px;
}

.ems-practical-dispatcher .ems-assignment-time {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 8px;
}

.ems-practical-dispatcher .ems-assignment-actions {
    display: flex;
    gap: 6px;
}

.ems-practical-dispatcher .ems-complete-btn,
.ems-practical-dispatcher .ems-recall-btn {
    padding: 4px 8px;
    font-size: 11px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ems-practical-dispatcher .ems-complete-btn {
    background: #28a745;
    color: white;
}

.ems-practical-dispatcher .ems-complete-btn:hover {
    background: #218838;
}

.ems-practical-dispatcher .ems-recall-btn {
    background: #dc3545;
    color: white;
}

.ems-practical-dispatcher .ems-recall-btn:hover {
    background: #c82333;
}

/* History Items */
.ems-practical-dispatcher .ems-history-item {
    padding: 10px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #007bff;
    font-size: 13px;
}

.ems-practical-dispatcher .ems-history-item.completed {
    border-left-color: #28a745;
}

.ems-practical-dispatcher .ems-history-item.cancelled {
    border-left-color: #dc3545;
}

.ems-practical-dispatcher .ems-history-item.active {
    border-left-color: #ffc107;
}

.ems-practical-dispatcher .ems-history-team {
    font-weight: 600;
    color: #2c3e50;
}

.ems-practical-dispatcher .ems-history-scenario {
    color: #6c757d;
    margin: 2px 0;
}

.ems-practical-dispatcher .ems-history-time {
    font-size: 11px;
    color: #6c757d;
    margin-top: 4px;
}

/* Modal */
.ems-practical-dispatcher .ems-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.ems-practical-dispatcher .ems-modal-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.ems-practical-dispatcher .ems-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ems-practical-dispatcher .ems-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.ems-practical-dispatcher .ems-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
}

.ems-practical-dispatcher .ems-modal-body {
    padding: 20px;
}

.ems-practical-dispatcher .ems-form-group {
    margin-bottom: 20px;
}

.ems-practical-dispatcher .ems-form-group label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.ems-practical-dispatcher .ems-selected-team {
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    font-weight: 600;
    color: #2c3e50;
}

.ems-practical-dispatcher .ems-scenario-options {
    max-height: 200px;
    overflow-y: auto;
}

.ems-practical-dispatcher .ems-scenario-option {
    padding: 10px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ems-practical-dispatcher .ems-scenario-option:hover {
    background: #e9ecef;
    border-color: #007bff;
}

.ems-practical-dispatcher .ems-scenario-option.selected {
    background: #e3f2fd;
    border-color: #007bff;
}

.ems-practical-dispatcher .ems-scenario-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

.ems-practical-dispatcher .ems-scenario-location {
    font-size: 12px;
    color: #6c757d;
}

.ems-practical-dispatcher .ems-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.ems-practical-dispatcher .ems-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.ems-practical-dispatcher .ems-btn-primary {
    background: #007bff;
    color: white;
}

.ems-practical-dispatcher .ems-btn-primary:hover {
    background: #0056b3;
}

.ems-practical-dispatcher .ems-btn-secondary {
    background: #6c757d;
    color: white;
}

.ems-practical-dispatcher .ems-btn-secondary:hover {
    background: #545b62;
}

/* Loading and Empty States */
.ems-practical-dispatcher .ems-loading {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-style: italic;
}

.ems-practical-dispatcher .ems-no-assignments,
.ems-practical-dispatcher .ems-no-teams,
.ems-practical-dispatcher .ems-no-scenarios {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .ems-practical-dispatcher .ems-dispatcher-content {
        flex-direction: column;
        height: auto;
    }
    
    .ems-practical-dispatcher .ems-left-panel,
    .ems-practical-dispatcher .ems-right-panel {
        width: 100%;
        flex-direction: row;
    }
    
    .ems-practical-dispatcher .ems-center-panel {
        height: 400px;
    }
}

/* ========================================
   NEW MODERN DISPATCHER LAYOUT
   ======================================== */

/* New Modern Dispatcher Layout - WordPress Page Compatible */
.ems-new-dispatcher {
    display: flex;
    flex-direction: column;
    min-height: 80vh;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f172a;
    color: #f8fafc;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    margin: 20px 0;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
}

/* Only hide admin bar when dispatcher is active */
body.ems-dispatcher-active #wpadminbar {
    display: none !important;
}

/* Ensure dispatcher is always visible */
.ems-new-dispatcher {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: #0f172a !important;
    min-height: 100vh !important;
    min-width: 100vw !important;
}

/* Ensure all dispatcher children are visible */
.ems-new-dispatcher * {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Alternative approach for browsers without :has() support */
.ems-new-dispatcher {
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure page content doesn't interfere with dispatcher */
body.ems-dispatcher-active {
    overflow-x: hidden;
}

/* Fallback for browsers without :has() support */
.ems-new-dispatcher {
    margin: 0 !important;
    padding: 0 !important;
}

/* Navigation Bar */
.ems-new-dispatcher .ems-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    background: #1e293b;
    border-bottom: 1px solid #334155;
    padding: 0 24px;
    flex-shrink: 0;
}

.ems-new-dispatcher .ems-nav-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.ems-new-dispatcher .ems-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ems-new-dispatcher .ems-logo-icon {
    font-size: 24px;
}

.ems-new-dispatcher .ems-logo-text {
    font-size: 20px;
    font-weight: 700;
    color: #f8fafc;
}

.ems-new-dispatcher .ems-event-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ems-new-dispatcher .ems-event-name {
    font-size: 16px;
    font-weight: 600;
    color: #f8fafc;
}

.ems-new-dispatcher .ems-event-status {
    font-size: 12px;
    color: #10b981;
    text-transform: uppercase;
    font-weight: 500;
}

.ems-new-dispatcher .ems-nav-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.ems-new-dispatcher .ems-quick-stats {
    display: flex;
    gap: 32px;
}

.ems-new-dispatcher .ems-stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: #334155;
    border-radius: 12px;
    border: 1px solid #475569;
}

.ems-new-dispatcher .ems-stat-icon {
    font-size: 20px;
}

.ems-new-dispatcher .ems-stat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ems-new-dispatcher .ems-stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1;
}

.ems-new-dispatcher .ems-stat-label {
    font-size: 12px;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 500;
}

.ems-new-dispatcher .ems-nav-right {
    display: flex;
    gap: 12px;
}

.ems-new-dispatcher .ems-nav-btn {
    width: 44px;
    height: 44px;
    border: 1px solid #475569;
    background: #334155;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ems-new-dispatcher .ems-nav-btn:hover {
    background: #475569;
    border-color: #64748b;
}

.ems-new-dispatcher .ems-btn-icon {
    font-size: 18px;
}

/* Main Dashboard */
.ems-new-dispatcher .ems-dashboard {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Sidebar */
.ems-new-dispatcher .ems-sidebar {
    width: 320px;
    background: #1e293b;
    border-right: 1px solid #334155;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.ems-new-dispatcher .ems-sidebar-section {
    padding: 24px;
    border-bottom: 1px solid #334155;
}

.ems-new-dispatcher .ems-sidebar-section:last-child {
    border-bottom: none;
}

.ems-new-dispatcher .ems-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.ems-new-dispatcher .ems-section-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #f8fafc;
    margin: 0;
}

.ems-new-dispatcher .ems-section-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #475569;
    background: #334155;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.ems-new-dispatcher .ems-section-btn:hover {
    background: #475569;
}

/* Teams Grid */
.ems-new-dispatcher .ems-teams-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ems-new-dispatcher .ems-team-card {
    padding: 16px;
    background: #334155;
    border: 1px solid #475569;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.ems-new-dispatcher .ems-team-card:hover {
    background: #475569;
    border-color: #64748b;
}

.ems-new-dispatcher .ems-team-card.free {
    border-left: 4px solid #10b981;
}

.ems-new-dispatcher .ems-team-card.occupied {
    border-left: 4px solid #f59e0b;
}

.ems-new-dispatcher .ems-team-card.reset {
    border-left: 4px solid #06b6d4;
}

.ems-new-dispatcher .ems-team-card.break {
    border-left: 4px solid #8b5cf6;
}

.ems-new-dispatcher .ems-team-name {
    font-size: 16px;
    font-weight: 600;
    color: #f8fafc;
    margin-bottom: 4px;
}

.ems-new-dispatcher .ems-team-status {
    font-size: 12px;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 500;
}

.ems-new-dispatcher .ems-team-actions {
    position: absolute;
    top: 12px;
    right: 12px;
}

.ems-new-dispatcher .ems-assign-btn {
    padding: 6px 12px;
    font-size: 12px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.ems-new-dispatcher .ems-assign-btn:hover {
    background: #2563eb;
}

/* Scenarios Grid */
.ems-new-dispatcher .ems-scenarios-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ems-new-dispatcher .ems-scenario-card {
    padding: 16px;
    background: #334155;
    border: 1px solid #475569;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.ems-new-dispatcher .ems-scenario-card.available {
    border-left: 4px solid #10b981;
}

.ems-new-dispatcher .ems-scenario-card.occupied {
    border-left: 4px solid #f59e0b;
}

.ems-new-dispatcher .ems-scenario-card.completed {
    border-left: 4px solid #6b7280;
}

.ems-new-dispatcher .ems-scenario-name {
    font-size: 16px;
    font-weight: 600;
    color: #f8fafc;
    margin-bottom: 4px;
}

.ems-new-dispatcher .ems-scenario-location {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 4px;
}

.ems-new-dispatcher .ems-scenario-status {
    font-size: 12px;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 500;
}

/* Main Content */
.ems-new-dispatcher .ems-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Map Section */
.ems-new-dispatcher .ems-map-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #1e293b;
    border-bottom: 1px solid #334155;
}

.ems-new-dispatcher .ems-map-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #334155;
}

.ems-new-dispatcher .ems-map-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #f8fafc;
    margin: 0;
}

.ems-new-dispatcher .ems-map-controls {
    display: flex;
    gap: 8px;
}

.ems-new-dispatcher .ems-control-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #475569;
    background: #334155;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

.ems-new-dispatcher .ems-control-btn:hover {
    background: #475569;
}

.ems-new-dispatcher .ems-map-container {
    flex: 1;
    min-height: 500px;
    height: 500px;
}

/* Assignments Section */
.ems-new-dispatcher .ems-assignments-section {
    height: 300px;
    background: #1e293b;
    display: flex;
    flex-direction: column;
}

.ems-new-dispatcher .ems-assignments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #334155;
}

.ems-new-dispatcher .ems-assignments-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #f8fafc;
    margin: 0;
}

.ems-new-dispatcher .ems-assignments-tabs {
    display: flex;
    gap: 4px;
}

.ems-new-dispatcher .ems-tab-btn {
    padding: 8px 16px;
    border: 1px solid #475569;
    background: #334155;
    color: #94a3b8;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.ems-new-dispatcher .ems-tab-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.ems-new-dispatcher .ems-tab-btn:hover:not(.active) {
    background: #475569;
}

.ems-new-dispatcher .ems-tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.ems-new-dispatcher .ems-tab-content:not(.active) {
    display: none;
}

/* Assignment Items */
.ems-new-dispatcher .ems-assignment-item {
    padding: 16px;
    margin-bottom: 12px;
    background: #334155;
    border: 1px solid #475569;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.ems-new-dispatcher .ems-assignment-item.active {
    border-left: 4px solid #f59e0b;
}

.ems-new-dispatcher .ems-assignment-item.completed {
    border-left: 4px solid #10b981;
}

.ems-new-dispatcher .ems-assignment-team {
    font-size: 16px;
    font-weight: 600;
    color: #f8fafc;
    margin-bottom: 4px;
}

.ems-new-dispatcher .ems-assignment-scenario {
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 8px;
}

.ems-new-dispatcher .ems-assignment-time {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 12px;
}

.ems-new-dispatcher .ems-assignment-actions {
    display: flex;
    gap: 8px;
}

.ems-new-dispatcher .ems-complete-btn,
.ems-new-dispatcher .ems-recall-btn {
    padding: 6px 12px;
    font-size: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.ems-new-dispatcher .ems-complete-btn {
    background: #10b981;
    color: white;
}

.ems-new-dispatcher .ems-complete-btn:hover {
    background: #059669;
}

.ems-new-dispatcher .ems-recall-btn {
    background: #ef4444;
    color: white;
}

.ems-new-dispatcher .ems-recall-btn:hover {
    background: #dc2626;
}

/* History Items */
.ems-new-dispatcher .ems-history-item {
    padding: 12px;
    margin-bottom: 8px;
    background: #334155;
    border-radius: 6px;
    border-left: 3px solid #3b82f6;
    font-size: 14px;
}

.ems-new-dispatcher .ems-history-item.completed {
    border-left-color: #10b981;
}

.ems-new-dispatcher .ems-history-item.cancelled {
    border-left-color: #ef4444;
}

.ems-new-dispatcher .ems-history-item.active {
    border-left-color: #f59e0b;
}

.ems-new-dispatcher .ems-history-team {
    font-weight: 600;
    color: #f8fafc;
}

.ems-new-dispatcher .ems-history-scenario {
    color: #94a3b8;
    margin: 2px 0;
}

.ems-new-dispatcher .ems-history-time {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

/* Modal */
.ems-new-dispatcher .ems-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.ems-new-dispatcher .ems-modal {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.ems-new-dispatcher .ems-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid #334155;
}

.ems-new-dispatcher .ems-modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #f8fafc;
    margin: 0;
}

.ems-new-dispatcher .ems-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #334155;
    color: #94a3b8;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ems-new-dispatcher .ems-modal-close:hover {
    background: #475569;
    color: #f8fafc;
}

.ems-new-dispatcher .ems-modal-body {
    padding: 24px;
}

.ems-new-dispatcher .ems-assignment-flow {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ems-new-dispatcher .ems-flow-step {
    opacity: 0.5;
    transition: all 0.3s ease;
}

.ems-new-dispatcher .ems-flow-step.active {
    opacity: 1;
}

.ems-new-dispatcher .ems-step-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.ems-new-dispatcher .ems-step-number {
    width: 32px;
    height: 32px;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.ems-new-dispatcher .ems-step-title {
    font-size: 16px;
    font-weight: 600;
    color: #f8fafc;
}

.ems-new-dispatcher .ems-selected-team {
    padding: 16px;
    background: #334155;
    border: 1px solid #475569;
    border-radius: 8px;
    font-weight: 600;
    color: #f8fafc;
}

.ems-new-dispatcher .ems-scenario-options {
    max-height: 200px;
    overflow-y: auto;
}

.ems-new-dispatcher .ems-scenario-option {
    padding: 16px;
    margin-bottom: 8px;
    background: #334155;
    border: 1px solid #475569;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ems-new-dispatcher .ems-scenario-option:hover {
    background: #475569;
    border-color: #64748b;
}

.ems-new-dispatcher .ems-scenario-option.selected {
    background: #1e40af;
    border-color: #3b82f6;
}

.ems-new-dispatcher .ems-scenario-title {
    font-weight: 600;
    color: #f8fafc;
    margin-bottom: 4px;
}

.ems-new-dispatcher .ems-scenario-location {
    font-size: 12px;
    color: #94a3b8;
}

.ems-new-dispatcher .ems-modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 24px;
    border-top: 1px solid #334155;
}

.ems-new-dispatcher .ems-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

.ems-new-dispatcher .ems-btn-primary {
    background: #3b82f6;
    color: white;
}

.ems-new-dispatcher .ems-btn-primary:hover:not(:disabled) {
    background: #2563eb;
}

.ems-new-dispatcher .ems-btn-primary:disabled {
    background: #475569;
    color: #64748b;
    cursor: not-allowed;
}

.ems-new-dispatcher .ems-btn-secondary {
    background: #475569;
    color: #f8fafc;
}

.ems-new-dispatcher .ems-btn-secondary:hover {
    background: #64748b;
}

/* Toast */
.ems-new-dispatcher .ems-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 16px 20px;
    z-index: 10001;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.ems-new-dispatcher .ems-toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ems-new-dispatcher .ems-toast-icon {
    font-size: 20px;
}

.ems-new-dispatcher .ems-toast-message {
    color: #f8fafc;
    font-weight: 500;
}

/* Loading States */
.ems-new-dispatcher .ems-loading {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .ems-new-dispatcher .ems-sidebar {
        width: 280px;
    }
    
    .ems-new-dispatcher .ems-quick-stats {
        gap: 16px;
    }
    
    .ems-new-dispatcher .ems-stat-card {
        padding: 8px 12px;
    }
}

@media (max-width: 768px) {
    .ems-new-dispatcher .ems-dashboard {
        flex-direction: column;
    }
    
    .ems-new-dispatcher .ems-sidebar {
        width: 100%;
        height: 200px;
        flex-direction: row;
        overflow-x: auto;
    }
    
    .ems-new-dispatcher .ems-sidebar-section {
        min-width: 280px;
        border-right: 1px solid #334155;
        border-bottom: none;
    }
    
    .ems-new-dispatcher .ems-assignments-section {
        height: 250px;
    }
}

.ems-modern-dispatcher .ems-complete-btn {
    background: #28a745;
    color: white;
}

.ems-modern-dispatcher .ems-complete-btn:hover {
    background: #218838;
}

.ems-modern-dispatcher .ems-recall-btn {
    background: #dc3545;
    color: white;
}

.ems-modern-dispatcher .ems-recall-btn:hover {
    background: #c82333;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .ems-modern-dispatcher .ems-content-area {
        flex-direction: column;
    }
    
    .ems-modern-dispatcher .ems-assignments-panel {
        width: 100%;
        height: 300px;
    }
    
    .ems-modern-dispatcher .ems-map-panel {
        height: 400px;
    }
}

/* Legacy Dispatcher Layout (for backward compatibility) */
.ems-dispatcher-layout {
    max-width: 1400px;
}

.ems-dispatcher-layout .ems-console-content {
    display: flex;
    gap: 20px;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

.ems-dispatcher-layout .ems-console-grid {
    display: none;
}

.ems-dispatcher-layout .ems-map-container {
    flex: 2;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ems-dispatcher-layout .ems-map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    flex-shrink: 0;
}

.ems-dispatcher-layout .ems-map-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.ems-dispatcher-layout .ems-map-controls {
    display: flex;
    gap: 10px;
}

.ems-dispatcher-layout .ems-map {
    flex: 1;
    min-height: 400px;
    border-radius: 0 0 8px 8px;
}

.ems-dispatcher-layout .ems-sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 350px;
}

.ems-dispatcher-layout .ems-console-section {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ems-dispatcher-layout .ems-console-section h3 {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 6px;
    flex-shrink: 0;
}

.ems-dispatcher-layout .ems-teams-list,
.ems-dispatcher-layout .ems-scenarios-list,
.ems-dispatcher-layout .ems-assignments-list,
.ems-dispatcher-layout .ems-history-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Compact team and scenario items for sidebar */
.ems-dispatcher-layout .ems-team-item,
.ems-dispatcher-layout .ems-scenario-item {
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 4px;
    font-size: 14px;
}

.ems-dispatcher-layout .ems-team-name,
.ems-dispatcher-layout .ems-scenario-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.ems-dispatcher-layout .ems-team-status,
.ems-dispatcher-layout .ems-scenario-status {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
}

/* History items */
.ems-history-item {
    padding: 10px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #0073aa;
    font-size: 13px;
}

.ems-history-item.completed {
    border-left-color: #28a745;
}

.ems-history-item.cancelled {
    border-left-color: #dc3545;
}

.ems-history-item.active {
    border-left-color: #ffc107;
}

.ems-history-team {
    font-weight: 600;
    color: #2c3e50;
}

.ems-history-scenario {
    color: #6c757d;
    margin: 2px 0;
}

.ems-history-time {
    font-size: 11px;
    color: #6c757d;
    margin-top: 4px;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .ems-dispatcher-layout .ems-console-content {
        flex-direction: column;
        height: auto;
    }
    
    .ems-dispatcher-layout .ems-sidebar {
        max-width: none;
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .ems-dispatcher-layout .ems-console-section {
        flex: 1;
        min-width: 300px;
    }
}