:root {
  --orange: #f97316;
  --orange-dark: #c2410c;
  --orange-soft: #fff7ed;
  --ink: #1f2937;
  --muted: #64748b;
  --line: #e5e7eb;
  --bg: #f7f8fa;
  --white: #ffffff;
  --green: #15803d;
  --green-soft: #f0fdf4;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --blue: #2563eb;
  --shadow: 0 14px 36px rgba(15, 23, 42, 0.07);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 248px; flex: 0 0 248px; min-height: 100vh; background: #111827; color: #f8fafc; padding: 22px 14px 18px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 20; }
.brand { display: flex; gap: 11px; align-items: center; padding: 4px 10px 25px; letter-spacing: .06em; }
.brand-mark { width: 39px; height: 39px; background: var(--orange); color: white; border-radius: 12px; display: grid; place-items: center; font-weight: 800; letter-spacing: -.04em; box-shadow: 0 7px 18px rgba(249,115,22,.28); }
.brand strong, .brand span { display: block; font-size: 12px; }
.brand span { color: #fb923c; font-weight: 700; margin-top: 2px; }
.main-nav { display: grid; gap: 4px; }
.nav-item { color: #cbd5e1; border: 0; background: transparent; border-radius: 10px; padding: 11px 12px; display: flex; gap: 12px; align-items: center; text-align: left; transition: .18s ease; }
.nav-item span { width: 20px; text-align: center; color: #94a3b8; font-size: 17px; }
.nav-item:hover { background: rgba(255,255,255,.07); color: white; }
.nav-item.active { background: var(--orange); color: white; box-shadow: 0 8px 22px rgba(249,115,22,.17); }
.nav-item.active span { color: white; }
.sidebar-note { margin-top: auto; border-top: 1px solid rgba(255,255,255,.1); padding: 15px 10px 0; color: #cbd5e1; display: flex; gap: 9px; line-height: 1.5; font-size: 12px; }
.sidebar-note small { color: #94a3b8; }
.status-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.13); }
.main-content { min-width: 0; flex: 1; }
.topbar { height: 78px; background: rgba(255,255,255,.9); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 32px; position: sticky; top: 0; z-index: 10; backdrop-filter: blur(10px); }
.breadcrumb { display: grid; gap: 3px; }
.breadcrumb span { color: var(--muted); font-size: 12px; }
.breadcrumb strong { font-size: 20px; letter-spacing: -.03em; }
.menu-btn { display: none !important; }
.page-content { max-width: 1500px; margin: 0 auto; padding: 30px 32px 64px; }
.page-heading { display: flex; justify-content: space-between; gap: 18px; align-items: flex-end; margin-bottom: 24px; }
.page-heading h1 { margin: 0; font-size: 28px; letter-spacing: -.04em; }
.page-heading p { margin: 7px 0 0; color: var(--muted); }
.actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.btn { border: 1px solid var(--line); border-radius: 9px; padding: 10px 14px; background: white; color: var(--ink); font-weight: 700; transition: .18s ease; }
.btn:hover { border-color: #fdba74; transform: translateY(-1px); }
.btn-primary { background: var(--orange); color: white; border-color: var(--orange); }
.btn-primary:hover { background: var(--orange-dark); border-color: var(--orange-dark); }
.btn-soft { background: var(--orange-soft); border-color: #fed7aa; color: var(--orange-dark); }
.btn-danger { background: var(--red-soft); border-color: #fecaca; color: var(--red); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-small { padding: 7px 10px; font-size: 12px; }
.icon-btn { background: transparent; border: 0; color: var(--muted); font-size: 19px; padding: 7px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 3px 14px rgba(15,23,42,.025); }
.card-pad { padding: 20px; }
.metric-card { padding: 18px 18px 16px; min-height: 120px; position: relative; overflow: hidden; }
.metric-card::after { content: ""; position: absolute; right: -25px; top: -34px; width: 92px; height: 92px; border-radius: 50%; background: var(--orange-soft); }
.metric-label { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.metric-value { display: block; margin: 14px 0 5px; font-size: 25px; letter-spacing: -.04em; position: relative; z-index: 1; }
.metric-sub { font-size: 12px; color: var(--muted); }
.metric-card.alert .metric-value { color: var(--red); }
.section-title { margin: 0; font-size: 16px; letter-spacing: -.025em; }
.section-head { padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 620px; }
th { text-align: left; padding: 12px 18px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: #fafafa; white-space: nowrap; }
td { padding: 13px 18px; border-top: 1px solid #f0f1f3; vertical-align: middle; }
tr:hover td { background: #fffaf5; }
.empty { padding: 32px 22px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 7px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.search { min-width: 230px; flex: 1; }
.field { display: grid; gap: 6px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 700; }
.field small { color: var(--muted); font-size: 11px; }
input, select, textarea { width: 100%; border: 1px solid #d9dee7; border-radius: 8px; background: white; padding: 10px 11px; color: var(--ink); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(249,115,22,.12); }
textarea { min-height: 88px; resize: vertical; }
.form-grid { display: grid; gap: 13px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 8px; }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 800; background: #f1f5f9; color: #475569; white-space: nowrap; }
.badge.orange { background: var(--orange-soft); color: var(--orange-dark); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: #eff6ff; color: var(--blue); }
.muted { color: var(--muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.kpi-line { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f0f1f3; }
.kpi-line:last-child { border-bottom: 0; }
.kpi-line span:first-child { color: var(--muted); }
.bar-chart { height: 210px; display: flex; align-items: flex-end; gap: 10px; padding: 26px 8px 24px; border-bottom: 1px solid var(--line); }
.bar { flex: 1; min-width: 15px; position: relative; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #fb923c, var(--orange)); min-height: 3px; }
.bar span { position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--muted); white-space: nowrap; }
.bar em { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--orange-dark); font-style: normal; white-space: nowrap; }
.split { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.35fr); gap: 16px; align-items: start; }
.cart-line { display: grid; grid-template-columns: 1fr 74px 95px 28px; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid #f0f1f3; }
.cart-line:last-child { border-bottom: 0; }
.cart-total { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 13px; }
.list-stack { display: grid; gap: 9px; }
.list-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px; border: 1px solid #eef0f3; border-radius: 10px; }
.modal { border: 0; border-radius: 15px; padding: 0; width: min(670px, calc(100vw - 28px)); max-width: 670px; box-shadow: 0 24px 70px rgba(15,23,42,.25); }
.modal::backdrop { background: rgba(15,23,42,.45); backdrop-filter: blur(3px); }
.modal-content { padding: 22px; }
.modal-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; margin-bottom: 18px; }
.modal-head h2 { margin: 0; letter-spacing: -.03em; }
.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: grid; gap: 8px; max-width: min(390px, calc(100vw - 44px)); }
.toast { padding: 12px 15px; border-radius: 10px; background: #111827; color: white; box-shadow: var(--shadow); animation: toast-in .18s ease; }
.toast.error { background: #991b1b; }
.toast.success { background: #166534; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.notice { display: flex; gap: 10px; background: var(--orange-soft); color: #9a3412; border: 1px solid #fed7aa; padding: 13px 15px; border-radius: 10px; line-height: 1.5; }
.danger-note { background: var(--red-soft); color: #991b1b; border-color: #fecaca; }
.print-only { display: none; }
@media (max-width: 1100px) { .sidebar { width: 220px; flex-basis: 220px; } .grid-4 { grid-template-columns: repeat(2,1fr); } .split { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .sidebar { position: fixed; left: -270px; width: 260px; flex-basis: 260px; transition: left .2s ease; box-shadow: 14px 0 34px rgba(15,23,42,.18); }
  .sidebar.open { left: 0; }
  .topbar { height: 70px; padding: 0 16px; } .menu-btn { display: inline-block !important; margin-right: 6px; }
  .breadcrumb strong { font-size: 17px; } .topbar-actions .btn { padding: 8px 10px; font-size: 12px; }
  .page-content { padding: 22px 16px 50px; } .page-heading { align-items: start; flex-direction: column; } .page-heading h1 { font-size: 24px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .form-grid { grid-template-columns: 1fr; } .form-grid .full { grid-column: auto; }
  .toolbar { align-items: stretch; } .search { min-width: 100%; } .toolbar select, .toolbar .btn { flex: 1; }
  .card-pad { padding: 16px; } th, td { padding-left: 13px; padding-right: 13px; }
  .cart-line { grid-template-columns: 1fr 62px 84px 24px; gap: 5px; } .cart-line .muted { font-size: 12px; }
}
@media print {
  body { background: white; } .sidebar, .topbar, .page-heading, .no-print, .toast-region { display: none !important; } .main-content { width: 100%; } .page-content { padding: 0; max-width: none; } .print-only { display: block; }
}
