:root {
    --bg: #f5f0e8;
    --surface: #fffaf2;
    --surface-strong: #fff;
    --text: #211a14;
    --muted: #776a5e;
    --line: #e4d8c8;
    --brand: #9b4f1d;
    --brand-dark: #713915;
    --accent: #1f6f5f;
    --danger: #b42318;
    --warning: #a15c07;
    --success: #1e7a46;
    --info: #175cd3;
    --shadow: 0 16px 40px rgba(56, 35, 20, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at top left, rgba(155, 79, 29, 0.16), transparent 32rem),
        linear-gradient(135deg, #f7efe4 0%, #eee3d3 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
}

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

a:hover {
    color: var(--brand-dark);
}

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

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

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.78rem 0.9rem;
    background: #fffdf8;
    color: var(--text);
    outline: none;
}

textarea {
    min-height: 104px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(155, 79, 29, 0.12);
}

code {
    border-radius: 8px;
    background: #f0e5d7;
    padding: 0.15rem 0.35rem;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 0.85rem 1.5rem;
    border-bottom: 1px solid rgba(126, 89, 58, 0.18);
    background: rgba(255, 250, 242, 0.92);
    backdrop-filter: blur(16px);
}

.brand {
    display: inline-flex;
    gap: 0.75rem;
    align-items: center;
    color: var(--text);
}

.brand:hover {
    color: var(--text);
}

.brand-mark {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand), #ca7b35);
    color: #fff;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.brand small,
.user-menu small {
    display: block;
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: capitalize;
}

