:root {
    --bg: #f6f3ef;
    --surface: #ffffff;
    --surface-soft: #f8faf9;
    --text: #1f2933;
    --muted: #697586;
    --line: #d9dee5;
    --primary: #176b63;
    --primary-strong: #104f49;
    --accent: #b84a62;
    --warning: #a15c13;
    --success: #237a4a;
    --danger: #b42318;
    --shadow: 0 16px 40px rgba(31, 41, 51, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px clamp(18px, 5vw, 56px);
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.brand {
    color: var(--text);
    font-weight: 800;
    white-space: nowrap;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.nav a {
    color: var(--text);
    font-size: 14px;
}

.page {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
    padding: 32px 0 56px;
}

.hero {
    min-height: calc(100vh - 180px);
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
    gap: clamp(28px, 5vw, 64px);
    align-items: center;
    padding: 34px 0;
}

.hero h1,
.section h1 {
    margin: 0;
    max-width: 780px;
    font-size: clamp(34px, 6vw, 68px);
    line-height: 1.02;
    letter-spacing: 0;
}

.section h1 {
    font-size: clamp(30px, 4vw, 48px);
}

.lead {
    max-width: 620px;
    margin: 20px 0 0;
    color: var(--muted);
    font-size: 19px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 28px;
}

.button,
button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

.button:hover,
button.button:hover {
    background: var(--primary-strong);
    text-decoration: none;
}

.button.secondary {
    background: #e6eeec;
    color: var(--primary-strong);
}

.button.small {
    min-height: 36px;
    padding: 0 12px;
    font-size: 14px;
}

.preview-panel {
    min-height: 430px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(23, 107, 99, 0.12), transparent 34%),
        linear-gradient(315deg, rgba(184, 74, 98, 0.12), transparent 38%),
        var(--surface);
    box-shadow: var(--shadow);
}

.print-sheet {
    aspect-ratio: 4 / 5;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    margin: 0 auto 18px;
    width: min(280px, 100%);
    border: 1px dashed #9aa6b2;
    border-radius: 8px;
    background: #fff;
}

.print-sheet span {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: conic-gradient(from 160deg, #176b63, #b84a62, #d9a441, #176b63);
}

.print-sheet small {
    color: var(--muted);
}

.preview-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
}

.section {
    padding: 28px 0;
}

.section.narrow {
    max-width: 780px;
}

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

.section-head.compact {
    margin-top: 32px;
}

.section-head h1,
.section-head h2 {
    margin: 0;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.product-card,
.panel,
.success-card,
.empty-state,
.flash {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.product-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 300px;
    overflow: hidden;
    padding: 0;
}

.product-card h3,
.panel h2 {
    margin: 0 0 8px;
}

.product-card p {
    margin: 0;
    color: var(--muted);
}

.product-card > div:not(.product-image),
.product-card .card-footer {
    padding-left: 20px;
    padding-right: 20px;
}

.product-card > div:not(.product-image) {
    padding-top: 18px;
}

.product-image {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #eef3f2;
    border-bottom: 1px solid var(--line);
}

.product-image:hover {
    text-decoration: none;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-image-empty span {
    display: grid;
    place-items: center;
    width: 74px;
    height: 74px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--primary-strong);
    font-size: 15px;
    font-weight: 800;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: auto;
    padding-top: 22px;
    padding-bottom: 20px;
}

.form {
    display: grid;
    gap: 16px;
}

.form label {
    display: grid;
    gap: 7px;
    color: var(--text);
    font-weight: 700;
}

.form input,
.form select,
.form textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #bfc8d2;
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-weight: 400;
}

.form textarea {
    resize: vertical;
}

.grid-2,
.details-grid,
.admin-layout,
.stats {
    display: grid;
    gap: 16px;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.details-grid,
.admin-layout {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.75fr);
}

.hint,
small {
    color: var(--muted);
    font-size: 13px;
}

.account-box {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.check {
    display: flex !important;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px !important;
}

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

.flash {
    padding: 14px 16px;
    margin-bottom: 18px;
}

.flash.error {
    border-color: rgba(180, 35, 24, 0.35);
    background: #fff4f2;
    color: var(--danger);
}

.flash.success {
    border-color: rgba(35, 122, 74, 0.35);
    background: #eef9f2;
    color: var(--success);
}

.empty-state {
    padding: 24px;
    color: var(--muted);
}

.success-card {
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.success-card h1 {
    margin: 0 0 8px;
}

.success-card p:last-child {
    margin-bottom: 0;
}

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

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

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

th {
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

td small {
    display: block;
    margin-top: 3px;
}

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

.status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #edf3f2;
    color: var(--primary-strong);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats div {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.stats span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.stats strong {
    display: block;
    margin-top: 8px;
    font-size: 34px;
}

.panel {
    padding: 20px;
}

.tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.tabs a {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
}

.tabs a.active {
    border-color: var(--primary);
    background: #e6eeec;
    color: var(--primary-strong);
    font-weight: 800;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.table-actions form {
    margin: 0;
}

.product-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 240px;
}

.product-row img,
.product-thumb-empty {
    flex: 0 0 auto;
    width: 54px;
    height: 54px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #eef3f2;
    object-fit: cover;
}

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

.product-admin-preview img {
    width: 160px;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--line);
    border-radius: 8px;
    object-fit: cover;
}

.link-button {
    border: 0;
    background: transparent;
    color: var(--primary);
    padding: 0;
    font: inherit;
    cursor: pointer;
}

.details {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 10px 16px;
    margin: 0 0 26px;
}

.details dt {
    color: var(--muted);
    font-weight: 800;
}

.details dd {
    margin: 0;
}

.upload-preview {
    display: block;
    overflow: hidden;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.upload-preview img {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
}

.footer {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
    padding: 28px 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 14px;
}

@media (max-width: 820px) {
    .topbar,
    .section-head,
    .footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero,
    .grid-2,
    .details-grid,
    .admin-layout,
    .stats {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: 0;
    }

    .preview-panel {
        min-height: auto;
    }

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