:root {
  color-scheme: light;
  --background: #f3f6fb;
  --surface: #fff;
  --text: #142033;
  --muted: #53647b;
  --line: #dbe3ec;
  --nav: #eaf0fb;
  --brand: #1f4f8f;
  --brand-dark: #173e73;
  --green: #0f665d;
  --green-bg: #e9f6f1;
  --red: #972e37;
  --red-bg: #fdf1f2;
  --gold: #7c4a12;
  --gold-bg: #fcf5e5;
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--background);
  color: var(--text);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-dark); }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid #2365b2; outline-offset: 2px; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner, .nav-inner { max-width: 1440px; margin: auto; padding-inline: 24px; }
.topbar-inner { min-height: 66px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding-block: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); line-height: 1.2; }
.brand strong { display: block; letter-spacing: -.02em; font-size: 16px; }
.brand small { display: block; color: var(--muted); margin-top: 3px; font-size: 11px; }
.mark { width: 37px; height: 37px; border-radius: 10px; display: grid; place-items: center; background: var(--brand); color: #fff; font-size: 14px; font-weight: 800; }
.header-actions { display: flex; gap: 14px; align-items: center; margin-inline-start: auto; flex-wrap: wrap; }
.account-name { font-weight: 600; overflow-wrap: anywhere; }
.company-row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.company-workspace-help { margin: 0 0 12px; }
.company-preview-shortcuts { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.company-preview-shortcuts .form-actions { margin-top: 8px; }
.workspace-shortcuts { margin-bottom: 14px; }
.dashboard-links:not(:empty) { margin: 14px 0; }
.dashboard-links strong { font-size: 22px; }
.workspace-module-link { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; background: #f6f9fe; }
.workspace-module-link:hover { border-color: var(--brand); }
.workspace-module-link span { color: var(--muted); font-size: 12px; }
.preview-banner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; padding: 12px 16px; margin-bottom: 14px; border: 1px solid #e9d7a9; border-radius: 8px; background: var(--gold-bg); color: var(--gold); }
.preview-banner p { margin: 2px 0 0; }
.language { display: inline-flex; align-items: center; gap: 3px; }
.language span { margin-inline-end: 5px; color: var(--muted); font-size: 12px; }
.language a { padding: 5px 7px; border: 1px solid transparent; border-radius: 6px; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 700; }
.language a[aria-current] { color: var(--brand); background: #eff5fd; border-color: var(--line); }
.nav-bar { background: var(--nav); border-top: 1px solid var(--line); }
.nav-inner { display: flex; gap: 7px; align-items: center; padding-block: 7px; overflow-x: auto; }
.nav-inner a { white-space: nowrap; border: 1px solid #e1e7ef; border-radius: 8px; background: #fff; padding: 8px 14px; text-decoration: none; color: var(--text); font-weight: 650; }
.nav-inner a[aria-current] { border-color: var(--brand); color: var(--brand); box-shadow: inset 0 -2px var(--brand); }
.main { width: min(1440px, 100%); margin: 0 auto; padding: 24px; }
.hero, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 2px 5px #14203309; }
.hero { display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; padding: 21px; background: linear-gradient(105deg, #fff 45%, #edf4ff); }
.hero-stat { min-width: 112px; padding: 8px 12px; border: 1px solid var(--line); background: #ffffffc9; border-radius: 8px; color: var(--muted); }
.hero-stat strong { display: block; font-size: 22px; color: var(--brand); }
.eyebrow { margin: 0 0 5px; font-size: 11px; font-weight: 750; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
h1 { font-size: clamp(24px, 3vw, 32px); line-height: 1.15; letter-spacing: -.025em; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; line-height: 1.3; }
.intro { color: var(--muted); margin: 6px 0 0; }
.work-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 14px; align-items: start; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr)); gap: 14px; }
.panel { padding: 16px; min-width: 0; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.wide, fieldset { grid-column: 1 / -1; }
label { display: flex; gap: 4px; flex-direction: column; font-weight: 650; font-size: 12px; min-width: 0; }
input:not([type="hidden"], [type="checkbox"]), select { min-height: 34px; width: 100%; padding: 5px 9px; border: 1px solid #cdd8e5; background: #fff; border-radius: 6px; color: var(--text); }
input[readonly] { background: #f4f7fb; }
fieldset { border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px 10px; }
legend { color: var(--muted); padding: 0 4px; }
.check { flex-direction: row; gap: 6px; align-items: center; min-height: 30px; }
.search, .form-actions { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; }
.search { margin-bottom: 12px; }
.search label { width: min(280px, 100%); flex: 1; }
.register-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 12px; margin: 12px 0 16px; }
.register-filters label { flex: 1 0 min(135px, 100%); }
.register-filters .register-search { flex: 2 0 min(220px, 100%); }
.hero .search { margin: 0; }
.button, button { display: inline-flex; justify-content: center; align-items: center; min-height: 34px; padding: 5px 11px; border: 1px solid transparent; border-radius: 7px; text-decoration: none; font-weight: 700; }
.primary { background: var(--brand); color: #fff; }
.primary:hover { background: var(--brand-dark); color: #fff; }
.quiet { background: #f7f9fc; border-color: #d4deea; color: var(--text); }
.quiet:hover { background: var(--nav); color: var(--brand-dark); }
.danger { background: var(--red-bg); border-color: #f0c7cb; color: var(--red); }
.status-form { border-top: 1px solid var(--line); padding-top: 11px; margin-top: 13px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
[hidden] { display: none !important; }
.inventory-toolbar .search button, .inventory-toolbar .search .button, .register-filters .form-actions > * { min-inline-size: 100px; text-align: center; }
.inventory-panel .table-wrap table { min-width: 570px; }
.inventory-panel .table-wrap { max-height: 66vh; overflow: auto; }
.inventory-panel .table-wrap thead th { position: sticky; top: 0; z-index: 1; background: #f4f7fb; }
.excel-selection-actions { margin: 10px 0; align-items: center; }
.excel-selection-actions .intro { margin: 0; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th, td { padding: 10px 9px; border-bottom: 1px solid #e8edf4; vertical-align: middle; }
td { overflow-wrap: anywhere; }
th { color: var(--muted); background: #f5f8fc; font-size: 12px; font-weight: 750; }
tr:last-child td { border-bottom: 0; }
tbody tr.selected td { background: #eef5ff; }
.empty { color: var(--muted); text-align: center; padding: 22px; }
.code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--muted); }
.badge { display: inline-block; border-radius: 99px; padding: 4px 8px; font-size: 11px; font-weight: 750; white-space: nowrap; }
.active, .scope { background: var(--green-bg); color: var(--green); }
.inactive { background: #ecf0f5; color: var(--muted); }
.pending { background: var(--gold-bg); color: var(--gold); }
.notice { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); }
.notice.error { background: var(--red-bg); color: var(--red); border-color: #f0c7cb; }
.notice.success { background: var(--green-bg); color: var(--green); border-color: #c8e7d8; }
.auth-card, .link-card { margin: clamp(12px, 5vw, 55px) auto 0; padding: 24px; }
.auth-card { max-width: 440px; }
.link-card { max-width: 630px; }
.auth-card .field-grid, .auth-card .notice, .link-actions { margin-top: 16px; }
.auth-help { color: var(--muted); font-size: 12px; margin-bottom: 0; }
.module-tabs { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 12px; }
.inventory-panel { margin-bottom: 14px; }
.inventory-card { max-width: 820px; }
.inventory-toolbar { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.inventory-toolbar .search { flex: 1 1 420px; margin: 0; }
.inventory-toolbar .search label { min-width: min(122px, 100%); }
.pager { align-items: center; margin-top: 12px; color: var(--muted); }
.inline-details summary { cursor: pointer; color: var(--brand); font-weight: 700; }
.inline-details .search, .stock-form { margin: 12px 0 0; }
.card-heading { align-items: center; justify-content: flex-start; }
.card-heading h2 { margin: 0; }
.quantity { font-variant-numeric: tabular-nums; }
.archived { background: var(--gold-bg); color: var(--gold); }
textarea { font: inherit; border: 1px solid #cdd8e5; border-radius: 6px; padding: 7px 9px; color: var(--text); resize: vertical; }
textarea[readonly] { background: #f4f7fb; }
.interface-toolbar { border-top: 1px solid var(--line); padding-top: 14px; margin-bottom: 14px; }
.interface-toolbar h2 { margin-bottom: 0; }
.interface-toolbar .form-actions { margin-top: 12px; }
.interface-filters label { min-width: min(150px, 100%); }
.interface-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 8px; }
.interface-option { background: #f8faff; border: 1px solid var(--line); border-radius: 8px; min-height: 51px; padding: 9px 12px; gap: 9px; cursor: pointer; }
.interface-option:focus-within { border-color: var(--brand); }
.interface-option input { accent-color: var(--brand); inline-size: 16px; block-size: 16px; }
.interface-option small { display: block; font-weight: 500; color: var(--muted); }
.interface-option small.interface-inherited { color: var(--gold); }
button:disabled { cursor: not-allowed; opacity: .55; }
[data-operation-fields][hidden] { display: none; }
@media print {
  .inventory-panel .table-wrap { max-height: none; overflow: visible; }
  .inventory-panel .table-wrap thead th { position: static; }
  .topbar, .print-hide { display: none !important; }
  body, .main { background: white; margin: 0; max-width: none; }
  .export-invoice { border: 0; padding: 0; box-shadow: none; }
}
@media (max-width: 850px) {
  .work-grid { grid-template-columns: minmax(0, 1fr); }
  .edit { grid-row: 1; }
}
@media (max-width: 600px) {
  .topbar-inner, .nav-inner, .main { padding-inline: 12px; }
  .main { padding-block: 12px; }
  .header-actions { margin-inline-start: 0; gap: 8px; }
  .hero { padding: 15px; }
  .panel { padding: 12px; }
}
