:root {
    --bg: #f6f7fb;
    --surface: #ffffff;
    --text: #1c1f26;
    --muted: #6f7585;
    --brand: #d28d2c;
    --brand-dark: #9c6518;
    --success: #1f9d56;
    --danger: #c23939;
    --border: #e6e8ef;
    --shadow: 0 10px 25px rgba(29, 35, 61, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.logo__mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: linear-gradient(135deg, #f3b24b, #cf7f18);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 15px;
}

.logo__image {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
}

.nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.nav a {
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 14px;
    color: #374057;
}

.nav a:hover {
    background: #f0f2f8;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

.hero {
    background: linear-gradient(120deg, #1d2338, #2e3654);
    color: #fff;
    border-radius: 18px;
    padding: 24px 20px;
    box-shadow: var(--shadow);
}

.hero h1 {
    margin: 0 0 8px;
    font-size: clamp(24px, 5vw, 34px);
}

.hero p {
    margin: 0;
    color: #d5dcf5;
}

.grid {
    display: grid;
    gap: 14px;
}

.grid--cards {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.category-title {
    margin: 24px 0 10px;
    color: #30384e;
}

.dish-title {
    margin: 0;
    font-size: 18px;
}

.price {
    margin-top: 10px;
    color: var(--brand-dark);
    font-size: 20px;
    font-weight: 700;
}

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

.form-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field label {
    font-size: 14px;
    color: #4a5266;
    font-weight: 600;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid #d9deea;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 15px;
    background: #fff;
}

.field textarea {
    min-height: 110px;
    resize: vertical;
}

.btn {
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

.btn--brand {
    background: linear-gradient(135deg, #e4a443, #c87e15);
    color: #fff;
}

.btn--dark {
    background: #262d42;
    color: #fff;
}

.alert {
    margin: 14px 0;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
}

.alert--success {
    background: #e9f8f0;
    color: #0f6b38;
}

.alert--danger {
    background: #fff0f0;
    color: #8f2323;
}

.auth-box {
    max-width: 420px;
    margin: 56px auto;
}

@media (max-width: 768px) {
    .app-header__inner {
        align-items: center;
        flex-direction: row;
        justify-content: space-between;
    }

    .nav {
        width: auto;
        margin-left: auto;
    }

    .nav a {
        background: #f4f6fc;
        white-space: nowrap;
    }
}

/* ---------- Admin dashboard ---------- */
.body--admin {
    background: linear-gradient(180deg, #eef0f6 0%, #f6f7fb 32%, #f6f7fb 100%);
}

.admin-dashboard {
    padding-bottom: 8px;
}

.admin-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: space-between;
    gap: 14px;
    background: linear-gradient(135deg, #1a2135 0%, #2d3652 48%, #243049 100%);
    color: #fff;
    border-radius: 16px;
    padding: 18px 18px;
    box-shadow: 0 16px 40px rgba(26, 33, 53, 0.35);
    position: relative;
    overflow: hidden;
}

.admin-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 100% 0%, rgba(226, 164, 67, 0.18), transparent 55%);
    pointer-events: none;
}

.admin-hero__main {
    position: relative;
    z-index: 1;
    flex: 1 1 240px;
    min-width: 0;
}

.admin-hero__eyebrow {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}

.admin-hero__title {
    margin: 0 0 8px;
    font-size: clamp(22px, 4vw, 30px);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.admin-hero__lead {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.45;
    color: rgba(213, 220, 245, 0.95);
    max-width: 36em;
}

.admin-hero__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #f3c56d;
    padding: 8px 0;
    border-bottom: 1px solid rgba(243, 197, 109, 0.45);
    transition: color 0.15s ease, border-color 0.15s ease;
}

.admin-hero__link:hover {
    color: #ffd48a;
    border-bottom-color: rgba(255, 212, 138, 0.7);
}

.admin-stats {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    align-self: center;
}

.admin-stat {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    padding: 10px 14px;
    min-width: 104px;
    text-align: center;
    backdrop-filter: blur(8px);
}

.admin-stat__value {
    display: block;
    font-size: 23px;
    font-weight: 800;
    line-height: 1.1;
    color: #fff;
}

.admin-stat__label {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: rgba(213, 220, 245, 0.85);
}

.admin-required-mark {
    color: var(--brand);
    font-weight: 800;
}

.admin-alerts {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-alert {
    margin: 0;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.admin-layout {
    margin-top: 14px;
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
}

@media (min-width: 900px) {
    .admin-layout {
        grid-template-columns: minmax(280px, 340px) 1fr;
        align-items: start;
    }
}

.admin-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 14px 16px;
    box-shadow: 0 4px 24px rgba(29, 35, 61, 0.06);
}

.admin-panel__head {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.admin-panel__head--row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.admin-panel__title {
    margin: 0 0 2px;
    font-size: 17px;
    font-weight: 800;
    color: #252b3d;
}

.admin-panel__hint {
    margin: 0;
    font-size: 13px;
    line-height: 1.35;
    color: var(--muted);
}

.admin-form--inline {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (min-width: 520px) {
    .admin-form--inline {
        flex-direction: row;
        align-items: flex-end;
        flex-wrap: wrap;
    }

    .admin-form--inline .field--grow {
        flex: 1 1 200px;
        min-width: 0;
    }

    .admin-form__actions {
        flex-shrink: 0;
    }
}

.admin-form__actions {
    padding-bottom: 2px;
}

.admin-form__footer {
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.btn--lg {
    padding: 10px 16px;
    font-size: 14px;
    border-radius: 10px;
    min-height: 42px;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.admin-tag-list {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-tag {
    display: inline-block;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #3d4559;
    background: #f0f2f8;
    border-radius: 999px;
    border: 1px solid #e2e6ef;
}

.admin-subhead {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #5a6278;
}

.admin-form--category-create,
.admin-form--category-photo {
    border: 1px solid #edf0f6;
    border-radius: 12px;
    padding: 10px;
    background: #fbfcff;
}

.admin-form--category-photo {
    margin-top: 10px;
}

.admin-panel--category .form-grid--admin.form-grid--two {
    gap: 8px 10px;
}

.admin-panel--category .field label {
    font-size: 13px;
}

.admin-panel--category .field input,
.admin-panel--category .field select {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 14px;
}

.admin-panel--category .admin-tag-list {
    margin-top: 8px;
    margin-bottom: 0;
}

.admin-form__footer--flat {
    border-top: 0;
    margin-top: 4px;
    padding-top: 6px;
}

.admin-btn-inline {
    margin-top: 8px;
}

.admin-panel--category .btn--lg {
    min-height: 40px;
    padding: 9px 14px;
}

.admin-empty-hint {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}

.form-section {
    margin: 0 0 14px;
    padding: 0;
    border: 0;
    min-width: 0;
}

.admin-panel--dish fieldset.form-section {
    margin-left: 0;
    margin-right: 0;
}

.admin-panel--dish fieldset.form-section legend {
    float: none;
    width: 100%;
    padding: 0;
}

.form-section:last-of-type {
    margin-bottom: 0;
}

.form-section__title {
    padding: 0;
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #5a6278;
}

.form-section__desc {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.45;
}

.form-grid--admin {
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .form-grid--admin {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-grid--admin .field:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }
}

@media (min-width: 900px) {
    .form-grid--admin:not(.form-grid--two) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .form-grid--admin:not(.form-grid--two) .field:last-child:nth-child(3n + 1):last-child {
        grid-column: 1 / -1;
    }
}

.form-grid--two {
    grid-template-columns: 1fr;
}

@media (min-width: 520px) {
    .form-grid--two {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.admin-panel--dish .field input,
.admin-panel--dish .field select,
.admin-panel--dish .field textarea {
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-panel--dish .field input:focus,
.admin-panel--dish .field select:focus,
.admin-panel--dish .field textarea:focus {
    outline: none;
    border-color: rgba(210, 141, 44, 0.55);
    box-shadow: 0 0 0 3px rgba(210, 141, 44, 0.15);
}

.admin-panel--recent {
    margin-top: 12px;
}

.admin-recent-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    background: #fafbfe;
}

.admin-recent-item {
    display: grid;
    gap: 8px 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    align-items: center;
    background: var(--surface);
}

.admin-recent-item:last-child {
    border-bottom: 0;
}

.admin-recent-item__name {
    font-weight: 700;
    font-size: 14px;
    color: #2a3144;
    word-break: break-word;
}

.admin-recent-item__price {
    font-weight: 800;
    font-size: 14px;
    color: var(--brand-dark);
    white-space: nowrap;
}

.admin-pill {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    color: #4a5369;
    background: #eef1f8;
    border-radius: 999px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 640px) {
    .admin-recent-item {
        grid-template-columns: minmax(0, 1fr) auto minmax(100px, auto);
        grid-template-areas: "name cat price";
    }

    .admin-recent-item__name {
        grid-area: name;
    }

    .admin-pill {
        grid-area: cat;
        justify-self: center;
    }

    .admin-recent-item__price {
        grid-area: price;
        justify-self: end;
    }
}

@media (max-width: 639px) {
    .admin-recent-item {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "name price"
            "cat cat";
    }

    .admin-recent-item__name {
        grid-area: name;
    }

    .admin-recent-item__price {
        grid-area: price;
        justify-self: end;
    }

    .admin-pill {
        grid-area: cat;
    }
}

/* Admin: dish list, import, buttons */
.btn--sm {
    padding: 6px 12px;
    font-size: 13px;
    min-height: auto;
    border-radius: 8px;
    display: inline-block;
    text-align: center;
}

.btn--ghost {
    background: transparent;
    color: #262d42;
    border: 1px solid #d9deea;
    text-decoration: none;
    line-height: 1.2;
}

.btn--ghost:hover {
    background: #f4f6fc;
}

.admin-panel--import {
    margin-top: 12px;
}

.admin-form--import {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-import-tools {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (min-width: 520px) {
    .admin-form--import {
        flex-direction: row;
        align-items: flex-end;
        flex-wrap: wrap;
    }

    .admin-form--import .field--grow {
        flex: 1 1 220px;
        min-width: 0;
    }
}

.admin-filter {
    margin-bottom: 12px;
}

.admin-filter__row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    align-items: flex-end;
}

.admin-filter__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 2px;
}

.admin-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.admin-dish-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 520px;
}

.admin-dish-table th,
.admin-dish-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.admin-dish-table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    background: #f8f9fc;
}

.admin-dish-table tbody tr:last-child td {
    border-bottom: 0;
}

.admin-dish-table__thumb-col {
    width: 56px;
}

.admin-dish-table__price-col {
    white-space: nowrap;
    font-weight: 700;
    color: var(--brand-dark);
}

.admin-dish-table__act-col {
    width: 1%;
    white-space: nowrap;
}

.admin-dish-table__name {
    font-weight: 600;
    color: #2a3144;
}

.admin-thumb-wrap {
    display: block;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    overflow: hidden;
    background: #eef1f8;
}

.admin-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #f0f2f8;
    color: var(--muted);
    font-size: 13px;
}

.admin-dish-preview {
    margin-bottom: 10px;
    max-width: 280px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #f8f9fc;
}

.admin-dish-preview img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
}

.admin-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4a5266;
    cursor: pointer;
}

/* Client: dish photo */
.dish-card__img-wrap {
    margin: -4px -4px 12px;
    border-radius: 12px;
    overflow: hidden;
    background: #eef1f8;
    aspect-ratio: 4 / 3;
}

.dish-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Client: выбор категории (сетка как в шаблоне) */
.client-intro {
    text-align: center;
    margin-bottom: 4px;
    padding: 12px 0 8px;
}

.client-intro__title {
    margin: 0 0 6px;
    font-size: clamp(22px, 5vw, 30px);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #1a1f2e;
}

.client-intro__subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
}

.client-empty {
    margin-top: 20px;
    text-align: center;
    padding: 24px 16px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 12px;
    margin-top: 8px;
    padding-bottom: 24px;
}

@media (min-width: 520px) {
    .category-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 18px 14px;
    }
}

@media (min-width: 900px) {
    .category-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 22px 18px;
    }
}

.category-tile {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    border-radius: 18px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 6px 20px rgba(29, 35, 61, 0.07);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.category-tile:hover {
    box-shadow: 0 10px 28px rgba(29, 35, 61, 0.1);
}

.category-tile:active {
    transform: scale(0.98);
}

.category-tile__media {
    aspect-ratio: 1;
    overflow: hidden;
    background: linear-gradient(160deg, #e2e6ef 0%, #f4f6fa 100%);
}

.category-tile__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.category-tile__placeholder {
    width: 100%;
    height: 100%;
    min-height: 120px;
    background: linear-gradient(145deg, #dce1eb 0%, #f0f2f8 45%, #e5e9f2 100%);
}

.category-tile__label {
    display: block;
    text-align: center;
    font-weight: 800;
    font-size: clamp(10px, 2.6vw, 12px);
    letter-spacing: 0.06em;
    line-height: 1.3;
    text-transform: uppercase;
    padding: 12px 8px 14px;
    color: #222735;
}

@media (min-width: 520px) {
    .category-tile__label {
        font-size: clamp(11px, 1.8vw, 13px);
        padding: 14px 10px 16px;
    }
}

.category-page-head {
    margin-bottom: 18px;
}

.category-page-back {
    display: inline-block;
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-dark);
    margin-bottom: 10px;
    text-decoration: none;
}

.category-page-back:hover {
    text-decoration: underline;
}

.category-page-title {
    margin: 0;
    font-size: clamp(22px, 5vw, 30px);
    font-weight: 800;
    color: #1a1f2e;
}

.category-dishes {
    margin-top: 4px;
}

.dish-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.dish-title-row .dish-title {
    margin: 0;
}

.dish-meta-icons {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px 14px;
    margin-top: 0;
}

.meta--icon {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 0;
}

.meta-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #7a8194;
    line-height: 0;
}

.meta-icon svg {
    display: block;
}

.meta-icon-text {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.3;
}
