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

:root {
    --primary-blue: #1e3a5f;
    --secondary-blue: #2d5986;
    --accent-blue: #4a90e2;
    --dark-bg: #0f1923;
    --panel-bg: #1a2332;
    --border-color: #2a3f5f;
    --text-primary: #e8eef5;
    --text-secondary: #94a3b8;
    --success-green: #22c55e;
    --warning-yellow: #fbbf24;
    --danger-red: #ef4444;
    --unit-bg: #243447;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background: linear-gradient(135deg, #0f1923 0%, #1a2332 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Login Screen */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: 
        radial-gradient(ellipse at top, rgba(74, 144, 226, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(30, 58, 95, 0.2) 0%, transparent 50%),
        var(--dark-bg);
}

.login-box {
    background: linear-gradient(145deg, var(--panel-bg) 0%, rgba(26, 35, 50, 0.95) 100%);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 50px 60px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    max-width: 450px;
    width: 90%;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo {
    font-size: 48px;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 20px rgba(74, 144, 226, 0.5));
}

.login-title {
    font-family: 'Courier Prime', monospace;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--accent-blue);
    text-shadow: 0 0 20px rgba(74, 144, 226, 0.3);
    margin-bottom: 5px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.login-footer {
    margin-top: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger-red);
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 20px;
    color: #fca5a5;
    font-size: 14px;
    text-align: center;
}

.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 8px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(15, 25, 35, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.login-buttons {
    display: flex;
    gap: 12px;
    margin-top: 35px;
}

.btn {
    flex: 1;
    padding: 14px 24px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--secondary-blue) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

/* Main Dispatch Interface */
.dispatch-container {
    display: none;
    min-height: 100vh;
    padding: 20px;
}

.dispatch-header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    padding: 20px 30px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.header-left p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.header-right {
    text-align: right;
}

.shift-time {
    font-size: 20px;
    font-weight: 600;
    color: var(--success-green);
    margin-bottom: 5px;
}

.dispatcher-name {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.dispatch-main {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 20px;
    height: calc(100vh - 180px);
}

/* Units Panel */
.units-panel {
    background: var(--panel-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    overflow-y: auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.panel-header {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent-blue);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.add-unit-form {
    margin-bottom: 20px;
}

.add-unit-form input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(15, 25, 35, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    margin-bottom: 10px;
}

.add-unit-form input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.add-unit-btn {
    width: 100%;
    padding: 10px;
    background: var(--success-green);
    border: none;
    border-radius: 4px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-unit-btn:hover {
    background: #16a34a;
    transform: translateY(-1px);
}

.unit-item {
    background: var(--unit-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: grab;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.unit-item:hover {
    background: rgba(74, 144, 226, 0.15);
    border-color: var(--accent-blue);
    transform: translateX(4px);
}

.unit-item:active {
    cursor: grabbing;
}

.unit-item.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.unit-callsign {
    font-size: 18px;
    font-weight: 700;
    font-family: 'Courier Prime', monospace;
    color: var(--accent-blue);
    margin-bottom: 4px;
}

.unit-status {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Dispatch Board */
.dispatch-board {
    background: var(--panel-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    overflow-y: auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.status-zones {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.status-zone {
    background: rgba(15, 25, 35, 0.5);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 15px;
    min-height: 200px;
    transition: all 0.3s ease;
}

.status-zone.drag-over {
    background: rgba(74, 144, 226, 0.1);
    border-color: var(--accent-blue);
    border-style: solid;
    box-shadow: inset 0 0 20px rgba(74, 144, 226, 0.2);
}

.zone-header {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent-blue);
    margin-bottom: 12px;
    padding: 8px 12px;
    background: rgba(74, 144, 226, 0.1);
    border-radius: 4px;
    border-left: 3px solid var(--accent-blue);
}

.zone-units {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Controls Panel */
.controls-panel {
    background: var(--panel-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    overflow-y: auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.stats-section {
    background: rgba(15, 25, 35, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.stat-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

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

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--accent-blue);
}

.end-shift-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--danger-red) 0%, #dc2626 100%);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.end-shift-btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--panel-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    font-size: 24px;
    font-weight: 700;
    color: var(--danger-red);
    margin-bottom: 20px;
    text-align: center;
}

.modal-body {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 30px;
    text-align: center;
    line-height: 1.6;
}

.modal-buttons {
    display: flex;
    gap: 12px;
}

/* Summary Modal */
.summary-content {
    max-height: 70vh;
    overflow-y: auto;
}

.summary-header {
    text-align: center;
    margin-bottom: 30px;
}

.summary-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--success-green);
    margin-bottom: 10px;
}

.summary-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.summary-stat {
    background: rgba(15, 25, 35, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    text-align: center;
}

.summary-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 8px;
}

.summary-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.summary-text {
    background: rgba(15, 25, 35, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    font-family: 'Courier Prime', monospace;
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-primary);
    white-space: pre-wrap;
    margin-bottom: 20px;
}

.copy-btn {
    width: 100%;
    padding: 12px;
    background: var(--accent-blue);
    border: none;
    border-radius: 4px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.copy-btn:hover {
    background: var(--secondary-blue);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 25, 35, 0.5);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}

.hidden {
    display: none;
}
