:root {
    --ink: #19211f;
    --muted: #68736f;
    --paper: #fffaf0;
    --panel: #ffffff;
    --line: #e7dfd1;
    --green: #1f7a5a;
    --green-dark: #15553f;
    --coral: #df694f;
    --blue: #3562a6;
    --gold: #c58a24;
    --shadow: 0 20px 60px rgba(36, 30, 19, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
}

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

main {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.site-header,
.site-footer {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.site-header {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: var(--ink);
    color: var(--paper);
    font-size: 0.78rem;
    letter-spacing: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
    font-weight: 700;
    font-size: 0.94rem;
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
}

.nav-links a:hover,
.text-link:hover {
    color: var(--green);
}

.nav-cta {
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.62);
}

.hero {
    padding: 34px 0 46px;
}

.hero-slider {
    position: relative;
    margin: 26px 0 34px;
    overflow: hidden;
}

.hero-track {
    position: relative;
}

.hero-slide {
    display: none;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
    align-items: center;
    gap: 44px;
    min-height: 470px;
}

.hero-slide.active {
    display: grid;
}

.hero-copy h1,
.detail-copy h1,
.account-hero h1,
.catalog-hero h1,
.auth-shell h1,
.error-panel h1 {
    margin: 0;
    max-width: 760px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.4rem, 6vw, 5.2rem);
    line-height: 0.98;
    letter-spacing: 0;
}

.hero-copy p,
.lead,
.section-head p,
.auth-shell p,
.error-panel p {
    color: var(--muted);
    font-size: 1.08rem;
}

.hero-copy > p {
    max-width: 620px;
}

.slider-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 18px;
}

.slider-controls button,
.slider-dots button {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--muted);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.slider-controls > button {
    min-height: 38px;
    padding: 0 13px;
}

.slider-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.slider-dots button {
    width: 13px;
    height: 13px;
    padding: 0;
    border-radius: 999px;
}

.slider-dots button.active {
    background: var(--green);
    border-color: var(--green);
}

.product-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    width: min(760px, 100%);
    margin-top: 26px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 12px 36px rgba(48, 37, 18, 0.08);
}

.product-search input {
    min-height: 48px;
    border: 0;
    background: transparent;
    padding: 0 12px;
    font-size: 1rem;
}

.product-search input:focus {
    outline: 2px solid rgba(31, 122, 90, 0.18);
    outline-offset: 2px;
}

.hero-visual {
    position: relative;
}

.hero-visual img {
    width: 100%;
    aspect-ratio: 1 / 1.05;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.category-strip,
.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 36px;
}

.category-strip a,
.admin-nav a {
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--muted);
    font-weight: 800;
    text-decoration: none;
}

.category-strip a:hover,
.category-strip a.active,
.admin-nav a:hover {
    border-color: rgba(31, 122, 90, 0.35);
    color: var(--green);
}

.admin-nav {
    margin-top: 28px;
}

.catalog-hero {
    padding: 42px 0 34px;
}

.catalog-hero h1 {
    margin: 0;
}

.catalog-hero p {
    max-width: 680px;
    color: var(--muted);
}

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

.button,
button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border: 1px solid var(--green);
    border-radius: 8px;
    background: var(--green);
    color: #fff;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.button:hover {
    background: var(--green-dark);
}

.button.ghost {
    background: transparent;
    color: var(--green);
}

.button.full {
    width: 100%;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--coral);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.referral-strip,
.metrics-band,
.referral-panel,
.account-hero,
.table-panel,
.form-panel,
.payment-panel,
.bank-box,
.checkout-product,
.error-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 10px 30px rgba(48, 37, 18, 0.06);
}

.referral-strip {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 26px;
    padding: 18px 20px;
    color: var(--muted);
}

.referral-strip strong {
    color: var(--ink);
}

.metrics-band {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 68px;
    overflow: hidden;
}

