:root {
    --bg: #f5efe6;
    --paper: #fffdf8;
    --ink: #1f2933;
    --muted: #6b7280;
    --brand: #0b5d52;
    --brand-dark: #083b34;
    --accent: #d97706;
    --danger: #b42318;
    --success: #0f766e;
    --border: #e7dccb;
    --shadow: 0 18px 40px rgba(30, 41, 59, 0.08);
    --radius: 22px;
    --font: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font);
    background:
        radial-gradient(circle at top right, rgba(217, 119, 6, 0.16), transparent 30%),
        radial-gradient(circle at bottom left, rgba(11, 93, 82, 0.16), transparent 26%),
        var(--bg);
    color: var(--ink);
}

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

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

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

th,
td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    text-align: right;
    vertical-align: middle;
}

.page-shell {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.25rem 0 3rem;
}

.site-header,
.hero,
.panel,
.auth-card,
.product-card,
.stat-card {
    background: rgba(255, 253, 248, 0.92);
    border: 1px solid rgba(231, 220, 203, 0.95);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.site-header {
    border-radius: 28px;
    padding: 1.2rem 1.4rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.25rem;
}

.brand {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--brand-dark);
}

.tagline {
    margin: 0.3rem 0 0;
    color: var(--muted);
}

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

.nav-links a,
.link-button {
    padding: 0.7rem 1rem;
    border-radius: 999px;
    background: rgba(11, 93, 82, 0.08);
    color: var(--brand-dark);
    border: none;
    font: inherit;
    cursor: pointer;
}

.pill,
.badge,
.status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    font-size: 0.84rem;
    font-weight: 700;
}

.pill,
.badge {
    background: rgba(217, 119, 6, 0.12);
    color: #9a5a05;
}

.badge.large {
    margin-bottom: 1rem;
}

.flash-stack {
    display: grid;
    gap: 0.7rem;
    margin-bottom: 1rem;
}

.flash {
    padding: 0.95rem 1rem;
    border-radius: 16px;
    font-weight: 600;
}

.flash-success {
    background: rgba(15, 118, 110, 0.12);
    color: var(--success);
}

.flash-danger {
    background: rgba(180, 35, 24, 0.12);
    color: var(--danger);
}

.flash-warning {
    background: rgba(217, 119, 6, 0.14);
    color: #9a5a05;
}

.flash-info {
    background: rgba(11, 93, 82, 0.1);
    color: var(--brand-dark);
}

.hero,
.panel,
.auth-card {
    border-radius: 30px;
    padding: 1.5rem;
}

.hero {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.2rem;
}

.eyebrow {
    margin: 0;
    color: var(--accent);
    font-weight: 800;
}

.hero h1,
.section-heading h1,
.auth-card h1,
.detail-content h1 {
    margin: 0.5rem 0 0.8rem;
    line-height: 1.3;
}

.hero h1 {
    max-width: 18ch;
    font-size: clamp(2.3rem, 3vw, 3.25rem);
    text-wrap: pretty;
}

.hero-copy,
.section-heading p,
.muted,
.description,
.empty-state p {
    color: var(--muted);
}

.hero-panel {
    padding: 1.2rem;
    border-radius: 24px;
    background: linear-gradient(145deg, var(--brand), var(--brand-dark));
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 180px;
}

.filter-form,
.grid-form,
.purchase-form,
.button-row,
.section-heading.split {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: end;
}

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

.field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex: 1 1 220px;
}

.field.small {
    max-width: 160px;
}

.field.full,
.image-preview-card.full,
.button-row.full {
    grid-column: 1 / -1;
}

.field label {
    font-weight: 700;
    line-height: 1.4;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: #fff;
    font: inherit;
    line-height: 1.5;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: rgba(11, 93, 82, 0.4);
    box-shadow: 0 0 0 4px rgba(11, 93, 82, 0.08);
}

