:root {
    --red: #f21832;
    --red-dark: #d60d26;
    --ink: #171719;
    --muted: #77777e;
    --line: #ececef;
    --paper: #fff;
    --canvas: #f7f7f8;
    --green: #14834f;
    --shadow: 0 12px 35px rgba(30, 25, 30, .055);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); font: 14px/1.5 "DM Sans", Arial, sans-serif; }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 252px; background: #171719; color: #fff; padding: 27px 17px; display: flex; flex-direction: column; flex-shrink: 0; }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 11px 30px; }
.brand-mark { width: 42px; height: 42px; color: #fff; border-radius: 13px; display: grid; place-items: center; background: var(--red); font: 800 17px "Manrope", sans-serif; }
.brand-name { font: 800 17px "Manrope", sans-serif; letter-spacing: -.5px; }
.brand-caption { color: #a4a4aa; font-size: 10px; text-transform: uppercase; letter-spacing: 1.15px; }
.nav-label { color: #77777d; padding: 12px 12px 8px; text-transform: uppercase; letter-spacing: 1px; font-size: 10px; font-weight: 700; }
.nav-link { min-height: 42px; display: flex; align-items: center; gap: 11px; color: #b8b8bd; padding: 0 12px; border-radius: 9px; margin: 2px 0; font-weight: 500; transition: .15s ease; }
.nav-link:hover, .nav-link.active { background: #29292d; color: #fff; }
.nav-link.active { box-shadow: inset 3px 0 var(--red); }
.nav-icon { display: inline-flex; width: 17px; justify-content: center; color: #a2a2a8; font-size: 16px; }
.nav-link.active .nav-icon { color: #ff5265; }
.sidebar-bottom { margin-top: auto; padding: 16px 10px 0; border-top: 1px solid #333337; }
.user-chip { display: flex; gap: 10px; align-items: center; padding: 10px 2px 15px; }
.avatar { width: 35px; height: 35px; border-radius: 50%; display: grid; place-items: center; background: #343439; color: #fff; font-weight: 700; }
.user-name { font-size: 12px; font-weight: 700; }
.user-role { font-size: 10px; text-transform: capitalize; color: #aaa; }
.logout-link { color: #c5c5c8; font-size: 12px; }
.main-area { min-width: 0; flex: 1; }
.topbar { height: 76px; padding: 0 36px; display: flex; align-items: center; justify-content: space-between; background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-title { font: 700 15px "Manrope", sans-serif; }
.topbar-right { display: flex; align-items: center; gap: 17px; color: var(--muted); font-size: 12px; }
.content { max-width: 1450px; margin: auto; padding: 31px 36px 50px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-heading h1 { font: 800 25px/1.2 "Manrope", sans-serif; letter-spacing: -.7px; margin: 0; }
.page-heading p { color: var(--muted); margin: 7px 0 0; }
.eyebrow { color: var(--red); text-transform: uppercase; font-size: 10px; font-weight: 800; letter-spacing: 1.5px; margin: 0 0 8px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 39px; padding: 0 15px; border: 0; border-radius: 8px; cursor: pointer; font-weight: 700; font-size: 12px; transition: .15s ease; }
.button-primary { background: var(--red); color: #fff; }
.button-primary:hover { background: var(--red-dark); }
.button-dark { color: #fff; background: var(--ink); }
.button-light { color: var(--ink); background: #f0f0f2; }
.button-danger { color: #b40b22; background: #ffeaed; }
.button-danger:hover { color: #fff; background: var(--red); }
.button-small { min-height: 31px; padding: 0 11px; font-size: 11px; }
.full-width { width: 100%; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 21px; }
.stat-card, .panel, .form-card { background: var(--paper); border: 1px solid #ededf0; border-radius: 12px; box-shadow: var(--shadow); }
.stat-card { padding: 18px 19px; }
.stat-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; }
.stat-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: #fff0f2; color: var(--red); font-size: 16px; }
.stat-value { font: 800 24px "Manrope", sans-serif; margin-top: 13px; letter-spacing: -.8px; }
.stat-foot { color: var(--muted); font-size: 11px; margin-top: 4px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(290px, .85fr); gap: 18px; margin-bottom: 20px; }
.panel { overflow: hidden; }
.panel-head { min-height: 62px; display: flex; align-items: center; justify-content: space-between; padding: 15px 19px; border-bottom: 1px solid var(--line); }
.panel-title { font: 700 14px "Manrope", sans-serif; }
.panel-subtitle { color: var(--muted); font-size: 11px; margin-top: 3px; }
.panel-body { padding: 17px 19px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 580px; }
th { padding: 12px 16px; color: #85858b; font-size: 10px; text-align: left; text-transform: uppercase; letter-spacing: .55px; background: #fbfbfc; }
td { padding: 13px 16px; border-top: 1px solid #f0f0f2; font-size: 12px; vertical-align: middle; }
.product-cell { display: flex; gap: 10px; align-items: center; }
.product-thumb { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: var(--red); background: #fff0f2; font-weight: 800; }
.product-name { font-weight: 700; }
.product-meta { color: var(--muted); font-size: 10px; margin-top: 2px; }
.badge { display: inline-flex; align-items: center; border-radius: 99px; padding: 4px 8px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.badge-red { color: #c30b22; background: #ffeaed; }
.badge-green { color: #0c7542; background: #e8f7ef; }
.badge-gray { color: #65656c; background: #f0f0f2; }
.low-list { display: flex; flex-direction: column; }
.low-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid #f0f0f2; }
.low-item:last-child { border-bottom: 0; }
.empty-state { color: var(--muted); text-align: center; padding: 30px 15px; font-size: 12px; }
.form-card { padding: 22px; max-width: 900px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { color: #55555d; font-size: 11px; font-weight: 700; }
.field input, .field select, .field textarea, .search-input { width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid #dedee2; border-radius: 7px; outline: none; background: #fff; color: var(--ink); }
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .search-input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(242, 24, 50, .09); }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 15px; }
.toolbar .search-input { max-width: 340px; }
.inline-form { display: inline; }
.receipt { max-width: 700px; margin: auto; }
.receipt-brand { text-align: center; padding: 23px; border-bottom: 1px dashed #d7d7dc; }
.receipt-brand .brand-mark { margin: 0 auto 10px; }
.receipt-totals { display: flex; justify-content: space-between; padding: 16px 0; border-top: 1px dashed #d7d7dc; font-weight: 800; }
.feedback-card { padding: 16px 0; border-bottom: 1px solid var(--line); }
.feedback-card:last-child { border: 0; }
.stars { color: #f3a90c; letter-spacing: 2px; }
.notice { padding: 11px 14px; border-radius: 8px; margin-bottom: 18px; font-size: 12px; }
.notice.success { color: #126d42; background: #eaf8f0; border: 1px solid #ccebd9; }
.notice.error { color: #a10c21; background: #fff0f2; border: 1px solid #ffd1d8; }
.alert-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.alert-row:last-child { border: 0; }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 20px; }
.setup-page, .login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: #f6f6f7; }
.setup-card, .login-card { width: min(100%, 440px); background: white; border: 1px solid #ededf0; border-radius: 16px; padding: 31px; box-shadow: var(--shadow); }
.setup-card > .brand-mark, .login-card > .brand-mark { margin-bottom: 20px; }
.setup-card h1, .login-card h1 { font: 800 25px "Manrope", sans-serif; margin: 0 0 8px; }
.setup-card h2 { font: 700 14px "Manrope", sans-serif; margin-top: 22px; }
.muted { color: var(--muted); }
.small { font-size: 11px; }
.login-card .field { margin: 15px 0; }
.account-list { list-style: none; padding: 0; }
.account-list li { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.account-list span { color: var(--muted); }
.login-foot { margin-top: 17px; text-align: center; color: var(--muted); font-size: 11px; }
.report-bar { display: flex; align-items: end; gap: 9px; height: 155px; padding-top: 16px; }
.bar-column { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 7px; }
.bar { width: min(32px, 72%); min-height: 3px; border-radius: 5px 5px 0 0; background: linear-gradient(0deg, #ed152f, #ff6878); }
.bar-label { font-size: 9px; color: var(--muted); }
.stock-level { width: 100%; height: 6px; background: #eeeef0; border-radius: 20px; margin-top: 7px; overflow: hidden; }
.stock-level span { display: block; height: 100%; background: var(--red); border-radius: inherit; }

@media (max-width: 1000px) {
    .sidebar { width: 218px; }
    .content { padding: 27px 22px 40px; }
    .topbar { padding: 0 22px; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .sidebar { width: 255px; position: fixed; z-index: 20; inset: 0 auto 0 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 15px 0 50px rgba(0,0,0,.2); }
    .sidebar.open { transform: translateX(0); }
    .mobile-menu { display: block; }
    .topbar { height: 63px; padding: 0 16px; }
    .topbar-right { gap: 9px; }
    .content { padding: 23px 15px 35px; }
    .content-grid { grid-template-columns: 1fr; }
    .page-heading h1 { font-size: 22px; }
    .form-grid { grid-template-columns: 1fr; }
    .field.full { grid-column: auto; }
    .stat-grid { gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-value { font-size: 21px; }
    .topbar-title { display: none; }
}
