:root {
    --brand-orange: #f68b1e;
    --brand-dark: #111827;
    --brand-red: #c61f1f;
    --surface: #ffffff;
    --muted: #6b7280;
    --line: #e5e7eb;
    --success: #1f9d55;
    --danger: #dc2626;
    --bg: #f6f7fb;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--brand-dark);
}

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

.top-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.promo-bar {
    text-align: center;
    background: linear-gradient(90deg, var(--brand-orange), #ffad4f);
    color: #fff;
    padding: 10px;
    font-weight: 600;
}

.nav-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 220px minmax(300px, 1fr) auto;
    gap: 16px;
    align-items: center;
}

.logo-main {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 1px;
}

.logo-sub {
    color: var(--brand-orange);
    font-size: 16px;
    margin-left: 6px;
    font-weight: 700;
}

.search-form {
    display: flex;
    gap: 8px;
}

.search-form input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.search-form button,
button,
.button-link {
    background: var(--brand-orange);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 600;
}

.button-link {
    display: inline-block;
}

.button-link.secondary {
    background: #fff4e6;
    color: #ad5b00;
}

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

.top-links {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

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

.link-btn {
    background: transparent;
    color: var(--brand-dark);
    padding: 0;
}

.cart-link {
    font-weight: 700;
}

.container {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 16px;
}

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    background: #fff;
    border: 1px solid var(--line);
}

.alert.success {
    border-color: #86efac;
    color: #166534;
    background: #f0fdf4;
}

.alert.error {
    border-color: #fecaca;
    color: #991b1b;
    background: #fef2f2;
}

.home-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 16px;
}

.category-sidebar {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    align-self: start;
}

.category-sidebar h3 {
    margin-top: 0;
}

.category-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-sidebar a {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
}

.category-sidebar a.active,
.category-sidebar a:hover {
    background: #fff4e6;
    color: #ad5b00;
}

.home-main {
    display: grid;
    gap: 16px;
}

.hero-banner {
    background: linear-gradient(120deg, var(--brand-red), #ea580c);
    border-radius: 14px;
    color: #fff;
    padding: 26px;
    min-height: 170px;
    display: flex;
    align-items: center;
}

.hero-banner h1 {
    margin: 0 0 8px;
    font-size: 28px;
}

.hero-banner p {
    margin: 0;
    max-width: 560px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
}

.product-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}

.product-image-wrap {
    display: block;
    height: 180px;
    background: #f8fafc;
}

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

.product-body {
    padding: 12px;
}

.product-body h4 {
    margin: 0 0 8px;
    font-size: 15px;
}

.vendor-name {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 13px;
}

.price {
    margin: 0 0 10px;
    color: #b45309;
    font-weight: 700;
}

.price.large {
    font-size: 24px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px;
}

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

.form-grid {
    display: grid;
    gap: 12px;
}

label {
    display: grid;
    gap: 6px;
    font-size: 14px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    font-size: 14px;
    font-family: inherit;
}

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

.inline-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

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

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 12px 10px;
    text-align: left;
    font-size: 14px;
}

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

.cart-summary {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.product-detail {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px;
    display: grid;
    grid-template-columns: minmax(280px, 420px) 1fr;
    gap: 20px;
}

.product-detail-image img {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--line);
}

.product-category {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.description {
    line-height: 1.5;
}

.field-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
}

.rich-editor-field {
    display: grid;
    gap: 8px;
}

.editor-shell {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
}

.editor-toolbar button {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--brand-dark);
}

.editor-toolbar button.is-active {
    background: #fff4e6;
    color: #ad5b00;
}

.editor-surface {
    min-height: 280px;
    padding: 16px;
    outline: none;
}

.editor-surface:empty::before {
    content: attr(data-placeholder);
    color: var(--muted);
}

.rich-content > :first-child {
    margin-top: 0;
}

.rich-content > :last-child {
    margin-bottom: 0;
}

.rich-content ul,
.rich-content ol {
    padding-left: 20px;
}

.rich-content a {
    color: #ad5b00;
    text-decoration: underline;
}

.dashboard-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dashboard-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-stats-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.admin-stat-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px;
    background: #f8fafc;
}

.admin-stat-card h3 {
    margin: 2px 0;
    font-size: 24px;
}

.admin-stat-card small {
    color: var(--muted);
}

.stat-label {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.admin-panels {
    margin-top: 16px;
    display: grid;
    gap: 16px;
}

.admin-workspace {
    margin-top: 16px;
    display: grid;
    gap: 16px;
}

.status-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px;
    background: #f9fafb;
    margin-bottom: 14px;
}

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

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

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.pager-link {
    border: 1px solid var(--line);
    background: #fff;
    padding: 8px 12px;
    border-radius: 8px;
}

.pager-link.disabled {
    color: var(--muted);
}

.footer {
    margin-top: 30px;
    border-top: 1px solid var(--line);
    text-align: center;
    padding: 18px 14px;
    color: var(--muted);
    font-size: 14px;
}

@media (max-width: 980px) {
    .nav-wrap {
        grid-template-columns: 1fr;
    }

    .top-links {
        flex-wrap: wrap;
    }

    .home-layout {
        grid-template-columns: 1fr;
    }

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

    .cart-summary {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .editor-toolbar {
        overflow-x: auto;
    }
}
