:root{
  --bg:#0b0d12;
  --panel:#111827;
  --card:#0f172a;
  --muted:#94a3b8;
  --text:#e5e7eb;
  --accent:#2AABEE; /* telegram blue */
  --meat:#E23D2B;   /* meat red */
  --gold:#F8B400;
  --radius:20px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--text);
  background:
    radial-gradient(900px 500px at 15% 0%, rgba(42,171,238,.22), transparent 60%),
    radial-gradient(700px 420px at 85% 10%, rgba(226,61,43,.18), transparent 55%),
    linear-gradient(180deg, #05060a, var(--bg));
}

a{color:inherit}
.container{max-width:1100px;margin:0 auto;padding:18px}

.topbar{
  position:sticky;top:0;z-index:10;
  display:flex;gap:14px;align-items:center;justify-content:space-between;
  padding:14px 18px;
  background:rgba(5,6,10,.72);
  backdrop-filter: blur(10px);
  border-bottom:1px solid rgba(255,255,255,.06)
}
.brand{display:flex;gap:12px;align-items:center;min-width:0}
.logo{
  width:72px;height:72px;border-radius:18px;
  object-fit:contain;
  background:rgba(255,255,255,.06);
  padding:8px;
  box-shadow:0 14px 40px rgba(0,0,0,.55)
}
.brandtext{min-width:0}
.title{font-weight:900;letter-spacing:.2px;font-size:18px}
.subtitle{color:var(--muted);font-size:.92rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}

.btn{
  border:0;
  color:white;
  padding:10px 14px;
  border-radius:999px;
  font-weight:800;
  cursor:pointer;
  display:inline-flex;align-items:center;justify-content:center;
  transition:transform .12s ease, filter .12s ease;
  text-decoration:none;
}
.btn:hover{transform:translateY(-1px);filter:brightness(1.02)}
.btn.primary{
  background:linear-gradient(135deg,var(--accent), #1b7bd1);
  box-shadow:0 16px 36px rgba(42,171,238,.24);
}
.btn.meat{
  background:linear-gradient(135deg,var(--meat), #ff7a3a);
  box-shadow:0 16px 36px rgba(226,61,43,.22);
}
.btn.ghost{
  background:transparent;
  border:1px solid rgba(255,255,255,.14);
  box-shadow:none;
}

.card{
  background:rgba(17,24,39,.72);
  border:1px solid rgba(255,255,255,.07);
  border-radius:var(--radius);
  padding:16px;
  box-shadow:0 24px 70px rgba(0,0,0,.35);
  margin-top:16px;
}

.card-head h2{margin:0 0 4px 0}
.card-head p{margin:0;color:var(--muted)}

.hero{
  display:grid;
  grid-template-columns:1.1fr .9fr;
  gap:16px;
  align-items:start;
  margin-top:16px;
}

.hero-card{
  border-radius:var(--radius);
  padding:18px;
  background:linear-gradient(180deg, rgba(15,23,42,.86), rgba(17,24,39,.72));
  border:1px solid rgba(255,255,255,.07);
  box-shadow:0 28px 80px rgba(0,0,0,.45);
}
.hero-badge{
  display:inline-flex;
  gap:8px;align-items:center;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(42,171,238,.12);
  border:1px solid rgba(42,171,238,.22);
  color:#d7f1ff;
  font-weight:800;
  margin-bottom:10px;
  font-size:13px;
}
.hero-card h1{margin:0 0 8px 0;font-size:34px;line-height:1.05}
.lead{margin:0 0 14px 0;color:#d7dde7}

.hero-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
  margin:14px 0 14px 0;
}
.feature{
  display:flex;gap:12px;align-items:flex-start;
  padding:12px;
  border-radius:16px;
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.06)
}
.feature-ico{
  width:38px;height:38px;border-radius:12px;
  display:flex;align-items:center;justify-content:center;
  background:rgba(226,61,43,.14);
  border:1px solid rgba(226,61,43,.22);
  flex:0 0 auto;
}
.feature-title{font-weight:900;margin-bottom:2px}
.feature-text{color:var(--muted);font-size:.92rem}

.hero-note{
  margin-top:10px;
  padding:10px 12px;
  border-radius:16px;
  background:rgba(248,180,0,.10);
  border:1px solid rgba(248,180,0,.22);
  color:#ffeab0;
}
.hero-card .btn{margin-right:10px;margin-top:12px}

.stats-card{
  border-radius:var(--radius);
  padding:16px;
  background:rgba(15,23,42,.72);
  border:1px solid rgba(255,255,255,.07);
  box-shadow:0 28px 80px rgba(0,0,0,.38);
}
.stats-title{font-weight:900;font-size:18px}
.stats-sub{color:var(--muted);font-size:.92rem;margin:4px 0 12px 0}
.stats-list{display:flex;flex-direction:column;gap:10px;max-height:520px;overflow:auto;padding-right:4px}
.stats-row{
  display:flex;justify-content:space-between;gap:10px;align-items:center;
  padding:10px 12px;border-radius:16px;
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.06)
}
.stats-name{font-weight:800;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.stats-right{display:flex;gap:8px;align-items:center}
.stats-stars{filter:drop-shadow(0 2px 6px rgba(0,0,0,.35))}
.stats-num{font-weight:900;color:#d7f1ff}
.stats-count{color:var(--muted);font-size:.9rem}

.form{display:grid;gap:12px;margin-top:10px}
.field label{display:block;margin:0 0 6px 0;font-weight:800}
.field input,.field textarea,.field select{
  width:100%;
  padding:12px 12px;
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.10);
  border-radius:16px;
  color:var(--text);
  outline:none;
}
.field input:focus,.field textarea:focus,.field select:focus{
  border-color:rgba(42,171,238,.55);
  box-shadow:0 0 0 4px rgba(42,171,238,.12);
}
/* Custom selectbox (pretty dropdown) */
.selectbox{position:relative;width:100%}
.selectbox__button{
  width:100%;
  padding:12px 12px;
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.10);
  border-radius:16px;
  color:var(--text);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  cursor:pointer;
}
.selectbox__value{font-weight:600}
.selectbox__chev{opacity:.8}
.selectbox.is-open .selectbox__button{
  border-color:rgba(42,171,238,.55);
  box-shadow:0 0 0 4px rgba(42,171,238,.12);
}
.selectbox__panel{
  position:absolute;
  left:0; right:0;
  margin-top:8px;
  /* solid dark so it never looks "white" */
  background:#0b1220;
  border:1px solid rgba(255,255,255,.10);
  border-radius:16px;
  box-shadow:0 18px 45px rgba(0,0,0,.55);
  padding:10px;
  z-index:50;
  display:none;
  max-height:240px;
  overflow:auto;
}

