@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

:root {
    --bg-primary: #0A0118;
    --bg-secondary: #1A0B2E;
    --bg-tertiary: #2A1540;
    --border-color: rgba(124, 58, 237, 0.2);
    --text-primary: #FFFFFF;
    --text-secondary: #E2E8F0;
    --text-muted: #CBD5E1;
    --accent-primary: #7C3AED;
    --accent-hover: #6D28D9;
    --accent-active: #5B21B6;
    --gold: #F59E0B;
    --gold-light: #FCD34D;
    --gold-dark: #D97706;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #F43F5E;
    --glass-bg: rgba(26, 11, 46, 0.7);
    --glass-border: rgba(139, 92, 246, 0.15);
    --purple-glow: rgba(124, 58, 237, 0.4);
    --gold-glow: rgba(245, 158, 11, 0.3);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: linear-gradient(180deg, #0A0118 0%, #1A0B2E 100%);
    color: var(--text-primary);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    right: 0;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.top-nav {
    background: rgba(10, 1, 24, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4), 0 0 40px rgba(124, 58, 237, 0.1);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 18px;
    letter-spacing: -0.02em;
}

.logo svg {
    color: var(--gold);
    filter: drop-shadow(0 0 12px var(--gold-glow));
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--text-muted);
    box-shadow: 0 0 0 2px rgba(100, 116, 139, 0.2);
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.status-indicator.online {
    background-color: var(--success);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3), 0 0 12px rgba(16, 185, 129, 0.5);
}

.status-indicator.offline {
    background-color: var(--danger);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.main-container {
    display: flex;
    margin-top: 60px;
    height: calc(100vh - 60px);
    position: relative;
    z-index: 1;
}

.sidebar {
    width: 250px;
    background: rgba(10, 1, 24, 0.9);
    backdrop-filter: blur(16px);
    border-right: 1px solid rgba(139, 92, 246, 0.2);
    padding: 28px 0;
    overflow-y: auto;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.nav-item svg {
    flex-shrink: 0;
    opacity: 0.8;
    transition: all 0.2s;
}

.nav-item:hover {
    background: rgba(124, 58, 237, 0.15);
    color: var(--text-primary);
    transform: translateX(2px);
}

.nav-item:hover svg {
    opacity: 1;
    color: var(--gold-light);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 4px 16px var(--purple-glow);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background: linear-gradient(180deg, var(--gold) 0%, var(--gold-light) 100%);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 12px var(--gold-glow);
}

.nav-item.active svg {
    opacity: 1;
}

.content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    background: var(--bg-primary);
}

.view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

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

.page-title {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 36px;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: rgba(26, 11, 46, 0.8);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 16px;
    padding: 28px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.3), 0 4px 8px -2px rgba(0, 0, 0, 0.2);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary) 0%, var(--gold) 100%);
    opacity: 1;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 16px 32px -8px rgba(124, 58, 237, 0.25), 0 8px 16px -4px rgba(0, 0, 0, 0.3);
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-value {
    font-size: 48px;
    font-weight: 800;
    color: #FFFFFF !important;
    line-height: 1;
    transition: all 0.3s;
    letter-spacing: -0.02em;
}

.card {
    background: rgba(26, 11, 46, 0.7);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 16px;
    margin-bottom: 28px;
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.3), 0 4px 8px -2px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(139, 92, 246, 0.35);
    box-shadow: 0 12px 24px -4px rgba(124, 58, 237, 0.2), 0 8px 16px -4px rgba(0, 0, 0, 0.3);
}

.card-header {
    padding: 24px 28px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 1, 24, 0.5);
}

.card-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.card-body {
    padding: 28px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: #0A0118;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px var(--gold-glow);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.4s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 24px var(--gold-glow), 0 0 32px rgba(245, 158, 11, 0.2);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 4px 16px var(--gold-glow);
}

.table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    background: rgba(10, 1, 24, 0.4);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: rgba(10, 1, 24, 0.7);
    backdrop-filter: blur(12px);
}

th {
    text-align: left;
    padding: 16px 20px;
    font-weight: 700;
    color: var(--primary-light);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 2px solid rgba(139, 92, 246, 0.3);
}

