:root {
    /* Paleta Estilo Médico / Clínico moderno */
    --primary-blue: #0066cc;
    --medical-teal: #009688;
    --light-bg: #f4f7f6;
    --sidebar-bg: #ffffff;
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    --danger-red: #e74c3c;
    --border-color: #e0e6ed;
}

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

body,
html {
    font-family: 'Inter', sans-serif;
    background-color: var(--light-bg);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.02);
    z-index: 10;
}

.logo-area {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.logo-icon {
    font-size: 24px;
    color: var(--danger-red);
}

.logo-area h1 {
    font-size: 18px;
    font-weight: 700;
}

.logo-area h1 span {
    display: block;
    font-size: 12px;
    color: var(--medical-teal);
    font-weight: 500;
}

.main-nav {
    flex-grow: 1;
    padding: 20px 0;
}

.main-nav a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 24px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.3s ease;
}

.main-nav a:hover,
.main-nav a.active {
    background: rgba(0, 150, 136, 0.08);
    color: var(--medical-teal);
    border-right: 4px solid var(--medical-teal);
}

.operator-profile {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar {
    width: 40px;
    height: 40px;
    background: #e8f4f8;
    color: var(--primary-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.operator-profile .info strong {
    display: block;
    font-size: 14px;
}

.operator-profile .info span {
    font-size: 12px;
    color: var(--text-muted);
}

/* MAIN CONTENT */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.top-bar {
    height: 64px;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 5;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--medical-teal);
    background: #e0f2f1;
    padding: 6px 12px;
    border-radius: 20px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #4CAF50;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(76, 175, 80, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--light-bg);
    padding: 8px 15px;
    border-radius: 8px;
    width: 300px;
}

.search-bar i {
    color: var(--text-muted);
    margin-right: 10px;
}

.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-family: inherit;
}

/* MAP */
.map-container {
    flex-grow: 1;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
}

/* CUSTOM MARKERS */
.device-marker {
    width: 16px;
    height: 16px;
    background-color: var(--primary-blue);
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.2s;
}

.device-marker:hover {
    transform: scale(1.2);
}

.device-marker.sos-active {
    background-color: var(--danger-red);
    animation: sos-pulse 1s infinite;
}

@keyframes sos-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(231, 76, 60, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
    }
}

/* SOS OVERLAY */
.sos-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.sos-overlay.hidden {
    display: none;
}

.sos-card {
    background: #fff;
    border-radius: 12px;
    width: 380px;
    box-shadow: 0 10px 30px rgba(231, 76, 60, 0.3);
    border-left: 6px solid var(--danger-red);
    overflow: hidden;
}

.pulse-critical {
    animation: critical-border 2s infinite alternate;
}

@keyframes critical-border {
    0% {
        box-shadow: 0 10px 30px rgba(231, 76, 60, 0.3);
    }

    100% {
        box-shadow: 0 10px 40px rgba(231, 76, 60, 0.6);
    }
}

.sos-header {
    background: var(--danger-red);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sos-header h2 {
    font-size: 16px;
    font-weight: 700;
}

.blink {
    animation: blinker 1s linear infinite;
}

@keyframes blinker {
    50% {
        opacity: 0;
    }
}

.sos-body {
    padding: 20px;
}

.patient-info p {
    margin: 5px 0;
    font-size: 14px;
}

.actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn:hover {
    opacity: 0.9;
}

.btn-primary {
    background: var(--primary-blue);
    color: #fff;
}

.btn-secondary {
    background: #e2e8f0;
    color: var(--text-main);
}