/* better contrast + nicer scroll */
.selectbox__panel, .selectbox__panel *{color:var(--text)}
.selectbox__panel::-webkit-scrollbar{width:10px}
.selectbox__panel::-webkit-scrollbar-thumb{background:rgba(255,255,255,.14);border-radius:10px}
.selectbox__panel::-webkit-scrollbar-track{background:rgba(255,255,255,.04)}
.selectbox.is-open .selectbox__panel{display:block}
.selectbox__search{
  width:100%;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.04);
  color:var(--text);
  outline:none;
  margin-bottom:8px;
}
.selectbox__options{display:flex;flex-direction:column;gap:4px}
.selectbox__option{
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  color:var(--text);
  background:transparent;
}
.selectbox__panel *{color:var(--text)}

/* nicer scrollbars inside dropdown */
.selectbox__panel::-webkit-scrollbar{width:10px}
.selectbox__panel::-webkit-scrollbar-thumb{background:rgba(255,255,255,.14);border-radius:10px}
.selectbox__panel::-webkit-scrollbar-track{background:transparent}
.selectbox__option:hover{background:rgba(42,171,238,.14)}
.selectbox__option[aria-selected="true"]{background:rgba(42,171,238,.20)}
/* rating selectbox: only on mobile */
.selectbox--rating{display:none}
@media (max-width: 640px){
  .selectbox--rating{display:block}
}

.hint{margin-top:6px;font-size:12px;color:var(--muted)}

.grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}

/* shop cards */
.shop-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:10px;
}
.shop-card{
  text-align:left;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.03);
  border-radius:16px;
  padding:12px;
  cursor:pointer;
  color:var(--text);
  transition:transform .12s ease, border-color .12s ease, background .12s ease;
}
.shop-card:hover{transform:translateY(-1px);border-color:rgba(42,171,238,.45)}
.shop-card.active{
  border-color:rgba(42,171,238,.70);
  background:rgba(42,171,238,.12);
  box-shadow:0 16px 36px rgba(42,171,238,.14);
}
.shop-card-title{font-weight:900;margin-bottom:8px}
.shop-card-meta{display:flex;gap:8px;flex-wrap:wrap}
.chip{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  font-weight:800;
  font-size:12px;
  background:rgba(248,180,0,.12);
  border:1px solid rgba(248,180,0,.22);
  color:#ffeab0;
}
.chip.ghost{
  background:transparent;
  border:1px solid rgba(255,255,255,.14);
  color:var(--muted);
}


