:root {
    --ink: #1f2328;
    --muted: #69707a;
    --line: #e8dde4;
    --gold: #c3922e;
    --gold-soft: #fff6df;
    --rose: #8e315b;
    --mint: #dff3ea;
    --panel: #fffdf9;
    --sidebar: #221a20;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #f7f3ee;
    color: var(--ink);
    font-family: Inter, Segoe UI, system-ui, -apple-system, sans-serif;
}

.app-shell {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background: #20171d;
    color: #fff;
    padding: 22px 14px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
    padding: 8px 10px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    margin-bottom: 12px;
}

.brand-mark {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8d77d, #c3922e);
    color: #3b2510;
    overflow: hidden;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand strong,
.brand small {
    display: block;
    line-height: 1.2;
}

.brand small {
    color: #dccfba;
    font-size: 12px;
    margin-top: 3px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-group {
    margin-top: 10px;
}

.nav-group-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 34px;
    margin: 0 0 2px;
    padding: 7px 10px;
    color: #fff7e3;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.2;
}

.nav-group.account-group {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, .14);
}

.nav-group-title i {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    flex: 0 0 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .08);
    color: #f5d889;
    font-size: 13px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #eaded0;
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 2px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

.nav-link.active {
    color: #271810;
    background: #f2c75b;
    box-shadow: inset 3px 0 0 #fff4cf;
}

.nav-link-primary {
    min-height: 42px;
    margin-bottom: 8px;
    color: #fff;
    background: rgba(255, 255, 255, .08);
    font-size: 15px;
}

.nav-link-child {
    position: relative;
    min-height: 32px;
    margin-left: 24px;
    padding-left: 26px;
    font-size: 14px;
    color: #d8cabb;
}

.nav-link-child::before {
    content: "";
    position: absolute;
    left: 8px;
    top: -4px;
    bottom: 50%;
    width: 10px;
    border-left: 1px solid rgba(245, 216, 137, .28);
    border-bottom: 1px solid rgba(245, 216, 137, .28);
    border-bottom-left-radius: 7px;
}

.nav-link-child.active::before {
    border-color: rgba(39, 24, 16, .42);
}

.nav-link i {
    width: 20px;
    text-align: center;
    flex: 0 0 20px;
    font-size: 14px;
}

.nav-link-child i {
    color: #cfbfae;
    font-size: 12px;
}

.nav-link-child.active i {
    color: #271810;
}

.nav-link span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.main-content {
    padding: 28px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.topbar h1 {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 0;
}

.eyebrow {
    color: var(--rose);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

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

.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 999px;
    padding: 8px 12px;
    font-weight: 700;
}

.stat-card,
.content-card {
    background: rgba(255, 255, 255, .9);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(55, 42, 30, .08);
}

.stat-card {
    padding: 18px;
    min-height: 126px;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    right: -26px;
    top: -30px;
    width: 90px;
    height: 90px;
    background: var(--gold-soft);
    border-radius: 50%;
}

.stat-card .icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--mint);
    color: #1d6b51;
    margin-bottom: 14px;
}

.stat-card h3 {
    font-size: 28px;
    margin: 0;
    font-weight: 850;
}

.stat-card p {
    margin: 0;
    color: var(--muted);
    font-weight: 650;
}

.content-card {
    padding: 22px;
    margin-bottom: 22px;
}

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

.section-title h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
}

.form-label {
    font-weight: 750;
    color: #3d3640;
}

.form-control,
.form-select {
    border-color: #ded3db;
    border-radius: 10px;
    min-height: 42px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 .2rem rgba(195, 146, 46, .18);
}

.btn-primary {
    --bs-btn-bg: #8e315b;
    --bs-btn-border-color: #8e315b;
    --bs-btn-hover-bg: #75274a;
    --bs-btn-hover-border-color: #75274a;
    border-radius: 10px;
    font-weight: 750;
}

.btn-warning {
    border-radius: 10px;
    font-weight: 750;
}

.table {
    overflow: hidden;
    border-radius: 12px;
}

.table thead th {
    background: #2a2028;
    color: #fff;
    border: 0;
    font-size: 13px;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 15% 20%, rgba(195, 146, 46, .28), transparent 28%),
        linear-gradient(135deg, #211820, #6f2c4b 55%, #c3922e);
}

.login-card {
    width: min(980px, 100%);
    display: grid;
    grid-template-columns: 1fr 420px;
    overflow: hidden;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .28);
}

.login-art {
    min-height: 560px;
    padding: 42px;
    color: #fff;
    background:
        linear-gradient(rgba(24, 18, 21, .52), rgba(24, 18, 21, .74)),
        url("https://images.unsplash.com/photo-1617038260897-41a1f14a8ca0?auto=format&fit=crop&w=1100&q=80") center/cover;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.login-art h1 {
    font-size: 44px;
    line-height: 1.02;
    font-weight: 850;
    margin-bottom: 12px;
}

.login-form {
    padding: 42px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mini-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--line);
}

.stock-image-preview {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.stock-image-preview img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.stock-image-preview.d-none {
    display: none !important;
}

.billing-section {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fffaf0;
    padding: 16px;
}

.addon-section {
    background: #f4fbf7;
}

.customer-section {
    background: #fbf8ff;
}

.quick-customer {
    border-top: 1px dashed #d8cadf;
    padding-top: 14px;
}

.customer-preview {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 10px;
    border: 1px solid #e4d9ea;
    border-radius: 12px;
    background: #fff;
    padding: 12px;
}

.customer-preview div {
    min-width: 0;
}

.customer-preview span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.customer-preview strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: 14px;
}

.bill-line {
    border: 1px solid #eadfcd;
    border-radius: 12px;
    background: #fff;
    padding: 14px;
}

.addon-line {
    border-color: #d1e8dc;
}

.bill-line-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.billing-total-panel {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    padding: 16px;
}

.mini-stat {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: 14px 16px;
}

.mini-stat span,
.mini-stat strong {
    display: block;
}

.mini-stat span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.mini-stat strong {
    margin-top: 4px;
    font-size: 22px;
    font-weight: 850;
}

@media (max-width: 992px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .main-content {
        padding: 18px;
    }

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

    .login-card {
        grid-template-columns: 1fr;
    }

    .login-art {
        min-height: 260px;
    }

    .billing-total-panel {
        grid-template-columns: 1fr;
    }

    .customer-preview {
        grid-template-columns: 1fr;
    }
}