.metrics-band div {
    padding: 26px;
    border-right: 1px solid var(--line);
}

.metrics-band div:last-child {
    border-right: 0;
}

.metrics-band strong {
    display: block;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2rem;
}

.metrics-band span {
    color: var(--muted);
}

.section-head {
    max-width: 720px;
    margin-bottom: 24px;
}

.section-head h2,
.referral-panel h2,
.payment-panel h2,
.table-panel h2 {
    margin: 0;
    font-size: 1.6rem;
    line-height: 1.1;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    padding-bottom: 80px;
}

.product-card {
    display: flex;
    min-height: 100%;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 36px rgba(44, 35, 21, 0.08);
}

.product-media {
    display: block;
    background: #f4ecdd;
}

.product-media img {
    width: 100%;
    aspect-ratio: 1.22 / 1;
    object-fit: cover;
}

.product-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 18px;
}

.product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 0.82rem;
}

.product-meta strong {
    color: var(--blue);
}

.product-card h3 {
    margin: 16px 0 8px;
    font-size: 1.18rem;
    line-height: 1.15;
}

.product-card p {
    flex: 1;
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 0.94rem;
}

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

.product-detail,
.checkout-grid {
    display: grid;
    grid-template-columns: minmax(280px, 520px) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
    padding: 44px 0 86px;
}

.detail-media img {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.gallery-grid img {
    aspect-ratio: 1 / 0.78;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: none;
}

.detail-copy h1,
.account-hero h1,
.auth-shell h1,
.error-panel h1 {
    font-size: clamp(2.2rem, 5vw, 4.7rem);
}

.price-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin: 26px 0;
}

.price-line strong {
    color: var(--blue);
    font-size: 2rem;
}

.price-line span,
.muted,
.cell-sub {
    color: var(--muted);
}

.feature-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.feature-list li {
    padding: 12px 14px;
    border-left: 4px solid var(--gold);
    background: rgba(255, 255, 255, 0.64);
    border-radius: 8px;
}

.auth-shell,
.narrow {
    width: min(520px, 100%);
    margin: 52px auto 88px;
}

.form-panel,
.payment-panel {
    padding: 28px;
}

label {
    display: grid;
    gap: 8px;
    margin-top: 18px;
    color: var(--ink);
    font-weight: 800;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

input,
select {
    min-height: 46px;
    padding: 0 14px;
}

textarea {
    resize: vertical;
    padding: 12px 14px;
}

.form-panel .button,
.payment-panel .button {
    margin-top: 22px;
}

.small-note {
    margin: 18px 0 0;
    color: var(--muted);
    text-align: center;
}

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

.check-line {
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    font-weight: 800;
}

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

.admin-form-shell {
    width: min(760px, 100%);
}

.checkout-product {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding: 14px;
}

.checkout-product img {
    border-radius: 8px;
}

.checkout-product strong,
.checkout-product span {
    display: block;
}

.payment-option {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.payment-option input {
    width: 18px;
    min-height: 18px;
    margin-top: 3px;
}

.payment-option strong,
.payment-option small {
    display: block;
}

.payment-option small {
    color: var(--muted);
    font-weight: 500;
}

.bank-box {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 12px 18px;
    margin-top: 24px;
    padding: 20px;
}

.bank-box span {
    color: var(--muted);
}

.bank-box p {
    grid-column: 1 / -1;
    margin: 8px 0 0;
    color: var(--muted);
}

.account-hero,
.referral-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 38px 0 18px;
    padding: 26px;
}

.account-hero p {
    margin-bottom: 0;
    color: var(--muted);
}

.balance-card {
    min-width: 220px;
    padding: 18px;
    border-radius: 8px;
    background: var(--ink);
    color: #fff;
}

.balance-card span,
.balance-card strong {
    display: block;
}

.balance-card span {
    color: rgba(255, 255, 255, 0.72);
}

.balance-card strong {
    font-size: 2rem;
}

.referral-panel {
    margin-top: 0;
}

.copy-box {
    display: flex;
    width: min(520px, 100%);
    gap: 8px;
}

.copy-box input {
    min-width: 0;
}

.icon-button {
    border: 1px solid var(--ink);
    border-radius: 8px;
    background: var(--ink);
    color: #fff;
    font: inherit;
    font-weight: 800;
    padding: 0 16px;
    cursor: pointer;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.85fr);
    gap: 18px;
    padding-bottom: 80px;
}

