/* FABULA — админпанель. Белый/чёрный/оранжевый, салатовые кнопки. Адаптив ПК/моб. */
:root {
  --bg: #f3f3f5;
  --surface: #ffffff;
  --text: #0a0a0a;
  --text-soft: #52525b;
  --muted: #9a9aa3;
  --line: #e8e8ec;
  --accent: #ff6a00;
  --accent-soft: #fff0e6;
  --lime: #c2ff3d;
  --danger: #ff3b3b;
  --ok: #16a06a;
  --sidebar-w: 248px;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(10, 10, 10, 0.05), 0 0 0 1px rgba(10, 10, 10, 0.05);
  --shadow: 0 10px 34px rgba(10, 10, 10, 0.12);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* Атрибут hidden должен побеждать классовые display-правила (.overlay, .login и т.п.) */
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Inter', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, .btn, .stat__num, .sidebar__brand, .login__title, .price { font-family: 'Plus Jakarta Sans', sans-serif; }
button { cursor: pointer; border: none; font-family: inherit; background: none; color: inherit; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

.input { width: 100%; border: none; background: var(--surface); color: var(--text); border-radius: 12px; padding: 12px 14px; font: inherit; box-shadow: var(--shadow-sm); }
.input:focus { outline: 2px solid var(--accent); }
textarea.input { resize: vertical; }
.input--color { padding: 6px; height: 46px; }
.muted { color: var(--muted); font-weight: 400; }

.btn { background: var(--lime); color: #0a0a0a; border-radius: 12px; padding: 12px 20px; font-size: 15px; font-weight: 800; box-shadow: 0 0 12px rgba(194, 255, 61, 0.55), var(--shadow-sm); transition: transform 0.08s ease; }
.btn:active { transform: scale(0.97); }
.btn--ghost { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.btn--danger { background: var(--surface); color: var(--danger); box-shadow: var(--shadow-sm); }
.btn--sm { padding: 8px 14px; font-size: 13px; }
.btn:disabled { opacity: 0.55; }

/* ---------- Вход ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login__card { background: var(--surface); border-radius: 22px; box-shadow: var(--shadow); padding: 34px 28px; width: 100%; max-width: 380px; text-align: center; }
.login__mark { width: 60px; height: 60px; border-radius: 18px; background: var(--text); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 30px; margin: 0 auto 18px; }
.login__title { font-size: 22px; font-weight: 800; margin: 0 0 4px; }
.login__sub { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.login__card .input { margin-bottom: 12px; text-align: center; }
.login__card .btn { width: 100%; }
.login__err { color: var(--danger); font-size: 13px; margin: 12px 0 0; }

/* ---------- Каркас ---------- */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w); z-index: 40;
  background: var(--surface); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; padding: 20px 14px;
}
.sidebar__brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; padding: 4px 8px 22px; }
.sidebar__mark { width: 34px; height: 34px; border-radius: 10px; background: var(--text); color: #fff; display: grid; place-items: center; font-weight: 800; }
.sidebar__nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.navlink {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; border-radius: 12px; font-size: 15px; font-weight: 600; color: var(--text-soft); text-align: left;
}
.navlink svg { width: 20px; height: 20px; flex: 0 0 20px; }
.navlink:hover { background: var(--bg); }
.navlink.is-active { background: var(--accent-soft); color: var(--accent); }
.navlink__badge { margin-left: auto; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 20px; }
.sidebar__foot { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--line); padding-top: 10px; }
.navlink--out { color: var(--danger); }

.scrim { display: none; position: fixed; inset: 0; background: rgba(10, 10, 10, 0.45); z-index: 39; }

.content { margin-left: var(--sidebar-w); min-height: 100vh; }
.content__top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 16px 24px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); }
.content__title { font-size: 22px; font-weight: 800; margin: 0; }
.burger { display: none; font-size: 22px; width: 40px; height: 40px; border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-sm); }
.view { padding: 8px 24px 60px; max-width: 1000px; }

.mobnav { display: none; }

/* ---------- Мобильная адаптация ---------- */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.25s ease; width: 260px; }
  .sidebar.open { transform: translateX(0); }
  .sidebar.open ~ .scrim { display: block; }
  .content { margin-left: 0; padding-bottom: 76px; }
  .burger { display: grid; place-items: center; }
  .view { padding: 8px 16px 40px; }
  .content__top { padding: 14px 16px; }
  .mobnav {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface); box-shadow: 0 -1px 0 var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .mobnav button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; color: var(--muted); font-size: 10px; font-weight: 600; border-radius: 10px; }
  .mobnav button svg { width: 21px; height: 21px; }
  .mobnav button.is-active { color: var(--accent); }
}

