:root {
  --ink-950: #101d19;
  --ink-900: #182722;
  --ink-800: #263832;
  --ink-700: #40534c;
  --ink-600: #60716b;
  --ink-500: #7b8a85;
  --ink-400: #9ca9a4;
  --ink-300: #c3cbc8;
  --ink-200: #dce2df;
  --ink-100: #edf1ef;
  --ink-50: #f7f9f8;
  --white: #fff;
  --green-900: #064e3b;
  --green-800: #086449;
  --green-700: #087f5b;
  --green-600: #0d9f70;
  --green-500: #18b981;
  --green-400: #37d39a;
  --green-200: #a9efd5;
  --green-100: #d8f8eb;
  --green-50: #edfcf6;
  --blue: #3b82f6;
  --blue-soft: #eaf2ff;
  --amber: #d99009;
  --amber-soft: #fff6dc;
  --red: #dc4c4c;
  --red-soft: #fff0ef;
  --violet: #7c5ce7;
  --violet-soft: #f2efff;
  --sidebar: 248px;
  --topbar: 76px;
  --radius-xs: 7px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(16, 29, 25, .04), 0 4px 12px rgba(16, 29, 25, .035);
  --shadow: 0 12px 30px rgba(16, 29, 25, .08), 0 2px 8px rgba(16, 29, 25, .04);
  --focus: 0 0 0 3px rgba(24, 185, 129, .2);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink-900);
  background: var(--ink-50);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