.stars-input{display:flex;gap:8px}
.star{
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.03);
  color:white;
  border-radius:14px;
  padding:10px 12px;
  cursor:pointer;
  font-size:18px;
}
.star.active{
  border-color:rgba(248,180,0,.6);
  background:rgba(248,180,0,.15);
}

.reviews{display:grid;gap:10px;margin-top:10px}
.review{
  padding:12px;border-radius:16px;
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.06)
}
.review-top{display:flex;justify-content:space-between;gap:10px;align-items:center}
.review-stars{font-size:18px}
.review-meta{color:var(--muted);font-size:.9rem;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.review-text{margin-top:8px}
.review-text.muted{color:var(--muted)}

@media (max-width:980px){
  .hero{grid-template-columns:1fr}
  .stats-list{max-height:unset}
}
@media (max-width:700px){
  .grid2{grid-template-columns:1fr}
  .subtitle{display:none}
  .logo{width:64px;height:64px}
  .hero-card h1{font-size:28px}
  .container{padding:12px}
}


/* Form selects */
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(20,24,32,.85);
  color: inherit;
  outline: none;
}

select:focus {
  border-color: rgba(46,140,255,.65);
  box-shadow: 0 0 0 4px rgba(46,140,255,.15);
}

.rating-wrap { display: grid; gap: 10px; justify-items:start; }
.rating-dropdown{display:none}

/* Mobile: use dropdown for rating, hide stars */
@media (max-width: 640px) {
  .stars-input { display: none; }
    /* legacy rating-dropdown removed */
}


/* --- Mobile ratings dropdown --- */

.stats-mobile{display:none;margin-top:12px}
.stats-mobile__row{display:flex;gap:12px;align-items:center}
.stats-mobile__result{
  flex:0 0 auto;
  padding:10px 12px;
  border-radius:14px;
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.10);
  display:flex;
  gap:8px;
  align-items:baseline;
  white-space:nowrap;
}
.stats-mobile__stars{font-size:14px;opacity:.9}
.stats-mobile__num{font-weight:800}
.stats-mobile__count{opacity:.7}
.stats-list--desktop{margin-top:12px}

@media (max-width: 720px){
  .stats-mobile{display:block}
  .stats-list--desktop{display:none}
  .stats-mobile__row{flex-direction:column;align-items:stretch}
  .stats-mobile__result{justify-content:space-between}
}

