/* ============================================================
   Фудкорт ТД — Админка (нео-мемфис dashboard)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@400;500;600;700;800;900&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --cream: #FFF4EA; --paper: #fff; --ink: #1B1A17; --ink-soft: #4A463E;
  --peach: #FF8F5E; --peach-deep: #F2622F; --peach-soft: #FFD8C2;
  --emerald: #0FA06C; --emerald-deep: #0A6B49; --emerald-soft: #BCEBD5; --emerald-tint: #E2F6EC;
  --pop-yellow: #FFC23B; --pop-pink: #E84C8A; --pop-blue: #2F9BE0; --pop-red: #EE4B3C;
  --border: 2.5px solid var(--ink); --shadow: 6px 6px 0 var(--ink); --shadow-sm: 4px 4px 0 var(--ink);
  --radius: 20px; --radius-sm: 12px;
  --font-display: 'Unbounded','Trebuchet MS',system-ui,sans-serif;
  --font-body: 'Manrope',system-ui,sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: var(--font-body); color: var(--ink); background: var(--cream);
  background-image: radial-gradient(rgba(27,26,23,.045) 1.6px, transparent 1.6px);
  background-size: 26px 26px; -webkit-font-smoothing: antialiased; min-height: 100dvh;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
h1,h2,h3,h4 { font-family: var(--font-display); margin: 0; line-height: 1.1; }
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 clamp(14px,3vw,28px); }

.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; font-family:var(--font-display); font-weight:700; font-size:14px; padding:11px 20px; border-radius:999px; border:var(--border); background:var(--paper); color:var(--ink); box-shadow:var(--shadow-sm); transition:transform .12s, box-shadow .12s; }
.btn:hover { transform:translate(-2px,-2px); box-shadow:var(--shadow); }
.btn:active { transform:translate(2px,2px); box-shadow:2px 2px 0 var(--ink); }
.btn--green { background:var(--emerald); color:#fff; }
.btn--peach { background:var(--peach); }
.btn--ink { background:var(--ink); color:var(--cream); }
.btn--danger { background:var(--pop-red); color:#fff; }
.btn--sm { padding:7px 14px; font-size:12.5px; }
.btn--block { width:100%; }
.btn--ghost { background:transparent; box-shadow:none; }
.btn--ghost:hover { background:var(--paper); box-shadow:var(--shadow-sm); }

/* ---------- ЛОГИН ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 20px; position: relative; overflow: hidden; }
.login .deco { position: absolute; pointer-events: none; }
.login-card { position: relative; z-index: 2; width: min(420px,100%); background: var(--paper); border: var(--border); border-radius: 28px; box-shadow: var(--shadow); padding: 36px 32px; text-align: center; }
.login-card img { width: 64px; height: 64px; border-radius: 16px; border: var(--border); padding: 5px; box-shadow: var(--shadow-sm); margin: 0 auto 16px; }
.login-card h1 { font-size: 26px; font-weight: 800; }
.login-card p { color: var(--ink-soft); font-weight: 600; font-size: 14px; margin: 6px 0 24px; }
.login-card input { width: 100%; font-family: var(--font-body); font-weight: 600; font-size: 16px; padding: 14px 16px; border: var(--border); border-radius: var(--radius-sm); margin-bottom: 14px; outline: none; text-align: center; }
.login-card input:focus { box-shadow: var(--shadow-sm); }
.login-hint { background: var(--emerald-tint); border: 2px dashed var(--emerald); border-radius: var(--radius-sm); padding: 10px; font-size: 13px; font-weight: 600; margin-top: 18px; }
.login-hint b { font-family: var(--font-display); }
.login-err { color: var(--pop-red); font-weight: 700; font-size: 14px; margin-bottom: 12px; min-height: 18px; }

/* ---------- ШАПКА АДМИНКИ ---------- */
.admin-header { position: sticky; top: 0; z-index: 50; background: rgba(255,244,234,.9); backdrop-filter: blur(10px); border-bottom: var(--border); }
.admin-header .container { display: flex; align-items: center; gap: 14px; height: 70px; }
.admin-brand { display: flex; align-items: center; gap: 10px; }
.admin-brand img { width: 42px; height: 42px; border-radius: 11px; border: var(--border); padding: 3px; box-shadow: var(--shadow-sm); background: #fff; }
.admin-brand b { font-family: var(--font-display); font-weight: 800; font-size: 16px; display: block; }
.admin-brand span { font-size: 11px; color: var(--ink-soft); font-weight: 600; }
.live-badge { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 12px; background: #fff; border: var(--border); border-radius: 999px; padding: 6px 12px; box-shadow: var(--shadow-sm); }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--pop-red); }
.live-badge.on .live-dot { background: var(--emerald); animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.admin-tabs { display: flex; gap: 6px; margin-left: auto; }
.admin-tab { font-family: var(--font-display); font-weight: 700; font-size: 14px; padding: 9px 18px; border-radius: 999px; border: var(--border); background: #fff; box-shadow: var(--shadow-sm); }
.admin-tab[aria-selected="true"] { background: var(--ink); color: var(--cream); }

/* ---------- СТАТИСТИКА ---------- */
.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin: 26px 0; }
.stat { background: #fff; border: var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.stat__icon { position: absolute; right: 12px; top: 12px; font-size: 26px; opacity: .9; }
.stat b { font-family: var(--font-display); font-weight: 800; font-size: 32px; display: block; }
.stat span { font-size: 13px; color: var(--ink-soft); font-weight: 700; }
.stat.s1 { background: var(--peach-soft); }
.stat.s2 { background: var(--emerald-soft); }
.stat.s3 { background: #FFF0C2; }
.stat.s4 { background: #fff; }

/* ---------- КАНБАН ЗАКАЗОВ ---------- */
.board { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; align-items: start; padding-bottom: 40px; }
.col { background: rgba(255,255,255,.5); border: 2px dashed rgba(27,26,23,.28); border-radius: var(--radius); padding: 12px; min-height: 140px; }
.col__head { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-display); font-weight: 700; font-size: 14px; padding: 4px 6px 12px; }
.col__count { background: var(--ink); color: var(--cream); border-radius: 999px; min-width: 24px; height: 24px; display: inline-grid; place-items: center; font-size: 12px; padding: 0 7px; }
.col[data-col="new"] .col__count { background: var(--peach-deep); }
.col[data-col="cooking"] .col__count { background: var(--pop-yellow); color: var(--ink); }
.col[data-col="ready"] .col__count { background: var(--emerald); }
.col__list { display: flex; flex-direction: column; gap: 12px; }

.ocard { background: #fff; border: var(--border); border-radius: 16px; box-shadow: var(--shadow-sm); padding: 14px; transition: transform .12s, box-shadow .12s; }
.ocard:hover { transform: translate(-2px,-2px); box-shadow: var(--shadow); }
.ocard.flash { animation: flash 1.6s ease; }
@keyframes flash { 0%,100% { box-shadow: var(--shadow-sm); } 30% { box-shadow: 0 0 0 4px var(--pop-yellow), var(--shadow); } }
.ocard__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ocard__num { font-family: var(--font-display); font-weight: 800; font-size: 22px; }
.ocard__time { font-size: 11px; color: var(--ink-soft); font-weight: 700; text-align: right; }
.ocard__name { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.ocard__phone { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.ocard__items { margin: 10px 0; font-size: 12.5px; }
.ocard__items div { display: flex; justify-content: space-between; padding: 2px 0; color: var(--ink-soft); font-weight: 600; }
.ocard__comment { font-size: 12px; background: var(--peach-soft); border: 2px solid var(--ink); border-radius: 10px; padding: 6px 9px; margin-bottom: 8px; font-weight: 600; }
.ocard__counters { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 10px; }
.ocard__counter { font-size: 10.5px; font-weight: 700; background: var(--emerald-tint); border: 1.5px solid var(--ink); border-radius: 999px; padding: 2px 8px; }
.ocard__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 2px dashed rgba(27,26,23,.18); padding-top: 10px; }
.ocard__total { font-family: var(--font-display); font-weight: 800; font-size: 16px; }
.ocard__revert { background: none; border: none; font-size: 12px; font-weight: 700; color: var(--ink-soft); text-decoration: underline; cursor: pointer; padding: 4px; }
.board-empty { color: var(--ink-soft); font-weight: 600; font-size: 13px; text-align: center; padding: 16px 8px; }

/* ---------- РЕДАКТОР МЕНЮ ---------- */
.menu-admin { padding-bottom: 50px; }
.menu-admin__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0; flex-wrap: wrap; }
.kitchen-group { margin-bottom: 30px; }
.kitchen-group__title { font-family: var(--font-display); font-weight: 800; font-size: 20px; display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.kitchen-group__title .pill { font-size: 12px; background: var(--ink); color: var(--cream); border-radius: 999px; padding: 3px 10px; }
.mitems { display: grid; grid-template-columns: repeat(auto-fill,minmax(300px,1fr)); gap: 14px; }
.mitem { display: grid; grid-template-columns: 64px 1fr; gap: 12px; background: #fff; border: var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); padding: 12px; align-items: start; }
.mitem.off { opacity: .6; }
.mitem img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; border: 2px solid var(--ink); }
.mitem__name { font-family: var(--font-display); font-weight: 700; font-size: 14px; line-height: 1.15; }
.mitem__price { font-weight: 700; font-size: 13px; color: var(--ink-soft); margin: 2px 0 8px; }
.mitem__actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* переключатель */
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; cursor: pointer; }
.switch input { display: none; }
.switch .track { width: 44px; height: 26px; border: 2.5px solid var(--ink); border-radius: 999px; background: #fff; position: relative; transition: background .15s; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; background: var(--ink); border-radius: 50%; transition: transform .18s; }
.switch input:checked + .track { background: var(--emerald); }
.switch input:checked + .track::after { transform: translateX(18px); background: #fff; }

/* ---------- МОДАЛКА РЕДАКТИРОВАНИЯ ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(27,26,23,.5); opacity: 0; visibility: hidden; transition: .2s; }
.modal.open { opacity: 1; visibility: visible; }
.modal__card { width: min(520px,100%); max-height: 92dvh; overflow-y: auto; background: var(--cream); border: var(--border); border-radius: 24px; box-shadow: var(--shadow); padding: 26px; }
.modal__card h3 { font-size: 22px; font-weight: 800; margin-bottom: 18px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-family: var(--font-display); font-weight: 700; font-size: 12.5px; margin-bottom: 6px; }
.field input, .field textarea, .field select { width: 100%; font-family: var(--font-body); font-weight: 600; font-size: 14px; padding: 11px 14px; border: var(--border); border-radius: 10px; background: #fff; outline: none; }
.field textarea { resize: vertical; min-height: 56px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal__foot { display: flex; gap: 10px; margin-top: 8px; }

/* ---------- ТОСТЫ ---------- */
.toasts { position: fixed; top: 84px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { background: var(--ink); color: var(--cream); font-weight: 700; font-size: 14px; padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow-sm); border: 2px solid var(--ink); animation: tin .3s ease; }
.toast.green { background: var(--emerald); }
.toast.new-order { background: var(--peach-deep); color: #fff; }
@keyframes tin { from { transform: translateX(40px); opacity: 0; } }

.hidden { display: none !important; }

/* ---------- АДАПТИВ ---------- */
@media (max-width: 1000px) {
  .stats { grid-template-columns: repeat(2,1fr); }
  .board { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 640px) {
  .board { grid-template-columns: 1fr; }
  .admin-header .container { height: auto; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; gap: 10px; }
  .admin-tabs { width: 100%; }
  .admin-tab { flex: 1; }
  .field-row { grid-template-columns: 1fr; }
  .live-badge { order: 3; }
}