svg { display: block; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin-top: 0; }
.sr-only { position: absolute!important; width: 1px!important; height: 1px!important; padding: 0!important; margin: -1px!important; overflow: hidden!important; clip: rect(0,0,0,0)!important; white-space: nowrap!important; border: 0!important; }
.skip-link { position: fixed; z-index: 1000; top: 8px; left: 8px; padding: 10px 14px; color: var(--white); background: var(--green-700); border-radius: 8px; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

/* App shell */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  z-index: 60;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  color: #d8e5df;
  background: #13241e;
  border-right: 1px solid rgba(255,255,255,.05);
}
.sidebar::before { position: absolute; inset: 0; pointer-events: none; content: ""; background: radial-gradient(circle at 10% 5%, rgba(55,211,154,.11), transparent 25%), radial-gradient(circle at 100% 90%, rgba(55,211,154,.06), transparent 30%); }
.sidebar__brand { position: relative; display: flex; min-height: var(--topbar); align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid rgba(255,255,255,.065); }
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand__mark { position: relative; display: grid; width: 31px; height: 31px; place-items: center; border: 2px solid var(--green-400); border-radius: 50%; box-shadow: 0 0 18px rgba(55,211,154,.14); }
.brand__mark::before { width: 9px; height: 9px; content: ""; background: var(--green-400); border-radius: 50%; }
.brand__mark span { position: absolute; top: -3px; right: 2px; width: 7px; height: 7px; background: #13241e; border: 2px solid var(--green-400); border-radius: 50%; }
.brand__word { color: var(--white); font-size: 20px; font-weight: 750; letter-spacing: -.5px; }
.brand__word span { color: var(--green-400); }
.sidebar__nav { position: relative; flex: 1; padding: 20px 14px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.nav-group + .nav-group { margin-top: 19px; }
.nav-group__label { margin: 0 10px 6px; color: #778b83; font-size: 10px; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; }
.nav-link { display: flex; min-height: 42px; align-items: center; gap: 12px; padding: 0 11px; color: #aebeb8; border: 1px solid transparent; border-radius: 9px; font-size: 13px; font-weight: 560; transition: .18s var(--ease); }
.nav-link:hover { color: var(--white); background: rgba(255,255,255,.055); }
.nav-link.is-active { color: #eafff7; background: linear-gradient(90deg, rgba(24,185,129,.19), rgba(24,185,129,.08)); border-color: rgba(55,211,154,.12); box-shadow: inset 3px 0 var(--green-400); }
.nav-link__icon { width: 18px; height: 18px; opacity: .9; }
.sidebar__footer { position: relative; padding: 14px; }
.workspace-card { display: flex; align-items: center; gap: 10px; padding: 11px; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.07); border-radius: 11px; }
.workspace-card__icon { display: grid; width: 31px; height: 31px; flex: 0 0 auto; place-items: center; color: #072c20; background: var(--green-400); border-radius: 8px; font-weight: 800; }
.workspace-card div { min-width: 0; flex: 1; }
.workspace-card strong, .workspace-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-card strong { color: #e6f2ed; font-size: 11px; }
.workspace-card small { color: #71877e; font-size: 9px; }
.status-dot { width: 6px; height: 6px; flex: 0 0 auto; background: var(--green-400); border-radius: 50%; box-shadow: 0 0 0 3px rgba(55,211,154,.12); }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sidebar__close { display: none; color: #b9c9c3!important; background: rgba(255,255,255,.06)!important; }
.sidebar-backdrop { position: fixed; z-index: 55; inset: 0; visibility: hidden; background: rgba(6,18,14,.5); opacity: 0; backdrop-filter: blur(2px); transition: .25s; }

.app-main { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; z-index: 40; top: 0; display: flex; min-height: var(--topbar); align-items: center; justify-content: space-between; gap: 20px; padding: 0 30px; background: rgba(255,255,255,.88); border-bottom: 1px solid var(--ink-200); backdrop-filter: blur(18px); }
.topbar__leading, .topbar__actions { display: flex; align-items: center; }
.topbar__leading { min-width: 0; gap: 13px; }
.topbar__actions { gap: 10px; }
.page-identity span { display: block; margin-bottom: 1px; color: var(--green-700); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.page-identity h1 { margin: 0; color: var(--ink-950); font-size: 20px; font-weight: 730; letter-spacing: -.35px; line-height: 1.2; }
.icon-button { display: inline-grid; width: 38px; height: 38px; padding: 0; place-items: center; color: var(--ink-600); background: var(--white); border: 1px solid var(--ink-200); border-radius: 10px; transition: .18s; }
.icon-button:hover { color: var(--green-700); border-color: var(--green-200); background: var(--green-50); }
.icon-button:focus-visible, .btn:focus-visible, .nav-link:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: none; box-shadow: var(--focus); }
.icon-button svg { width: 18px; height: 18px; }
.mobile-menu { display: none; align-content: center; gap: 4px; }
.mobile-menu span { width: 17px; height: 1.5px; background: currentColor; border-radius: 2px; }
.global-search { display: flex; width: min(280px, 25vw); height: 39px; align-items: center; gap: 8px; padding: 0 9px 0 12px; background: var(--ink-50); border: 1px solid var(--ink-200); border-radius: 10px; }
.global-search:focus-within { background: var(--white); border-color: var(--green-500); box-shadow: var(--focus); }
.global-search svg { width: 16px; height: 16px; color: var(--ink-500); }
.global-search input { min-width: 0; flex: 1; padding: 0; background: transparent; border: 0; outline: none; font-size: 12px; }
.global-search input::placeholder { color: var(--ink-400); }
.global-search kbd { padding: 2px 5px; color: var(--ink-500); background: var(--white); border: 1px solid var(--ink-200); border-radius: 5px; font-family: inherit; font-size: 9px; box-shadow: 0 1px 1px rgba(0,0,0,.03); }
.notification-button { position: relative; }
.notification-dot { position: absolute; top: -5px; right: -5px; display: grid; min-width: 18px; height: 18px; padding: 0 4px; place-items: center; color: var(--white); background: var(--red); border: 2px solid var(--white); border-radius: 10px; font-size: 8px; font-weight: 800; }
.user-menu { position: relative; }
.user-menu__trigger { display: flex; height: 45px; align-items: center; gap: 9px; padding: 4px 6px 4px 5px; background: transparent; border: 0; border-radius: 11px; text-align: left; }
.user-menu__trigger:hover { background: var(--ink-50); }
.avatar, .avatar-sm, .avatar-lg { display: inline-grid; flex: 0 0 auto; place-items: center; color: var(--green-800); background: linear-gradient(145deg, var(--green-100), #c8f1e2); border: 1px solid var(--green-200); border-radius: 50%; font-weight: 760; }
.avatar { width: 34px; height: 34px; font-size: 10px; }
.avatar-sm { width: 30px; height: 30px; font-size: 9px; }
.avatar-lg { width: 62px; height: 62px; font-size: 18px; }
.user-menu__copy { display: block; min-width: 82px; }
.user-menu__copy strong, .user-menu__copy small { display: block; line-height: 1.3; }
.user-menu__copy strong { max-width: 120px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.user-menu__copy small { color: var(--ink-500); font-size: 9px; }
.user-menu__trigger > svg { width: 13px; height: 13px; color: var(--ink-400); }
.dropdown-menu { position: absolute; top: calc(100% + 8px); right: 0; width: 190px; padding: 7px; background: var(--white); border: 1px solid var(--ink-200); border-radius: 11px; box-shadow: var(--shadow); }
.dropdown-menu a, .dropdown-menu button { display: block; width: 100%; padding: 9px 10px; background: none; border: 0; border-radius: 7px; font-size: 12px; text-align: left; }
.dropdown-menu a:hover, .dropdown-menu button:hover { color: var(--green-700); background: var(--green-50); }
.dropdown-menu__divider { height: 1px; margin: 5px 2px; background: var(--ink-100); }

.page-content { width: 100%; max-width: 1720px; min-height: calc(100vh - var(--topbar) - 52px); margin: 0 auto; padding: 26px 30px 38px; }
.app-footer { display: flex; min-height: 52px; align-items: center; justify-content: space-between; padding: 0 30px; color: var(--ink-500); background: var(--white); border-top: 1px solid var(--ink-200); font-size: 10px; }
.app-footer p { margin: 0; }
.app-footer div { display: flex; align-items: center; gap: 8px; }
.app-footer a:hover { color: var(--green-700); }
.system-status { display: inline-flex; align-items: center; gap: 5px; }
.system-status i { width: 6px; height: 6px; background: var(--green-500); border-radius: 50%; }

/* Primitives */
.page-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-toolbar__copy h2 { margin: 0 0 4px; color: var(--ink-950); font-size: 21px; font-weight: 720; letter-spacing: -.5px; }
.page-toolbar__copy p { margin: 0; color: var(--ink-600); font-size: 12px; }
.page-toolbar__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 9px; }
.btn { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; border: 1px solid transparent; border-radius: 9px; font-size: 11px; font-weight: 680; transition: .18s var(--ease); }
.btn:hover { transform: translateY(-1px); }
.btn svg { width: 15px; height: 15px; }
.btn--primary { color: var(--white); background: var(--green-700); border-color: var(--green-700); box-shadow: 0 4px 11px rgba(8,127,91,.17); }
.btn--primary:hover { background: var(--green-800); box-shadow: 0 7px 18px rgba(8,127,91,.2); }
.btn--secondary { color: var(--ink-700); background: var(--white); border-color: var(--ink-200); box-shadow: var(--shadow-sm); }
.btn--secondary:hover { color: var(--green-700); border-color: var(--green-200); background: var(--green-50); }
.btn--danger { color: var(--red); background: var(--red-soft); border-color: #ffd6d2; }
.btn--ghost { min-height: 33px; padding: 0 9px; color: var(--ink-600); background: transparent; border-color: transparent; }
.btn--ghost:hover { color: var(--green-700); background: var(--green-50); }
.btn--sm { min-height: 31px; padding: 0 10px; font-size: 10px; }
.icon-link { display: inline-grid; width: 30px; height: 30px; place-items: center; color: var(--ink-500); border-radius: 7px; }
.icon-link:hover { color: var(--green-700); background: var(--green-50); }
.icon-link svg { width: 15px; height: 15px; }

.card { background: var(--white); border: 1px solid var(--ink-200); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card__header { display: flex; min-height: 59px; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--ink-100); }
.card__header h3 { margin: 0; font-size: 13px; font-weight: 720; letter-spacing: -.15px; }
.card__header p { margin: 2px 0 0; color: var(--ink-500); font-size: 10px; }
.card__body { padding: 18px; }
.card__footer { padding: 12px 18px; background: var(--ink-50); border-top: 1px solid var(--ink-100); border-radius: 0 0 var(--radius) var(--radius); }
.card-link { color: var(--green-700); font-size: 10px; font-weight: 700; }
.card-link:hover { text-decoration: underline; }
.grid { display: grid; gap: 18px; }
.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)); }
.grid--main { grid-template-columns: minmax(0, 1.65fr) minmax(270px, .75fr); }
.stack { display: grid; gap: 18px; }
.section-gap { margin-top: 18px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { position: relative; min-width: 0; padding: 17px; overflow: hidden; background: var(--white); border: 1px solid var(--ink-200); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.stat-card::after { position: absolute; right: -30px; bottom: -38px; width: 100px; height: 100px; content: ""; background: var(--green-50); border-radius: 50%; opacity: .7; }
.stat-card__top { display: flex; align-items: center; justify-content: space-between; }
.stat-card__label { margin: 0; color: var(--ink-600); font-size: 10px; font-weight: 650; }
.stat-card__icon { display: grid; width: 34px; height: 34px; place-items: center; color: var(--green-700); background: var(--green-50); border: 1px solid var(--green-100); border-radius: 9px; }
.stat-card__icon svg { width: 17px; height: 17px; }
.stat-card__value { position: relative; z-index: 1; margin: 10px 0 7px; color: var(--ink-950); font-size: clamp(19px, 2vw, 25px); font-weight: 760; letter-spacing: -.7px; line-height: 1; }
.stat-card__meta { position: relative; z-index: 1; display: flex; align-items: center; gap: 6px; margin: 0; color: var(--ink-500); font-size: 9px; }
.trend { display: inline-flex; align-items: center; gap: 2px; padding: 2px 5px; border-radius: 5px; font-size: 8px; font-weight: 750; }
.trend--up { color: var(--green-700); background: var(--green-50); }
.trend--down { color: var(--red); background: var(--red-soft); }

.badge { display: inline-flex; min-height: 22px; align-items: center; gap: 5px; padding: 2px 8px; border: 1px solid transparent; border-radius: 999px; font-size: 9px; font-weight: 700; line-height: 1; text-transform: capitalize; white-space: nowrap; }
.badge::before { width: 5px; height: 5px; content: ""; background: currentColor; border-radius: 50%; opacity: .8; }
.badge--success, .badge--active, .badge--paid, .badge--completed, .badge--received, .badge--fulfilled, .badge--approved { color: var(--green-700); background: var(--green-50); border-color: var(--green-100); }
.badge--warning, .badge--pending, .badge--partial, .badge--low, .badge--on_hold { color: #a96700; background: var(--amber-soft); border-color: #ffe8a4; }
.badge--danger, .badge--inactive, .badge--cancelled, .badge--overdue, .badge--out, .badge--void { color: #c43e3e; background: var(--red-soft); border-color: #ffd6d2; }
.badge--info, .badge--draft, .badge--processing, .badge--ordered, .badge--confirmed, .badge--sent { color: #326dcc; background: var(--blue-soft); border-color: #d3e3ff; }
.badge--neutral { color: var(--ink-600); background: var(--ink-100); border-color: var(--ink-200); }
.badge--violet { color: var(--violet); background: var(--violet-soft); border-color: #e4ddff; }

/* Tables and filters */
.filter-bar { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; padding: 11px; background: var(--white); border: 1px solid var(--ink-200); border-radius: 12px; box-shadow: var(--shadow-sm); }
.filter-bar__search { position: relative; min-width: 180px; flex: 1; }
.filter-bar__search svg { position: absolute; top: 50%; left: 11px; width: 15px; height: 15px; color: var(--ink-400); transform: translateY(-50%); }
.filter-bar__search input { width: 100%; padding-left: 34px; }
.filter-bar select { width: auto; min-width: 120px; }
.filter-bar .btn { flex: 0 0 auto; }
.table-card { overflow: hidden; background: var(--white); border: 1px solid var(--ink-200); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.data-table th { height: 42px; padding: 0 15px; color: var(--ink-500); background: #fafcfb; border-bottom: 1px solid var(--ink-200); font-size: 9px; font-weight: 750; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
.data-table td { height: 57px; padding: 8px 15px; border-bottom: 1px solid var(--ink-100); font-size: 11px; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: #fbfdfc; }
.data-table .is-right { text-align: right; }
.data-table .is-center { text-align: center; }
.table-primary { color: var(--ink-900); font-weight: 680; }
.table-primary a:hover { color: var(--green-700); }
.table-secondary { display: block; margin-top: 2px; color: var(--ink-500); font-size: 9px; }
.entity-cell { display: flex; align-items: center; gap: 9px; }
.entity-cell__thumb { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; overflow: hidden; color: var(--green-700); background: var(--green-50); border: 1px solid var(--green-100); border-radius: 9px; font-size: 10px; font-weight: 750; }
.entity-cell__thumb img { width: 100%; height: 100%; object-fit: cover; }
.table-actions { display: flex; justify-content: flex-end; gap: 2px; }
.table-actions form { display: inline; }
.pagination-bar { display: flex; min-height: 54px; align-items: center; justify-content: space-between; gap: 15px; padding: 10px 15px; color: var(--ink-500); background: #fcfdfd; border-top: 1px solid var(--ink-100); font-size: 10px; }
.pagination { display: flex; align-items: center; gap: 4px; }
.pagination a, .pagination span { display: grid; min-width: 29px; height: 29px; padding: 0 7px; place-items: center; border: 1px solid var(--ink-200); border-radius: 7px; }
.pagination a:hover, .pagination .is-current { color: var(--white); background: var(--green-700); border-color: var(--green-700); }
.pagination .is-disabled { color: var(--ink-300); pointer-events: none; }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px 18px; }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.field { min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field label, .field-label { display: block; margin-bottom: 6px; color: var(--ink-700); font-size: 10px; font-weight: 680; }
.required { color: var(--red); }
.field small, .field-help { display: block; margin-top: 5px; color: var(--ink-500); font-size: 9px; }
input, select, textarea { width: 100%; min-height: 39px; padding: 8px 11px; background: var(--white); border: 1px solid var(--ink-200); border-radius: 8px; outline: none; font-size: 11px; transition: .16s; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-300); }
input:focus, select:focus, textarea:focus { border-color: var(--green-500); box-shadow: var(--focus); }
input::placeholder, textarea::placeholder { color: var(--ink-400); }
input[readonly], input:disabled, select:disabled { color: var(--ink-500); background: var(--ink-50); cursor: not-allowed; }
textarea { min-height: 92px; resize: vertical; }
select { padding-right: 30px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-500) 50%), linear-gradient(135deg, var(--ink-500) 50%, transparent 50%); background-position: calc(100% - 15px) calc(50% - 2px), calc(100% - 11px) calc(50% - 2px); background-repeat: no-repeat; background-size: 4px 4px, 4px 4px; }
.input-group { display: flex; }
.input-group > span { display: inline-flex; min-width: 39px; align-items: center; justify-content: center; color: var(--ink-500); background: var(--ink-50); border: 1px solid var(--ink-200); font-size: 10px; }
.input-group > span:first-child { border-right: 0; border-radius: 8px 0 0 8px; }
.input-group > input { border-radius: 0 8px 8px 0; }
.input-group > input:not(:last-child) { border-radius: 0; }
.input-group > span:last-child { border-left: 0; border-radius: 0 8px 8px 0; }
.input-group > input:first-child { border-radius: 8px 0 0 8px; }
.check-row { display: flex; align-items: flex-start; gap: 9px; }
.check-row input { width: 16px; min-height: 16px; margin: 2px 0 0; accent-color: var(--green-700); }
.check-row label { margin: 0; }
.form-errors { margin: 0 0 18px; padding: 12px 14px 12px 32px; color: #a93434; background: var(--red-soft); border: 1px solid #ffd6d2; border-radius: 9px; font-size: 10px; }
.form-section + .form-section { margin-top: 25px; padding-top: 22px; border-top: 1px solid var(--ink-100); }
.form-section__title { margin-bottom: 14px; }
.form-section__title h3 { margin: 0 0 2px; font-size: 12px; }
.form-section__title p { margin: 0; color: var(--ink-500); font-size: 9px; }
.form-layout { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(250px,.65fr); gap: 18px; align-items: start; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.sticky-actions { position: sticky; z-index: 5; bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 18px; padding: 12px 14px; background: rgba(255,255,255,.94); border: 1px solid var(--ink-200); border-radius: 12px; box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.sticky-actions p { margin: 0; color: var(--ink-500); font-size: 9px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 11px 0; border-bottom: 1px solid var(--ink-100); }
.switch-row:last-child { border-bottom: 0; }
.switch-row strong, .switch-row small { display: block; }
.switch-row strong { font-size: 10px; }
.switch-row small { margin-top: 2px; color: var(--ink-500); font-size: 9px; }
.switch { position: relative; display: inline-flex; }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch span { position: relative; width: 35px; height: 20px; background: var(--ink-300); border-radius: 20px; transition: .2s; }
.switch span::after { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; content: ""; background: var(--white); border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: .2s; }
.switch input:checked + span { background: var(--green-600); }
.switch input:checked + span::after { transform: translateX(15px); }
.switch input:focus-visible + span { box-shadow: var(--focus); }

/* Dashboard and charts */
.welcome-panel { position: relative; display: flex; min-height: 104px; align-items: center; justify-content: space-between; gap: 25px; margin-bottom: 18px; padding: 21px 23px; overflow: hidden; color: #eafff7; background: linear-gradient(110deg, #153b2f, #0a694c); border: 1px solid rgba(255,255,255,.06); border-radius: var(--radius-lg); box-shadow: 0 14px 30px rgba(8,78,59,.13); }
.welcome-panel::before, .welcome-panel::after { position: absolute; content: ""; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; }
.welcome-panel::before { right: 5%; width: 145px; height: 145px; }
.welcome-panel::after { right: 10%; width: 80px; height: 80px; }
.welcome-panel__copy { position: relative; z-index: 1; }
.welcome-panel h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: -.4px; }
.welcome-panel p { margin: 0; color: #abd1c3; font-size: 11px; }
.welcome-panel .btn { position: relative; z-index: 1; color: var(--green-900); background: var(--green-400); border-color: var(--green-400); box-shadow: none; }
.chart-wrap { position: relative; min-height: 244px; padding: 15px 8px 5px; }
.chart-wrap canvas { width: 100%!important; height: 215px!important; }
.chart-legend { display: flex; align-items: center; gap: 14px; color: var(--ink-500); font-size: 9px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i { width: 8px; height: 8px; background: var(--green-500); border-radius: 3px; }
.chart-legend i.alt { background: var(--ink-200); }
.progress { height: 6px; overflow: hidden; background: var(--ink-100); border-radius: 4px; }
.progress span { display: block; height: 100%; background: var(--green-500); border-radius: inherit; }
.metric-list { display: grid; gap: 14px; }
.metric-list__row { display: grid; gap: 6px; }
.metric-list__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 10px; }
.metric-list__top span { color: var(--ink-600); }
.activity-list { margin: 0; padding: 0; list-style: none; }
.activity-item { position: relative; display: flex; gap: 11px; padding: 0 0 16px; }
.activity-item:last-child { padding-bottom: 0; }
.activity-item::after { position: absolute; top: 25px; bottom: 3px; left: 12px; width: 1px; content: ""; background: var(--ink-100); }
.activity-item:last-child::after { display: none; }
.activity-item__icon { position: relative; z-index: 1; display: grid; width: 25px; height: 25px; flex: 0 0 auto; place-items: center; color: var(--green-700); background: var(--green-50); border: 1px solid var(--green-100); border-radius: 50%; font-size: 9px; font-weight: 800; }
.activity-item p { margin: 0 0 2px; font-size: 10px; }
.activity-item time { color: var(--ink-500); font-size: 8px; }
.donut { --value: 70; display: grid; width: 128px; height: 128px; margin: 9px auto; place-items: center; background: conic-gradient(var(--green-500) calc(var(--value) * 1%), var(--green-100) 0); border-radius: 50%; }
.donut::before { grid-area: 1/1; width: 88px; height: 88px; content: ""; background: var(--white); border-radius: 50%; }
.donut__label { z-index: 1; grid-area: 1/1; text-align: center; }
.donut__label strong, .donut__label small { display: block; }
.donut__label strong { font-size: 21px; }
.donut__label small { color: var(--ink-500); font-size: 8px; }

/* Detail pages and documents */
.profile-hero { display: flex; align-items: center; gap: 16px; }
.profile-hero__copy { min-width: 0; flex: 1; }
.profile-hero__copy h2 { margin: 0 0 3px; font-size: 18px; }
.profile-hero__copy p { margin: 0; color: var(--ink-500); font-size: 10px; }
.detail-list { display: grid; margin: 0; }
.detail-list__row { display: grid; grid-template-columns: 105px minmax(0,1fr); gap: 15px; padding: 10px 0; border-bottom: 1px solid var(--ink-100); }
.detail-list__row:last-child { border-bottom: 0; }
.detail-list dt { color: var(--ink-500); font-size: 9px; }
.detail-list dd { margin: 0; font-size: 10px; font-weight: 600; word-break: break-word; }
.summary-strip { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; overflow: hidden; background: var(--ink-100); border: 1px solid var(--ink-100); border-radius: 11px; }
.summary-strip__item { padding: 13px; background: var(--white); }
.summary-strip__item small, .summary-strip__item strong { display: block; }
.summary-strip__item small { margin-bottom: 4px; color: var(--ink-500); font-size: 8px; text-transform: uppercase; }
.summary-strip__item strong { font-size: 14px; }
.document { padding: 30px; }
.document__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; padding-bottom: 25px; border-bottom: 1px solid var(--ink-200); }
.document__brand .brand__word { color: var(--ink-950); }
.document__title { text-align: right; }
.document__title h2 { margin: 0; color: var(--ink-300); font-size: 30px; font-weight: 800; letter-spacing: .04em; }
.document__title strong { display: block; margin-top: 4px; font-size: 12px; }
.document__parties { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 30px; padding: 24px 0; }
.document__parties small { display: block; margin-bottom: 6px; color: var(--ink-500); font-size: 8px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.document__parties strong, .document__parties span { display: block; }
.document__parties strong { margin-bottom: 3px; font-size: 12px; }
.document__parties span { color: var(--ink-600); font-size: 10px; }
.document__totals { width: min(320px,100%); margin: 18px 0 0 auto; }
.total-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; color: var(--ink-600); font-size: 10px; }
.total-row--grand { margin-top: 5px; padding-top: 12px; color: var(--ink-950); border-top: 1px solid var(--ink-200); font-size: 14px; font-weight: 750; }
.document__note { margin-top: 25px; padding: 12px; color: var(--ink-600); background: var(--ink-50); border-radius: 8px; font-size: 9px; }

.line-items { overflow: visible; }
.line-items .data-table input, .line-items .data-table select { min-width: 80px; }
.line-items .data-table select { min-width: 190px; }
.line-items .data-table td { height: auto; padding: 7px; }
.line-items__summary { display: grid; grid-template-columns: minmax(0,1fr) 290px; gap: 25px; padding: 15px; border-top: 1px solid var(--ink-100); }
.line-items__summary textarea { min-height: 80px; }
.remove-line { width: 30px; height: 30px; padding: 0; color: var(--red); background: transparent; border: 0; border-radius: 7px; font-size: 18px; }
.remove-line:hover { background: var(--red-soft); }

/* Inventory, reports, settings */
.stock-level { min-width: 105px; }
.stock-level__top { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 8px; }
.stock-level__top span { color: var(--ink-500); }
.report-card { display: flex; min-height: 150px; flex-direction: column; padding: 18px; transition: .2s var(--ease); }
.report-card:hover { border-color: var(--green-200); box-shadow: var(--shadow); transform: translateY(-2px); }
.report-card__icon { display: grid; width: 39px; height: 39px; margin-bottom: 15px; place-items: center; color: var(--green-700); background: var(--green-50); border: 1px solid var(--green-100); border-radius: 10px; }
.report-card__icon svg { width: 19px; height: 19px; }
.report-card h3 { margin: 0 0 4px; font-size: 12px; }
.report-card p { flex: 1; margin: 0 0 13px; color: var(--ink-500); font-size: 9px; }
.report-card__footer { display: flex; align-items: center; justify-content: space-between; color: var(--green-700); font-size: 9px; font-weight: 700; }
.settings-layout { display: grid; grid-template-columns: 190px minmax(0,1fr); gap: 18px; align-items: start; }
.settings-nav { position: sticky; top: calc(var(--topbar) + 18px); padding: 7px; }
.settings-nav a { display: flex; min-height: 37px; align-items: center; gap: 9px; padding: 0 10px; color: var(--ink-600); border-radius: 8px; font-size: 10px; font-weight: 620; }
.settings-nav a:hover, .settings-nav a.is-active { color: var(--green-700); background: var(--green-50); }
.settings-nav svg { width: 15px; height: 15px; }
.settings-pane { scroll-margin-top: calc(var(--topbar) + 18px); }
.settings-pane + .settings-pane { margin-top: 18px; }

/* Empty and state screens */
.empty-state { display: grid; min-height: 250px; padding: 35px 20px; place-items: center; text-align: center; }
.empty-state__inner { max-width: 340px; }
.empty-state__icon { display: grid; width: 56px; height: 56px; margin: 0 auto 14px; place-items: center; color: var(--green-700); background: var(--green-50); border: 1px solid var(--green-100); border-radius: 17px; box-shadow: 0 9px 20px rgba(8,127,91,.09); }
.empty-state__icon svg { width: 25px; height: 25px; }
.empty-state h3 { margin: 0 0 5px; font-size: 13px; }
.empty-state p { margin: 0 auto 15px; color: var(--ink-500); font-size: 10px; }
.flash-stack { display: grid; gap: 8px; margin-bottom: 14px; }
.flash-stack:empty { display: none; }
.alert { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid; border-radius: 9px; box-shadow: var(--shadow-sm); }
.alert__icon { display: grid; width: 23px; height: 23px; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: 10px; font-weight: 800; }
.alert strong, .alert p { margin: 0; }
.alert strong { display: block; font-size: 9px; }
.alert p { font-size: 10px; }
.alert > button { width: 25px; height: 25px; padding: 0; color: inherit; background: transparent; border: 0; border-radius: 6px; font-size: 18px; }
.alert--success { color: var(--green-800); background: var(--green-50); border-color: var(--green-200); }
.alert--error { color: #ae3636; background: var(--red-soft); border-color: #ffd3cf; }
.alert--warning { color: #936000; background: var(--amber-soft); border-color: #ffe391; }
.alert--info { color: #2e66c3; background: var(--blue-soft); border-color: #cee0ff; }

/* Login and errors */
.auth-page { min-height: 100vh; background: #11241d; }
.auth-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(0,1.08fr) minmax(420px,.92fr); }
.auth-showcase { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 45px clamp(38px,6vw,88px); overflow: hidden; color: var(--white); background: linear-gradient(145deg,#11271f,#07573f); }
.auth-showcase::before { position: absolute; inset: 0; content: ""; background: radial-gradient(circle at 25% 35%, rgba(55,211,154,.16), transparent 30%), radial-gradient(circle at 90% 85%, rgba(255,255,255,.07), transparent 30%); }
.auth-showcase__brand, .auth-showcase__copy, .auth-showcase__footer { position: relative; z-index: 1; }
.auth-showcase__copy { max-width: 590px; }
.auth-showcase__eyebrow { margin-bottom: 16px; color: var(--green-300, #75e7bd); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.auth-showcase h1 { margin: 0 0 16px; font-size: clamp(34px,4vw,60px); font-weight: 760; letter-spacing: -2.5px; line-height: 1.05; }
.auth-showcase h1 span { color: var(--green-400); }
.auth-showcase__copy > p { max-width: 500px; color: #acd0c3; font-size: 13px; }
.auth-features { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.auth-features span { padding: 7px 10px; color: #cfebe1; background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.09); border-radius: 999px; font-size: 9px; }
.auth-showcase__footer { color: #71988a; font-size: 9px; }
.auth-panel { display: grid; padding: 35px; place-items: center; background: #fbfdfc; }
.auth-card { width: min(390px,100%); }
.auth-card__mobile-brand { display: none; margin-bottom: 28px; }
.auth-card__head { margin-bottom: 25px; }
.auth-card__head h2 { margin: 0 0 7px; font-size: 25px; letter-spacing: -.8px; }
.auth-card__head p { margin: 0; color: var(--ink-500); font-size: 11px; }
.auth-form { display: grid; gap: 15px; }
.auth-form .btn { min-height: 43px; margin-top: 3px; }
.password-field { position: relative; }
.password-field input { padding-right: 45px; }
.password-toggle { position: absolute; top: 50%; right: 5px; width: 34px; height: 30px; padding: 0; color: var(--ink-500); background: transparent; border: 0; border-radius: 7px; transform: translateY(-50%); }
.password-toggle:hover { color: var(--green-700); background: var(--green-50); }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.auth-row a { color: var(--green-700); font-size: 10px; font-weight: 680; }
.auth-card__foot { margin: 24px 0 0; color: var(--ink-500); font-size: 9px; text-align: center; }
.demo-access { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding: 11px 12px; color: var(--green-800); background: var(--green-50); border: 1px solid var(--green-100); border-radius: 10px; }
.demo-access strong, .demo-access span { display: block; }
.demo-access strong { font-size: 10px; }
.demo-access span { margin-top: 2px; color: var(--ink-600); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; }
.demo-access button { flex: 0 0 auto; padding: 6px 9px; color: var(--green-800); background: var(--white); border: 1px solid var(--green-200); border-radius: 7px; font-size: 9px; font-weight: 720; }
.demo-access button:hover { background: var(--green-100); }
.error-page { display: grid; min-height: 100vh; padding: 30px; place-items: center; background: linear-gradient(145deg, var(--ink-50), var(--green-50)); text-align: center; }
.error-state { max-width: 530px; }
.error-state__code { position: relative; display: inline-block; margin-bottom: 12px; color: var(--green-700); font-size: clamp(80px,15vw,150px); font-weight: 850; letter-spacing: -9px; line-height: .9; text-shadow: 8px 8px 0 var(--green-100); }
.error-state h1 { margin: 0 0 8px; font-size: 24px; letter-spacing: -.7px; }
.error-state p { max-width: 440px; margin: 0 auto 22px; color: var(--ink-600); font-size: 11px; }
.error-state__actions { display: flex; justify-content: center; gap: 9px; }

/* Utilities */
.text-muted { color: var(--ink-500)!important; }
.text-success { color: var(--green-700)!important; }
.text-danger { color: var(--red)!important; }
.text-right { text-align: right!important; }
.font-medium { font-weight: 650!important; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0!important; }
.mb-0 { margin-bottom: 0!important; }
.w-full { width: 100%; }
.divider { height: 1px; margin: 17px 0; background: var(--ink-100); }

@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .grid--4 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .grid--main { grid-template-columns: minmax(0,1.4fr) minmax(245px,.7fr); }
  .form-grid--3 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .global-search { width: 210px; }
}
@media (max-width: 980px) {
  :root { --sidebar: 240px; }
  .sidebar { transform: translateX(-102%); transition: transform .25s var(--ease); box-shadow: 18px 0 45px rgba(0,0,0,.14); }
  body.sidebar-open { overflow: hidden; }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { visibility: visible; opacity: 1; }
  .sidebar__close, .mobile-menu { display: inline-grid; }
  .app-main { margin-left: 0; }
  .grid--main { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr minmax(400px,.82fr); }
  .auth-showcase h1 { font-size: 38px; }
}
@media (max-width: 760px) {
  .topbar { min-height: 67px; padding: 0 16px; }
  .page-content { padding: 20px 16px 30px; }
  .app-footer { padding: 14px 16px; }
  .global-search { display: none; }
  .user-menu__copy, .user-menu__trigger > svg { display: none; }
  .user-menu__trigger { padding: 3px; }
  .page-toolbar { align-items: stretch; flex-direction: column; }
  .page-toolbar__actions { justify-content: flex-start; }
  .grid--2, .grid--3, .form-layout, .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; display: flex; overflow-x: auto; }
  .settings-nav a { flex: 0 0 auto; }
  .filter-bar { align-items: stretch; flex-wrap: wrap; }
  .filter-bar__search { flex-basis: 100%; }
  .filter-bar select { min-width: 0; flex: 1; }
  .form-grid, .form-grid--3 { grid-template-columns: 1fr; }
  .field--full { grid-column: auto; }
  .line-items__summary { grid-template-columns: 1fr; }
  .document { padding: 20px; }
  .document__head, .document__parties { gap: 18px; }
  .auth-shell { display: block; }
  .auth-showcase { display: none; }
  .auth-panel { min-height: 100vh; padding: 28px 22px; }
  .auth-card__mobile-brand { display: block; }
  .auth-card__mobile-brand .brand__word { color: var(--ink-950); }
}
@media (max-width: 520px) {
  .stat-grid, .grid--4 { grid-template-columns: 1fr; }
  .welcome-panel { align-items: flex-start; flex-direction: column; }
  .welcome-panel::before, .welcome-panel::after { right: -25px; }
  .page-identity h1 { max-width: 180px; overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
  .page-identity span { display: none; }
  .notification-button { display: none; }
  .page-toolbar__actions .btn { flex: 1; }
  .filter-bar select { flex-basis: calc(50% - 5px); }
  .summary-strip { grid-template-columns: 1fr; }
  .pagination-bar { align-items: flex-start; flex-direction: column; }
  .sticky-actions { align-items: stretch; flex-direction: column; }
  .sticky-actions .form-actions { width: 100%; }
  .sticky-actions .btn { flex: 1; }
  .document__head, .document__parties { grid-template-columns: 1fr; flex-direction: column; }
  .document__title { text-align: left; }
  .document__parties { display: grid; }
  .app-footer { align-items: flex-start; flex-direction: column; gap: 4px; }
  .error-state__actions { flex-direction: column; }
}
.compact-tables .data-table th,
.compact-tables .data-table td { padding-top: 8px; padding-bottom: 8px; }

@media print {
  body { background: white; }
  .sidebar, .topbar, .app-footer, .page-toolbar, .flash-stack, .no-print { display: none!important; }
  .app-main { margin: 0; }
  .page-content { max-width: none; min-height: 0; padding: 0; }
  .card, .table-card { border: 0; box-shadow: none; }
  .document { padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto!important; transition-duration: .01ms!important; animation-duration: .01ms!important; animation-iteration-count: 1!important; }
}
