/* PRAGA PUB — панель заказов. */

:root {
    --bg: #0c0c0e;
    --bg-2: #141417;
    --bg-3: #1c1c21;
    --line: #2b2b33;
    --gold: #d9b45b;
    --gold-2: #f0d391;
    --gold-dim: #8f7534;
    --text: #ececef;
    --text-dim: #9a9aa4;
    --red: #d9534f;
    --green: #4caf7d;
    --blue: #5b8fd9;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

a { color: var(--gold); text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }

/* ── Вход ──────────────────────────────────────────────────────────────── */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }

.login {
    width: 320px;
    max-width: calc(100% - 32px);
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 28px 24px;
    text-align: center;
}

.login__title { margin: 0; font-size: 20px; letter-spacing: .14em; color: var(--gold); text-transform: uppercase; }
.login__sub { margin: 4px 0 20px; font-size: 13px; color: var(--text-dim); }

.login input {
    width: 100%;
    font: inherit;
    color: var(--text);
    background: var(--bg-3);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 12px;
    margin-bottom: 10px;
}

.login input:focus { outline: none; border-color: var(--gold); }

.login button {
    width: 100%;
    font: 600 15px inherit;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: var(--gold);
    color: #17130a;
    cursor: pointer;
}

.alert {
    margin: 0 0 14px;
    padding: 9px;
    border-radius: 8px;
    background: rgba(217, 83, 79, .14);
    border: 1px solid var(--red);
    color: #f0a9a7;
    font-size: 13px;
}

/* ── Шапка ─────────────────────────────────────────────────────────────── */
.ahdr { border-bottom: 1px solid var(--line); background: var(--bg-2); position: sticky; top: 0; z-index: 10; }