td {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    font-size: 14px;
    color: var(--text-secondary);
}

tbody tr {
    transition: all 0.3s;
}

tbody tr:hover {
    background: rgba(124, 58, 237, 0.08);
    transform: scale(1.005);
}

tbody tr:last-child td {
    border-bottom: none;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-online {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-online::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

.badge-offline {
    background: rgba(100, 116, 139, 0.15);
    color: var(--text-muted);
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.badge-offline::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    background: rgba(10, 1, 24, 0.7);
    border: 2px solid rgba(139, 92, 246, 0.2);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s;
    font-weight: 500;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15), 0 4px 12px rgba(124, 58, 237, 0.2);
    background: rgba(10, 1, 24, 0.9);
    transform: translateY(-1px);
}

.code-input {
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Courier New', monospace;
    resize: vertical;
    font-size: 13px;
    line-height: 1.6;
}

.logs-container {
    max-height: 600px;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 16px;
}

.log-entry {
    padding: 10px 12px;
    margin-bottom: 6px;
    border-left: 3px solid var(--glass-border);
    border-radius: 0 6px 6px 0;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Courier New', monospace;
    font-size: 12px;
    background: rgba(15, 23, 42, 0.3);
    transition: all 0.2s;
}

.log-entry:hover {
    background: rgba(15, 23, 42, 0.6);
}

.log-entry.telemetry {
    border-left-color: var(--accent-primary);
}

.log-entry.mission_sent {
    border-left-color: var(--success);
}

.log-entry.error {
    border-left-color: var(--danger);
}

.log-entry.connection {
    border-left-color: var(--warning);
}

.log-timestamp {
    color: var(--text-muted);
    margin-right: 12px;
}

.log-robot {
    color: var(--accent-primary);
    margin-right: 12px;
    font-weight: 600;
}

.log-type {
    color: var(--success);
    margin-right: 12px;
    text-transform: uppercase;
    font-size: 10px;
    font-weight: 700;
}

.log-message {
    color: var(--text-secondary);
}

.info-box {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 24px;
    margin-top: 24px;
}

.info-box h3 {
    color: var(--accent-primary);
    margin-bottom: 12px;
    font-weight: 600;
}

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

.text-muted {
    color: var(--text-muted);
    font-size: 13px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 24px;
    opacity: 0.2;
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 8px;
}

.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    min-width: 320px;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
    backdrop-filter: blur(12px);
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast-icon {
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
}

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

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(14, 165, 233, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-primary);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 5px;
    transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}

@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

.alerts-badge {
    position: relative;
    padding: 8px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.alerts-badge:hover {
    background: rgba(14, 165, 233, 0.1);
    border-color: var(--accent-primary);
}

.badge-count {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.alerts-panel {
    position: fixed;
    top: 70px;
    right: 24px;
    width: 380px;
    max-height: 500px;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
    z-index: 999;
    overflow-y: auto;
    display: none;
    animation: slideDown 0.3s ease;
}

.alerts-panel.show {
    display: block;
}

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

.alert-item {
    padding: 16px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    gap: 12px;
    transition: background 0.2s;
}

.alert-item:hover {
    background: rgba(148, 163, 184, 0.05);
}

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

.alert-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-icon.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.alert-icon.danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.alert-icon.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.alert-message {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.alert-time {
    font-size: 11px;
    color: var(--text-muted);
}

#fleetMap {
    border-radius: 0 0 12px 12px;
    z-index: 1;
}

.leaflet-container {
    background: var(--bg-primary);
}

.leaflet-popup-content-wrapper {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.leaflet-popup-tip {
    background: var(--bg-secondary);
}

.robot-popup {
    min-width: 200px;
}

.robot-popup h4 {
    color: var(--accent-primary);
    margin-bottom: 8px;
    font-size: 16px;
}

.robot-popup p {
    font-size: 13px;
    margin: 4px 0;
    color: var(--text-secondary);
}

.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.health-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.health-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.health-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-primary);
    margin-top: 4px;
}

.template-btn {
    padding: 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
    text-align: left;
}

.template-btn:hover {
    background: rgba(14, 165, 233, 0.1);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.template-btn i {
    color: var(--accent-primary);
    flex-shrink: 0;
}

.template-btn strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
}

.template-btn p {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

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

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

.modal-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--glass-bg);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.modal-section {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
}

.modal-section h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-primary);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

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

