:root {
  --topbar-h: 56px;

  /* Цвета — спокойная светлая тема */
  --bg: #f8f9fa;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #212529;
  --muted: #6c757d;

  --accent: #4f7cff;
  --accent-contrast: #ffffff;

  --ok: #198754;
  --warn: #cc8a00;
  --danger: #dc3545;
}

/* База */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Roboto Flex", sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* Ссылки и кнопки */
a { color: var(--accent); text-decoration: none; }
.btn {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-contrast);
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
}
.btn.small { padding: 8px 10px; font-size: 14px; }
.btn.secondary { background: #eef2ff; color: #2b3a67; border-color: #dfe6ff; }
.btn.danger { background: var(--danger); color: #fff; }
.leaflet-container {font-family: "Roboto Flex", sans-serif;}
/* Верхняя панель */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { font-weight: 800; color: var(--text); }
.brand > span{
    font-size: 13px;
    margin-left: 5px;
}
.navlinks a, .navlinks .hello { margin-left: 12px; font-size: 14px; color: var(--text); }
.navlinks a:hover { text-decoration: underline; }
.leaflet-tooltip-pane{top:-30px;}
/* Контейнер контента */
.container {
  width: 100%;
  max-width: none;
}

/* Всплывающие уведомления */
.flashes { margin: 8px 0 12px; }
.flash {
  padding: 10px 12px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--border);
  margin-bottom: 8px;
}
.flash.success { border-color: #b7e4c7; background: #e9f7ef; }
.flash.info { border-color: #cfe2ff; background: #eaf2ff; }
.flash.warning, .flash.warn { border-color: #ffe69c; background: #fff7dd; }
.flash.danger { border-color: #f8d7da; background: #fdecef; }

/* Главная: макет карта + фильтр */
.layout {
  display: flex;
  gap: 0;
  height: calc(100vh - var(--topbar-h));
}

.sidebar {
  width: 320px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px;
  overflow-y: auto;
}
.sidebar-title { margin: 0 0 10px; }
.field { margin: 12px 0; display: flex; flex-direction: column; gap: 6px; }
.input, input[type="text"], input[type="range"], select, textarea {
  padding: 5px 6px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
}
.muted { color: var(--muted); font-size: 0.9em; }

/* Карта справа — на всю высоту */
.mapwrap { flex: 1; min-width: 0; }
#map { height: 100%; width:100%}

/* Карточки и списки (прочие страницы) */
.header-row { display: flex; align-items: center; justify-content: space-between; margin: 10px 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.card .title { font-weight: 700; margin-bottom: 6px; }
.line { margin: 4px 0; }
.actions { margin-top: 10px; }

/* Popup карты */
.popup .title { font-weight: 700; margin-bottom: 6px; }
.popup .line.ok { color: var(--ok); }
.popup .line.warn { color: var(--warn); }

/* Улучшения форм */
label { font-weight: 600; }

.listings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.listing-card {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.listing-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
}

.listing-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.listing-title {
  font-weight: 600;
}

.listing-price {
  color: var(--ok);
}

.listing-status.ok { color: var(--ok); }
.listing-status.warn { color: var(--warn); }
.listing-address{
    font-size: 14px;
}
.listing-until{
    font-size:10px;
    margin-bottom: 7px;
}
.card.inactive {
  opacity: 0.6;
  background: #f5f5f5;
}

.reviews {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.review {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
}
.review-header {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
}
.review-header .rating {
  color: var(--ok);
}
.review-text {
  margin-top: 4px;
  font-size: 14px;
}
.actions {
  display: flex;
  flex-wrap: wrap;           /* перенос на новую строку при нехватке места */
  gap: 8px;                  /* расстояние между кнопками */
  justify-content: space-between; /* равномерное распределение */
  margin-top: 10px;
}

.actions form {
  display: inline;           /* формы не ломают поток */
}

.btn.small {
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 6px;
}

.btn.danger {
  background: var(--danger);
  color: #fff;
}
.listing-detail {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.listing-header {
  display: flex;
  align-items: center;
  gap: 20px;
}

.listing-image {
  max-width: 300px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.listing-info {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.status.ok {
  color: var(--ok);
  font-weight: 600;
}
.status.warn {
  color: var(--warn);
  font-weight: 600;
}

.reserve-form {
  margin-top: 16px;
}

.map-box {
  height: 350px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.reviews {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.review {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}

.review-header {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 14px;
}

.review-text {
  margin-top: 6px;
  font-size: 14px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(90deg, #ff6b35, #ff9f1c);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
}

.topbar .brand {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.5px;
}

.topbar .navlinks {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar .navlinks a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.topbar .navlinks a:hover {
  background: rgba(255,255,255,0.15);
}

.topbar .hello {
  font-size: 0.95rem;
  opacity: 0.9;
  margin-right: 8px;
}

.topbar .logout {
  background: rgba(255,255,255,0.15);
}

.topbar .register {
  background: rgba(255,255,255,0.15);
}


.layout {
  display: flex;
  gap: 20px;
  padding: 20px;
}

.sidebar {
  flex: 0 0 300px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #ddd);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border, #ccc);
  border-radius: 6px;
  font-size: 14px;
}

.btn {
  display: inline-block;
  background: linear-gradient(90deg, #ff6b35, #ff9f1c);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s ease;
}

.btn:hover {
  background: linear-gradient(90deg, #ff7f50, #ffb347);
}

.muted {
  font-size: 13px;
  color: #666;
}

.listings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.listing-card {
  display: flex;
  gap: 10px;
  background: #fafafa;
  border: 1px solid var(--border, #ddd);
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.listing-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.listing-img {
  width: 80px;
  height: auto;
  object-fit: cover;
}

.listing-info {
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.mapwrap {
  flex: 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border, #ddd);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

#map {
  width: 100%;
}

/* Для браузеров на WebKit (Chrome, Edge, Safari, Opera) */
::-webkit-scrollbar {
  width: 5px;               /* ширина вертикального скролла */
  height: 5px;              /* высота горизонтального скролла */
}

::-webkit-scrollbar-track {
  background: #f0f0f0;       /* фон трека */
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #ff6b35, #ff9f1c); /* фирменный градиент */
  border-radius: 5px;
  border: 2px solid #f0f0f0; /* зазор между треком и ползунком */
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #ff7f50, #ffb347);
}

/* Для Firefox */
* {
  scrollbar-width: thin; /* тонкий скролл */
  scrollbar-color: #ff6b35 #f0f0f0; /* цвет ползунка и трека */
}

.muted {
margin-top: 0px;
}