/* Оформление веб-GIS. Цвета объектов карты задаются в js/config.js. */
:root {
    --bg: #f4f6f8;
    --panel-bg: #ffffff;
    --sidebar-bg: #263238;
    --sidebar-fg: #eceff1;
    --muted: #90a4ae;
    --border: #cfd8dc;
    --accent: #1e88e5;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    color: #263238;
    background: var(--bg);
}

.layout { display: flex; height: 100%; }

/* --- Боковая панель ------------------------------------------------- */
.sidebar {
    width: 300px;
    flex: 0 0 300px;
    background: var(--sidebar-bg);
    color: var(--sidebar-fg);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar__header { padding: 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.sidebar__title { font-size: 17px; font-weight: 600; }
.sidebar__subtitle { margin-top: 4px; font-size: 12px; color: var(--muted); }

.panel { padding: 14px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.panel--footer { margin-top: auto; border-bottom: none; }

.panel__title {
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.panel__title--sub { margin-top: 16px; }

/* --- Чекбоксы слоёв -------------------------------------------------- */
.check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    cursor: pointer;
    user-select: none;
}
.check input { cursor: pointer; margin: 0; }
.check--compact { font-size: 12px; color: var(--muted); margin-top: 8px; }

.swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex: 0 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.35);
}
.swatch--line { height: 4px; border-radius: 2px; border: none; }
.swatch--land { background: #90a4ae; border-style: dashed; }
.swatch--building { background: #78909c; }

/* --- Карточка объекта ------------------------------------------------ */
.card {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    padding: 12px;
    font-size: 13px;
}
.card--empty { color: var(--muted); font-size: 12px; }
.card__title { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.card__subtitle { font-size: 11px; color: var(--muted); text-transform: uppercase;
                  letter-spacing: 0.06em; margin-bottom: 8px; }
.card__rows { display: flex; flex-direction: column; gap: 4px; }
.card__row { display: flex; justify-content: space-between; gap: 12px; }
.card__key { color: var(--muted); }
.card__val { text-align: right; font-weight: 500; }

/* Та же карточка внутри popup Leaflet — на светлом фоне */
.leaflet-popup-content .card__key { color: #78909c; }
.leaflet-popup-content .card__title { font-size: 15px; font-weight: 600; color: #263238; }
.leaflet-popup-content .card__subtitle { font-size: 11px; color: #90a4ae;
    text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.leaflet-popup-content .card__rows { display: flex; flex-direction: column; gap: 4px; }
.leaflet-popup-content .card__row { display: flex; justify-content: space-between; gap: 16px; }
.leaflet-popup-content .card__val { text-align: right; font-weight: 500; }

/* --- Кнопки и статус -------------------------------------------------- */
.btn {
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}
.btn:hover { background: #1976d2; }

.status { margin-top: 8px; font-size: 11px; color: var(--muted); min-height: 14px; }
.status--error { color: #ef9a9a; }

/* --- Карта ------------------------------------------------------------ */
.map-wrap { flex: 1; position: relative; }
#map { position: absolute; inset: 0; background: #e8eaed; }

@media (max-width: 720px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; flex: 0 0 auto; max-height: 45%; }
    .map-wrap { flex: 1; }
}
