:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --ink: #1f2933;
    --muted: #637083;
    --line: #d9e0e7;
    --brand: #c9342f;
    --brand-dark: #8f2421;
    --green: #197c59;
    --amber: #a65f00;
    --blue: #246b88;
    --shadow: 0 10px 30px rgba(31, 41, 51, .08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.45;
}

a {
    color: var(--brand);
    text-decoration: none;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 420px) 1fr;
}

.auth-panel {
    background: var(--surface);
    padding: 48px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-visual {
    background:
        linear-gradient(rgba(31, 41, 51, .35), rgba(31, 41, 51, .35)),
        url("demo-plano.svg") center/cover no-repeat;
}

.brand-mark {
    font-size: 13px;
    letter-spacing: .08em;
    color: var(--brand);
    font-weight: 700;
    text-transform: uppercase;
}

h1, h2, h3 {
    margin: 0 0 14px;
    line-height: 1.15;
}

h1 {
    font-size: 32px;
}

h2 {
    font-size: 22px;
}

h3 {
    font-size: 16px;
}

p {
    color: var(--muted);
}

.field {
    margin: 14px 0;
}

label {
    display: block;
    margin-bottom: 6px;
    color: var(--ink);
    font-weight: 700;
    font-size: 13px;
}

input, select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 11px 12px;
    color: var(--ink);
    background: #fff;
    font-size: 15px;
}

input[type="checkbox"] {
    width: auto;
}

.button, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 6px;
    padding: 11px 15px;
    min-height: 42px;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.button.secondary {
    background: #eef2f5;
    color: var(--ink);
}

.button.ghost {
    background: transparent;
    color: var(--brand);
    border: 1px solid var(--line);
}

.alert {
    border-radius: 6px;
    padding: 12px 14px;
    margin: 16px 0;
    border: 1px solid var(--line);
    background: #fff;
}

.alert.success {
    border-color: #b8dbc8;
    color: var(--green);
}

.alert.error {
    border-color: #edc2c0;
    color: var(--brand-dark);
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 250px 1fr;
}

.sidebar {
    background: #1f2933;
    color: #fff;
    padding: 24px 18px;
}

.sidebar a {
    color: #eef2f5;
}

.sidebar .nav {
    display: grid;
    gap: 8px;
    margin-top: 26px;
}

.nav a {
    border-radius: 6px;
    padding: 10px 12px;
}

.nav a.active, .nav a:hover {
    background: rgba(255, 255, 255, .12);
}

.main {
    padding: 26px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.grid {
    display: grid;
    gap: 16px;
}

.grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    box-shadow: var(--shadow);
}

.stat {
    font-size: 30px;
    font-weight: 800;
}

.muted {
    color: var(--muted);
}

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

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

th, td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: .04em;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

.badge.red {
    background: var(--brand);
}

.badge.green {
    background: var(--green);
}

.badge.blue {
    background: var(--blue);
}

.map-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 16px;
}

.floor-tabs, .filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.map-stage {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    min-height: 420px;
}

.map-stage img.plan {
    display: block;
    width: 100%;
    height: auto;
}

.map-marker {
    position: absolute;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    border: 3px solid #fff;
    box-shadow: 0 6px 18px rgba(31, 41, 51, .25);
    cursor: pointer;
}

.map-marker.extinguisher {
    background: var(--brand);
}

.map-marker.first_aid {
    background: var(--green);
}

.map-marker.responder {
    background: var(--blue);
}

.responder-list {
    display: grid;
    gap: 10px;
}

.responder-item {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.avatar {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    background: #eef2f5;
}

.admin-section {
    margin-bottom: 18px;
}

@media (max-width: 980px) {
    .app-shell, .auth-page, .map-layout {
        grid-template-columns: 1fr;
    }

    .auth-visual {
        display: none;
    }

    .sidebar {
        position: static;
    }

    .grid.cols-3, .grid.cols-2 {
        grid-template-columns: 1fr;
    }
}

