/* مپ نیوز - استایل مشترک: صفحهٔ عمومی و پنل مدیریت */
:root {
  --ink: #0B2239; --ink2: #56697C; --paper: #FFFFFF; --fog: #F3F6F8; --rule: #DCE3EA;
  --red: #E5383B; --sea: #1C7C7D; --gold: #E0A526; --gold-ink: #8F6100; --r: 3px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { font-family: Vazirmatn, Tahoma, sans-serif; font-size: 15px; line-height: 1.75; color: var(--ink); background: var(--fog); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
h2 { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.4; }
.msg { font-size: 13px; color: var(--ink2); }
.msg.err { color: #C62828; }

.brand { display: flex; align-items: center; gap: 10px; text-align: start; }
.brand b { display: block; font-size: 18px; font-weight: 800; line-height: 1.2; }
.brand small { font-size: 12.5px; color: var(--ink2); }
.mark { flex: none; position: relative; width: 34px; height: 34px; border-radius: var(--r); background: var(--ink); }
.mark::after { content: ""; position: absolute; inset: 8px; border: 2px dashed #fff; border-radius: 50%; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--ink); border-radius: var(--r); background: #fff; font-size: 13.5px; font-weight: 700; line-height: 1.4; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.quiet { border-color: var(--rule); }
.btn.bad { color: #C62828; border-color: #F2C4C4; }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }

/* ---------- نقشه و شکل‌ها ---------- */
#map { position: fixed; inset: 0; }
.leaflet-control-zoom { border: 0 !important; box-shadow: none !important; }
.leaflet-control-zoom a { border: 1px solid var(--rule) !important; box-shadow: none !important; color: var(--ink) !important; }
.dot-tip { background: var(--ink) !important; border: 0 !important; border-radius: var(--r) !important; box-shadow: none !important; color: #fff; font-size: 12.5px; max-width: 240px; white-space: normal; }
.dot-tip::before { display: none; }
.lbl { background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; font-size: 13px; font-weight: 700; color: var(--ink); text-shadow: 0 0 3px #fff, 0 0 3px #fff; }
.lbl::before { display: none; }
.pin { background: none !important; border: 0 !important; }
.pin span { display: block; width: 22px; height: 22px; border-radius: 50%; background: var(--red); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--red); }
.ico { display: flex !important; align-items: center; justify-content: center; border: 2px solid var(--ink) !important; border-radius: 50%; background: #fff !important; font-size: 17px; }

.news-popup .leaflet-popup-content-wrapper { border: 1px solid var(--rule); border-radius: var(--r); box-shadow: none; }
.news-popup .leaflet-popup-tip { box-shadow: none; }
.news-popup .leaflet-popup-content { margin: 16px 18px; font-size: 14px; }
.pop h3 { margin: 2px 0 8px; font-size: 16px; font-weight: 800; line-height: 1.5; }
.pop p { margin: 0 0 6px; color: #243446; }
.pop .cat { font-size: 12px; font-weight: 700; color: var(--red); }
.legend, .route { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--rule); font-size: 13px; }
.legend i { display: inline-block; width: 12px; height: 12px; margin-inline-end: 8px; border-radius: 2px; vertical-align: -1px; }

.m1, .m2, .m3, .m4 { font-weight: 700; }
.m1 { color: var(--ink); } .m2 { color: var(--red); } .m3 { color: var(--sea); } .m4 { color: var(--gold-ink); }

/* ---------- صفحهٔ عمومی: پنل اخبار ---------- */
.panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 1000; width: 380px; display: flex; flex-direction: column; background: var(--paper); border-left: 1px solid var(--rule); }
.panel-head { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 18px 20px; border: 0; border-bottom: 1px solid var(--rule); background: var(--paper); text-align: start; }
.count { margin-inline-start: auto; font-size: 12.5px; color: var(--ink2); }
.grip { display: none; }
.body { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.box { padding: 14px 20px; border-bottom: 1px solid var(--rule); }
.panel input[type=search] { width: 100%; padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--fog); }
.panel input[type=search]:focus { outline: none; border-color: var(--ink); background: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips + .chips { margin-top: 8px; }
.chip { padding: 5px 12px; border: 1px solid var(--rule); border-radius: 999px; background: #fff; font-size: 13px; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.meta { padding: 10px 20px; font-size: 12.5px; color: var(--ink2); border-bottom: 1px solid var(--rule); }
.list { flex: 1; margin: 0; padding: 0; list-style: none; overflow-y: auto; }
.item { padding: 16px 20px; border-bottom: 1px solid var(--rule); cursor: pointer; }
.item:hover { background: var(--fog); }
.item.on { background: var(--fog); box-shadow: inset -3px 0 0 var(--red); }
.item .row { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12px; color: var(--ink2); }
.item h3 { margin: 6px 0 4px; font-size: 15px; font-weight: 700; }
.item p { margin: 0; font-size: 13.5px; color: var(--ink2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

@media (max-width: 820px) {
  .panel { top: auto; left: 0; width: auto; max-height: 60vh; border-left: 0; border-top: 1px solid var(--rule); border-radius: 14px 14px 0 0; }
  .panel-head { padding-top: 22px; cursor: pointer; }
  .grip { display: block; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; transform: translateX(-50%); border-radius: 2px; background: var(--rule); }
  .panel.collapsed .body { display: none; }
}

/* ---------- پنل مدیریت ---------- */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; display: flex; align-items: center; gap: 20px; height: 60px; padding: 0 20px; background: var(--paper); border-bottom: 1px solid var(--rule); }
.top .brand small { display: block; }
.tabs { display: flex; gap: 4px; }
.tab { padding: 7px 14px; border: 0; border-radius: var(--r); background: none; font-weight: 700; color: var(--ink2); }
.tab.on { background: var(--ink); color: #fff; }
.top a { margin-inline-start: auto; font-size: 13px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--ink); }

.main { position: fixed; top: 60px; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: minmax(360px, 460px) 1fr; }
.side { overflow-y: auto; padding: 24px; background: var(--paper); border-left: 1px solid var(--rule); }
#pick { position: relative; min-width: 0; }
#pickerMap { position: absolute; inset: 0; }
.hint { position: absolute; top: 14px; left: 50%; z-index: 500; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); padding: 9px 14px; border-radius: var(--r); background: var(--ink); color: #fff; font-size: 13px; }
.no-map .main { grid-template-columns: 1fr; }
.no-map #pick { display: none; }
.no-map .side { max-width: 760px; }

.bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
label { display: block; margin-bottom: 12px; font-size: 13px; font-weight: 700; color: var(--ink2); }
input, select, textarea { display: block; width: 100%; margin-top: 6px; padding: 9px 11px; border: 1px solid var(--rule); border-radius: var(--r); background: #fff; font-size: 14px; font-weight: 400; color: var(--ink); }
input[type=radio] { display: inline-block; width: auto; margin: 0 8px 0 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); }
textarea { resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.box2 { margin: 0 0 14px; padding: 10px 14px 4px; border: 1px solid var(--rule); border-radius: var(--r); }
.box2 legend { padding: 0 6px; font-size: 13px; font-weight: 700; color: var(--ink2); }
.box2 label { display: flex; align-items: center; margin: 8px 0; font-weight: 400; color: var(--ink); }
.mp { margin-bottom: 14px; padding: 12px; border-radius: var(--r); background: var(--fog); }
.grp { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding: 8px 10px; border: 1px solid var(--rule); border-radius: var(--r); background: #fff; font-size: 13.5px; }
.grp.cur { border-color: var(--ink); }
.grp i { flex: none; width: 12px; height: 12px; border-radius: 2px; }
.grp span { flex: 1; font-weight: 700; }
.grp small { white-space: nowrap; color: var(--ink2); }
.list2 { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.list2 li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.list2 .info { display: flex; flex-direction: column; min-width: 0; }
.list2 small { font-size: 12.5px; color: var(--ink2); }
.acts { display: flex; gap: 6px; flex: none; }

@media (max-width: 900px) {
  .main { top: 60px; display: block; overflow-y: auto; }
  #pick { height: 46vh; }
  .side { overflow: visible; border: 0; }
  .row { grid-template-columns: 1fr; }
}
