:root {
    --page: #f5f7fb;
    --panel: #ffffff;
    --ink: #111827;
    --muted: #61708a;
    --line: #d8e1ee;
    --green: #0d7f73;
    --green-soft: #e7f4f1;
    --blue: #255aaa;
    --orange: #ff7119;
    --red: #a13e4c;
    --red-soft: #f8e8eb;
    --shadow: 0 18px 50px rgba(17, 24, 39, .08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        linear-gradient(130deg, rgba(13, 127, 115, .10), transparent 34%),
        linear-gradient(315deg, rgba(255, 113, 25, .08), transparent 32%),
        var(--page);
    color: var(--ink);
    font: 16px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(110deg, rgba(37, 90, 170, .08) 1px, transparent 1px);
    background-size: 44px 100%;
    opacity: .65;
}

.admin-header,
main {
    position: relative;
    width: min(1180px, calc(100% - 32px));
    margin: auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    padding: 34px 0 18px;
}

h1,
h2 {
    margin: 0;
    line-height: 1.05;
    letter-spacing: 0;
}

h1 {
    font-size: clamp(2.1rem, 4.5vw, 4rem);
}

h2 {
    font-size: clamp(1.45rem, 2.5vw, 2rem);
}

p {
    color: var(--muted);
}

a {
    color: var(--green);
    font-weight: 800;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--green);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .16em;
}

section,
.login-card {
    margin: 18px 0;
    padding: 26px;
    background: rgba(255, 255, 255, .92);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.overview article {
    padding: 18px 20px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
}

.overview span {
    display: block;
    color: var(--green);
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
}

.overview strong {
    display: block;
    margin-top: 8px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
}

.logout-form {
    margin: 0;
}

.secondary,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 11px 18px;
    border-radius: 12px;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

button {
    border: 0;
    background: var(--green);
    color: #fff;
}

.secondary {
    border: 1px solid var(--green);
    background: #fff;
    color: var(--green);
}

.secondary:hover {
    text-decoration: none;
    background: var(--green-soft);
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 14px;
}

table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

tbody tr:last-child td {
    border-bottom: 0;
}

th {
    background: #f3f6fb;
    color: #43516a;
    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

td small,
.product-list small {
    display: block;
    color: var(--muted);
    margin-top: 3px;
}

.status {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 900;
}

.status.on {
    background: var(--green-soft);
    color: var(--green);
}

.status.off {
    background: #eef1f6;
    color: #59657a;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.wide {
    grid-column: 1 / -1;
}

label {
    display: grid;
    gap: 7px;
    font-weight: 850;
}

.field {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.field > label {
    display: block;
}

label small {
    font-weight: 500;
    color: var(--muted);
}

input,
select {
    width: 100%;
    min-height: 44px;
    padding: 11px 12px;
    border: 1px solid #bdcada;
    border-radius: 11px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

input:focus,
select:focus {
    outline: 3px solid rgba(13, 127, 115, .18);
    border-color: var(--green);
}

.field-help {
    color: var(--muted);
    font-size: .9rem;
    font-weight: 500;
}

.field-help summary {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    color: var(--green);
    cursor: pointer;
    font-size: .86rem;
    font-weight: 850;
    list-style-position: inside;
}

.field-help summary:hover {
    text-decoration: underline;
}

.field-help p {
    margin: 5px 0 0;
    padding: 10px 12px;
    border-left: 3px solid var(--green);
    border-radius: 0 10px 10px 0;
    background: var(--green-soft);
    color: #38524f;
}

.field-help code {
    padding: 1px 5px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .75);
    color: var(--ink);
    font: .9em ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.icon-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px dashed var(--line);
    border-radius: 12px;
    color: var(--muted);
    font-size: .92rem;
    font-weight: 800;
}

.icon-preview img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
}

.check {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
}

.check input {
    width: 18px;
    min-height: 18px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.product-list {
    display: grid;
    gap: 10px;
}

.product-list article {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.product-list img {
    width: 56px;
    height: 56px;
    border-radius: 13px;
    object-fit: cover;
}

.product-list small {
    overflow-wrap: anywhere;
}

.notice {
    margin: 16px 0;
    padding: 13px 16px;
    border-radius: 12px;
    font-weight: 800;
}

.success {
    background: var(--green-soft);
    color: var(--green);
}

.error {
    background: var(--red-soft);
    color: var(--red);
}

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

.login-card {
    width: min(450px, 100%);
    margin: 0;
}

.login-card form {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

@media (max-width: 820px) {
    .admin-header {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .section-title {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .wide {
        grid-column: auto;
    }

    section,
    .login-card {
        padding: 20px;
        border-radius: 16px;
    }

    .product-list article {
        grid-template-columns: 52px minmax(0, 1fr);
    }

    .product-list article > .status,
    .product-list article > a {
        grid-column: 2;
        justify-self: start;
    }
}

@media (max-width: 520px) {
    .admin-header,
    main {
        width: min(100% - 20px, 1180px);
    }

    h1 {
        font-size: 2.15rem;
    }

    table {
        min-width: 760px;
    }
}
