body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f1f5f9;
    color: #333;
}

/* Sidebar */

.sidebar {
    width: 220px;
    height: 100vh;
    background: #1e293b;
    position: fixed;
    top: 0;
    left: 0;
    padding: 20px;
}

.sidebar h2 {
    color: white;
    margin-bottom: 30px;
}

.sidebar a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 5px;
}

.sidebar a:hover {
    background: #334155;
}

/* Main area */

.main {
    margin-left: 260px;
    padding: 30px;
}

h1 {
    color: #1e293b;
}

/* Dashboard cards */

.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 25px;
}

.card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px #00000010;
}

.card h3 {
    color: #64748b;
}

.card h1 {
    color: #2563eb;
    font-size: 35px;
}

/* Panels */

.panel {
    background: white;
    padding: 20px;
    margin-top: 25px;
    border-radius: 10px;
}

/* Forms */

input,
select {
    padding: 12px;
    margin: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

/* Buttons */

button {
    background: #2563eb;
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 5px;
    cursor: pointer;
}

button:hover {
    background: #1d4ed8;
}

/* Tables */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

th {
    background: #e2e8f0;
}

/* Login page */

.login-container {
    width: 350px;
    margin: 100px auto;
    padding: 30px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 15px #00000015;
}

.login-container input {
    display: block;
    width: 90%;
}

.login-container button {
    width: 100%;
    margin-top: 15px;
}

@media screen and (max-width: 900px) {
    .cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 600px) {
    .sidebar {
        position: relative;
        width: auto;
        height: auto;
    }

    .main {
        margin-left: 0;
    }

    .cards {
        grid-template-columns: 1fr;
    }
}
/* Live status */

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: bold;
}

.badge.online {
    background: #dcfce7;
    color: #166534;
}

.badge.offline {
    background: #e2e8f0;
    color: #475569;
}

.nav-count {
    background: #dc2626;
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 12px;
    margin-left: 4px;
}

.nav-count:empty {
    display: none;
}

.live-banner {
    display: none;
    position: fixed;
    top: 16px;
    right: 16px;
    left: 16px;
    max-width: 480px;
    margin-left: auto;
    padding: 14px 18px;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    text-decoration: none;
    box-shadow: 0 4px 14px #00000030;
    z-index: 100;
}

.live-banner.urgent {
    background: #dc2626;
}

.live-banner.warning {
    background: #d97706;
}

.device-key {
    font-family: Consolas, monospace;
    font-size: 13px;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
}

.table-scroll {
    overflow-x: auto;
}

/* Emergency contacts on alerts */

.missing {
    color: #b91c1c;
    font-weight: bold;
}

.alert-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.alert-card {
    background: white;
    border-radius: 10px;
    padding: 18px;
    border-left: 6px solid #d97706;
    box-shadow: 0 2px 8px #00000010;
}

.alert-card.urgent {
    border-left-color: #dc2626;
}

.alert-card-head {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 18px;
}

.alert-card-head span {
    font-size: 13px;
    color: #64748b;
}

.alert-card-people {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 12px 0;
}

.alert-card-people h4 {
    margin: 0 0 4px;
    color: #64748b;
    font-size: 13px;
    text-transform: uppercase;
}

.alert-card-people p {
    margin: 0 0 8px;
}

.contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.contact-actions a {
    color: white;
    text-decoration: none;
    padding: 7px 12px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
}

.btn-call { background: #16a34a; }
.btn-sms  { background: #2563eb; }
.btn-wa   { background: #059669; }

.live-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    align-items: center;
}

.live-banner-actions a {
    color: white;
    background: #00000030;
    padding: 6px 10px;
    border-radius: 5px;
    text-decoration: none;
}

.live-banner-actions button {
    background: #00000030;
    padding: 6px 10px;
}

@media screen and (max-width: 600px) {
    .alert-card-people {
        grid-template-columns: 1fr;
    }
}
