:root { --bg: #f4f6f8; --card: #ffffff; --ink: #1c2733; --muted: #66788a; --brand: #0f766e; }
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", Arial, sans-serif; background: var(--bg); color: var(--ink); }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.topbar { background: #0b3b39; color: #fff; padding: 10px 0; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.brand { color: #fff; text-decoration: none; font-weight: bold; font-size: 1.05rem; }
nav { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
nav a { color: #d7efec; text-decoration: none; }
nav a:hover { text-decoration: underline; }
.who { color: #9fd3cd; font-size: 0.9rem; }
.role-switch select { background: #123f3c; color: #d7efec; border: 1px solid #2a5f5a; border-radius: 6px; padding: 4px 6px; font-size: 0.85rem; }
main.wrap { padding-top: 20px; padding-bottom: 40px; }
.card { background: var(--card); border: 1px solid #dde5ea; border-radius: 10px; padding: 16px; margin: 14px 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.meta { color: var(--muted); font-size: 0.85rem; margin: 4px 0 10px; }
.form label { display: block; margin: 10px 0; }
.form input[type=text], .form input[type=email], .form input[type=password],
.form textarea, .form select { width: 100%; max-width: 420px; padding: 8px; border: 1px solid #c3ced6; border-radius: 6px; }
.form textarea { resize: vertical; }
.form .row { display: flex; gap: 12px; flex-wrap: wrap; }
button { background: var(--brand); color: #fff; border: none; border-radius: 6px; padding: 8px 14px; cursor: pointer; }
button:hover { filter: brightness(1.1); }
.inline { display: inline; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.chk { display: inline-flex; gap: 4px; align-items: center; margin-right: 10px; font-size: 0.9rem; }
.table { width: 100%; border-collapse: collapse; background: var(--card); margin: 14px 0; }
.table th, .table td { border: 1px solid #dde5ea; padding: 8px; text-align: left; vertical-align: top; font-size: 0.92rem; }
.table th { background: #eef4f3; }
.alert { background: #fde8e8; border: 1px solid #f3b8b8; color: #8f1d1d; padding: 10px; border-radius: 6px; }
.ok { background: #e6f6ec; border: 1px solid #a9dfba; color: #14532d; padding: 10px; border-radius: 6px; }
.row-blocked { background: #fdf0f0; }
.table input[type=password] { padding: 6px; border: 1px solid #c3ced6; border-radius: 6px; width: 130px; }
.footer { padding: 18px 16px 30px; color: var(--muted); }
code { background: #eef2f4; padding: 1px 5px; border-radius: 4px; }

/* ---- 3D map section (/map) ---- */
.map-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.map-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.map-btn { background: #e7efee; color: #0b3b39; border: 1px solid #bfd4d1; }
.map-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.map-btn.ghost { background: transparent; }
.map-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 800px) { .map-layout { grid-template-columns: 1fr; } }
.map-canvas-wrap { position: relative; padding: 10px; overflow: hidden; }
#building-map { width: 100%; height: 520px; border-radius: 8px; overflow: hidden; background: #ddeeff; }
#building-map canvas { width: 100% !important; height: 100% !important; display: block; touch-action: none; }
.map-loading { position: absolute; top: 22px; left: 50%; transform: translateX(-50%); background: rgba(11,59,57,.9); color: #fff; padding: 8px 16px; border-radius: 20px; font-size: .9rem; pointer-events: none; }
.map-compass { position: absolute; right: 22px; top: 22px; background: rgba(255,255,255,.9); border: 1px solid #bfd4d1; border-radius: 50%; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: bold; color: #0b3b39; pointer-events: none; }
.map-info h3 { margin-top: 0; }
