:root {
    --bg: #f6f1e8;
    --surface: #fffdf8;
    --surface-alt: #f0e7d8;
    --text: #1e2a1f;
    --muted: #5d6a5f;
    --primary: #375534;
    --primary-dark: #223720;
    --accent: #bf6a2f;
    --border: #d8c9b0;
    --danger: #9b2c2c;
    --success: #2f6b3b;
    --shadow: 0 14px 34px rgba(34, 55, 32, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at top right, rgba(191, 106, 47, 0.14), transparent 22%),
        linear-gradient(180deg, #fbf7f0 0%, var(--bg) 100%);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
    background: rgba(251, 247, 240, 0.9);
    border-bottom: 1px solid rgba(216, 201, 176, 0.7);
}

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

.brand {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.nav {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.nav a {
    color: var(--muted);
    font-weight: 600;
}

.page-content {
    padding: 28px 0 56px;
}

.hero,
.card,
.stats-grid .stat-card,
.table-card,
.login-card {
    background: var(--surface);
    border: 1px solid rgba(216, 201, 176, 0.85);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.hero {
    padding: 28px;
    margin-bottom: 24px;
}

.hero h1,
.section-header h2,
.card h2,
.login-card h1 {
    margin-top: 0;
}

.hero p,
.section-header p,
.muted {
    color: var(--muted);
}

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

.btn,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    font-weight: 700;
    cursor: pointer;
}

.btn-primary,
button,
.btn-secondary:hover {
    background: var(--primary);
    color: #fff;
}

.btn-secondary {
    background: var(--surface-alt);
    color: var(--primary-dark);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    margin: 24px 0 16px;
}

.product-grid,
.stats-grid,
.two-column {
    display: grid;
    gap: 20px;
}

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

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 24px;
}

.two-column {
    grid-template-columns: 1.05fr 1fr;
    align-items: start;
}

.card,
.table-card,
.login-card,
.stat-card {
    padding: 22px;
}

.stat-card span {
    display: block;
    color: var(--muted);
    margin-bottom: 10px;
}

.stat-card strong {
    font-size: 1.8rem;
}

.product-card img,
.thumb {
    width: 100%;
    height: 210px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid rgba(216, 201, 176, 0.8);
    background: var(--surface-alt);
}

.product-card h3 {
    margin-bottom: 8px;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0;
    font-weight: 700;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(55, 85, 52, 0.1);
    color: var(--primary-dark);
    font-size: 0.9rem;
    font-weight: 700;
}

.alert {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 16px;
    font-weight: 600;
}

.alert-success {
    background: rgba(47, 107, 59, 0.12);
    color: var(--success);
}

.alert-error {
    background: rgba(155, 44, 44, 0.11);
    color: var(--danger);
}

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

label {
    display: grid;
    gap: 8px;
    font-weight: 600;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

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

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

th,
td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(216, 201, 176, 0.7);
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 0.95rem;
}

.inline-form {
    display: inline;
}

.login-wrapper {
    min-height: calc(100vh - 160px);
    display: grid;
    place-items: center;
}

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

.empty-state {
    padding: 24px;
    text-align: center;
    color: var(--muted);
    border: 1px dashed var(--border);
    border-radius: 16px;
    background: rgba(240, 231, 216, 0.5);
}

.admin-tabs-card {
    padding-top: 16px;
}

.tabs-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(216, 201, 176, 0.7);
}

.tab-button {
    background: var(--surface-alt);
    color: var(--primary-dark);
}

.tab-button.is-active {
    background: var(--primary);
    color: #fff;
}

.tab-panel {
    display: none;
}

.tab-panel.is-active {
    display: block;
}

.tab-panel-header {
    margin-bottom: 18px;
}

.tab-panel-header h3 {
    margin: 0 0 6px;
}

.tab-panel-header p {
    margin: 0;
    color: var(--muted);
}

@media (max-width: 800px) {
    .header-inner,
    .section-header {
        align-items: start;
        flex-direction: column;
    }

    .two-column {
        grid-template-columns: 1fr;
    }

    .tabs-nav {
        flex-direction: column;
    }
}