.info-row span:first-child {
    color: var(--text-muted);
    font-size: 13px;
}

.info-row strong {
    color: var(--text-primary);
    font-size: 14px;
}

.telemetry-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.telemetry-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 8px;
}

.telemetry-item i {
    color: var(--accent-primary);
}

.telemetry-item div span {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.telemetry-item div strong {
    display: block;
    font-size: 16px;
    color: var(--text-primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

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

.btn-secondary:hover {
    background: rgba(148, 163, 184, 0.15);
    border-color: var(--text-muted);
}

@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
    
    .alerts-panel {
        width: 320px;
        right: 12px;
    }
}

@media (max-width: 768px) {
    .content {
        padding: 20px;
    }
    
    .page-title {
        font-size: 24px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
    
    .alerts-panel {
        width: calc(100% - 24px);
        right: 12px;
    }
}

.btn-control {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.btn-control:hover {
    background: rgba(14, 165, 233, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-1px);
}

.btn-control:active {
    transform: translateY(0);
    background: rgba(14, 165, 233, 0.2);
}

.control-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
}

.sim-status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.sim-status-badge .status-indicator {
    width: 8px;
    height: 8px;
}

#webots-view {
    display: none;
}

#webots-view.connected {
    display: block;
}

#simPlaceholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

#simPlaceholder.hidden {
    display: none;
}

.robot-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.9));
    border: 1px solid rgba(71, 85, 105, 0.4);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.robot-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(139, 92, 246, 0.2));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s;
}

.robot-card:hover::before {
    opacity: 1;
}

.robot-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 20px 60px rgba(59, 130, 246, 0.35), 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.robot-card-img {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: #0f172a;
    position: relative;
    overflow: hidden;
}

.robot-card-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(15, 23, 42, 0.8) 100%);
}

.robot-card-img i {
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}

.robot-card-content {
    padding: 20px;
}

.robot-card-content h3 {
    margin: 0 0 10px 0;
    font-size: 19px;
    color: #f1f5f9;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.robot-card-content p {
    margin: 0 0 18px 0;
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.6;
    min-height: 42px;
}

.robot-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid rgba(71, 85, 105, 0.4);
}

.robot-type {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    letter-spacing: 0.5px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(59, 130, 246, 0.2);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

webots-view {
    display: block;
    width: 100%;
    height: 100%;
}

/* Fleet Type Cards */
.fleet-type-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.9));
    border: 1px solid rgba(71, 85, 105, 0.4);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.fleet-type-card:hover {
    transform: translateY(-4px);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 12px 40px rgba(59, 130, 246, 0.25);
}

.fleet-type-header {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.fleet-type-header i {
    color: rgba(255, 255, 255, 0.95);
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.fleet-type-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(15, 23, 42, 0.5) 100%);
}

.fleet-type-content {
    padding: 20px;
}

.fleet-type-content h3 {
    font-size: 18px;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 6px 0;
    letter-spacing: -0.02em;
}

.fleet-type-category {
    font-size: 12px;
    color: #3b82f6;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 12px 0;
}

.fleet-type-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.6;
    margin: 0 0 18px 0;
    min-height: 40px;
}

.fleet-type-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px 0;
    border-top: 1px solid rgba(71, 85, 105, 0.3);
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
    margin-bottom: 18px;
}

.fleet-stat {
    text-align: center;
}

.fleet-stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 4px;
}

.fleet-stat-label {
    display: block;
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.fleet-type-btn {
    width: 100%;
    padding: 12px 18px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.1));
    border: 1.5px solid rgba(59, 130, 246, 0.4);
    border-radius: 10px;
    color: #60a5fa;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.fleet-type-btn:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(37, 99, 235, 0.18));
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.fleet-type-btn i {
    display: inline-block;
    vertical-align: middle;
}
