/* ── Layout ──────────────────────────────────────────────────────────────── */
body {
    background: #f5f6f8;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    height: 100vh;
    overflow-y: auto;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1rem;
}

.main-content {
    margin-left: 220px;
    padding: 2rem 2.5rem;
    min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar-brand {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
    text-decoration: none;
    padding: 0 0.5rem;
    margin-bottom: 0.25rem;
}

.sidebar-brand:hover { color: #4f46e5; }

.sidebar-section-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    margin: 1.25rem 0 0.25rem 0.5rem;
}

.sidebar .nav-link {
    color: #374151;
    padding: 0.45rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    font-weight: 400;
}

.sidebar .nav-link:hover {
    background: #f3f4f6;
    color: #111827;
}

.sidebar .nav-link.active {
    background: #ede9fe;
    color: #4f46e5;
    font-weight: 500;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #6b7280;
}

/* ── Topbar mobile ───────────────────────────────────────────────────────── */
.topbar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 900;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem 1rem;
    align-items: center;
    gap: 0.75rem;
}

/* ── Page header ─────────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-header h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: #111827;
}

/* ── Admin table ─────────────────────────────────────────────────────────── */
.table-admin {
    font-size: 0.875rem;
    border-collapse: collapse;
    width: 100%;
}

.table-admin thead th {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.6rem 1rem;
    white-space: nowrap;
}

.table-admin tbody td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
    vertical-align: middle;
}

.table-admin tbody tr:last-child td {
    border-bottom: none;
}

.table-admin tbody tr:hover td {
    background: #fafafa;
}

.table-card {
    background: #fff;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    overflow-x: auto;
}

/* ── Item name + badge ───────────────────────────────────────────────────── */
.item-name {
    font-weight: 500;
    color: #111827;
    text-decoration: none;
}

.item-name:hover { color: #4f46e5; }

.item-sku {
    font-size: 0.72rem;
    color: #9ca3af;
    font-weight: 400;
    margin-left: 0.4rem;
}

/* ── Prices ──────────────────────────────────────────────────────────────── */
.price-main {
    font-weight: 700;
    color: #111827;
}

.price-muted {
    color: #6b7280;
}

/* ── Action buttons ──────────────────────────────────────────────────────── */
.btn-icon {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.8rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    line-height: 1;
}

.btn-icon-edit {
    background: #dcfce7;
    color: #16a34a;
}

.btn-icon-edit:hover {
    background: #bbf7d0;
    color: #15803d;
}

.btn-icon-delete {
    background: #fee2e2;
    color: #dc2626;
}

.btn-icon-delete:hover {
    background: #fecaca;
    color: #b91c1c;
}

/* ── SKU badge ───────────────────────────────────────────────────────────── */
.sku {
    color: #9ca3af;
    font-weight: 400;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

/* ── Price summary (product detail) ─────────────────────────────────────── */
.price-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.price-card {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.5rem;
    border-right: 1px solid #f3f4f6;
    min-width: 130px;
}

.price-card:last-child { border-right: none; }

.price-card .label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    margin-bottom: 0.25rem;
}

.price-card .value {
    font-size: 1.05rem;
    font-weight: 600;
    color: #111827;
}

.price-card.is-total {
    background: #f9fafb;
}

.price-card.is-retail .value {
    font-size: 1.3rem;
    color: #4f46e5;
    font-weight: 700;
}

/* ── Accordion totals ────────────────────────────────────────────────────── */
.accordion-total {
    font-weight: 600;
    margin-right: 0.75rem;
    color: #6b7280;
    font-size: 0.9rem;
}

/* ── Component row (product form) ────────────────────────────────────────── */
.component-row {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

/* ── Pagination ──────────────────────────────────────────────────────────── */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    color: #6b7280;
    font-size: 0.875rem;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,.12);
    }

    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.3);
        z-index: 999;
    }

    .sidebar-backdrop.open { display: block; }

    .topbar { display: flex; }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .price-card { min-width: 110px; }

    .page-header h2 { font-size: 1.2rem; }
}
