:root {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  color: #211d34;
  background: #f7f7fb;
  font-synthesis: none;
  --surface: #fff;
  --border: #e9e6f0;
  --muted: #676379;
  --purple: #6537cb;
  --purple-dark: #5329ae;
  --purple-light: #eee7fd;
  --sidebar: 236px;
  --radius: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 14px; line-height: 1.45; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid #9270ec; outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.18; }
input, select, textarea {
  min-width: 0;
  min-height: 40px;
  padding: 8px 11px;
  color: #29243b;
  background: #fff;
  border: 1px solid #ded9e8;
  border-radius: 8px;
}
input::placeholder, textarea::placeholder { color: #767187; }
input[type="checkbox"] { width: 17px; height: 17px; min-height: auto; accent-color: var(--purple); }
button { color: inherit; }
svg { flex: none; vertical-align: middle; }
.muted { color: var(--muted); }
.pilot-tag { display: inline-flex; padding: 4px 9px; border-radius: 20px; color: #623c05; background: #fff0ce; font-size: 12px; font-weight: 700; }
.pilot-banner { margin: 0; padding: 8px 20px; background: #fff8e8; color: #62491e; border-bottom: 1px solid #efe0be; font-size: 12px; text-align: center; }
.pilot-login { color: #745421; background: #fff8e8; border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 1px 2px #281b4407; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 41px; padding: 8px 14px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-weight: 650; text-align: center; line-height: 1.2; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn.primary { background: var(--purple); color: white; border-color: var(--purple); }
.btn.primary:hover { background: var(--purple-dark); border-color: var(--purple-dark); }
.btn.secondary { background: #fff; color: #342b49; border-color: #dfdae9; }
.btn.secondary:hover { background: #f7f3ff; border-color: #cdbceb; }
.btn:disabled, .btn[aria-disabled="true"] { cursor: default; opacity: .52; pointer-events: none; }
.icon-button { cursor: pointer; width: 40px; height: 40px; background: transparent; border: 0; border-radius: 9px; display: grid; place-items: center; }
.icon-button:hover { background: var(--purple-light); color: var(--purple-dark); }
.field { display: grid; gap: 6px; color: #403650; font-size: 13px; font-weight: 650; }
.field :is(input,select,textarea) { font-weight: 450; }
.empty { min-height: 114px; padding: 21px; color: var(--muted); display: grid; justify-items: center; align-content: center; gap: 8px; text-align: center; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; margin-right: 6px; }
.badge.danger { color: #a52d44; background: #fff0f2; }
.badge.caution { color: #885413; background: #fff3dc; }
.table-wrap { overflow-x: auto; }
.form-error { color: #952b40; background: #fff0f2; border-radius: 8px; padding: 9px 11px; margin: 0; }
.eyebrow { display: none; }
.loading-screen { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 13px; color: var(--muted); }
.loading-brand-icon { display: block; width: 76px; height: 76px; object-fit: contain; }
.loading-indicator { display: block; width: 34px; height: 34px; border: 3px solid #e4d9fb; border-top-color: var(--purple); border-radius: 50%; animation: spin .8s infinite linear; }
@keyframes spin { to { transform: rotate(360deg); } }
.skip { position: fixed; z-index: 20; top: -100px; left: 10px; background: white; padding: 10px; border-radius: 6px; }
.skip:focus { top: 10px; }

.shell { min-height: 100dvh; display: grid; grid-template-columns: var(--sidebar) minmax(0,1fr); }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 25px; padding: 25px 17px 17px; background: #fff; border-right: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; width: fit-content; padding: 0 4px; }
.brand strong, .brand small { display: block; white-space: nowrap; line-height: 1.2; }
.brand strong { font-size: 20px; font-weight: 760; letter-spacing: -.045em; }
.brand small { color: #6d6187; font-size: 11px; font-weight: 650; margin-top: 4px; }
.brand-icon { display: grid; place-items: center; flex: none; width: 43px; height: 43px; }
.brand-icon img { display: block; width: 43px; height: 43px; object-fit: contain; }
.inventory-wordmark { position: relative; display: block; width: 100%; aspect-ratio: 3 / 1; overflow: hidden; background: #fff; }
.inventory-wordmark img { position: absolute; display: block; left: 0; top: 50%; width: 100%; height: auto; transform: translateY(-50%); }
.sidebar nav { overflow: auto; display: grid; gap: 4px; }
.nav-title { color: #787185; display: block; align-self: end; font-size: 10px; letter-spacing: .115em; font-weight: 750; text-transform: uppercase; padding: 0 11px 6px; }
.nav-title.second { margin-top: 20px; }
.nav-item { display: flex; align-items: center; gap: 11px; min-height: 42px; border-radius: 9px; padding: 7px 11px; color: #555064; font-size: 13px; font-weight: 620; }
.nav-item:hover { background: #f6f2fd; color: var(--purple-dark); }
.nav-item.current { background: #eee7fc; color: #592ab9; font-weight: 760; }
.sidebar-footer { margin-top: auto; padding: 15px 9px 1px; border-top: 1px solid var(--border); }
.sidebar-footer .inventory-wordmark { max-width: 210px; }
.sidebar-footer small { display: block; color: #767084; font-size: 10px; margin-top: 9px; }
.workspace { min-width: 0; }
.topbar { min-height: 65px; display: flex; align-items: center; justify-content: space-between; gap: 13px; padding: 7px clamp(20px,3vw,43px); border-bottom: 1px solid var(--border); background: #fff; }
.breadcrumb { display: flex; align-items: center; gap: 9px; color: #6d677e; font-size: 13px; }
.header-app-icon { display: block; flex: none; width: 28px; height: 28px; object-fit: contain; }
.breadcrumb b { color: #352844; font-weight: 700; }
.account-wrap { display: flex; align-items: center; gap: 17px; }
.demo-tag { background: #f3edff; color: #6338ab; border: 1px solid #ede2ff; border-radius: 20px; white-space: nowrap; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; }
.demo-tag i { width: 5px; height: 5px; border-radius: 50%; background: #925deb; }
.account { position: relative; }
.account summary { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; }
.account summary::-webkit-details-marker { display: none; }
.account summary>svg { color: #726884; transform: rotate(90deg); }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #ebe0fb; color: #6336b5; font-size: 12px; font-weight: 750; }
.account-name strong, .account-name small { display: block; line-height: 1.2; }
.account-name strong { font-size: 12px; }
.account-name small { font-size: 10px; color: var(--muted); margin-top: 3px; }
.account-action { position: absolute; top: calc(100% + 11px); right: 0; z-index: 5; min-width: 158px; display: flex; align-items: center; gap: 7px; padding: 9px 12px; background: #fff; border: 1px solid var(--border); color: #4b375d; border-radius: 8px; box-shadow: 0 7px 22px #21113c1c; cursor: pointer; white-space: nowrap; }
.account-action:hover { background: #f7f3ff; }
.menu-toggle,.mobile-nav,.mobile-overlay { display: none; }
.content { max-width: 1610px; margin: 0 auto; padding: 27px clamp(20px,3vw,43px) 40px; }
.content:focus { outline: none; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 21px; }
.page-heading h1 { margin: 0 0 5px; font-size: clamp(27px,3vw,36px); font-weight: 760; letter-spacing: -.045em; }
.page-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.heading-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.period-row { display: flex; align-items: center; justify-content: space-between; gap: 11px; margin-bottom: 13px; }
.range-label { display: flex; align-items: center; gap: 7px; color: #685d79; font-weight: 630; font-size: 12px; }
.period-control { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 650; }
.period-control select { min-height: 34px; padding: 4px 27px 4px 10px; font-size: 13px; font-weight: 640; }
.kpi-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; margin-bottom: 15px; }
.kpi { padding: 14px 14px 13px; min-width: 0; }
.tile-icon { display: grid; place-items: center; flex: none; width: 37px; height: 37px; border-radius: 10px; }
.tile-icon.purple { color: #6537c1; background: #eee6fe; }
.tile-icon.green { color: #087657; background: #e1f5eb; }
.tile-icon.blue { color: #286493; background: #e8f2fe; }
.tile-icon.orange { color: #9c521c; background: #fff0e2; }
.kpi p { margin: 9px 0 1px; color: #625a73; font-size: 12px; font-weight: 680; }
.kpi strong { display: block; font-size: clamp(20px,2.18vw,31px); letter-spacing: -.055em; line-height: 1.16; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi small { display: block; color: #6b6578; font-size: 11px; margin-top: 5px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(0,1fr); align-items: stretch; gap: 14px; }
.chart-card { padding: 16px 17px; min-width: 0; }
.chart-card header, .label-picker header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.chart-card h2,.label-picker h2,.label-preview h2,.export-card h2 { font-size: 17px; font-weight: 740; letter-spacing: -.026em; margin: 0 0 4px; }
.chart-card header p,.label-picker p,.label-preview p { margin: 0; color: var(--muted); font-size: 12px; }
.trend-chart { width: 100%; height: auto; max-height: 186px; margin-top: 11px; }
.trend-chart text { fill: #6d667d; font-size: 11px; }
.category-chart { display: flex; align-items: center; justify-content: center; gap: 15px; padding: 14px 0 2px; min-height: 138px; }
.ring { position: relative; display: grid; place-items: center; flex: none; width: 109px; aspect-ratio: 1; border-radius: 50%; background: var(--segments); }
.ring span { width: 76%; height: 76%; background: white; border-radius: 50%; display: grid; align-content: center; justify-items: center; }
.ring small { color: #6b617b; font-size: 10px; }
.ring b { font-size: 15px; letter-spacing: -.04em; }
.chart-legend { list-style: none; display: grid; width: 100%; max-width: 237px; gap: 7px; padding: 0; margin: 0; }
.chart-legend li { display: flex; align-items: center; gap: 6px; font-size: 11px; min-width: 0; }
.chart-legend i { flex: none; background: var(--marker); width: 7px; height: 7px; border-radius: 3px; }
.chart-legend li span { flex: 1; overflow-wrap: anywhere; color: #5d536e; }
.chart-legend strong { font-weight: 700; }
.text-link { display: inline-flex; align-items: center; gap: 6px; color: var(--purple-dark); font-size: 12px; font-weight: 720; white-space: nowrap; }
.text-link:hover,.dashboard-table a:hover { text-decoration: underline; text-underline-offset: 3px; }
.dashboard-table { width: 100%; text-align: left; font-size: 12px; border-collapse: collapse; margin-top: 11px; }
.dashboard-table th { padding: 6px 6px 7px; color: #746880; font-size: 10px; font-weight: 690; white-space: nowrap; }
.dashboard-table td { border-top: 1px solid var(--border); padding: 6px; }
.dashboard-table td small { display: block; color: var(--muted); font-size: 10px; }
.status-list { display: grid; gap: 9px; margin-top: 14px; }
.status-row div { display: flex; justify-content: space-between; font-size: 12px; }
.status-row progress { display: block; appearance: none; width: 100%; height: 5px; border: 0; margin-top: 4px; background: #f0edf6; border-radius: 10px; overflow: hidden; }
.status-row progress::-webkit-progress-bar { background: #f0edf6; }
.status-row progress::-webkit-progress-value { background: var(--bar); }
.status-row progress::-moz-progress-bar { background: var(--bar); }

.forecast-summary { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 13px; }
.forecast-title { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 8px; }
.forecast-title h3 { margin: 0 0 3px; font-size: 15px; }
.forecast-title p { margin: 0; color: var(--muted); font-size: 12px; }
.forecast-title>strong { color: var(--purple-dark); font-size: 18px; line-height: 1.25; }
.forecast-series { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; margin: 10px 0; }
.forecast-month { background: #f6f1fe; color: #58426e; border-radius: 7px; padding: 7px; min-width: 0; font-size: 11px; }
.forecast-month span,.forecast-month b { display: block; }
.forecast-month b { color: #42296a; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.forecast-month progress { display: block; width: 100%; height: 4px; accent-color: #8456e4; margin-top: 5px; }
.forecast-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.text-link[type="button"] { background: none; border: 0; cursor: pointer; padding: 4px 0; }
.forecast-items { list-style: none; padding: 0; margin: 12px 0 0; }
.forecast-items li { display: flex; justify-content: space-between; gap: 9px; padding: 9px 0; border-top: 1px solid var(--border); }
.forecast-items small { color: var(--muted); display: block; overflow-wrap: anywhere; }
.forecast-item-value { display: grid; justify-items: end; flex: none; }
.forecast-status { color: var(--muted); font-size: 11px; }
.forecast-form { display: grid; gap: 13px; grid-template-columns: repeat(2,minmax(0,1fr)); }
.forecast-form-wide { grid-column: 1/-1; }
.forecast-form .heading-actions { justify-content: flex-end; }
.forecast-form textarea { resize: vertical; }

.report-filters { display: flex; flex-wrap: wrap; gap: 13px; padding: 17px; margin-bottom: 16px; }
.report-filters .field { flex: 1; max-width: 200px; }
.report-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-top: 15px; }
.export-card { display: flex; flex-direction: column; align-items: flex-start; padding: 17px; }
.export-highlight { border-color: #bfa9f0; }
.export-card h2 { margin-top: 12px; }
.export-card p { color: var(--muted); font-size: 13px; flex-grow: 1; margin-bottom: 15px; }
.labels-layout { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(260px,.75fr); gap: 14px; align-items: start; }
.label-picker,.label-preview { padding: 18px; }
.labels-filters { display: flex; flex-wrap: wrap; margin: 14px 0 4px; gap: 9px; }
.searchbox { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 160px; min-height: 40px; padding: 0 9px; color: var(--muted); border: 1px solid #ded9e8; border-radius: 8px; }
.searchbox input { width: 100%; min-height: 36px; padding: 4px; border: 0; }
.label-options { max-height: 480px; overflow-y: auto; }
.label-option { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--border); cursor: pointer; }
.label-option:last-child { border-bottom: 0; }
.label-option strong,.label-option small { display: block; }
.label-option small,.label-preview>small { color: var(--muted); }
.label-preview { display: grid; gap: 9px; }
.label-preview :is(h2,p) { margin: 0; }
.label-cards { display: grid; gap: 7px; border-radius: 9px; padding: 8px; background: #f7f4fb; border: 1px dashed #ddd1ef; }
.label-placeholder { display: grid; gap: 7px; justify-items: center; align-content: center; min-height: 116px; color: #766290; font-size: 12px; }
.label-sample { display: flex; align-items: center; gap: 9px; border: 1px solid var(--border); border-radius: 6px; background: white; padding: 4px; }
.label-sample img { flex: none; }
.label-sample strong,.label-sample small { display: block; }
.label-sample small { line-height: 1.2; color: var(--muted); }

.dialog { border: 1px solid var(--border); border-radius: 16px; color: #29223b; padding: 0; width: min(640px,calc(100vw - 24px)); max-height: min(89dvh,850px); box-shadow: 0 19px 55px #23133c42; }
.dialog::backdrop { background: #1c132f60; }
.dialog-head { position: sticky; top: 0; z-index: 2; background: white; display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 58px; padding: 6px 15px 6px 20px; border-bottom: 1px solid var(--border); }
.dialog-head h2 { font-size: 19px; margin: 0; }
.dialog-content { padding: 19px 20px 22px; }
.toast { position: fixed; z-index: 30; bottom: 22px; right: 22px; max-width: min(440px,calc(100vw - 44px)); background: #312244; color: white; padding: 11px 15px; border-radius: 10px; box-shadow: 0 8px 22px #28193930; }
.login-layout { min-height: 100dvh; display: grid; grid-template-columns: minmax(0,1.07fr) minmax(0,1fr); }
.login-brand { min-height: 100%; display: grid; align-content: center; justify-items: center; gap: 14px; padding: 42px 18px; background: radial-gradient(ellipse at 48% 50%,#fff8fd 3%,#f1e6ff 48%,#e8dcff 100%); }
.login-logo { width: min(100%,460px); background: white; padding: 12px; border-radius: 12px; box-shadow: 0 2px 9px #5a299913; }
.login-illustration { padding: 4px 0; min-width: 0; }
.login-illustration img { width: min(30vw,380px); height: auto; display: block; mix-blend-mode: multiply; }
.login-brand p { margin: 0; font-size: clamp(14px,2vw,24px); font-weight: 720; color: #58378d; letter-spacing: -.035em; }
.login-side { background: #fff; display: grid; place-items: center; padding: 42px 22px; }
.login-card { width: min(100%,390px); }
.login-mark { padding: 0; margin-bottom: 28px; }
.login-card h1 { font-size: 34px; margin: 0 0 6px; letter-spacing: -.05em; }
.login-card p { color: var(--muted); margin-bottom: 19px; }
.login-card form { display: grid; gap: 13px; }
.login-card input { min-height: 44px; }
.login-submit { min-height: 44px; justify-content: space-between; margin-top: 3px; }
.demo-choices { margin-top: 25px; border-top: 1px solid var(--border); padding-top: 15px; }
.demo-choices h2 { font-size: 14px; margin-bottom: 3px; }
.demo-choices p { font-size: 12px; margin-bottom: 9px; }
.demo-choices div { display: flex; flex-wrap: wrap; gap: 6px; }
.demo-choices .btn { font-size: 11px; padding: 6px 8px; min-height: 35px; }

@media (max-width: 1130px) {
  :root { --sidebar: 197px; }
  .category-chart { gap: 8px; }
  .ring { width: 81px; }
  .ring b { font-size: 13px; }
}
@media (max-width: 900px) {
  :root { --sidebar: 172px; }
  .sidebar { padding-inline: 11px; }
  .content { padding-inline: 17px; }
  .dashboard-grid { grid-template-columns: minmax(0,1fr) minmax(0,.82fr); }
  .category-chart { flex-direction: column; align-items: center; }
  .report-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 730px) {
  :root { --sidebar: min(266px,84vw); }
  .shell { display: block; }
  .sidebar { position: fixed; z-index: 12; inset: 0 auto 0 0; width: var(--sidebar); height: 100dvh; transform: translateX(-101%); transition: transform .2s; visibility: hidden; }
  .menu-open .sidebar { transform: translateX(0); visibility: visible; }
  .mobile-overlay { position: fixed; inset: 0; z-index: 11; background: #1b102e64; border: 0; width: 100%; height: 100%; }
  .menu-open .mobile-overlay { display: block; }
  .topbar { position: sticky; top: 0; z-index: 6; min-height: 55px; padding: 5px 13px; gap: 7px; }
  .menu-toggle { display: grid; color: #593ba0; }
  .breadcrumb { flex: 1; }
  .breadcrumb>span,.breadcrumb>svg,.account-name { display: none; }
  .account-wrap { gap: 7px; }
  .account summary { gap: 4px; }
  .mobile-nav { position: fixed; inset: auto 0 0; display: flex; justify-content: space-around; gap: 3px; padding: 5px max(5px,env(safe-area-inset-right)) max(5px,env(safe-area-inset-bottom)) max(5px,env(safe-area-inset-left)); background: #fff; border-top: 1px solid var(--border); z-index: 8; }
  .mobile-nav .nav-item { flex: 1; display: grid; justify-items: center; align-content: center; gap: 4px; min-height: 47px; min-width: 0; padding: 4px; font-size: 10px; }
  .content { padding: 20px 14px 85px; }
  .kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .kpi { padding: 11px; }
  .kpi strong { font-size: clamp(17px,5vw,27px); }
  .dashboard-grid,.labels-layout { grid-template-columns: 1fr; }
  .category-chart { flex-direction: row; gap: 17px; }
  .ring { width: 100px; }
  .toast { bottom: 68px; right: 13px; }
  .login-layout { grid-template-columns: 1fr; }
  .login-brand { padding: 13px 15px; min-height: auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .login-logo { width: auto; min-width: 0; padding: 8px; flex: 0 1 310px; }
  .login-brand p { display: none; }
  .login-illustration img { width: 58px; }
  .login-side { place-items: start center; padding-top: 25px; }
  .login-mark { margin-bottom: 15px; }
}
@media (max-width: 490px) {
  .page-heading { flex-wrap: wrap; align-items: flex-start; margin-bottom: 14px; }
  .page-heading p { font-size: 13px; }
  .dashboard-table { min-width: 365px; }
  .report-grid { grid-template-columns: 1fr; }
  .labels-filters select { width: 100%; }
  .forecast-form { grid-template-columns: 1fr; }
  input:not([type="checkbox"]),select,textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
