:root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #211b1f;
    background: #f6f2f4;
}

* { box-sizing: border-box; }

body { margin: 0; min-height: 100vh; }

.shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.card {
    width: min(680px, 100%);
    padding: 40px;
    border: 1px solid #eadfe4;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(45, 21, 33, .08);
}

.eyebrow {
    color: #9b1b55;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

h1 { margin: 10px 0; font-size: clamp(2rem, 6vw, 3.5rem); }
p { color: #6d5e65; line-height: 1.65; }

a { color: inherit; }
button, input, select, textarea { font: inherit; }

.admin-header {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid #eadfe4;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(12px);
}

.admin-nav {
    width: min(1120px, calc(100% - 40px));
    min-height: 68px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand { font-weight: 900; color: #211b1f; text-decoration: none; letter-spacing: .02em; }
.brand span { color: #9b1b55; }
.admin-nav nav { display: flex; align-items: center; gap: 22px; }
.admin-nav nav a, .link-button { color: #5d4d55; text-decoration: none; font-weight: 700; font-size: .92rem; }
.admin-nav form, .actions form { display: inline; margin: 0; }
.link-button { padding: 0; border: 0; background: none; cursor: pointer; }
.admin-nav nav a:hover, .link-button:hover, .text-link:hover { color: #9b1b55; }

.admin-main { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 48px 0 80px; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 28px; }
.page-head h1 { margin: 8px 0 0; font-size: clamp(2rem, 5vw, 3.25rem); }
.page-head p { margin: 6px 0 0; }

.button {
    display: inline-flex;
    min-height: 44px;
    padding: 11px 20px;
    border: 1px solid #9b1b55;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    background: #9b1b55;
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.button:hover { background: #801546; }
.button-secondary { background: #fff; color: #6c1a43; }
.button-secondary:hover { background: #faf5f7; }
.button-full { width: 100%; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat, .panel { border: 1px solid #eadfe4; border-radius: 16px; background: #fff; box-shadow: 0 12px 35px rgba(45, 21, 33, .05); }
.stat { padding: 24px; }
.stat strong { display: block; font-size: 2rem; }
.stat span { color: #76666e; }
.panel { padding: 28px; }
.panel h2 { margin-top: 0; }
.text-link { color: #8e194e; font-weight: 800; text-decoration: none; }

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(430px, 100%); padding: 38px; border: 1px solid #eadfe4; border-radius: 18px; background: #fff; box-shadow: 0 18px 50px rgba(45, 21, 33, .08); }
.auth-card h1 { margin-bottom: 0; font-size: 2.25rem; }
.back-link { display: inline-block; margin-top: 22px; }

.form-stack { display: grid; gap: 18px; margin-top: 24px; }
label { display: grid; gap: 7px; color: #3c3036; font-weight: 750; font-size: .92rem; }
input, select, textarea {
    width: 100%;
    border: 1px solid #d9cbd1;
    border-radius: 9px;
    padding: 11px 12px;
    background: #fff;
    color: #211b1f;
}
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(155, 27, 85, .14); border-color: #9b1b55; }
small, .hint { display: block; color: #7b6b73; font-weight: 500; }

.alert { padding: 14px 16px; margin: 0 0 20px; border-radius: 10px; line-height: 1.5; }
.alert ul { margin-bottom: 0; }
.alert-error { border: 1px solid #e9b8c2; background: #fff0f3; color: #7b1630; }
.alert-success { border: 1px solid #afd7bd; background: #effaf3; color: #20653a; }

.table-wrap { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 17px 20px; border-bottom: 1px solid #eee5e9; text-align: left; vertical-align: middle; }
th { color: #6e5d65; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
td small { margin-top: 4px; }
tbody tr:last-child td { border-bottom: 0; }
.actions { white-space: nowrap; }
.actions a, .actions button { margin-right: 12px; color: #8e194e; font-weight: 750; text-decoration: none; }
.status { display: inline-block; padding: 5px 9px; border-radius: 999px; font-size: .78rem; font-weight: 800; }
.status-active { color: #20653a; background: #e7f7ec; }
.status-inactive { color: #76666e; background: #eee9eb; }
.empty { padding: 46px 20px; text-align: center; color: #76666e; }

.product-form { display: grid; gap: 28px; }
fieldset { min-width: 0; margin: 0; padding: 0 0 28px; border: 0; border-bottom: 1px solid #eadfe4; }
fieldset:last-of-type { border-bottom: 0; padding-bottom: 0; }
legend { margin-bottom: 18px; color: #271e22; font-size: 1.2rem; font-weight: 850; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.check { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 9px; margin-top: 16px; }
.check input { width: auto; }
.rule-box { padding: 13px 15px; border-radius: 9px; background: #f7f2f4; color: #68575f; font-size: .9rem; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; }

@media (max-width: 760px) {
    .admin-nav { align-items: flex-start; flex-direction: column; padding: 16px 0; }
    .admin-nav nav { width: 100%; gap: 15px; flex-wrap: wrap; }
    .admin-main { padding-top: 32px; }
    .page-head { align-items: flex-start; flex-direction: column; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
    .card, .auth-card, .panel { padding: 24px; }
    .table-wrap { padding: 0; }
}
