:root{
  --ink: #2f2f2f;
  --ink-soft: #36342e;
  --muted: rgba(54,52,46,0.65);
  --panel: rgba(255,255,255,0.5);
  --panel-strong: rgba(255,255,255,0.68);
  --panel-border: rgba(255,255,255,0.62);
  --accent: #8f3f45;
  --accent-strong: #a1783f;
  --accent-soft: rgba(177,137,80,0.22);
  --danger: #b23a3a;
  --danger-soft: rgba(178,58,58,0.12);
  --focus: rgba(161,120,63,0.4);
}

*{ box-sizing:border-box; }

/* =====================
   TOPBAR
   ===================== */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 16px;
  margin:10px;
  border-radius:16px;
  background: var(--panel);
  border:1px solid var(--panel-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(60,50,40,0.14);
  position: sticky;
  top: 10px;
  z-index: 5;
}

.topbar-brand{ display:flex; align-items:center; gap:10px; }
.brand-mark{ color: var(--accent-strong); font-size:18px; line-height:1; }
.topbar h1{ margin:0; font-size:18px; color: var(--ink); }

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

/* =====================
   BUTTONS
   ===================== */
button{
  font: inherit;
  cursor: pointer;
  padding:9px 15px;
  border-radius:11px;
  border:1px solid var(--panel-border);
  background: rgba(255,255,255,0.4);
  color: var(--ink);
  transition: transform .15s ease, background .15s ease, border-color .15s ease, opacity .15s ease;
}
button:hover{ transform: translateY(-1px); background: rgba(255,255,255,0.62); }
button:active{ transform: translateY(0); }
button:disabled{ opacity:.45; cursor: not-allowed; transform:none; }
button:focus-visible{ outline: 2px solid var(--focus); outline-offset: 2px; }

.primaryBtn{
  background: var(--accent);
  border-color: rgba(93,40,43,0.42);
  color:#fff;
  font-weight:700;
}
.primaryBtn:hover{ background:#7c3339; }

.ghostBtn{ background: rgba(255,255,255,0.42); }

.dangerBtn{
  border-color: rgba(178,58,58,0.4);
  color: var(--danger);
  background: var(--danger-soft);
}
.dangerBtn:hover{ background: rgba(178,58,58,0.2); }

/* =====================
   LAYOUT
   ===================== */
.wrap{ max-width:1180px; margin:0 auto 60px; padding:0 16px; }

.card{
  background: var(--panel);
  border:1px solid var(--panel-border);
  border-radius:18px;
  padding:18px 20px;
  margin:10px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 35px rgba(60,50,40,0.12);
}

.card h2{
  margin:0 0 4px;
  font-size:17px;
  color: var(--ink);
  display:flex;
  align-items:center;
  gap:8px;
}
.card h2::before{
  content:"";
  width:6px; height:6px;
  border-radius:999px;
  background: var(--accent-strong);
  display:inline-block;
}

.card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

.controls{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
}
.controls input, .controls select{
  padding:11px 12px;
  border-radius:12px;
  border:1px solid var(--panel-border);
  background: rgba(0,0,0,0.18);
  color: var(--ink);
  min-width:220px;
  flex: 1 1 220px;
}
.controls button{ flex: 0 0 auto; }

input, select, textarea{
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus{
  outline:none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px var(--focus);
}
input::placeholder, textarea::placeholder{ color: rgba(54,52,46,0.45); }

.hint{ color: var(--muted); margin:12px 0 0; font-size:13px; line-height:1.6; }

.grid{
  display:grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap:0;
  margin-top:0;
}
@media (max-width: 900px){
  .grid{ grid-template-columns:1fr; }
}

.status{
  color: var(--muted);
  font-size:12.5px;
  font-variant-numeric: tabular-nums;
}

.badge{
  font-size:11px;
  font-weight:700;
  letter-spacing:.3px;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid transparent;
}
.badge-new{ color:#7c3339; background: rgba(143,63,69,0.14); border-color: rgba(143,63,69,0.3); }
.badge-edit{ color:#4c6b3f; background: rgba(76,107,63,0.14); border-color: rgba(76,107,63,0.3); }

/* =====================
   PLACES LIST
   ===================== */
.list{
  display:flex;
  flex-direction:column;
  gap:8px;
  max-height: 62vh;
  overflow:auto;
  padding-right:4px;
  margin-top:12px;
}

.emptyState{
  margin-top:12px;
  color: var(--muted);
  font-size:13.5px;
  text-align:center;
  padding:18px 10px;
  border:1px dashed var(--panel-border);
  border-radius:14px;
}

.item{
  padding:11px 13px;
  border:1px solid var(--panel-border);
  border-radius:14px;
  background: rgba(255,255,255,0.32);
  cursor:pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.item:hover{ background: rgba(255,255,255,0.58); border-color: rgba(161,120,63,0.4); transform: translateX(2px); }
html[dir="rtl"] .item:hover{ transform: translateX(-2px); }
.item.is-selected{ border-color: var(--accent-strong); background: var(--accent-soft); }

.item .t{ font-weight:700; font-size:14.5px; color: var(--ink); }
.item .s{
  color: var(--muted);
  font-size:12px;
  margin-top:4px;
  display:flex;
  align-items:center;
  gap:6px;
  font-family: "Consolas", monospace;
}
.item .s .typeChip{
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  font-size:11px;
  padding:2px 8px;
  border-radius:999px;
  background: rgba(0,0,0,0.08);
  color: var(--ink-soft);
}

.communityActions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin-top:10px;
}
.communityActions button{
  padding:7px 12px;
  font-size:12.5px;
}

/* =====================
   FORM
   ===================== */
.form{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-top:14px;
}
.form input, .form textarea{
  padding:11px 12px;
  border-radius:12px;
  border:1px solid var(--panel-border);
  background: rgba(0,0,0,0.18);
  color: var(--ink);
  width:100%;
  font-family: inherit;
  resize: vertical;
}
.form label{
  font-size:12px;
  font-weight:600;
  color: var(--ink-soft);
  margin-top:10px;
  letter-spacing:.2px;
}

.row2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
@media (max-width: 560px){
  .row2{ grid-template-columns:1fr; }
}

.form-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:16px;
  padding-top:14px;
  border-top:1px solid var(--panel-border);
}
