:root {
  --masvid-brand: #2859d9;
  --masvid-brand-strong: #1c43ad;
  --masvid-navy: #101827;
  --masvid-slate: #475569;
  --masvid-bg: #f4f6fa;
  --masvid-surface: #ffffff;
  --masvid-surface-subtle: #f8fafc;
  --masvid-border: #dfe4ec;
  --masvid-text: #172033;
  --masvid-muted: #657087;
  --masvid-sidebar: #111a2e;
  --masvid-radius: .25rem;
  --masvid-radius-sm: .2rem;
  --masvid-control-height: 2.15rem;
  --masvid-space-1: .25rem;
  --masvid-space-2: .5rem;
  --masvid-space-3: .75rem;
  --masvid-space-4: 1rem;
  --masvid-shadow: 0 1px 2px rgba(24, 35, 58, 0.06);
  --masvid-drawer-shadow: -10px 0 28px rgba(8, 13, 23, .14);
}

[data-bs-theme="dark"] {
  --masvid-bg: #0d1320;
  --masvid-surface: #151d2d;
  --masvid-surface-subtle: #111827;
  --masvid-border: #2a354a;
  --masvid-text: #edf2fb;
  --masvid-muted: #a5afc2;
  --masvid-sidebar: #080d17;
  --masvid-shadow: 0 8px 30px rgba(0, 0, 0, 0.24);
}