.primary-button,
.secondary-button,
.danger-button {
    border: none;
    border-radius: 16px;
    padding: 0.9rem 1.2rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    line-height: 1.2;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.primary-button {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
}

.secondary-button {
    background: rgba(11, 93, 82, 0.1);
    color: var(--brand-dark);
}

.danger-button {
    background: rgba(180, 35, 24, 0.12);
    color: var(--danger);
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.link-button:hover {
    transform: translateY(-1px);
}

.primary-button:active,
.secondary-button:active,
.danger-button:active,
.link-button:active {
    transform: translateY(0);
}

.product-grid,
.stats-grid {
    display: grid;
    gap: 1rem;
}

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

.product-card {
    border-radius: 28px;
    overflow: hidden;
}

.product-card img {
    width: 100%;
    height: 240px;
    object-fit: contain;
    object-position: center;
    padding: 0.9rem;
    background: linear-gradient(135deg, rgba(11, 93, 82, 0.12), rgba(217, 119, 6, 0.12));
}

.product-body {
    padding: 1.1rem;
}

.product-card .price-row {
    align-items: flex-end;
}

.product-card .price-row .secondary-button {
    flex: 0 0 auto;
    min-width: 7.75rem;
    padding-inline: 1rem;
    white-space: nowrap;
    box-shadow: inset 0 0 0 1px rgba(11, 93, 82, 0.12);
}

.card-meta,
.price-row,
.cart-actions,
.product-cell,
.meta-grid {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.product-body h2 {
    margin: 0.8rem 0 0.5rem;
    font-size: 1.15rem;
}

.clamp {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    color: var(--muted);
    min-height: 3rem;
}

.detail-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 1.5rem;
}

.detail-image,
.detail-content,
.image-preview-card {
    background: rgba(255, 253, 248, 0.92);
    border-radius: 30px;
    padding: 1.4rem;
    border: 1px solid rgba(231, 220, 203, 0.95);
    box-shadow: var(--shadow);
}

.detail-image img,
.image-preview-card img {
    border-radius: 24px;
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    object-position: center;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(11, 93, 82, 0.08), rgba(217, 119, 6, 0.08));
}

.detail-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--brand-dark);
}

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

.spec-grid,
.meta-grid {
    display: grid;
    gap: 0.9rem;
    margin: 1rem 0;
}

.auth-card {
    max-width: 540px;
    margin: 0 auto;
}

.auth-form {
    display: grid;
    gap: 1rem;
}

.auth-submit {
    width: 100%;
    margin-top: 0.25rem;
}

.filter-form {
    display: grid;
    grid-template-columns: minmax(280px, 1.6fr) minmax(220px, 1fr) auto;
    align-items: end;
}

.filter-form .field {
    margin: 0;
}

.filter-action {
    display: flex;
    align-items: end;
}

.filter-submit {
    min-width: 140px;
}

.cart-table table {
    margin-top: 1rem;
}

.product-cell {
    justify-content: flex-start;
}

.product-cell img {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    object-fit: contain;
    object-position: center;
    padding: 0.3rem;
    background: linear-gradient(135deg, rgba(11, 93, 82, 0.08), rgba(217, 119, 6, 0.08));
}

.quantity-control {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.quantity-control input {
    width: 78px;
    text-align: center;
}

.qty-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
    font-size: 1.1rem;
}

.order-total {
    font-size: 1.1rem;
    font-weight: 700;
}

.status-pending {
    background: rgba(217, 119, 6, 0.14);
    color: #9a5a05;
}

.status-approved {
    background: rgba(11, 93, 82, 0.12);
    color: var(--brand-dark);
}

.status-shipped {
    background: rgba(15, 118, 110, 0.12);
    color: var(--success);
}

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

.stat-card {
    border-radius: 24px;
    padding: 1.2rem;
}

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

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

.image-preview-card {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.form-actions {
    justify-content: flex-start;
    align-items: center;
    margin-top: 0.25rem;
}

.form-actions .primary-button,
.form-actions .secondary-button {
    min-width: 148px;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 253, 248, 0.86);
    border: 1px dashed var(--border);
    border-radius: 28px;
}

@media (max-width: 900px) {
    .hero,
    .detail-layout,
    .stats-grid,
    .spec-grid,
    .meta-grid {
        grid-template-columns: 1fr;
    }

    .site-header,
    .cart-actions,
    .section-heading.split {
        flex-direction: column;
        align-items: stretch;
    }

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

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

    .filter-action,
    .filter-submit {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .page-shell {
        width: min(100% - 1rem, 100%);
    }

    th,
    td {
        padding: 0.75rem 0.55rem;
        font-size: 0.92rem;
    }

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

    .product-card img {
        height: 210px;
    }
}