/* Progressive enhancement (stable):
   - Native selects are visible by default (works even if JS fails)
   - When JS loads successfully, <body> gets class "enhanced"
   - In enhanced mode we hide native selects and show custom selectboxes
*/
.native-select{width:100%;padding:14px 14px;border-radius:18px;border:1px solid rgba(255,255,255,.10);background:#0b1220;color:var(--text);}
.selectbox{display:none;}
.enhanced .selectbox{display:block;}
.enhanced .native-select{display:none;}
/* Keep native selects visible if JS didn't run */

.native-select { width: 100%; }
.enhanced .native-select { display: none; }

@media (max-width: 720px) {
  /* On mobile: use native rating dropdown, hide star buttons */
  .stars-input { display: none !important; }
  #rating_native.native-select { display: block !important; }
}
/* Desktop: hide native rating dropdown when enhanced (stars used) */
@media (min-width: 721px) {
  .enhanced #rating_native.native-select { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
}


/* Admin filter */
.admin-filter { margin: 10px 0 18px; }
.admin-filter__row { display:flex; flex-wrap:wrap; gap:10px; align-items:end; }
.admin-filter input[type="date"] { background: rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.12); color: #eaf2ff; padding:10px 12px; border-radius:14px; }
.btn { display:inline-flex; align-items:center; gap:8px; padding:10px 14px; border-radius:14px; border:1px solid rgba(255,255,255,.14); background: rgba(45,111,255,.22); color:#eaf2ff; text-decoration:none; cursor:pointer; }
.btn-ghost { background: rgba(255,255,255,.06); }


/* =========================
   Admin panel redesign
   ========================= */
.admin-body{
  background: #0b1220;
}
.admin-body .container{max-width:1200px;}
.admin-body .topbar{
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.admin-body .card{
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: none;
}
.admin-body h2{margin-bottom:14px;}
.admin-body .admin-filter{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:end;
  margin:12px 0 16px;
}
.admin-body .admin-filter .field{
  min-width: 180px;
  flex: 1 1 220px;
}
.admin-body .tablewrap{
  overflow:auto;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.10);
}
.admin-body table.table{
  width:100%;
  border-collapse:collapse;
  background: rgba(0,0,0,.18);
}
.admin-body table.table th{
  text-align:left;
  font-weight:700;
  font-size:13px;
  letter-spacing:.02em;
  padding:12px 14px;
  color: rgba(255,255,255,.82);
  background: rgba(255,255,255,.06);
  position: sticky;
  top:0;
}
.admin-body table.table td{
  padding:12px 14px;
  border-top:1px solid rgba(255,255,255,.08);
  vertical-align:top;
}
.admin-body .inline{display:flex; gap:10px; align-items:center; flex-wrap:wrap;}
.admin-body .muted{color: rgba(255,255,255,.70);}
.admin-body .small{font-size:12px;}
.admin-body .input.small{padding:8px 10px; border-radius:10px;}
.admin-body .btn.small{padding:8px 10px; border-radius:10px;}
.admin-body .btn.ghost{background: transparent; border:1px solid rgba(255,255,255,.18);}
.admin-body .btn.danger{background: rgba(255,70,70,.18); border:1px solid rgba(255,70,70,.35);}


/* --- Custom dropdown (details) --- */
.dd { position: relative; width: 100%; }
.dd[open] .dd-summary { border-color: rgba(110,168,254,.55); box-shadow: 0 0 0 4px rgba(110,168,254,.10); }
.dd-summary{
  display:flex; align-items:center; justify-content:space-between;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  cursor:pointer;
  list-style:none;
}
.dd-summary::-webkit-details-marker{ display:none; }
.dd-caret{ opacity:.7; }
.dd-panel{
  position:absolute; left:0; right:0; top: calc(100% + 8px);
  z-index: 50;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(17,22,30,.96);
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
  max-height: 320px;
  overflow:auto;
}
.dd-list{ padding: 8px; display:flex; flex-direction:column; gap:6px; }
.dd-item{
  display:flex; align-items:center; gap:10px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor:pointer;
  border: 1px solid transparent;
}
.dd-item:hover{ background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.08); }
.dd-item input{ width:16px; height:16px; accent-color: #6ea8fe; }
.dd-text{ color: rgba(255,255,255,.92); }

/* --- Rating stars (radio) --- */
.rating{
  display:flex;
  gap:10px;
  align-items:center;
  flex-direction: row-reverse; /* чтобы 5 звезд = все светятся */
}

.rating{
  display:flex;
  flex-direction: row-reverse; /* DOM 5..1, but visually 1..5; checked~label lights to the left */
  justify-content:flex-start;  /* stars on the LEFT */
  gap:10px;
  align-items:center;
}
.rating input{ position:absolute; left:-9999px; }

.rating label{
  width:44px; height:44px;
  display:flex; align-items:center; justify-content:center;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
  font-size:26px;
  color: rgba(255,255,255,.28); /* off */
  cursor:pointer;
  user-select:none;
  transition: 140ms ease;
}

/* Hover preview */
.rating label:hover,
.rating label:hover ~ label{
  border-color: rgba(247,201,72,.35);
  color:#f7c948;
}

/* Selected state: light up selected + all to the left */
.rating input:checked ~ label{
  color:#f7c948;
  background: rgba(247,201,72,.10);
  border-color: rgba(247,201,72,.28);
  box-shadow: 0 0 0 3px rgba(247,201,72,.08) inset;
}

/* Progressive enhancement: show pretty selectbox only when JS loaded */
body:not(.enhanced) .selectbox{display:none}
body.enhanced .native-select{display:none}


/* Pretty rating stars */
.rating {
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
}
.rating input { display:none; }
.rating label {
  width:44px; height:44px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  font-size:24px;
  line-height:1;
  color: rgba(255,255,255,.35);
  transition: transform .08s ease, background .2s ease, border-color .2s ease, color .2s ease, opacity .2s ease;
}
.rating label.is-on {
  color:#f7c948;
  background: rgba(247,201,72,.12);
  border-color: rgba(247,201,72,.45);
  box-shadow: 0 0 0 3px rgba(247,201,72,.08) inset;
  opacity: 1;
}
.rating label.is-off { opacity: .35; }
.rating label:active { transform: scale(.98); }


/* Admin inline rename */
.mini-details { display:inline-block; position:relative; }
.mini-details > summary { list-style:none; cursor:pointer; }
.mini-details > summary::-webkit-details-marker { display:none; }
.mini-details[open] { z-index:3; }
.mini-details[open] form { background: #fff; border: 1px solid rgba(0,0,0,.08); padding:10px; border-radius:12px; box-shadow: 0 10px 24px rgba(0,0,0,.10); position:absolute; left:0; top:110%; min-width: 280px; }