/* ---------- Дашборд ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat { background: var(--surface); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.stat__num { font-size: 30px; font-weight: 800; line-height: 1; }
.stat__label { color: var(--muted); font-size: 13px; margin-top: 6px; }
.stat--accent { background: linear-gradient(135deg, var(--accent), #ff9500); color: #fff; }
.stat--accent .stat__label { color: rgba(255, 255, 255, 0.85); }

.section-title { font-size: 16px; font-weight: 800; margin: 0 0 12px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); }

/* ---------- Универсальные строки/список ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.list { display: grid; gap: 10px; }
.row { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; background: var(--surface); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow-sm); }
.row--click { cursor: pointer; }
.row--click:active { transform: scale(0.995); }
.row__thumb { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--bg); }
.row__thumb--empty { display: grid; place-items: center; color: var(--muted); font-size: 10px; text-align: center; }
.row__title { font-weight: 700; font-size: 15px; }
.row__meta { color: var(--muted); font-size: 13px; margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tag { background: var(--accent-soft); color: var(--accent); padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.tag--hot { background: #ffe3d6; color: #e14b00; }
.row__price { font-family: 'Plus Jakarta Sans'; font-weight: 800; font-size: 16px; text-align: right; white-space: nowrap; }
.row__old { color: var(--muted); text-decoration: line-through; font-size: 12px; margin-left: 6px; }
.row__actions { display: flex; gap: 8px; }
.icon-act { width: 36px; height: 36px; border-radius: 10px; background: var(--bg); display: grid; place-items: center; font-size: 14px; box-shadow: var(--shadow-sm); }
.icon-act--del { color: var(--danger); }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 17px; }
.empty { text-align: center; color: var(--muted); padding: 50px 20px; }

/* Статусы заказов */
.status { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; }
.status--new { background: var(--accent-soft); color: var(--accent); }
.status--processing { background: #e6f0ff; color: #2563eb; }
.status--done { background: #e3f6ec; color: var(--ok); }
.status--canceled { background: #f1f1f3; color: var(--muted); }

.search { margin-bottom: 14px; }

/* ---------- Оверлеи (редактор/drawer) ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(10, 10, 10, 0.5); display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 640px) { .overlay { align-items: center; } }
.sheet { background: var(--bg); width: 100%; max-width: 560px; max-height: 94vh; border-radius: 22px 22px 0 0; display: flex; flex-direction: column; box-shadow: var(--shadow); }
@media (min-width: 640px) { .sheet { border-radius: 22px; } }
.sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.sheet__head h3 { margin: 0; font-size: 19px; font-weight: 800; }
.sheet__close { width: 34px; height: 34px; border-radius: 10px; background: var(--surface); font-size: 15px; box-shadow: var(--shadow-sm); }
.sheet__body { padding: 18px 20px; overflow-y: auto; }
.sheet__foot { display: flex; gap: 10px; justify-content: space-between; margin-top: 18px; }
.sheet__foot .btn[type='submit'], .sheet__foot .btn:only-child { flex: 1; }
.sheet__err { color: var(--danger); font-size: 13px; margin: 4px 0 0; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-soft); margin-bottom: 7px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; background: var(--surface); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow-sm); margin-bottom: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.images { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.img { position: relative; width: 72px; height: 88px; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-sm); }
.img img { width: 100%; height: 100%; object-fit: cover; }
.img__main { position: absolute; bottom: 0; left: 0; right: 0; background: var(--accent); color: #fff; font-size: 9px; font-weight: 700; text-align: center; padding: 2px; }
.img__del { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 12px; display: grid; place-items: center; }
.uploader { display: inline-flex; align-items: center; justify-content: center; padding: 12px 18px; background: var(--surface); border: 1.5px dashed var(--line); border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--text-soft); cursor: pointer; }
.uploader.busy { opacity: 0.6; pointer-events: none; }

/* Детали (заказ/пользователь) */
.detail__row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.detail__row:last-child { border-bottom: none; }
.detail__row .k { color: var(--muted); }
.detail__row .v { font-weight: 600; text-align: right; word-break: break-word; }
.order-item { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.status-picker { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.status-pick { padding: 8px 12px; border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-sm); font-size: 13px; font-weight: 600; }
.status-pick.is-active { background: var(--accent); color: #fff; }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--text); color: #fff; padding: 12px 20px; border-radius: 40px; font-size: 14px; font-weight: 600; z-index: 60; box-shadow: var(--shadow); }
