:root {
    --bg: #f5f1ea;
    --surface: #ffffff;
    --surface-muted: #f1f5f9;
    --text: #1f2937;
    --text-soft: #6b7280;
    --border: #d7dde6;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --accent: #b45309;
    --danger: #b91c1c;
    --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    --radius: 18px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, #f7f3ed 0%, #eef6f5 100%);
    color: var(--text);
    overflow-x: hidden;
}

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

img {
    max-width: 100%;
    display: block;
}

.container {
    width: min(1120px, calc(100% - 24px));
    margin: 0 auto;
}

.admin-page .container {
    width: min(1680px, calc(100% - 12px));
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid rgba(215, 221, 230, 0.8);
}

.catalog-page .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    transition: transform 0.28s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.catalog-page .site-header.is-hidden {
    transform: translateY(calc(-100% - 8px));
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 0;
}

.site-header__nav {
    display: flex;
    gap: 16px;
    color: var(--text-soft);
    font-weight: 600;
}

.brand {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--primary-dark);
}

.page-shell {
    padding: 32px 0 56px;
}

.catalog-page .page-shell {
    padding-top: 108px;
}

.hero {
    display: grid;
    gap: 24px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    color: var(--accent);
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.lead {
    max-width: 720px;
    color: var(--text-soft);
    font-size: 1.05rem;
    line-height: 1.65;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.card,
.panel,
.metric-card {
    background: var(--surface);
    border: 1px solid rgba(215, 221, 230, 0.9);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 0;
}

.card {
    padding: 24px;
}

.button,
button,
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    background: var(--primary);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.button:hover,
button:hover,
input[type="submit"]:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.button-secondary {
    background: var(--surface-muted);
    color: var(--text);
}

.button-secondary:hover {
    background: #e2e8f0;
}

.button:disabled,
button:disabled,
input[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.flash {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 14px;
    font-weight: 600;
}

.flash-success {
    background: #dcfce7;
    color: #166534;
}

.flash-error {
    background: #fee2e2;
    color: #991b1b;
}

.flash-info {
    background: #e0f2fe;
    color: #075985;
}

.panel {
    padding: 22px;
}

.field {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.field label {
    font-weight: 700;
}

.field input,
.field textarea,
.field select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
    font-size: 16px;
}

.table-wrap {
    max-width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--text-soft);
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    background: #ecfeff;
    color: #155e75;
    font-size: 0.8rem;
    font-weight: 700;
}

.site-footer {
    padding: 18px 0 34px;
    color: var(--text-soft);
    font-size: 0.92rem;
}

.table-wrap table[data-responsive-table] {
    min-width: 100%;
}

@media (max-width: 860px) {
    .table-wrap table[data-responsive-table],
    .table-wrap table[data-responsive-table] tbody {
        display: block;
    }

    .table-wrap table[data-responsive-table] thead {
        display: none;
    }

    .table-wrap table[data-responsive-table] tbody {
        display: grid;
        gap: 14px;
    }

    .table-wrap table[data-responsive-table] tr {
        display: grid;
        gap: 12px;
        padding: 16px;
        border: 1px solid rgba(215, 221, 230, 0.95);
        border-radius: 18px;
        background: #ffffff;
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
    }

    .table-wrap table[data-responsive-table] td {
        display: grid;
        gap: 4px;
        padding: 0;
        border: 0;
        text-align: left;
    }

    .table-wrap table[data-responsive-table] td::before {
        content: attr(data-label);
        color: var(--text-soft);
        font-size: 0.76rem;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }
}

@media (max-width: 768px) {
    .site-header__inner {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .site-header__nav {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 10px;
    }

    .site-header__nav a {
        flex: 1 1 120px;
        text-align: center;
        padding: 10px 12px;
        border: 1px solid rgba(215, 221, 230, 0.9);
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.9);
    }

    .page-shell {
        padding: 24px 0 40px;
    }

    .catalog-page .page-shell {
        padding-top: 136px;
    }

    .card,
    .panel,
    .metric-card {
        border-radius: 20px;
    }

    .card,
    .panel {
        padding: 18px;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .container {
        width: min(1120px, calc(100% - 18px));
    }

    .admin-page .container {
        width: min(1680px, calc(100% - 14px));
    }

    .brand {
        font-size: 1.02rem;
    }

    h1 {
        font-size: 2rem;
        line-height: 1.08;
    }

    h2 {
        font-size: 1.45rem;
        line-height: 1.12;
    }

    .lead {
        font-size: 0.98rem;
        line-height: 1.55;
    }

    .button,
    button,
    input[type="submit"] {
        min-height: 46px;
        padding: 12px 16px;
    }

    .badge {
        padding: 7px 10px;
    }

    .table-wrap table[data-responsive-table] tr {
        padding: 14px;
    }
}