html, body { min-height: 100%; }
body { margin: 0; background: var(--masvid-bg); color: var(--masvid-text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--masvid-brand); }
.btn-primary { --bs-btn-bg: var(--masvid-brand); --bs-btn-border-color: var(--masvid-brand); --bs-btn-hover-bg: var(--masvid-brand-strong); }
.app-layout { min-height: 100vh; display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 0; background: #101827; color: #fff; border-right: 1px solid rgba(153, 174, 199, .12); z-index: 30; }
.brand { min-height: 4rem; display: flex; align-items: center; gap: .7rem; padding: .75rem 1rem; border-bottom: 1px solid rgba(153, 174, 199, .12); }
.brand-mark { display: inline-grid; place-items: center; flex: 0 0 auto; width: 2.15rem; height: 2.15rem; border: 1px solid rgba(210, 222, 236, .38); border-radius: 0; background: transparent; color: #fff; box-shadow: none; font-size: .95rem; font-weight: 650; }
.brand-mark.large { width: 3rem; height: 3rem; border-radius: .85rem; font-size: 1.3rem; }
.sidebar-company-logo { display: block; flex: 0 0 auto; width: auto; height: auto; max-width: 4.5rem; max-height: 2.15rem; object-fit: contain; object-position: left center; }
.brand-name { min-width: 0; overflow: hidden; color: #f4f7fb; font-size: .85rem; font-weight: 650; letter-spacing: .035em; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-nav { display: grid; gap: .1rem; padding: .75rem 0 1.25rem; }
.nav-item, .nav-category { position: relative; width: 100%; min-height: 2.55rem; display: grid; grid-template-columns: 1.15rem minmax(0, 1fr) auto; align-items: center; gap: .7rem; padding: .58rem 1rem; border: 0; border-radius: 0; background: transparent; color: #aab7c8; text-align: left; text-decoration: none; font: inherit; font-size: .83rem; font-weight: 560; transition: color .18s ease, background-color .18s ease; }
.nav-item { grid-template-columns: 1.15rem minmax(0, 1fr); }
.nav-item:hover, .nav-item:focus-visible, .nav-category:hover, .nav-category:focus-visible { color: #fff; background: rgba(101, 132, 169, .1); }
.nav-item.active, .nav-subitem.active { color: #fff; background: rgba(77, 111, 153, .2); }
.nav-item.active::before, .nav-subitem.active::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 2px; background: #6f91b9; }
.nav-icon { width: 1rem; height: 1rem; fill: currentColor; stroke: none; }
.nav-chevron { width: .8rem; height: .8rem; fill: none; stroke: currentColor; stroke-width: 1.7; transition: transform .18s ease; }
.nav-category[aria-expanded="true"] { color: #f3f6fa; }
.nav-category[aria-expanded="true"] .nav-chevron { transform: rotate(180deg); }
.nav-submenu { max-height: 0; overflow: hidden; opacity: 0; transition: max-height .2s ease, opacity .18s ease; }
.nav-submenu.open { max-height: 9rem; opacity: 1; }
.nav-subitem { position: relative; display: block; padding: .53rem 1rem .53rem 2.85rem; color: #8f9eb1; text-decoration: none; font-size: .79rem; transition: color .18s ease, background-color .18s ease; }
.nav-subitem:hover, .nav-subitem:focus-visible { color: #fff; background: rgba(101, 132, 169, .08); }
.unavailable-dot { width: .42rem; height: .42rem; border-radius: 50%; background: #667187; }
.app-main { min-width: 0; }
.sidebar-scrim { display: none; }
.topbar { min-height: 3.125rem; display: flex; align-items: center; gap: .65rem; padding: .38rem 1.15rem; background: var(--masvid-surface); border: 0; border-bottom: 1px solid var(--masvid-border); }
.topbar-spacer { flex: 1; }
.theme-form, .logout-form { margin: 0; }
.user-summary { display: grid; padding: 0 .3rem; line-height: 1.05; text-align: right; }
.user-name { max-width: 14rem; overflow: hidden; font-size: .8rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.role-badge { color: var(--masvid-muted); font-size: .62rem; font-weight: 650; text-transform: uppercase; letter-spacing: .1em; }
.icon-button { display: inline-grid; place-items: center; width: 2rem; height: 2rem; padding: 0; border: 1px solid var(--masvid-border); border-radius: .2rem; color: var(--masvid-text); background: var(--masvid-surface); transition: color .18s ease, border-color .18s ease, background-color .18s ease; }
.icon-button:hover { border-color: #9aa8b9; background: var(--masvid-bg); }
.icon-button svg, .topbar-logout svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: square; stroke-linejoin: miter; }
.topbar-logout { min-height: 2rem; display: inline-flex; align-items: center; gap: .4rem; padding: .32rem .65rem; border: 1px solid var(--masvid-border); border-radius: .2rem; background: transparent; color: var(--masvid-text); font-size: .75rem; font-weight: 600; transition: color .18s ease, border-color .18s ease, background-color .18s ease; }
.topbar-logout:hover { border-color: #9aa8b9; background: var(--masvid-bg); }
.mobile-menu { display: none; }
.content { width: 100%; max-width: 100rem; margin: 0 auto; padding: 1rem 1.25rem 1.5rem; }
.page-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-bottom: .65rem; padding-bottom: .55rem; border-bottom: 1px solid var(--masvid-border); }
h1 { margin: 0; font-size: 1.15rem; font-weight: 720; letter-spacing: -.02em; }
h2 { font-size: .85rem; font-weight: 680; }
.eyebrow { margin: 0 0 .35rem; color: var(--masvid-brand); text-transform: uppercase; letter-spacing: .13em; font-size: .72rem; font-weight: 750; }
.muted, .metric-card p, .notice-card p, .empty-state p { color: var(--masvid-muted); }
.panel, .metric-card, .notice-card, .empty-state { background: var(--masvid-surface); border: 1px solid var(--masvid-border); border-radius: var(--masvid-radius); box-shadow: var(--masvid-shadow); }
.panel { padding: .75rem; margin-bottom: .65rem; }
.notice-card { display: flex; gap: 1rem; align-items: flex-start; padding: 1.25rem; margin-bottom: 1.25rem; }
.notice-icon { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; flex: 0 0 auto; border-radius: 50%; background: #dff7e9; color: #157347; font-weight: 800; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; }
.metric-card { min-height: 0; padding: .75rem; }
.status-chip { display: inline-block; margin: 0; padding: .18rem .42rem; border: 1px solid transparent; border-radius: 999px; background: var(--masvid-bg); color: var(--masvid-muted); font-size: .67rem; font-weight: 700; white-space: nowrap; }
.status-chip.warning { background: #fff1cc; color: #7b5200; }
.auth-page {
  --auth-navy: #101827;
  --auth-navy-soft: #162235;
  --auth-accent: #496788;
  min-height: 100vh;
  display: grid;
  background: var(--masvid-bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(24rem, 1.05fr) minmax(32rem, .95fr); }
.auth-brand-panel { position: relative; isolation: isolate; display: flex; flex-direction: column; overflow: hidden; padding: clamp(2rem, 4vw, 4.75rem); background: var(--auth-navy); color: #f6f8fb; }
.auth-brand-panel::before, .auth-brand-panel::after { content: ""; position: absolute; z-index: -1; border: 1px solid rgba(155, 178, 204, .12); transform: rotate(36deg); }
.auth-brand-panel::before { width: 36rem; height: 36rem; right: -17rem; top: -14rem; }
.auth-brand-panel::after { width: 24rem; height: 24rem; left: -13rem; bottom: -11rem; }
.auth-atmosphere { position: absolute; z-index: -2; inset: -20%; background: radial-gradient(circle at 62% 30%, rgba(84, 118, 153, .2), transparent 27%), radial-gradient(circle at 24% 76%, rgba(45, 73, 104, .28), transparent 24%); animation: auth-ambient 14s ease-in-out infinite alternate; }
.auth-brand-lockup, .auth-mobile-brand { display: flex; align-items: center; gap: .85rem; font-size: .83rem; font-weight: 700; letter-spacing: .22em; }
.auth-company-logo { display: block; width: auto; height: auto; max-width: 11rem; max-height: 2.65rem; object-fit: contain; object-position: left center; }
.auth-monogram { display: grid; place-items: center; width: 2.65rem; height: 2.65rem; border: 1px solid rgba(210, 222, 236, .38); color: #fff; font-size: 1.2rem; font-weight: 600; letter-spacing: 0; }
.auth-brand-message { width: min(100%, 34rem); margin: auto 0; padding: 5rem 0; }
.auth-kicker { margin: 0 0 1.1rem; color: #9eafc2; font-size: .72rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.auth-brand-message h2 { max-width: 31rem; margin: 0; color: #f6f8fb; font-size: clamp(2.1rem, 3.7vw, 3.4rem); font-weight: 600; line-height: 1.12; letter-spacing: -.03em; }
.auth-brand-message p:last-child { max-width: 29rem; margin: 1.6rem 0 0; color: #aebbc9; font-size: 1rem; line-height: 1.75; }
.auth-brand-footnote { margin: 0; color: #8190a2; font-size: .72rem; letter-spacing: .08em; }
.auth-form-panel { display: grid; place-items: center; padding: clamp(2.25rem, 7vw, 7rem); background: var(--masvid-surface); border-left: 1px solid var(--masvid-border); }
.auth-form-wrap { width: min(100%, 28rem); }
.auth-mobile-brand { display: none; color: var(--masvid-text); }
.auth-mobile-brand .auth-monogram { border-color: var(--masvid-border); color: var(--auth-navy); }
.auth-heading { margin-bottom: 2rem; }
.auth-heading h1 { margin-bottom: .7rem; color: var(--masvid-text); font-size: clamp(2.2rem, 3.5vw, 2.8rem); font-weight: 600; line-height: 1.12; letter-spacing: -.03em; }
.auth-heading .muted { margin: 0; line-height: 1.65; }
.auth-error { margin: 0 0 1.35rem; border-radius: .3rem; box-shadow: none; }
.auth-form { gap: 1.25rem; margin-top: 0; }
.auth-form .form-field { gap: .55rem; }
.auth-form .form-field label { color: var(--masvid-text); font-size: .78rem; font-weight: 650; letter-spacing: .045em; }
.auth-form .form-control { min-height: 3.25rem; padding: .75rem .9rem; border-radius: .3rem; transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease; }
.auth-form .form-control:hover { border-color: #a8b3c2; }
.auth-form .form-control:focus { border-color: var(--auth-accent); outline: 0; box-shadow: 0 0 0 3px rgba(73, 103, 136, .13); }
.auth-form .password-field .form-control { padding-right: 4.5rem; }
.auth-form .password-toggle { right: .6rem; color: var(--auth-accent); transition: color .18s ease; }
.auth-form .password-toggle:hover { color: var(--masvid-text); }
.auth-submit { min-height: 3.25rem; margin-top: .35rem; border-radius: .3rem; background: var(--auth-navy); border-color: var(--auth-navy); font-size: .92rem; font-weight: 650; letter-spacing: .025em; transition: background-color .2s ease, border-color .2s ease, transform .2s ease; }
.auth-submit:hover, .auth-submit:focus-visible { background: #1d2b40; border-color: #1d2b40; }
.auth-submit:active { transform: translateY(1px); }
.auth-security-note { display: flex; align-items: center; justify-content: center; gap: .5rem; margin: 1.6rem 0 0; color: var(--masvid-muted); font-size: .72rem; }
.auth-security-note span { width: .38rem; height: .38rem; border-radius: 50%; background: #5e7896; }
@keyframes auth-ambient { from { transform: translate3d(-1.5%, -1%, 0) scale(1); } to { transform: translate3d(1.5%, 1%, 0) scale(1.04); } }
.stack { display: grid; gap: 1rem; margin-top: 1.4rem; }
.form-field { display: grid; gap: .38rem; }
.form-field label { font-size: .86rem; font-weight: 650; }
.field-label { display: inline-flex; align-items: center; gap: .32rem; width: max-content; max-width: 100%; }
.field-label label { margin: 0; }
.field-help { display: inline-flex; flex: 0 0 auto; }
.field-help-trigger { display: inline-grid; place-items: center; width: 1rem; height: 1rem; padding: 0; border: 1px solid var(--masvid-muted); border-radius: 50%; background: transparent; color: var(--masvid-muted); font: inherit; font-size: .65rem; font-weight: 750; line-height: 1; transition: color .18s ease, border-color .18s ease, background-color .18s ease; }
.field-help-trigger:hover, .field-help-trigger:focus-visible, .field-help-trigger[aria-expanded="true"] { border-color: var(--masvid-brand); background: var(--masvid-brand); color: #fff; }
.field-help-tooltip { position: fixed; z-index: 1200; width: max-content; max-width: min(18rem, calc(100vw - 1rem)); padding: .38rem .5rem; border: 1px solid rgba(255, 255, 255, .12); border-radius: .2rem; background: #101827; color: #f5f7fb; box-shadow: 0 5px 16px rgba(8, 13, 23, .2); font-size: .7rem; font-weight: 500; line-height: 1.4; text-align: left; white-space: normal; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .15s ease, visibility .15s ease; }
.field-help-tooltip.is-open { opacity: 1; visibility: visible; }
.form-control, .form-select { border-color: var(--masvid-border); background-color: var(--masvid-surface); color: var(--masvid-text); }
.form-control:focus, .form-select:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(40,89,217,.2); outline-offset: 2px; box-shadow: none; }
.password-field { position: relative; }
.password-field .form-control { padding-right: 4.2rem; }
.password-toggle { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--masvid-brand); font-size: .8rem; font-weight: 700; }
.narrow-page { max-width: 36rem; }
.empty-state { padding: 4rem 1.5rem; text-align: center; }
.empty-state.compact { padding: 2rem 1rem; box-shadow: none; border: 0; }
.empty-icon { font-size: 2.8rem; color: var(--masvid-muted); }
.create-panel summary { cursor: pointer; font-weight: 700; }
.create-panel[open] summary { margin-bottom: 1rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; }
.form-actions { grid-column: 1 / -1; }
.filter-bar { display: grid; grid-template-columns: minmax(12rem, 1fr) 10rem 10rem auto; gap: .65rem; margin-bottom: 1rem; }
.users-page { width: 100%; min-height: 0; font-size: .85rem; }
.users-server-alert { padding: .55rem .7rem; margin-bottom: .65rem; border-radius: .2rem; font-size: .78rem; }
.users-toolbar { display: grid; grid-template-columns: minmax(14rem, 1fr) 9rem 9rem auto auto; gap: .5rem; align-items: center; width: 100%; margin-bottom: .6rem; }
.users-toolbar .form-control, .users-toolbar .form-select { min-height: 2.15rem; border-radius: .2rem; font-size: .78rem; }
.users-create-button { white-space: nowrap; }
.users-page .users-grid { width: 100%; overflow: visible; border: 1px solid var(--masvid-border); background: var(--masvid-surface); }
.users-grid-filters .user-search-field { width: min(18rem, 100%); }
.users-grid-body { min-height: 12.5rem; overflow: visible; }
.user-table { width: 100%; min-width: 50rem; margin: 0; color: var(--masvid-text); font-size: .75rem; table-layout: fixed; }
.user-table > :not(caption) > * > * { padding: .5rem .6rem; background: transparent; border-color: var(--masvid-border); }
.user-table thead th { position: relative; color: var(--masvid-text); background: color-mix(in srgb, var(--masvid-surface-subtle) 75%, var(--masvid-border)); font-size: .66rem; font-weight: 750; letter-spacing: .045em; text-align: center; text-transform: uppercase; }
.user-table thead th:hover .backup-resize-handle::after, .user-column-resizing .backup-resize-handle::after { opacity: .55; }
.user-column-resizing, .user-column-resizing * { cursor: col-resize !important; user-select: none !important; }
.user-username-column { width: 20%; }
.user-role-column { width: 12%; }
.user-status-column { width: 12%; }
.user-security-column { width: 16%; }
.user-actions-column { width: 40%; }
.user-table th:last-child { position: sticky; right: 0; z-index: 3; }
.user-table tr[data-user-row] > td:last-child { position: sticky; right: 0; z-index: 2; background: var(--masvid-surface); box-shadow: -1px 0 var(--masvid-border); }
.user-table .form-control, .user-table .form-select { min-height: 2rem; padding: .28rem .45rem; border-radius: .2rem; font-size: .76rem; }
.user-table .status-chip { margin: 0; white-space: nowrap; }
.user-actions { display: flex; flex-wrap: wrap; gap: .25rem; }
.user-row-error, .users-form-error { margin: .35rem 0 0; color: var(--bs-danger); font-size: .72rem; font-weight: 600; }
.users-grid .inline-reset { border-radius: 0; }
.users-drawer-layer { position: fixed; z-index: 1050; inset: 0; display: grid; grid-template-columns: 1fr minmax(20rem, 25rem); }
.users-drawer-layer[hidden] { display: none; }
.products-csv-layer { position: fixed; z-index: 1060; inset: 0; display: grid; place-items: center; padding: var(--masvid-space-4); }
.products-csv-layer[hidden] { display: none; }
.products-csv-scrim { position: absolute; inset: 0; border: 0; background: rgba(15, 23, 42, .6); }
.products-csv-modal { position: relative; display: flex; flex-direction: column; width: min(600px, 100%); max-height: calc(100dvh - 2rem); overflow: hidden; background: var(--masvid-surface); color: var(--masvid-text); border: 1px solid var(--masvid-border); border-radius: var(--masvid-radius); box-shadow: var(--masvid-drawer-shadow); }
.products-csv-modal .products-csv-header { align-items: center; padding: var(--masvid-space-3) var(--masvid-space-4); }
.products-csv-header h2 { font-size: 1rem; }
.products-csv-modal form { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; margin: 0; }
.products-csv-body { min-height: 0; overflow-y: auto; padding: var(--masvid-space-4); font-size: .78rem; line-height: 1.5; }
.products-csv-intro { margin: 0 0 var(--masvid-space-3); color: var(--masvid-muted); }
.products-csv-file-field { gap: var(--masvid-space-1); margin-bottom: var(--masvid-space-4); }
.products-csv-file-field label { font-size: .75rem; }
.products-csv-file-field .form-control { min-height: var(--masvid-control-height); border-color: var(--masvid-border); border-radius: var(--masvid-radius-sm); font-size: .78rem; }
.products-csv-file-field .form-control::file-selector-button { margin-right: var(--masvid-space-3); border-right: 1px solid var(--masvid-border); background: var(--masvid-surface-subtle); color: var(--masvid-text); font-weight: 600; }
.products-csv-requirements { border: 1px solid var(--masvid-border); border-radius: var(--masvid-radius-sm); background: var(--masvid-surface-subtle); padding: var(--masvid-space-3); }
.products-csv-section-header { display: flex; align-items: center; justify-content: space-between; gap: var(--masvid-space-2); margin-bottom: var(--masvid-space-2); }
.products-csv-section-header h3 { margin: 0; font-size: .8rem; font-weight: 700; }
.products-csv-section-header .btn { flex: 0 0 auto; }
.products-csv-format { margin: 0 0 var(--masvid-space-3); color: var(--masvid-muted); font-size: .73rem; }
.products-csv-format code { overflow-wrap: anywhere; color: var(--masvid-text); }
.products-csv-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--masvid-space-3) var(--masvid-space-4); margin: 0; }
.products-csv-rules > div { min-width: 0; }
.products-csv-rules dt { margin-bottom: var(--masvid-space-1); font-size: .72rem; font-weight: 700; }
.products-csv-rules dd { margin: 0; color: var(--masvid-muted); font-size: .72rem; }
.products-csv-rules code { color: var(--masvid-text); }
.products-csv-modal [data-products-csv-error] { margin: var(--masvid-space-3) 0 0; white-space: pre-line; }
.products-csv-modal .products-csv-actions { flex: 0 0 auto; align-items: center; margin: 0; padding: var(--masvid-space-3) var(--masvid-space-4); border-top: 1px solid var(--masvid-border); background: var(--masvid-surface); }
.products-csv-actions [data-products-csv-loading] { margin-right: auto; color: var(--masvid-muted); font-size: .75rem; }
@media (max-width: 620px) {
  .products-csv-layer { padding: var(--masvid-space-2); }
  .products-csv-modal { max-height: calc(100dvh - 1rem); }
  .products-csv-rules { grid-template-columns: 1fr; }
  .products-csv-section-header { align-items: flex-start; flex-direction: column; }
}
.users-drawer-scrim { grid-column: 1; grid-row: 1; border: 0; background: rgba(6, 11, 19, .48); }
.users-drawer { grid-column: 2; grid-row: 1; min-width: 0; height: 100%; padding: 1rem; overflow-y: auto; background: var(--masvid-surface); border-left: 1px solid var(--masvid-border); box-shadow: -10px 0 28px rgba(8, 13, 23, .14); }
.users-drawer-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding-bottom: .7rem; border-bottom: 1px solid var(--masvid-border); }
.users-drawer-header .eyebrow { margin-bottom: .2rem; }
.users-drawer-header h2 { margin: 0; font-size: 1rem; }
.users-drawer-close { display: grid; place-items: center; width: 1.9rem; height: 1.9rem; padding: 0; border: 1px solid var(--masvid-border); border-radius: .2rem; background: transparent; color: var(--masvid-text); font-size: 1.2rem; line-height: 1; }
.users-create-form { display: grid; gap: .7rem; margin-top: .8rem; }
.users-create-form .form-field { gap: .28rem; }
.users-create-form .form-field label { font-size: .75rem; }
.users-create-form .form-control, .users-create-form .form-select { min-height: 2.3rem; border-radius: .2rem; font-size: .8rem; }
.users-drawer-actions { display: flex; justify-content: flex-end; gap: .4rem; margin-top: .15rem; }
.users-page [aria-busy="true"] { opacity: .68; }
.backups-page { width: 100%; min-height: 0; font-size: .85rem; }
.backups-server-alert { padding: .55rem .7rem; margin-bottom: .65rem; border-radius: .2rem; font-size: .78rem; }
.backups-page .backups-grid { position: relative; width: 100%; overflow: visible; border: 1px solid var(--masvid-border); background: var(--masvid-surface); }
.backup-grid-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.25rem; padding: .55rem .7rem; border-bottom: 1px solid var(--masvid-border); }
.backup-grid-header > div:first-child { display: flex; align-items: baseline; gap: .5rem; }
.backup-grid-header h1 { margin: 0; font-size: 1rem; }
.backup-grid-header span { color: var(--masvid-muted); font-size: .7rem; font-weight: 650; }
.backup-grid-actions { display: flex; align-items: center; justify-content: flex-end; gap: .35rem; }
.backup-grid-filters { display: flex; align-items: end; gap: .45rem; padding: .5rem .7rem; border-bottom: 1px solid var(--masvid-border); background: var(--masvid-surface-subtle); }
.backup-grid-filters .form-field { width: 10.5rem; gap: .16rem; }
.backup-grid-filters label, .backup-page-size label { margin: 0; color: var(--masvid-muted); font-size: .65rem; font-weight: 700; }
.backup-clear-filters { align-self: end; white-space: nowrap; }
.backup-grid-body { min-height: 12.5rem; overflow: visible; }
.backups-table { width: 100%; min-width: 48rem; margin: 0; color: var(--masvid-text); font-size: .75rem; table-layout: fixed; }
.backups-table > :not(caption) > * > * { padding: .46rem .58rem; background: transparent; border-color: var(--masvid-border); }
.backups-table thead th { position: relative; color: var(--masvid-text); background: color-mix(in srgb, var(--masvid-surface-subtle) 75%, var(--masvid-border)); font-size: .66rem; font-weight: 750; letter-spacing: .045em; text-align: center; text-transform: uppercase; }
.backup-sort-link { display: inline-flex; align-items: center; justify-content: center; gap: .22rem; color: inherit; text-decoration: none; }
.backup-sort-link:hover, .backup-sort-link:focus-visible { color: var(--masvid-brand); }
.backup-sort-arrow { color: var(--masvid-brand); font-size: .72rem; line-height: 1; }
.backup-resize-handle { position: absolute; z-index: 2; top: 0; right: -5px; bottom: 0; width: 10px; padding: 0; border: 0; background: transparent; cursor: col-resize; touch-action: none; }
.backup-resize-handle::after { content: ""; position: absolute; top: 20%; right: 4px; bottom: 20%; width: 1px; background: var(--masvid-brand); opacity: 0; }
.backups-table thead th:hover .backup-resize-handle::after, .backup-resize-handle:focus-visible::after, .backup-column-resizing .backup-resize-handle::after { opacity: .55; }
.backup-resize-handle:focus-visible { outline: 2px solid var(--masvid-brand); outline-offset: -2px; }
.backup-column-resizing, .backup-column-resizing * { cursor: col-resize !important; user-select: none !important; }
.backup-date-column { width: 15.7%; }
.backup-type-column { width: 11.8%; }
.backup-status-column { width: 11.5%; }
.backup-size-column { width: 10.5%; }
.backup-expiry-column { width: 17%; }
.backup-error-column { width: 20.9%; }
.backup-actions-column { width: 12.6%; }
.backup-status-cell, .backup-action-cell { text-align: center; }
.backup-size-cell { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.backups-table th:last-child { position: sticky; right: 0; z-index: 3; }
.backups-table td:last-child { position: sticky; right: 0; z-index: 2; background: var(--masvid-surface); box-shadow: -1px 0 var(--masvid-border); }
.backups-table .status-chip { margin: 0; white-space: nowrap; }
.backups-table .status-chip.success { background: #dff7e9; color: #157347; }
.backups-table .status-chip.error { background: #f8d7da; color: #842029; }
.backup-error { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backup-grid-footer { display: grid; grid-template-columns: minmax(9rem, 1fr) auto minmax(9rem, 1fr); align-items: center; gap: .65rem; min-height: 3rem; padding: .5rem .7rem; border-top: 1px solid var(--masvid-border); color: var(--masvid-muted); font-size: .7rem; }
.backup-page-navigation { display: flex; align-items: center; justify-content: center; gap: .25rem; }
.backup-page-navigation .btn { min-width: 2rem; }
.backup-page-navigation .btn:first-child, .backup-page-navigation .btn:last-child { min-width: 4.5rem; }
.backup-page-size { display: flex; align-items: center; justify-content: flex-end; gap: .4rem; }
.backup-page-size .form-select { width: 4.75rem; }
.backups-grid-loading { position: absolute; z-index: 3; inset: 3.25rem 0 0; display: flex; align-items: center; justify-content: center; gap: .5rem; min-height: 7rem; background: color-mix(in srgb, var(--masvid-surface) 88%, transparent); color: var(--masvid-muted); font-size: .78rem; font-weight: 600; }
.backups-grid-loading[hidden] { display: none; }

/* Catalog grids deliberately reuse the approved Backups grid geometry. */
.catalog-approved-page { width: 100%; }
.catalog-approved-grid { width: 100%; }
.catalog-approved-grid .table-responsive { overflow-x: visible; }
.catalog-approved-table { width: 100%; table-layout: fixed; min-width: 0; }
.catalog-grid-filters input[type="search"] { flex: 1 1 16rem; min-width: 12rem; }
.catalog-approved-grid td { overflow: hidden; text-overflow: ellipsis; }
.catalog-approved-grid td:last-child { overflow: visible; }
.documents-page .catalog-approved-grid + .catalog-approved-grid { margin-top: 1rem; }
.documents-page .catalog-approved-grid .backups-table { min-width: 0; }
.catalog-approved-grid .catalog-actions,
.catalog-approved-grid .supplier-row-actions { justify-content: flex-end; flex-wrap: nowrap; }
.catalog-column-resizing { cursor: col-resize; user-select: none; }
@media (max-width: 767.98px) {
  .catalog-approved-grid .table-responsive { overflow-x: auto; }
  .catalog-approved-table { min-width: 48rem; }
  .documents-page .catalog-approved-grid .backups-table { min-width: 48rem; }
  .catalog-grid-filters input[type="search"] { flex-basis: 100%; }
}
.backup-create-form { display: grid; gap: .75rem; margin-top: .8rem; }
.backup-type-options { display: grid; gap: .45rem; margin: 0; padding: 0; border: 0; }
.backup-type-options legend { margin-bottom: .2rem; font-size: .75rem; font-weight: 650; }
.backup-type-option { display: flex; align-items: center; gap: .45rem; min-height: 2.4rem; margin: 0; padding: .5rem .6rem; border: 1px solid var(--masvid-border); background: var(--masvid-bg); font-size: .78rem; font-weight: 600; cursor: pointer; }
.backup-type-option label { margin: 0; cursor: pointer; }
.backup-type-option:has(input:checked) { border-color: var(--masvid-brand); background: color-mix(in srgb, var(--masvid-brand) 7%, var(--masvid-surface)); }
.backup-type-option .field-help { margin-left: auto; }
.backups-form-error { margin: 0; color: var(--bs-danger); font-size: .72rem; font-weight: 600; }
.backups-page [aria-busy="true"] { opacity: .68; }
.suppliers-page { width: 100%; min-height: 0; font-size: .85rem; }
.supplier-server-alert, .supplier-detail-alert { padding: .55rem .7rem; margin-bottom: .65rem; border-radius: .2rem; font-size: .78rem; }
.suppliers-toolbar { display: grid; grid-template-columns: minmax(14rem, 2fr) repeat(4, minmax(7rem, 1fr)) auto auto; gap: .5rem; align-items: center; width: 100%; margin-bottom: .6rem; }
.suppliers-toolbar .form-control, .suppliers-toolbar .form-select { min-height: 2.15rem; border-radius: .2rem; font-size: .78rem; }
.suppliers-create-button { white-space: nowrap; }
.suppliers-grid { width: 100%; border: 1px solid var(--masvid-border); background: var(--masvid-surface); }
.suppliers-table { width: 100%; min-width: 50rem; margin: 0; color: var(--masvid-text); font-size: .78rem; }
.suppliers-table > :not(caption) > * > * { padding: .5rem .6rem; background: transparent; border-color: var(--masvid-border); }
.suppliers-table thead th { color: var(--masvid-muted); font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.suppliers-table .status-chip { margin: 0; white-space: nowrap; }
.supplier-row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem; }
.supplier-row-actions form { margin: 0; }
.suppliers-pagination { padding: .55rem .65rem; border-top: 1px solid var(--masvid-border); color: var(--masvid-muted); font-size: .75rem; }
.supplier-drawer-layer { grid-template-columns: 1fr minmax(25rem, 30rem); }
.supplier-editor-form { display: grid; gap: .65rem; margin-top: .8rem; }
.supplier-editor-form .form-field { gap: .28rem; }
.supplier-editor-form .form-field label { font-size: .75rem; }
.supplier-editor-form .form-control { min-height: 2.25rem; padding: .38rem .55rem; border-radius: .2rem; font-size: .8rem; }
.supplier-editor-form textarea.form-control { min-height: 4rem; resize: vertical; }
.supplier-form-error { margin: 0; color: var(--bs-danger); font-size: .72rem; font-weight: 600; }
.suppliers-page [aria-busy="true"] { opacity: .68; }
.supplier-form-page { width: min(100%, 52rem); margin: 0 auto; font-size: .85rem; }
.supplier-form-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: .65rem; }
.supplier-form-heading h1 { font-size: 1.15rem; letter-spacing: -.015em; }
.supplier-form-panel { padding: .85rem; border: 1px solid var(--masvid-border); background: var(--masvid-surface); }
.supplier-form-panel .supplier-editor-form { margin-top: 0; }
.supplier-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.supplier-form-wide { grid-column: 1 / -1; }
.supplier-form-actions { display: flex; justify-content: flex-end; gap: .4rem; padding-top: .65rem; border-top: 1px solid var(--masvid-border); }
.supplier-detail-page { width: 100%; min-height: 0; font-size: .82rem; }
.supplier-detail-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .65rem; padding-bottom: .65rem; border-bottom: 1px solid var(--masvid-border); }
.supplier-detail-title { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.supplier-detail-title h1 { font-size: 1.15rem; letter-spacing: -.015em; }
.supplier-detail-title .status-chip { margin: 0; }
.supplier-detail-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .35rem; }
.supplier-detail-actions form { margin: 0; }
.supplier-detail-sections { display: grid; grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr); gap: .65rem; }
.supplier-detail-section { min-width: 0; border: 1px solid var(--masvid-border); background: var(--masvid-surface); }
.supplier-detail-section > header { padding: .5rem .65rem; border-bottom: 1px solid var(--masvid-border); }
.supplier-detail-section h2 { margin: 0; font-size: .78rem; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; }
.supplier-detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.supplier-detail-list > div { min-width: 0; padding: .55rem .65rem; border-bottom: 1px solid var(--masvid-border); }
.supplier-detail-list .supplier-detail-wide { grid-column: 1 / -1; border-bottom: 0; }
.supplier-detail-list dt { margin-bottom: .15rem; color: var(--masvid-muted); font-size: .67rem; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; }
.supplier-detail-list dd { margin: 0; font-size: .8rem; font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; }
.supplier-notes { min-height: 4rem; padding: .55rem .65rem; font-size: .8rem; font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; }
.supplier-ledger-page { width: 100%; min-height: 0; font-size: .82rem; }
.supplier-ledger-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: .65rem; padding-bottom: .65rem; border-bottom: 1px solid var(--masvid-border); }
.supplier-ledger-header h1 { font-size: 1.15rem; letter-spacing: -.015em; }
.supplier-ledger-header p:last-child { margin: .2rem 0 0; color: var(--masvid-muted); font-size: .74rem; }
.supplier-ledger-navigation { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .35rem; }
.supplier-ledger-toolbar { display: flex; align-items: end; gap: .45rem; width: 100%; margin-bottom: .6rem; }
.supplier-ledger-toolbar label { margin: 0; color: var(--masvid-muted); font-size: .7rem; font-weight: 700; }
.supplier-ledger-toolbar .form-control, .supplier-ledger-toolbar .form-select { min-height: 2.15rem; border-radius: .2rem; font-size: .78rem; }
.statement-supplier-field { display: grid; flex: 1 1 15rem; gap: .2rem; min-width: 12rem; max-width: 22rem; }
.statement-date-field { display: grid; gap: .2rem; width: 10.5rem; }
.transaction-toolbar label { align-self: center; }
.transaction-toolbar .form-select { width: 6rem; }
.supplier-ledger-exports { display: flex; flex-wrap: wrap; gap: .35rem; margin-left: auto; }
.supplier-ledger-grid { width: 100%; border: 1px solid var(--masvid-border); background: var(--masvid-surface); }
.supplier-ledger-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--masvid-border); }
.supplier-ledger-summary > div { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; min-width: 0; padding: .55rem .65rem; border-right: 1px solid var(--masvid-border); }
.supplier-ledger-summary > div:last-child { border-right: 0; }
.supplier-ledger-summary span { color: var(--masvid-muted); font-size: .67rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.supplier-ledger-summary strong { font-size: .86rem; white-space: nowrap; }
.supplier-ledger-table { width: 100%; margin: 0; color: var(--masvid-text); font-size: .76rem; table-layout: fixed; }
.supplier-ledger-table > :not(caption) > * > * { padding: .45rem .6rem; background: transparent; border-color: var(--masvid-border); }
.supplier-ledger-table thead th { color: var(--masvid-muted); font-size: .65rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.supplier-ledger-table .transaction-kind { margin: 0; white-space: nowrap; }
.supplier-ledger-table .financial-cell { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.supplier-ledger-table .running-balance { color: var(--masvid-text); }
.supplier-ledger-table .empty-state { margin: 0; }
.statement-grid .statement-toolbar { align-items: end; }
.statement-grid .supplier-ledger-table thead th { text-align: center; }
.statement-grid .supplier-ledger-table th:last-child,
.statement-grid .supplier-ledger-table td:last-child { position: static; box-shadow: none; }
.statement-grid .supplier-ledger-table th:nth-child(4) { width: 25%; }
.supplier-ledger-pagination { padding: .55rem .65rem; border-top: 1px solid var(--masvid-border); color: var(--masvid-muted); font-size: .75rem; }
.supplier-statement-empty { border: 1px solid var(--masvid-border); background: var(--masvid-surface); }
.supplier-transactions-page { width: 100%; min-height: 0; font-size: .82rem; }
.supplier-transactions-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: .65rem; padding-bottom: .65rem; border-bottom: 1px solid var(--masvid-border); }
.supplier-transactions-header h1 { font-size: 1.15rem; letter-spacing: -.015em; }
.supplier-transactions-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: .45rem; width: 100%; margin: 0; }
.supplier-transactions-toolbar label { margin: 0; color: var(--masvid-muted); font-size: .7rem; font-weight: 700; }
.supplier-transactions-toolbar .form-control, .supplier-transactions-toolbar .form-select { min-height: 2.15rem; border-radius: .2rem; font-size: .78rem; }
.supplier-transaction-date-field, .supplier-transaction-size-field { display: grid; gap: .2rem; }
.supplier-transaction-date-field { width: 10.5rem; }
.supplier-transaction-size-field { width: 5rem; }
.supplier-transactions-grid { width: 100%; border: 1px solid var(--masvid-border); background: var(--masvid-surface); }
.supplier-transactions-table { width: 100%; margin: 0; color: var(--masvid-text); font-size: .76rem; table-layout: fixed; }
.transaction-reference-filter { flex: 1 1 8rem; min-width: 7rem; max-width: 12rem; }
.supplier-transactions-table td, .supplier-ledger-table td { overflow: hidden; text-overflow: ellipsis; }
.supplier-transactions-table > :not(caption) > * > * { padding: .45rem .6rem; background: transparent; border-color: var(--masvid-border); }
.supplier-transactions-table thead th { color: var(--masvid-muted); font-size: .65rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.supplier-transactions-table a { font-weight: 600; text-decoration: none; }
.supplier-transactions-table .financial-cell { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.supplier-transactions-table .row-actions { text-align: right; white-space: nowrap; }
.supplier-transactions-table .status-chip { margin: 0; white-space: nowrap; }
.supplier-transactions-pagination { padding: .55rem .65rem; border-top: 1px solid var(--masvid-border); color: var(--masvid-muted); font-size: .75rem; }
.party-autocomplete { position: relative; display: grid; flex: 1 1 15rem; gap: .2rem; min-width: 12rem; max-width: 22rem; }
.party-autocomplete > label { margin: 0; color: var(--masvid-muted); font-size: .7rem; font-weight: 700; }
.party-autocomplete-control { position: relative; }
.party-autocomplete-control .form-control { padding-right: 1.8rem; }
.party-autocomplete-clear { position: absolute; top: 50%; right: .35rem; padding: 0 .2rem; border: 0; background: transparent; color: var(--masvid-muted); transform: translateY(-50%); }
.party-autocomplete-options { position: absolute; z-index: 40; top: calc(100% + .2rem); right: 0; left: 0; max-height: 15rem; overflow-y: auto; border: 1px solid var(--masvid-border); border-radius: .2rem; background: var(--masvid-surface); box-shadow: var(--masvid-shadow); }
.party-autocomplete-option, .party-autocomplete-state { display: block; width: 100%; padding: .45rem .55rem; border: 0; border-bottom: 1px solid var(--masvid-border); background: transparent; color: var(--masvid-text); text-align: left; font-size: .76rem; }
.party-autocomplete-option:hover, .party-autocomplete-option:focus, .party-autocomplete-option[aria-selected="true"] { background: color-mix(in srgb, var(--masvid-primary) 10%, transparent); outline: none; }
.party-autocomplete-state { color: var(--masvid-muted); }
.customer-detail-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.customer-detail-sections > :first-child { grid-column: 1 / -1; }
.customer-record-list { padding: .55rem .65rem; }
.customer-form-page { display: flex; flex-direction: column; min-height: 0; height: 100%; font-size: .8rem; }
.customer-drawer { width: min(100%, 48rem); max-width: 48rem; padding: 0; overflow: hidden; }
.customer-drawer-header { flex: 0 0 auto; padding: .75rem 1rem; }
.customer-drawer-header h1 { margin: 0; font-size: 1rem; }
.customer-editor-form { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
.customer-drawer-body { display: grid; flex: 1 1 auto; gap: .65rem; min-height: 0; padding: .75rem 1rem; overflow-y: auto; }
.customer-form-section { border: 1px solid var(--masvid-border); background: var(--masvid-surface); }
.customer-form-section > header { padding: .48rem .6rem; border-bottom: 1px solid var(--masvid-border); }
.customer-form-section h2 { margin: 0; font-size: .72rem; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; }
.customer-section-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.customer-section-header p { margin: .12rem 0 0; color: var(--masvid-muted); font-size: .68rem; }
.customer-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; padding: .6rem; }
.customer-form-wide { grid-column: 1 / -1; }
.customer-editor-form .form-field { gap: .22rem; }
.customer-editor-form .form-field label { color: var(--masvid-text); font-size: .72rem; font-weight: 600; }
.customer-editor-form .form-control, .customer-editor-form .form-select { min-height: 2.15rem; padding: .34rem .5rem; border-radius: .2rem; font-size: .78rem; }
.customer-editor-form textarea.form-control { min-height: 3.6rem; resize: vertical; }
.customer-repeat-list { display: grid; }
.customer-repeat-row { position: relative; min-width: 0; margin: 0; padding: 0; border: 0; border-bottom: 1px solid var(--masvid-border); }
.customer-repeat-row:last-child { border-bottom: 0; }
.customer-repeat-row legend { float: none; width: auto; margin: 0; padding: .45rem .6rem 0; color: var(--masvid-muted); font-size: .67rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.customer-repeat-remove { position: absolute; z-index: 1; top: .28rem; right: .45rem; display: grid; place-items: center; width: 1.65rem; height: 1.65rem; padding: 0; border: 0; background: transparent; color: var(--masvid-muted); font-size: 1rem; line-height: 1; }
.customer-repeat-remove:hover, .customer-repeat-remove:focus { color: var(--bs-danger); }
.customer-repeat-empty { margin: 0; padding: .7rem .6rem; color: var(--masvid-muted); font-size: .72rem; }
.customer-form-error { margin: 0; padding: .5rem .6rem; border: 1px solid color-mix(in srgb, var(--bs-danger) 35%, var(--masvid-border)); background: color-mix(in srgb, var(--bs-danger) 7%, var(--masvid-surface)); color: var(--bs-danger); font-size: .72rem; font-weight: 600; }
.customer-drawer-footer { display: flex; flex: 0 0 auto; justify-content: flex-end; gap: .4rem; padding: .65rem 1rem; border-top: 1px solid var(--masvid-border); background: var(--masvid-surface); box-shadow: 0 -5px 12px rgba(8, 13, 23, .05); }
.price-lists-page, .price-list-detail-page { width: 100%; min-height: 0; font-size: .82rem; }
.price-lists-toolbar, .price-list-products-toolbar { display: flex; align-items: center; gap: .45rem; margin-bottom: .6rem; }
.price-lists-toolbar label { color: var(--masvid-muted); font-size: .7rem; font-weight: 700; }
.price-lists-toolbar .form-select { width: 5rem; }
.price-lists-grid { border: 1px solid var(--masvid-border); background: var(--masvid-surface); }
.price-lists-table { width: 100%; min-width: 42rem; margin: 0; font-size: .76rem; }
.price-lists-table > :not(caption) > * > * { padding: .45rem .6rem; background: transparent; border-color: var(--masvid-border); }
.price-lists-table thead th { color: var(--masvid-muted); font-size: .65rem; letter-spacing: .06em; text-transform: uppercase; }
.price-list-summary, .price-list-override { margin-bottom: .65rem; }
.price-list-detail-body { display: grid; gap: .65rem; padding: .65rem; }
.price-list-products-toolbar { padding: .55rem .65rem; margin: 0; border-bottom: 1px solid var(--masvid-border); }
.price-list-products-toolbar .form-control { flex: 1 1 16rem; }
.price-list-products-toolbar .form-select { width: 7rem; }
.price-list-pricing-table { min-width: 72rem; }
.price-list-pricing-table .financial-cell { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-list-pricing-table .row-actions { text-align: right; white-space: nowrap; }
.price-list-pricing-table .status-chip { margin: 0; white-space: nowrap; }
.customer-pricing-page { width: 100%; min-height: 0; font-size: .82rem; }
.customer-price-list-assignment { margin-bottom: .6rem; padding: .5rem .65rem; border: 1px solid var(--masvid-border); background: var(--masvid-surface); }
.customer-price-list-form { display: flex; align-items: center; gap: .45rem; }
.customer-price-list-form label { margin: 0; color: var(--masvid-muted); font-size: .7rem; font-weight: 700; white-space: nowrap; }
.customer-price-list-form .form-select { width: min(20rem, 100%); min-height: 2.15rem; border-radius: .2rem; font-size: .78rem; }
.customer-pricing-table { min-width: 76rem; }
.customer-pricing-table .financial-cell { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.customer-pricing-table .row-actions { text-align: right; white-space: nowrap; }
.customer-pricing-table .status-chip { margin: 0; white-space: nowrap; }
.documents-page { display: grid; gap: .6rem; width: 100%; min-height: 0; font-size: .82rem; }
.documents-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: .55rem; border-bottom: 1px solid var(--masvid-border); }
.documents-header h1 { margin: 0; font-size: 1.12rem; letter-spacing: -.015em; }
.documents-header .eyebrow { margin-bottom: .12rem; }
.document-alert { margin: 0; padding: .5rem .65rem; border-radius: .2rem; font-size: .76rem; }
.documents-toolbar { display: flex; align-items: center; gap: .45rem; }
.documents-toolbar .form-control { flex: 1 1 18rem; min-height: 2.15rem; border-radius: .2rem; font-size: .78rem; }
.documents-toolbar .form-select { width: 7rem; min-height: 2.15rem; border-radius: .2rem; font-size: .78rem; }
.documents-grid { min-width: 0; border: 1px solid var(--masvid-border); background: var(--masvid-surface); }
.documents-grid > header { display: flex; align-items: center; justify-content: space-between; padding: .45rem .6rem; border-bottom: 1px solid var(--masvid-border); }
.documents-grid > header h2 { margin: 0; font-size: .72rem; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; }
.documents-grid > header span { color: var(--masvid-muted); font-size: .7rem; font-weight: 700; }
.documents-table { width: 100%; min-width: 58rem; margin: 0; color: var(--masvid-text); font-size: .76rem; }
.documents-table > :not(caption) > * > * { padding: .45rem .6rem; background: transparent; border-color: var(--masvid-border); }
.documents-table thead th { color: var(--masvid-muted); font-size: .65rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.documents-table code { color: var(--masvid-muted); font-size: .68rem; }
.documents-table .financial-cell { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.documents-table .row-actions { text-align: right; white-space: nowrap; }
.documents-table .status-chip { margin: 0; white-space: nowrap; }
.documents-pagination { padding: .5rem .6rem; border-top: 1px solid var(--masvid-border); color: var(--masvid-muted); font-size: .72rem; }
.financial-document-page { width: 100%; min-height: 0; font-size: .82rem; }
.financial-document-page .page-heading { align-items: center; margin-bottom: .6rem; padding-bottom: .55rem; border-bottom: 1px solid var(--masvid-border); }
.financial-document-page .page-heading h1 { font-size: 1.12rem; letter-spacing: -.015em; }
.financial-document-page .page-heading p { margin-top: .15rem; font-size: .72rem; }
.financial-document-page .panel { padding: .65rem; margin-bottom: .6rem; border-radius: 0; box-shadow: none; }
.financial-document-page .panel h2 { margin-bottom: .45rem; font-size: .76rem; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; }
.financial-document-page .form-field { gap: .22rem; }
.financial-document-page .form-field label { font-size: .7rem; font-weight: 650; }
.financial-document-page .form-control, .financial-document-page .form-select { min-height: 2.15rem; padding: .34rem .5rem; border-radius: .2rem; font-size: .78rem; }
.financial-document-page .quotation-lines { min-width: 64rem; margin: 0; font-size: .75rem; }
.financial-document-page .quotation-lines > :not(caption) > * > * { padding: .42rem .5rem; background: transparent; border-color: var(--masvid-border); }
.financial-document-page .quotation-lines thead th { color: var(--masvid-muted); font-size: .64rem; letter-spacing: .055em; text-transform: uppercase; }
.financial-document-page .totals-card > div { padding: .42rem .55rem; }
.financial-document-page .editor-actions { z-index: 12; gap: .35rem; padding: .55rem .65rem; border: 1px solid var(--masvid-border); box-shadow: 0 -4px 14px rgba(8, 13, 23, .07); }
.document-detail-page .detail-grid { gap: .6rem; margin-bottom: .6rem; }
.document-detail-page .detail-list { margin: 0; }
.document-detail-page .detail-list dt, .document-detail-page .detail-list dd { padding: .38rem 0; font-size: .75rem; }
.pricing-drawer-context { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--masvid-border); }
.pricing-drawer-context span { display: flex; justify-content: space-between; gap: .5rem; padding: .5rem .55rem; color: var(--masvid-muted); font-size: .72rem; }
.pricing-drawer-context span + span { border-left: 1px solid var(--masvid-border); }
.pricing-drawer-context strong { color: var(--masvid-text); font-variant-numeric: tabular-nums; }
.catalog-list-page, .categories-page { width: 100%; min-height: 0; font-size: .85rem; }
.catalog-server-alert { padding: .55rem .7rem; margin-bottom: .65rem; border-radius: .2rem; font-size: .78rem; }
.products-toolbar { display: grid; grid-template-columns: minmax(14rem, 2fr) repeat(4, minmax(7rem, 1fr)) 6.5rem auto auto; gap: .5rem; align-items: center; width: 100%; margin-bottom: .6rem; }
.products-toolbar .form-control, .products-toolbar .form-select, .categories-toolbar .form-select { min-height: 2.15rem; border-radius: .2rem; font-size: .78rem; }
.products-create-button, .categories-create-button { white-space: nowrap; }
.categories-toolbar { display: grid; grid-template-columns: auto 6rem auto 1fr; gap: .5rem; align-items: center; width: 100%; margin-bottom: .6rem; }
.categories-toolbar label { margin: 0; color: var(--masvid-muted); font-size: .75rem; font-weight: 650; }
.categories-create-button { justify-self: end; }
.catalog-grid { width: 100%; border: 1px solid var(--masvid-border); background: var(--masvid-surface); }
.catalog-table { width: 100%; min-width: 50rem; margin: 0; color: var(--masvid-text); font-size: .78rem; }
.catalog-table > :not(caption) > * > * { padding: .5rem .6rem; background: transparent; border-color: var(--masvid-border); }
.catalog-table thead th { color: var(--masvid-muted); font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.catalog-table .status-chip { margin: 0; white-space: nowrap; }
.categories-table { min-width: 32rem; }
.catalog-actions { display: flex; flex-wrap: wrap; gap: .25rem; }
.catalog-actions form { margin: 0; }
.catalog-pagination { padding: .55rem .65rem; border-top: 1px solid var(--masvid-border); color: var(--masvid-muted); font-size: .75rem; }
.categories-page [aria-busy="true"] { opacity: .68; }
.product-drawer-layer { grid-template-columns: 1fr minmax(30rem, 36rem); }
.product-drawer { padding: 1rem 1.1rem; }
.product-editor-form { display: grid; gap: .7rem; margin-top: .8rem; }
.product-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.product-editor-form .form-field { gap: .28rem; }
.product-editor-form .form-field label { font-size: .75rem; }
.product-editor-form .form-control, .product-editor-form .form-select { min-height: 2.25rem; padding: .38rem .55rem; border-radius: .2rem; font-size: .8rem; }
.product-editor-form textarea.form-control { min-height: 4.6rem; resize: vertical; }
.product-description-field { grid-column: 1 / -1; }
.product-form-error { margin: 0; color: var(--bs-danger); font-size: .72rem; font-weight: 600; }
.product-form-actions { display: flex; justify-content: flex-end; gap: .4rem; padding-top: .65rem; border-top: 1px solid var(--masvid-border); }
.product-form-page { width: min(100%, 56rem); margin: 0 auto; font-size: .85rem; }
.product-form-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: .65rem; }
.product-form-heading h1 { font-size: 1.15rem; letter-spacing: -.015em; }
.product-form-heading p:last-child { margin: .25rem 0 0; color: var(--masvid-muted); font-size: .76rem; }
.product-form-panel { padding: .85rem; border: 1px solid var(--masvid-border); background: var(--masvid-surface); }
.product-form-panel .product-editor-form { margin-top: 0; }
.catalog-list-page [aria-busy="true"] { opacity: .68; }
.product-detail-page { width: 100%; min-height: 0; font-size: .82rem; }
.product-detail-alert { padding: .55rem .7rem; margin-bottom: .65rem; border-radius: .2rem; font-size: .78rem; }
.product-detail-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .65rem; padding-bottom: .65rem; border-bottom: 1px solid var(--masvid-border); }
.product-detail-title { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.product-detail-title h1 { font-size: 1.15rem; letter-spacing: -.015em; }
.product-detail-title .status-chip { margin: 0; }
.product-detail-identity p { margin: .2rem 0 0; color: var(--masvid-muted); font-size: .74rem; }
.product-detail-identity p strong { color: var(--masvid-text); font-weight: 650; }
.product-detail-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: .35rem; }
.product-detail-actions form { margin: 0; }
.product-detail-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.product-detail-section { min-width: 0; border: 1px solid var(--masvid-border); background: var(--masvid-surface); }
.product-detail-section > header { padding: .5rem .65rem; border-bottom: 1px solid var(--masvid-border); }
.product-detail-section h2 { margin: 0; font-size: .78rem; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; }
.product-detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.product-detail-list > div { min-width: 0; padding: .55rem .65rem; border-bottom: 1px solid var(--masvid-border); }
.product-detail-list .product-detail-wide { grid-column: 1 / -1; border-top: 1px solid var(--masvid-border); border-bottom: 0; }
.product-detail-list dt { margin-bottom: .15rem; color: var(--masvid-muted); font-size: .67rem; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; }
.product-detail-list dd { margin: 0; font-size: .8rem; font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; }
.product-pricing-list > div:last-child { border-bottom: 0; }
.product-history-section { grid-column: 1 / -1; }
.product-history-table { width: 100%; min-width: 38rem; margin: 0; color: var(--masvid-text); font-size: .76rem; }
.product-history-table > :not(caption) > * > * { padding: .45rem .6rem; background: transparent; border-color: var(--masvid-border); }
.product-history-table thead th { color: var(--masvid-muted); font-size: .66rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.action-row { display: flex; flex-wrap: wrap; gap: .35rem; }
.inline-reset { display: flex; gap: .7rem; align-items: end; padding: .7rem; background: var(--masvid-bg); border-radius: .5rem; }
.inline-reset label { display: grid; gap: .25rem; font-size: .8rem; font-weight: 650; }
.error-page { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: .7rem; text-align: center; padding: 1.5rem; }
.error-code { font-size: 4rem; line-height: 1; font-weight: 800; color: var(--masvid-brand); }
.page-loader { position: fixed; right: 1rem; bottom: 1rem; padding: .5rem .75rem; background: var(--masvid-sidebar); color: white; border-radius: .5rem; }
.settings-page { width: 100%; min-height: 0; font-size: .85rem; }
.settings-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; margin: 0 0 .6rem; border-bottom: 1px solid var(--masvid-border); }
.settings-tab { position: relative; width: 100%; min-width: 0; padding: .5rem .6rem; border: 0; background: transparent; color: var(--masvid-muted); font-size: .76rem; font-weight: 650; line-height: 1.25; transition: color .18s ease, background-color .18s ease; }
.settings-tab:hover, .settings-tab:focus-visible { color: var(--masvid-text); background: var(--masvid-bg); }
.settings-tab.active { color: var(--masvid-text); }
.settings-tab.active::after { content: ""; position: absolute; right: .75rem; bottom: -1px; left: .75rem; height: 2px; background: var(--masvid-brand); }
.settings-tab-panel { width: 100%; padding: .75rem; border: 1px solid var(--masvid-border); background: var(--masvid-surface); }
.settings-tab-panel[hidden] { display: none; }
.settings-section-heading { display: flex; justify-content: space-between; gap: .75rem; margin-bottom: .65rem; padding-bottom: .5rem; border-bottom: 1px solid var(--masvid-border); }
.settings-section-heading h2 { margin: 0; font-size: .95rem; font-weight: 650; }
.settings-section-heading p { margin: .2rem 0 0; color: var(--masvid-muted); font-size: .76rem; }
.settings-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.settings-field-wide { grid-column: span 2; }
.settings-page .form-field { gap: .28rem; }
.settings-page .form-field label { font-size: .75rem; }
.settings-page .form-control { min-height: 2.25rem; padding: .38rem .58rem; border-radius: .2rem; font-size: .82rem; }
.settings-page textarea.form-control { min-height: 3.25rem; }
.settings-page .form-text { color: var(--masvid-muted); font-size: .7rem; }
.settings-form-actions { display: flex; justify-content: flex-end; margin-top: .65rem; }
.settings-form-error { flex-basis: 100%; margin: .45rem 0 0; color: var(--bs-danger); font-size: .75rem; font-weight: 600; }
.settings-server-alert { padding: .55rem .7rem; margin-bottom: .75rem; border-radius: .2rem; font-size: .78rem; }
.form-field-wide { grid-column: 1 / -1; }
.settings-actions, .inline-form { display: flex; align-items: end; gap: .75rem; }
.inline-form { flex: 1 1 32rem; }
.inline-form .form-control { min-width: 15rem; }
.settings-logo-preview { min-height: 4.5rem; display: flex; align-items: center; gap: .85rem; margin-bottom: .8rem; padding: .65rem; border: 1px solid var(--masvid-border); }
.settings-logo-preview img { width: auto; height: auto; max-width: 10rem; max-height: 3.2rem; object-fit: contain; }
.settings-logo-preview span, .settings-logo-empty { color: var(--masvid-muted); font-size: .75rem; }
.settings-logo-empty { margin-bottom: .8rem; padding: 1.15rem; border: 1px dashed var(--masvid-border); }
.settings-logo-actions { display: flex; align-items: end; gap: .65rem; }
.settings-logo-form { flex: 1; display: flex; align-items: end; gap: .65rem; }
.settings-logo-form .form-field { flex: 1; }
.payment-method-create { max-width: 34rem; display: flex; align-items: end; gap: .65rem; margin-bottom: .85rem; }
.payment-method-create .form-field { flex: 1; }
.payment-method-list { display: grid; gap: .4rem; }
.statement-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.statement-summary > div { display: grid; gap: .2rem; padding: .85rem; border: 1px solid var(--masvid-border); border-radius: var(--masvid-radius); }
.statement-export-actions { justify-content: flex-end; margin-bottom: 1rem; }
.payment-method-row { display: grid; grid-template-columns: minmax(12rem, 1fr) auto auto; align-items: center; gap: .65rem; padding: .55rem .65rem; border: 1px solid var(--masvid-border); }
.payment-method-row .form-field { flex: 1; }
.payment-method-row .form-switch { min-width: 5.2rem; margin: 0; }
.payment-method-row .settings-form-error { grid-column: 1 / -1; }
.settings-toast { position: fixed; right: 1rem; bottom: 1rem; z-index: 1100; min-width: 14rem; max-width: min(24rem, calc(100vw - 2rem)); padding: .62rem .8rem; border: 1px solid transparent; border-radius: .2rem; color: #fff; font-size: .78rem; font-weight: 600; box-shadow: 0 8px 22px rgba(10, 18, 30, .16); }
.settings-toast.success { border-color: #287a4d; background: #246a45; }
.settings-toast.error { border-color: #a33a45; background: #8f303b; }
.settings-page [aria-busy="true"] { opacity: .68; }
.directory-filters { display: grid; grid-template-columns: 2fr repeat(4, minmax(7rem, 1fr)) auto; gap: .75rem; align-items: end; margin-bottom: 1rem; }
.pagination-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.detail-list { display: grid; grid-template-columns: minmax(6rem, auto) 1fr; gap: .65rem 1rem; margin: 0; }
.detail-list dt { color: var(--masvid-muted); font-weight: 600; }
.detail-list dd { margin: 0; white-space: pre-wrap; }
.record-block { padding: .75rem 0; border-bottom: 1px solid var(--masvid-border); }
.record-block:last-child { border-bottom: 0; }
.record-block strong, .record-block span { display: block; }
.record-block span { color: var(--masvid-muted); font-size: .85rem; }
.record-block p { margin: .35rem 0 0; }
.nested-card { margin: 1rem 0; padding: 1rem; border: 1px solid var(--masvid-border); border-radius: var(--masvid-radius); }
.nested-card legend { float: none; width: auto; padding: 0 .35rem; font-size: .9rem; font-weight: 700; }
.unavailable-section { margin-top: 1rem; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.report-card { color: inherit; text-decoration: none; transition: transform .15s ease, border-color .15s ease; }
.report-card:hover, .report-card:focus-visible { transform: translateY(-2px); border-color: var(--masvid-brand); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: 1rem; margin-top: 1rem; }
.bar-chart { display: grid; gap: .75rem; }
.bar-row { display: grid; grid-template-columns: 5rem minmax(80px, 1fr) 7rem; align-items: center; gap: .75rem; }
.bar-row strong { text-align: right; }
.bar-track { height: .75rem; background: var(--masvid-border); border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; min-width: 2px; background: var(--masvid-brand); border-radius: inherit; }
@media (max-width: 760px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 4.5rem 1fr; }
  .bar-row strong { grid-column: 2; text-align: left; }
  .auth-page { background: var(--masvid-surface); }
  .auth-shell { min-height: 100vh; display: block; }
  .auth-brand-panel { display: none; }
  .auth-form-panel { min-height: 100vh; place-items: start center; padding: 2rem 1.35rem; border-left: 0; }
  .auth-form-wrap { padding-top: clamp(1rem, 9vh, 5rem); }
  .auth-mobile-brand { display: flex; margin-bottom: clamp(3rem, 10vh, 5.5rem); }
  .auth-mobile-brand .auth-monogram { width: 2.35rem; height: 2.35rem; }
  .auth-mobile-brand .auth-company-logo { max-width: 9rem; max-height: 2.35rem; }
  .auth-heading { margin-bottom: 1.7rem; }
  .auth-heading h1 { font-size: 2.35rem; }
}
.price-list-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; }
.stacked-form { display: grid; gap: .75rem; margin-top: 1rem; }
.quotation-header-grid, .quotation-footer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.quotation-footer-grid { align-items: start; margin-bottom: 1rem; }
.quotation-lines input { min-width: 7rem; }
.quotation-lines td:first-child input { min-width: 16rem; }
.line-add-toolbar { margin-bottom: 1rem; }
.totals-card { display: grid; gap: .65rem; }
.totals-card > div { display: flex; justify-content: space-between; gap: 1rem; }
.totals-card .grand-total { border-top: 1px solid var(--masvid-border); padding-top: .75rem; font-size: 1.1rem; }
.editor-actions { position: sticky; bottom: 0; display: flex; align-items: center; gap: .75rem; padding: .75rem; background: var(--masvid-surface); border: 1px solid var(--masvid-border); border-radius: var(--masvid-radius); box-shadow: var(--masvid-shadow); }

/* Shared enterprise workspace primitives. Module selectors remain for behavior only. */
.workspace-page { display: grid; gap: .6rem; width: 100%; min-width: 0; font-size: .82rem; }
.workspace-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: .55rem; border-bottom: 1px solid var(--masvid-border); }
.workspace-header h1 { font-size: 1.15rem; }
.workspace-header .eyebrow { margin-bottom: .12rem; }
.workspace-toolbar { display: flex; align-items: end; gap: .45rem; min-width: 0; padding: .5rem .6rem; border: 1px solid var(--masvid-border); background: var(--masvid-surface); }
.workspace-toolbar .form-field { gap: .18rem; }
.workspace-toolbar label { margin: 0; color: var(--masvid-muted); font-size: .67rem; font-weight: 700; }
.workspace-section { min-width: 0; border: 1px solid var(--masvid-border); background: var(--masvid-surface); }
.workspace-section > header { padding: .45rem .6rem; border-bottom: 1px solid var(--masvid-border); }
.workspace-section > header h2 { margin: 0; font-size: .7rem; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; }

.masvid-app .form-control, .masvid-app .form-select { min-height: var(--masvid-control-height); border-radius: var(--masvid-radius-sm); font-size: .78rem; }
.masvid-app .form-field { gap: .22rem; }
.masvid-app .form-field label { color: var(--masvid-text); font-size: .7rem; font-weight: 650; }
.masvid-app textarea.form-control { min-height: 3.75rem; }
.masvid-app .alert { border-radius: var(--masvid-radius-sm); box-shadow: none; font-size: .76rem; }

:is(.users-grid, .backups-grid, .catalog-grid, .suppliers-grid, .price-lists-grid, .supplier-ledger-grid, .supplier-transactions-grid, .documents-grid) {
  width: 100%; min-width: 0; overflow: hidden; border: 1px solid var(--masvid-border); border-radius: 0; background: var(--masvid-surface); box-shadow: none;
}
:is(.user-table, .backups-table, .catalog-table, .suppliers-table, .price-lists-table, .supplier-ledger-table, .supplier-transactions-table, .documents-table, .enterprise-table) {
  width: 100%; margin: 0; color: var(--masvid-text); font-size: .76rem;
}
:is(.user-table, .backups-table, .catalog-table, .suppliers-table, .price-lists-table, .supplier-ledger-table, .supplier-transactions-table, .documents-table, .enterprise-table) > :not(caption) > * > * {
  padding: .45rem .58rem; background: transparent; border-color: var(--masvid-border); vertical-align: middle;
}
:is(.user-table, .backups-table, .catalog-table, .suppliers-table, .price-lists-table, .supplier-ledger-table, .supplier-transactions-table, .documents-table, .enterprise-table) thead th {
  color: var(--masvid-muted); background: var(--masvid-surface-subtle); font-size: .64rem; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; white-space: nowrap;
}
.financial-cell, .numeric-cell { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-actions { text-align: right; white-space: nowrap; }
:is(.user-actions, .catalog-actions, .supplier-row-actions, .action-row) { align-items: center; gap: .3rem; }
:is(.catalog-pagination, .backups-pagination, .suppliers-pagination, .supplier-ledger-pagination, .supplier-transactions-pagination, .documents-pagination, .pagination-row) {
  min-height: 2.55rem; padding: .48rem .6rem; color: var(--masvid-muted); font-size: .72rem;
}
.empty-state { padding: 2rem 1rem; border-radius: 0; box-shadow: none; }
.empty-state.compact { padding: 1.2rem .75rem; }
.empty-state h2 { margin: 0 0 .2rem; font-size: .8rem; }
.empty-state p { margin: 0; font-size: .74rem; }

:is(.users-toolbar, .categories-toolbar, .products-toolbar, .suppliers-toolbar, .price-lists-toolbar, .price-list-products-toolbar, .supplier-ledger-toolbar, .supplier-transactions-toolbar, .documents-toolbar) {
  gap: .45rem; margin-bottom: .6rem;
}
:is(.users-toolbar, .categories-toolbar, .products-toolbar, .suppliers-toolbar, .price-lists-toolbar, .price-list-products-toolbar, .supplier-ledger-toolbar, .supplier-transactions-toolbar, .documents-toolbar) :is(.form-control, .form-select) {
  min-height: var(--masvid-control-height); border-radius: var(--masvid-radius-sm); font-size: .78rem;
}

.users-drawer { display: flex; flex-direction: column; padding: 0; overflow: hidden; box-shadow: var(--masvid-drawer-shadow); }
.users-drawer-header { flex: 0 0 auto; padding: .7rem .85rem; }
.users-drawer-header h2 { font-size: .95rem; }
.users-drawer > form { display: flex; flex: 1 1 auto; flex-direction: column; gap: .65rem; min-height: 0; margin: 0; padding: .75rem .85rem 0; overflow-y: auto; }
.users-drawer > form > .users-drawer-actions { position: sticky; bottom: 0; z-index: 2; flex: 0 0 auto; margin: auto -.85rem 0; padding: .6rem .85rem; border-top: 1px solid var(--masvid-border); background: var(--masvid-surface); box-shadow: 0 -4px 12px rgba(8, 13, 23, .05); }
.users-drawer-close { border-radius: var(--masvid-radius-sm); }
[data-customer-drawer-content] { height: 100%; min-height: 0; }

:is(.supplier-detail-header, .product-detail-header, .documents-header, .supplier-ledger-header, .supplier-transactions-header) {
  min-height: 2.75rem; margin-bottom: .6rem; padding-bottom: .55rem; border-bottom: 1px solid var(--masvid-border);
}
:is(.supplier-detail-title, .product-detail-title) h1, :is(.supplier-ledger-header, .supplier-transactions-header) h1 { font-size: 1.15rem; }
:is(.supplier-detail-section, .product-detail-section, .customer-form-section, .workspace-section) { border-radius: 0; box-shadow: none; }

.dashboard-toolbar { justify-content: flex-end; }
.dashboard-toolbar .form-field { width: 10.5rem; }
.dashboard-page .metric-card span { color: var(--masvid-muted); font-size: .65rem; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; }
.dashboard-page .metric-card h2 { margin: .3rem 0 .2rem; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.dashboard-page .metric-card p { margin: 0; font-size: .7rem; }
.dashboard-page .dashboard-grid { gap: .6rem; margin-top: 0; }
.dashboard-page .bar-chart { padding: .6rem; }
.dashboard-page .bar-row { font-size: .72rem; }
.reports-page .report-grid { gap: .6rem; }
.reports-page .report-card { min-height: 0; margin: 0; padding: .75rem; border-radius: 0; box-shadow: none; }
.reports-page .report-card h2 { margin-bottom: .25rem; font-size: .82rem; }
.reports-page .report-card p { margin-bottom: .6rem; font-size: .72rem; }

@media (max-width: 900px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; transform: translateX(-105%); width: 15.5rem; transition: transform .18s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar.open + .sidebar-scrim { position: fixed; inset: 0; z-index: 20; display: block; border: 0; background: rgba(6, 11, 19, .48); }
  .mobile-menu { display: inline-grid; place-items: center; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-shell { grid-template-columns: minmax(18rem, .7fr) minmax(27rem, 1fr); }
  .auth-brand-panel { padding: 2.2rem; }
  .auth-brand-message h2 { font-size: 2.35rem; }
  .auth-form-panel { padding: 3rem; }
}

@media (max-width: 620px) {
  .statement-summary { grid-template-columns: 1fr; }
  .workspace-header { align-items: stretch; flex-direction: column; }
  .workspace-toolbar { align-items: stretch; flex-direction: column; }
  .dashboard-toolbar .form-field { width: 100%; }
  .topbar { padding: .38rem .75rem; }
  .content { padding: 1.25rem .9rem; }
  .user-summary { display: none; }
  .metric-grid, .form-grid { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: 1fr; }
  .users-toolbar { grid-template-columns: 1fr 1fr; }
  .users-toolbar #search { grid-column: 1 / -1; }
  .users-toolbar .users-create-button { grid-column: 1 / -1; }
  .users-drawer-layer { grid-template-columns: 1fr; }
  .users-drawer-scrim, .users-drawer { grid-column: 1; }
  .users-drawer { width: min(100%, 25rem); margin-left: auto; }
  .supplier-drawer-layer { grid-template-columns: 1fr; }
  .supplier-drawer { width: min(100%, 30rem); }
  .product-drawer-layer { grid-template-columns: 1fr; }
  .product-drawer { width: min(100%, 36rem); }
  .backup-grid-header { align-items: stretch; flex-direction: column; }
  .backup-grid-header > div:first-child { justify-content: space-between; }
  .backup-grid-actions .btn { width: 100%; }
  .backup-grid-filters { align-items: stretch; flex-direction: column; }
  .backup-grid-filters .form-field { width: 100%; }
  .backup-clear-filters { align-self: flex-start; }
  .backup-grid-footer { grid-template-columns: 1fr; text-align: center; }
  .backup-page-navigation { flex-wrap: wrap; order: 2; }
  .backup-page-size { justify-content: center; order: 3; }
  .products-toolbar { grid-template-columns: 1fr 1fr; }
  .products-toolbar #product-search { grid-column: 1 / -1; }
  .products-toolbar .products-create-button { grid-column: 1 / -1; }
  .categories-toolbar { grid-template-columns: auto 1fr auto; }
  .categories-create-button { grid-column: 1 / -1; justify-self: stretch; }
  .suppliers-toolbar { grid-template-columns: 1fr 1fr; }
  .suppliers-toolbar #supplier-search { grid-column: 1 / -1; }
  .suppliers-create-button { grid-column: 1 / -1; }
  .supplier-form-grid { grid-template-columns: 1fr; }
  .supplier-form-wide { grid-column: auto; }
  .supplier-detail-header { align-items: stretch; flex-direction: column; }
  .supplier-detail-actions { justify-content: flex-start; }
  .supplier-detail-sections, .supplier-detail-list { grid-template-columns: 1fr; }
  .supplier-detail-list .supplier-detail-wide { grid-column: auto; }
  .supplier-ledger-header { align-items: stretch; flex-direction: column; }
  .supplier-ledger-navigation { justify-content: flex-start; }
  .supplier-ledger-toolbar { align-items: stretch; flex-direction: column; }
  .statement-supplier-field { width: 100%; max-width: none; }
  .statement-date-field, .transaction-toolbar .form-select { width: 100%; }
  .transaction-toolbar label { align-self: auto; }
  .supplier-ledger-exports { width: 100%; margin-left: 0; }
  .supplier-ledger-exports .btn { flex: 1 1 auto; }
  .supplier-ledger-summary { grid-template-columns: 1fr; }
  .supplier-ledger-summary > div { border-right: 0; border-bottom: 1px solid var(--masvid-border); }
  .supplier-ledger-summary > div:last-child { border-bottom: 0; }
  .supplier-transactions-toolbar { align-items: stretch; flex-direction: column; }
  .supplier-transaction-date-field, .supplier-transaction-size-field { width: 100%; }
  .party-autocomplete { width: 100%; max-width: none; flex: 0 0 auto; }
  .customer-detail-sections { grid-template-columns: 1fr; }
  .customer-detail-sections > :first-child { grid-column: auto; }
  .customer-form-grid { grid-template-columns: 1fr; }
  .customer-form-wide { grid-column: auto; }
  .price-list-products-toolbar, .price-lists-toolbar { align-items: stretch; flex-direction: column; }
  .price-list-products-toolbar .form-select, .price-lists-toolbar .form-select { width: 100%; }
  .customer-price-list-form { align-items: stretch; flex-direction: column; }
  .customer-price-list-form .form-select { width: 100%; }
  .documents-header { align-items: stretch; flex-direction: column; }
  .documents-toolbar { align-items: stretch; flex-direction: column; }
  .documents-toolbar .form-select { width: 100%; }
  .product-form-grid { grid-template-columns: 1fr; }
  .product-description-field { grid-column: auto; }
  .product-detail-header { align-items: stretch; flex-direction: column; }
  .product-detail-actions { justify-content: flex-start; }
  .product-detail-sections, .product-detail-list { grid-template-columns: 1fr; }
  .product-detail-list > div { border-bottom: 1px solid var(--masvid-border); }
  .product-detail-list > div:last-child { border-bottom: 0; }
  .product-detail-list .product-detail-wide { grid-column: auto; border-top: 0; }
  .inline-reset { align-items: stretch; flex-direction: column; }
  .settings-actions, .inline-form, .payment-method-row { align-items: stretch; flex-direction: column; }
  .settings-form-grid { grid-template-columns: 1fr; }
  .settings-field-wide { grid-column: auto; }
  .settings-logo-actions, .settings-logo-form, .payment-method-create { align-items: stretch; flex-direction: column; }
  .payment-method-row { grid-template-columns: 1fr; }
  .inline-form .form-control { min-width: 0; }
  .directory-filters, .detail-grid { grid-template-columns: 1fr; }
  .pagination-row { align-items: stretch; flex-direction: column; }
  .quotation-header-grid, .quotation-footer-grid { grid-template-columns: 1fr; }
  .editor-actions { flex-wrap: wrap; }
}

@media (prefers-color-scheme: dark) {
  html[data-bs-theme="light"] .auth-page { --masvid-bg: #0d1320; --masvid-surface: #151d2d; --masvid-border: #2a354a; --masvid-text: #edf2fb; --masvid-muted: #a5afc2; }
  html[data-bs-theme="light"] .auth-mobile-brand .auth-monogram { color: #edf2fb; }
  html[data-bs-theme="light"] .auth-form .form-control { background-color: #111927; color: #edf2fb; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } .auth-atmosphere { animation: none !important; } }

/* Shared action controls: normal form actions and smaller financial-grid actions. */
.masvid-app .btn, .masvid-app .btn.btn-sm {
  display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
  min-height: var(--masvid-control-height); padding: .35rem .65rem;
  border-radius: var(--masvid-radius-sm); font-size: .75rem; line-height: 1.2;
  font-weight: 600; vertical-align: middle;
}
.masvid-app .btn svg { width: 1em; height: 1em; flex-shrink: 0; }
.masvid-app .btn-icon { width: var(--masvid-control-height); padding: .3rem; }
.masvid-app .table .btn {
  min-height: 1.65rem; padding: .2rem .4rem; font-size: .68rem;
}
.masvid-app .table .btn-icon { width: 1.65rem; padding: .25rem; }
.masvid-app .table th.row-actions, .masvid-app .table td.row-actions {
  text-align: right; white-space: nowrap;
}
.masvid-app .table td.row-actions > :is(div, .action-row),
.masvid-app .table :is(.user-actions, .catalog-actions, .supplier-row-actions) {
  display: flex; align-items: center; justify-content: flex-end; gap: .25rem;
}
.masvid-app .table td.row-actions form { display: inline-flex; margin: 0; gap: .25rem; }
.masvid-app .table td.row-actions > .btn + .btn { margin-left: .25rem; }
.statement-grid .supplier-ledger-table { width: 100%; min-width: 48rem; }
.statement-grid .supplier-ledger-table th:nth-child(4) { width: auto; }

.masvid-app :is(.users-drawer-actions, .customer-drawer-footer, .supplier-form-actions,
  .product-form-actions, .product-detail-actions, .supplier-detail-actions, .editor-actions) {
  gap: .35rem;
}
.masvid-app .users-drawer-close {
  width: var(--masvid-control-height); height: var(--masvid-control-height);
  padding: .3rem; border-radius: var(--masvid-radius-sm);
}
.party-autocomplete-option[aria-selected="true"] { background: var(--masvid-surface-subtle); outline: 2px solid var(--masvid-brand); outline-offset: -2px; }