.ahdr__in {
    max-width: 1100px;
    margin: 0 auto;
    padding: 13px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ahdr__logo { font-weight: 700; letter-spacing: .08em; color: var(--gold); text-transform: uppercase; font-size: 14px; }
.ahdr__right { display: flex; align-items: center; gap: 14px; }
.ahdr__exit, .ahdr__site { color: var(--text-dim); font-size: 14px; }
.ahdr__site:hover, .ahdr__exit:hover { color: var(--gold); }

/* ── Вкладки ───────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 6px; margin-right: auto; margin-left: 22px; }

.tabs__item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 15px;
    border-radius: 9px;
    font-size: 14px;
    color: var(--text-dim);
    border: 1px solid transparent;
}

.tabs__item:hover { color: var(--gold); }
.tabs__item.is-active { color: var(--gold-2); border-color: var(--line); background: var(--bg-3); }

.badge {
    background: var(--red);
    color: #fff;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
}

.badge[hidden] { display: none; }

/* ── Фильтры ───────────────────────────────────────────────────────────── */
.filters { border-bottom: 1px solid var(--line); background: var(--bg); }

.filters__in {
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.chip {
    padding: 6px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 14px;
    color: var(--text-dim);
}

.chip.is-active { background: var(--gold); border-color: var(--gold); color: #17130a; }

.filters input {
    margin-left: auto;
    font: inherit;
    color: var(--text);
    background: var(--bg-3);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 7px 11px;
    min-width: 180px;
}

.filters button {
    font: inherit;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--bg-3);
    color: var(--text);
    cursor: pointer;
}

/* ── Список заказов ────────────────────────────────────────────────────── */
.list { max-width: 1100px; margin: 0 auto; padding: 16px 14px 60px; display: grid; gap: 14px; }

.empty { color: var(--text-dim); text-align: center; padding: 60px 0; }

.ord {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-left: 3px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
}

.ord_new { border-left-color: var(--red); }
.ord_accepted { border-left-color: var(--gold); }
.ord_delivering { border-left-color: var(--blue); }
.ord_done { border-left-color: var(--green); opacity: .75; }
.ord_canceled { opacity: .5; }

.ord__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ord__no { font-weight: 700; font-size: 16px; color: var(--gold-2); }
.ord__date { color: var(--text-dim); font-size: 13px; margin-left: 10px; }
.ord__total { font-weight: 700; font-size: 18px; color: var(--gold-2); white-space: nowrap; }

.ord__grid {
    margin-top: 12px;
    display: grid;
    gap: 8px 18px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.ord__field span { display: block; font-size: 12px; color: var(--text-dim); }
.ord__field b { font-weight: 600; }
.ord__field_wide { grid-column: span 2; }

.ord__comment {
    margin: 12px 0 0;
    padding: 8px 11px;
    background: var(--bg-3);
    border-radius: 8px;
    font-size: 14px;
}

.ord__items { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }

.ord__items li {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    padding: 3px 0;
    font-size: 14px;
}

.ord__qty { color: var(--text-dim); }
.ord__sum { color: var(--gold-2); white-space: nowrap; }

.ord__foot {
    margin-top: 12px;
    padding-top: 11px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.ord__sums { font-size: 13px; color: var(--text-dim); }
.warn { color: var(--red); }

.ord__actions { display: flex; flex-wrap: wrap; gap: 6px; }

.st {
    font: inherit;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
}

.st:hover { border-color: var(--gold); color: var(--gold); }
.st.is-current { background: var(--gold); border-color: var(--gold); color: #17130a; font-weight: 600; }

@media (max-width: 640px) {
    .ord__field_wide { grid-column: span 2; }
    .filters input { margin-left: 0; width: 100%; }
    .ord__actions { width: 100%; }
}

/* ── Редактор меню ─────────────────────────────────────────────────────── */
.filters__in_scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.filters__in_scroll::-webkit-scrollbar { display: none; }
.filters__in_scroll .chip { flex: 0 0 auto; }

.mhint {
    max-width: 1100px;
    margin: 14px auto 0;
    padding: 0 14px;
    font-size: 13px;
    color: var(--text-dim);
}

.mlist { max-width: 1100px; margin: 0 auto; padding: 10px 14px 60px; }

.mcat { padding-top: 26px; scroll-margin-top: 110px; }

.mcat__title {
    display: flex;
    align-items: baseline;
    gap: 12px;
    font-size: 17px;
    color: var(--gold-2);
    text-transform: uppercase;
    letter-spacing: .06em;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--line);
    margin: 0 0 12px;
}

.mcat__tag {
    font-size: 11px;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text-dim);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 2px 9px;
}

.mcat__group {
    margin: 18px 0 10px;
    font-size: 13px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-dim);
}

/* строка позиции */
.mi {
    display: grid;
    grid-template-columns: 86px 1fr auto;
    grid-template-areas: "photo fields actions" "photo status status";
    gap: 6px 14px;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 11px;
}

.mi__photo {
    grid-area: photo;
    position: relative;
    width: 86px;
    height: 66px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-3);
    border: 1px dashed var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.mi__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mi__photo img[hidden] { display: none; }
.mi__ph { font-size: 26px; opacity: .4; }

.mi__photo-hint {
    position: absolute;
    inset: auto 0 0 0;
    background: rgba(0, 0, 0, .68);
    color: var(--gold);
    font-size: 11px;
    text-align: center;
    padding: 3px 0;
    opacity: 0;
    transition: opacity .15s;
}

.mi__photo:hover .mi__photo-hint { opacity: 1; }
.mi__photo_empty .mi__photo-hint { opacity: 1; }

.mi__fields { grid-area: fields; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.mi__name {
    flex: 1 1 240px;
    min-width: 160px;
    font: inherit;
    color: var(--text);
    background: var(--bg-3);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 11px;
}

.mi__price { display: flex; align-items: center; gap: 6px; color: var(--text-dim); }

.mi__price input,
.mi__var input {
    width: 110px;
    font: inherit;
    color: var(--gold-2);
    background: var(--bg-3);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 11px;
    font-variant-numeric: tabular-nums;
}

.mi__name:focus, .mi__price input:focus, .mi__var input:focus { outline: none; border-color: var(--gold); }

.mi__vars { display: flex; flex-wrap: wrap; gap: 8px; }
.mi__var { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-dim); }
.mi__var input { width: 92px; }

.mi__note { width: 100%; margin: 0; font-size: 12px; color: var(--text-dim); }

.mi__actions { grid-area: actions; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.mi__status, .madd__status { grid-area: status; font-size: 13px; min-height: 16px; color: var(--text-dim); }
.mi__status.is-ok, .madd__status.is-ok { color: var(--green); }
.mi__status.is-err, .madd__status.is-err { color: var(--red); }

.mbtn {
    font: inherit;
    font-size: 13px;
    padding: 8px 13px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    white-space: nowrap;
}

.mbtn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.mbtn:disabled { opacity: .5; cursor: default; }
.mbtn_save { background: var(--gold); border-color: var(--gold); color: #17130a; font-weight: 600; }
.mbtn_save:hover:not(:disabled) { background: var(--gold-2); border-color: var(--gold-2); color: #17130a; }
.mbtn_danger:hover { border-color: var(--red); color: var(--red); }

/* добавление блюда */
.madd {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 12px;
    border: 1px dashed var(--line);
    border-radius: 11px;
}

.madd input {
    font: inherit;
    color: var(--text);
    background: var(--bg-3);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 11px;
}

.madd input[name="name"] { flex: 1 1 260px; }
.madd input[name="price"] { width: 120px; font-variant-numeric: tabular-nums; }
.madd input:focus { outline: none; border-color: var(--gold); }
.mbtn_add { border-color: var(--gold-dim, #8f7534); color: var(--gold); }

@media (max-width: 700px) {
    .tabs { margin-left: 0; }
    .ahdr__in { flex-wrap: wrap; }
    .ahdr__site { display: none; }

    .mi {
        grid-template-columns: 86px 1fr;
        grid-template-areas: "photo fields" "actions actions" "status status";
    }

    .mi__actions { justify-content: flex-start; }
}