.table-panel {
    padding: 22px;
}

.table-panel.wide {
    margin: 36px 0 86px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.panel-head a,
.panel-head span {
    color: var(--muted);
    font-weight: 800;
    text-decoration: none;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

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

th {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.cell-sub {
    display: block;
    font-size: 0.86rem;
}

.status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 8px;
    background: #eee5d7;
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: capitalize;
}

.status.paid {
    background: #dff3e9;
    color: #116343;
}

.status.active {
    background: #dff3e9;
    color: #116343;
}

.status.inactive {
    background: #eee5d7;
    color: var(--muted);
}

.status.failed,
.status.cancelled {
    background: #ffe4df;
    color: #9a2d20;
}

.status.manual_review,
.status.pending {
    background: #fff1cf;
    color: #875a04;
}

.empty-state {
    padding: 24px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.48);
}

.empty-state h3,
.empty-state p {
    margin: 0;
}

.empty-state p {
    margin-top: 8px;
    color: var(--muted);
}

.catalog-reset {
    padding-bottom: 80px;
}

.inline-actions {
    display: inline-flex;
    margin: 0 6px 6px 0;
}

.inline-actions button {
    min-height: 34px;
    border: 1px solid var(--green);
    border-radius: 8px;
    background: #e4f3ec;
    color: var(--green-dark);
    font-weight: 900;
    cursor: pointer;
}

.inline-actions button.danger {
    border-color: #d95c44;
    background: #ffe5df;
    color: #9a2d20;
}

.flash-wrap {
    position: fixed;
    z-index: 20;
    top: 84px;
    right: 20px;
    display: grid;
    gap: 10px;
    width: min(380px, calc(100% - 40px));
}

.flash {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
    padding: 14px 16px;
    font-weight: 800;
}

.flash.success {
    border-color: #9bd4b9;
}

.flash.error {
    border-color: #ee9b89;
}

.flash.info {
    border-color: #d9b86c;
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-weight: 700;
}

.site-footer a {
    color: var(--muted);
    text-decoration: none;
}

@media (max-width: 980px) {
    .hero-slide,
    .product-detail,
    .checkout-grid,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
        padding-top: 34px;
    }

    .hero-visual {
        max-width: 560px;
    }

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

@media (max-width: 680px) {
    main,
    .site-header,
    .site-footer {
        width: min(100% - 28px, 1180px);
    }

    .site-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 18px 0;
    }

    .nav-links {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 12px;
    }

    .hero-copy h1,
    .detail-copy h1,
    .account-hero h1,
    .catalog-hero h1,
    .auth-shell h1,
    .error-panel h1 {
        font-size: 2.45rem;
        line-height: 1;
    }

    .product-search {
        grid-template-columns: 1fr;
    }

    .hero-actions,
    .referral-strip,
    .account-hero,
    .referral-panel,
    .panel-head {
        align-items: stretch;
        flex-direction: column;
    }

    .metrics-band,
    .product-grid {
        grid-template-columns: 1fr;
    }

    .metrics-band div {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .metrics-band div:last-child {
        border-bottom: 0;
    }

    .copy-box {
        flex-direction: column;
    }

    .bank-box,
    .checkout-product,
    .form-row {
        grid-template-columns: 1fr;
    }

    .form-panel,
    .payment-panel,
    .table-panel,
    .account-hero,
    .referral-panel {
        padding: 18px;
    }
}