.nav-links {
    display: flex;
    gap: 0.45rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-links a,
.user-menu a {
    border-radius: 999px;
    padding: 0.48rem 0.72rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.nav-links a:hover,
.nav-links a.active,
.user-menu a:hover {
    background: #efe2d1;
    color: var(--brand-dark);
}

.user-menu {
    display: flex;
    gap: 0.55rem;
    align-items: center;
    justify-content: flex-end;
    color: var(--text);
}

.container {
    width: min(1220px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.5rem 0 3rem;
}

.site-footer {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    width: min(1220px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.5rem 0 2rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
    gap: 1.5rem;
    align-items: stretch;
    padding: 2.4rem;
    border: 1px solid rgba(126, 89, 58, 0.18);
    border-radius: 32px;
    background: linear-gradient(135deg, rgba(255, 250, 242, 0.9), rgba(235, 219, 198, 0.76));
    box-shadow: var(--shadow);
}

.hero h1 {
    max-width: 860px;
    margin: 0.2rem 0 1rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.3rem, 5vw, 5rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.hero p {
    max-width: 720px;
    color: var(--muted);
    font-size: 1.05rem;
}

.hero-actions,
.form-actions,
.actions {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    flex-wrap: wrap;
}

.hero-card,
.panel,
.stat-card,
.product-card,
.shipping-card {
    border: 1px solid rgba(126, 89, 58, 0.18);
    border-radius: 24px;
    background: rgba(255, 250, 242, 0.88);
    box-shadow: var(--shadow);
}

.hero-card {
    padding: 1.5rem;
    background: #2e2117;
    color: #fff5e7;
}

.hero-card h2 {
    margin-top: 0;
}

.demo-list {
    display: grid;
    gap: 0.85rem;
    padding: 0;
    list-style: none;
}

.demo-list li {
    display: grid;
    gap: 0.2rem;
    padding: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
}

.demo-list span {
    color: #dcc8b0;
}

.eyebrow {
    margin: 0 0 0.45rem;
    color: var(--brand);
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.78rem;
}

.panel {
    margin-bottom: 1.2rem;
    padding: 1.35rem;
}

.panel h1,
.panel h2,
.panel h3 {
    margin-top: 0;
}

.grid {
    display: grid;
    gap: 1rem;
}

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

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 1rem;
}

.grid-form-list {
    grid-template-columns: minmax(280px, 0.38fr) minmax(0, 0.62fr);
    align-items: start;
}

.feature-card {
    min-height: 180px;
}

.feature-icon {
    display: inline-grid;
    width: 46px;
    height: 46px;
    margin-bottom: 1rem;
    place-items: center;
    border-radius: 14px;
    background: #2e2117;
    color: #fff5e7;
    font-weight: 900;
}

.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    padding: 0.72rem 1.05rem;
    background: var(--brand);
    color: #fff;
    cursor: pointer;
    font-weight: 800;
    text-decoration: none;
}

.button:hover {
    background: var(--brand-dark);
    color: #fff;
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.button-secondary {
    background: #efe2d1;
    color: var(--brand-dark);
}

.button-secondary:hover {
    background: #e4d2bc;
    color: var(--brand-dark);
}

.button-danger {
    background: var(--danger);
}

.button-danger:hover {
    background: #8f1d13;
}

.button-small {
    min-height: 34px;
    padding: 0.45rem 0.75rem;
    font-size: 0.86rem;
}

.auth-container {
    display: grid;
    min-height: calc(100vh - 190px);
    place-items: center;
}

.auth-card {
    width: min(440px, 100%);
}

.auth-card.wide {
    width: min(760px, 100%);
}

.narrow-panel {
    width: min(620px, 100%);
    margin-inline: auto;
}

.form-stack,
.form-grid {
    display: grid;
    gap: 0.9rem;
}

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

label span {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-weight: 700;
    font-size: 0.88rem;
}

.span-2 {
    grid-column: 1 / -1;
}

.alert {
    margin-bottom: 1rem;
    border-radius: 16px;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(126, 89, 58, 0.18);
    background: #fff8ea;
    color: var(--warning);
}

.alert-success {
    background: #ecfdf3;
    color: var(--success);
}

.alert-danger {
    background: #fff0ed;
    color: var(--danger);
}

.alert-warning {
    background: #fff8ea;
    color: var(--warning);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.compact-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 1rem;
}

.stat-card {
    display: grid;
    gap: 0.35rem;
    min-height: 118px;
    padding: 1.1rem;
    background: linear-gradient(145deg, rgba(255, 250, 242, 0.95), rgba(240, 226, 208, 0.84));
}

.stat-card span {
    color: var(--muted);
    font-weight: 700;
}

.stat-card strong {
    align-self: end;
    color: var(--text);
    font-size: clamp(1.7rem, 3vw, 2.45rem);
    line-height: 1;
}

.stat-link:hover {
    transform: translateY(-2px);
}

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

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

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

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

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

th {
    color: var(--muted);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

tfoot th {
    color: var(--text);
    font-size: 1rem;
}

.empty-state {
    padding: 2rem;
    color: var(--muted);
    text-align: center;
}

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

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.28rem 0.58rem;
    font-size: 0.8rem;
    font-weight: 800;
    white-space: nowrap;
}

.badge-success {
    background: #dcfae6;
    color: var(--success);
}

.badge-info {
    background: #dbeafe;
    color: var(--info);
}

.badge-warning {
    background: #fff4d7;
    color: var(--warning);
}

.badge-danger {
    background: #ffe4e0;
    color: var(--danger);
}

.badge-muted {
    background: #eee4d8;
    color: var(--muted);
}

.inline-form,
.filter-form {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-form {
    justify-content: flex-end;
}

.filter-form.compact {
    justify-content: flex-start;
    margin-bottom: 1rem;
}

.filter-form input,
.filter-form select {
    min-width: 190px;
    width: auto;
}

.inline-form input {
    max-width: 120px;
}

.catalog-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: end;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.product-card {
    overflow: hidden;
    background: var(--surface);
}

.product-image {
    display: grid;
    aspect-ratio: 16 / 9;
    place-items: center;
    background: linear-gradient(135deg, #3b2b1f, #93613b);
    color: #fff5e7;
    font-size: 2.6rem;
    font-weight: 900;
}

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

.product-body {
    display: grid;
    gap: 0.7rem;
    padding: 1rem;
}

.product-body h2 {
    margin: 0;
}

.product-body p {
    min-height: 50px;
    margin: 0;
    color: var(--muted);
}

.product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.product-meta span {
    color: var(--muted);
    font-size: 0.9rem;
}

.pill {
    width: fit-content;
    border-radius: 999px;
    padding: 0.25rem 0.55rem;
    background: #efe2d1;
    color: var(--brand-dark);
    font-size: 0.78rem;
    font-weight: 800;
}

.detail-list {
    display: grid;
    gap: 0.7rem;
    margin: 0;
}

.detail-list div {
    display: grid;
    gap: 0.2rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--line);
}

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

.detail-list dd {
    margin: 0;
}

.total-preview {
    border-radius: 16px;
    padding: 1rem;
    background: #efe2d1;
}

.order-heading {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.order-statuses {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.timeline {
    display: grid;
    gap: 0.9rem;
    margin: 0;
    padding-left: 1.2rem;
}

.timeline li::marker {
    color: var(--brand);
}

.timeline span {
    display: block;
    color: var(--muted);
    font-size: 0.88rem;
}

.payment-actions {
    display: grid;
    gap: 0.5rem;
    min-width: 240px;
}

.payment-actions textarea {
    min-height: 78px;
}

.shipping-list {
    display: grid;
    gap: 1rem;
}

.shipping-card {
    display: grid;
    grid-template-columns: minmax(240px, 0.32fr) minmax(0, 0.68fr);
    gap: 1rem;
    padding: 1rem;
    box-shadow: none;
}

.report-header {
    text-align: center;
}

@media (max-width: 1060px) {
    .site-header {
        grid-template-columns: 1fr;
    }

    .nav-links,
    .user-menu {
        justify-content: flex-start;
    }

    .hero,
    .catalog-header,
    .shipping-card,
    .grid-form-list {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 760px) {
    .container {
        width: min(100% - 1rem, 1220px);
        padding-top: 0.8rem;
    }

    .site-header {
        padding: 0.85rem;
    }

    .hero {
        padding: 1.3rem;
        border-radius: 24px;
    }

    .grid-2,
    .stats-grid,
    .compact-stats,
    .product-grid,
    .grid-3,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .filter-form,
    .filter-form.compact,
    .inline-form,
    .section-title,
    .order-heading,
    .site-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-form input,
    .filter-form select,
    .inline-form input {
        width: 100%;
        max-width: none;
    }

    .panel {
        padding: 1rem;
        border-radius: 20px;
    }

    .nav-links a,
    .user-menu a {
        padding: 0.45rem 0.58rem;
    }
}

@media print {
    body {
        background: #fff;
    }

    .site-header,
    .site-footer,
    .print-hidden,
    .button,
    .actions,
    form {
        display: none !important;
    }

    .container {
        width: 100%;
        padding: 0;
    }

    .panel,
    .stat-card {
        box-shadow: none;
        border-color: #ccc;
        break-inside: avoid;
    }

    table {
        min-width: 0;
    }
}
