:root {
  --app-bg: #fff; --app-bg-subtle: #f8f9fa;
  --app-surface: #fff; --app-surface-2: #f8fafc; --app-surface-3: #f1f5f9; --app-content-surface: #fff;
  --app-border: #dee2e6; --app-border-strong: #ced4da;
  --app-disabled-bg: #e9ecef;
  --app-text: #212529; --app-text-muted: #6c757d; --app-heading: #111827;
  --app-shadow: 0 .65rem 1.5rem rgba(33,37,41,.10);
  --app-accent: #0d6efd; --app-accent-soft: rgba(13,110,253,.12);
  --app-success-soft: #f4fbf6; --app-danger-soft: #fff5f6; --app-warning-soft: #fff8e8;
}
html[data-theme="dark"] {
  --app-bg: #27282b; --app-bg-subtle: #3c3e42;
  --app-surface: #323438; --app-surface-2: #3a3c41; --app-surface-3: #45484e; --app-content-surface: #404247;
  --app-border: #575b62; --app-border-strong: #6c717a;
  --app-disabled-bg: #45484e;
  --app-text: #eceef1; --app-text-muted: #bcc1c8; --app-heading: #fafafa;
  --app-shadow: 0 .5rem 1.25rem rgba(0,0,0,.16);
  --app-accent: #8ab8ff; --app-accent-soft: rgba(138,184,255,.18);
  --app-success-soft: #294139; --app-danger-soft: #492f33; --app-warning-soft: #49402d;
}
html, body { background: var(--app-bg); color: var(--app-text); overscroll-behavior-x: none; overscroll-behavior-y: contain; }
body { margin: 0; padding-top: env(safe-area-inset-top, 0px); }
body.app-impersonating { padding-bottom: calc(3.8rem + env(safe-area-inset-bottom, 0px)); }
a { color: var(--app-accent); }
:focus-visible { outline: 3px solid var(--app-accent); outline-offset: 3px; }
.skip-link { position: fixed; top: .5rem; left: .5rem; z-index: 1100; background: var(--app-surface); padding: .5rem; }
.card, .list-group-item, .offcanvas-lg, .form-control, .form-select, .input-group-text {
  background-color: var(--app-surface); color: var(--app-text); border-color: var(--app-border);
}
.card { box-shadow: var(--app-shadow); border: 1px solid var(--app-border-strong); border-radius: .75rem; }
.text-muted, .text-secondary, .text-body-secondary, .form-text, .helptext, caption { color: var(--app-text-muted) !important; }
.border, .border-top, .border-bottom { border-color: var(--app-border) !important; }
.table { --bs-table-bg: var(--app-surface); --bs-table-color: var(--app-text); --bs-table-border-color: var(--app-border); --bs-table-striped-bg: transparent; }
.list-group-item-action:hover, .list-group-item-action:focus { background: var(--app-surface-2); color: var(--app-heading); }
.btn-outline-secondary { color: var(--app-text-muted); border-color: var(--app-border-strong); }
.btn-outline-secondary:hover, .btn-outline-secondary:focus { background: var(--app-surface-3); color: var(--app-heading); border-color: var(--app-border-strong); }
html[data-theme="dark"] .btn-outline-primary { --bs-btn-color: var(--app-accent); --bs-btn-border-color: var(--app-accent); }
html[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
.auth-card { max-width: 32rem; }
.app-login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 1rem; background: radial-gradient(circle at 15% 15%, var(--app-accent-soft), transparent 55%), var(--app-bg); }
.app-login-content { width: 100%; max-width: 32rem; min-width: 0; }
.app-login .auth-card { border-top: 3px solid var(--app-accent); }
.app-login-brand { display: flex; align-items: center; gap: .85rem; padding-bottom: 1.1rem; margin-bottom: 1.1rem; border-bottom: 1px solid var(--app-border); }
.app-login-logo { width: 4rem; height: 4rem; flex: 0 0 4rem; object-fit: contain; border-radius: .85rem; background: var(--app-surface-2); }
.app-login-logo-fallback { display: inline-flex; align-items: center; justify-content: center; color: var(--app-accent); font-size: 1.8rem; }
.app-login-company { margin: 0; min-width: 0; font-size: 1.15rem; font-weight: 700; line-height: 1.3; color: var(--app-heading); overflow-wrap: anywhere; }
label { display: block; margin-bottom: .35rem; }
.app-checkbox-field { display: flex; align-items: center; gap: .5rem; }
.app-checkbox-field label { margin: 0; }
.app-checkbox-field input { flex: 0 0 auto; margin: 0; }
.app-capability-option { display: flex; align-items: flex-start; gap: .4rem; }
.app-capability-option input { flex: 0 0 auto; margin-top: .3rem; }
.app-capability-copy { min-width: 0; }
.app-capability-copy small { display: block; }
/* Cover unadorned auth widgets without changing form behavior. */
input:not([type=hidden]):not([type=checkbox]):not([type=radio]), select, textarea {
  max-width: 100%; min-width: 0; padding: .375rem .75rem;
  border: 1px solid var(--app-border); border-radius: .375rem;
  background-color: var(--app-surface); color: var(--app-text); font: inherit;
}
input:not([type=hidden]):not([type=checkbox]):not([type=radio]), textarea { display: block; width: 100%; }
/* State styling must win over ordinary widget/component backgrounds, including iOS. */
input:not([type=hidden]):not([type=checkbox]):not([type=radio]):is(:disabled, [readonly]:not([data-native-autofill-pending])),
select:is(:disabled, [readonly]), textarea:is(:disabled, [readonly]) {
  background-color: var(--app-disabled-bg) !important;
  color: var(--app-text-muted) !important;
  -webkit-text-fill-color: var(--app-text-muted);
  opacity: 1;
}
input::placeholder, textarea::placeholder { color: var(--app-text-muted); opacity: 1; }
.errorlist { margin: .25rem 0 0; padding-left: 1rem; color: var(--bs-danger); font-size: .875rem; }
.app-main { min-width: 0; padding: 1rem .75rem 1.25rem; }
.app-shell { max-width: 740px; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.app-shell-wide { max-width: 1320px; }
@media (min-width: 992px) {
  .app-shell:not(.app-shell-wide):has(.app-content > form:not(.d-inline-block):not(.app-search):not(.app-period-filter)) { max-width: 900px; }
}
.app-bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.app-bar-leading { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.app-bar-title { font-size: 1.05rem; font-weight: 700; color: var(--app-heading); line-height: 1.15; }
.app-bar-status { display: inline-flex; align-items: center; gap: .4rem; color: var(--app-text-muted); font-size: .84rem; flex-shrink: 0; }
.app-bar-actions { display: flex; align-items: center; gap: 1rem; flex-shrink: 0; }
.app-notification-center { position: relative; }
.app-notification-bell { position: relative; width: 2.6rem; height: 2.6rem; padding: .4rem; color: var(--app-text-muted); font-size: 1.25rem; }
.app-notification-bell.has-unread { color: var(--bs-danger); }
.app-notification-badge { position: absolute; right: -.15rem; top: -.1rem; padding: .1rem .3rem; border-radius: 1rem; background: var(--bs-danger); color: white; font-size: .65rem; font-weight: 700; }
.app-notification-box { position: absolute; right: 0; top: calc(100% + .5rem); width: min(25rem, calc(100vw - 2rem)); padding: .75rem; border: 1px solid var(--app-border-strong); border-radius: .85rem; background: var(--app-surface); box-shadow: var(--app-shadow); z-index: 1030; }
.app-notification-box-heading, .app-notification-box-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .25rem .1rem .75rem; }
.app-notification-box-footer { border-top: 1px solid var(--app-border); padding: .75rem .1rem 0; font-size: .85rem; }
.app-notification-box .app-notifications { max-height: min(65dvh, 32rem); overflow-y: auto; overscroll-behavior: contain; margin-bottom: .75rem; overflow-wrap: anywhere; }
.app-notification-box .app-notification-toolbar { flex-wrap: wrap; }
.app-notification-box .app-notification-copy > span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.app-notification-history-item.is-read .app-notification-icon { color: var(--app-text-muted); }
.app-notification-history-item .app-notification-toolbar { padding: .25rem .5rem; }
.app-notification-card { position: relative; }
.app-notification-card .app-notification-item { padding-right: 3rem; }
.app-notification-delete { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: .4rem; background: transparent; color: var(--bs-danger); font-size: .85rem; }
.app-notification-delete:hover, .app-notification-delete:focus-visible { background: var(--app-surface-3); }
.app-notification-delete:disabled { opacity: .55; }
.app-notification-history-actions { display: flex; align-items: center; flex-wrap: nowrap; gap: .375rem; }
.app-notification-history-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: .25rem; flex-shrink: 0; padding: .25rem .4rem; font-size: .72rem; line-height: 1.2; min-height: 1.85rem; white-space: nowrap; }
.app-notification-history-actions .app-notification-configure { width: 1.85rem; margin-left: auto; padding: .25rem; }
.app-menu-button { width: 2.4rem; min-width: 2.4rem; height: 2.4rem; padding: 0; }
.app-page-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.app-page-header > :first-child { min-width: 0; }
h1, .app-page-title { color: var(--app-heading); font-size: 1.45rem; font-weight: 700; line-height: 1.15; margin: 0 0 1rem; }
.app-page-header h1 { margin: 0; }
h2 { color: var(--app-heading); font-size: 1.15rem; font-weight: 700; }
.app-page-action { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 2.75rem; width: 2.75rem; height: 2.75rem; padding: 0; border-radius: 50%; white-space: nowrap; }
.app-page-action i { font-size: 1.1rem; line-height: 1; }
.app-content { min-width: 0; margin-top: clamp(.75rem, 2.5vh, 1.5rem); overflow-wrap: anywhere; }
.app-notifications { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.app-notifications[hidden] { display: none; }
.app-notification-item {
  appearance: none; display: flex; align-items: center; gap: .65rem; width: 100%;
  padding: .7rem .8rem; border: 1px solid var(--app-border); border-radius: .7rem;
  background: var(--app-surface-2); color: var(--app-text); text-align: left;
  text-decoration: none; cursor: pointer;
}
.app-notification-item:hover, .app-notification-item:focus { background: var(--app-surface-3); color: var(--app-text); }
.app-notification-icon { flex: 0 0 auto; color: var(--app-accent); }
.app-notification-copy { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.app-notification-copy strong { color: var(--app-heading); font-size: .9rem; }
.app-notification-copy span { color: var(--app-text-muted); font-size: .8rem; }
.app-notification-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: .65rem; min-height: 1.4rem; color: var(--app-text-muted); font-size: .72rem; }
.app-notification-toolbar button {
  appearance: none; display: inline-flex; align-items: center; gap: .25rem; padding: .1rem 0;
  border: 0; background: transparent; color: var(--app-text-muted); font: inherit;
}
.app-notification-toolbar button:hover, .app-notification-toolbar button:focus { color: var(--app-accent); text-decoration: underline; }
.app-notification-toolbar button:disabled { opacity: .55; pointer-events: none; }
.app-content > form:not(.d-inline-block) { border: 1px solid var(--app-border-strong); border-radius: .75rem; background: var(--app-surface); box-shadow: var(--app-shadow); padding: 1rem; }
.app-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; padding: 1rem; border: 1px solid var(--app-border); border-radius: 1rem; background: linear-gradient(145deg, var(--app-surface), var(--app-surface-2)); box-shadow: var(--app-shadow); }
.app-intro h1 { margin: 0; font-size: 1.15rem; font-weight: 750; letter-spacing: -.02em; }
.app-intro p { margin: .3rem 0 0; font-size: .8rem; color: var(--app-text-muted); line-height: 1.4; }
.app-content fieldset { min-width: 0; }
.app-content .d-inline-block { max-width: 100%; }
.app-version-link { color: inherit; text-decoration: none; }
.app-version-link:hover { color: var(--app-accent); text-decoration: underline; }
.app-version-link:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: .2rem; }
.app-version { margin-top: .9rem; text-align: center; font-size: .72rem; color: var(--app-text-muted); line-height: 1.2; overflow-wrap: anywhere; padding-bottom: env(safe-area-inset-bottom, 0px); }
.app-sidebar { --bs-offcanvas-width: 260px; background: var(--app-bg-subtle); color: var(--app-text); border-right: 1px solid var(--app-border); }
.app-sidebar .offcanvas-header { background: var(--app-surface); border-bottom: 1px solid var(--app-border); padding-top: calc(1rem + env(safe-area-inset-top, 0px)); }
.app-sidebar-brand { display: flex; align-items: center; gap: .55rem; min-width: 0; font-size: .95rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
.app-sidebar-brand-link { display: flex; align-items: center; gap: inherit; min-width: 0; color: inherit; text-decoration: none; }
.app-sidebar-brand-logo, .app-sidebar-brand-fallback { width: 2.25rem; height: 2.25rem; flex: 0 0 2.25rem; }
.app-sidebar-brand-logo { object-fit: contain; }
.app-sidebar-brand-fallback { display: inline-flex; align-items: center; justify-content: center; color: var(--app-text-muted); font-size: 1.5rem; }
.app-sidebar-brand-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-sidebar .offcanvas-body { display: flex; flex-direction: column; gap: 1rem; padding: 1rem .85rem calc(1rem + env(safe-area-inset-bottom, 0px)); background: var(--app-bg-subtle); }
.app-profile-summary { display: flex; align-items: center; justify-content: center; gap: .6rem; min-width: 0; padding: .15rem 0 .45rem; color: var(--app-heading); font-weight: 600; text-decoration: none; }
.app-profile-summary:hover, .app-profile-summary:focus { color: var(--app-heading); text-decoration: underline; }
.app-profile-summary .menu-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-profile-avatar { width: 2.25rem; height: 2.25rem; flex: 0 0 2.25rem; border-radius: 50%; object-fit: cover; background: var(--app-surface-3); box-shadow: inset 0 0 0 1px var(--app-border-strong); }
.app-profile-avatar-fallback { display: inline-flex; align-items: center; justify-content: center; color: var(--app-text-muted); font-size: 1.25rem; }
.app-avatar-placeholder { display: grid; place-items: center; width: 100%; height: 100%; }
.app-avatar-brand[src] { width: 100%; height: 100%; object-fit: contain; }
.app-nav { display: flex; flex-direction: column; gap: .2rem; margin: 0 -.85rem; }
.app-menu-entry { display: flex; align-items: center; gap: .55rem; margin: 0 .45rem; padding: .5rem 1rem; width: calc(100% - .9rem); border: 0; border-radius: .8rem; color: var(--app-text-muted); text-decoration: none; background: transparent; }
.app-menu-entry i { width: 1.15rem; flex: 0 0 1.15rem; line-height: 1; text-align: center; }
.app-menu-entry:hover, .app-menu-entry:focus { background: var(--app-surface-2); color: var(--app-heading); }
.app-menu-entry[aria-current="page"] { background: var(--app-accent-soft); color: var(--app-heading); box-shadow: inset 0 0 0 1px rgba(96,165,250,.18); }
.app-menu-footer { margin-top: auto; padding-top: .65rem; border-top: 1px solid var(--app-border); }
.app-theme { display: flex; align-items: center; gap: .55rem; margin-bottom: .75rem; }
.app-theme-button { width: 2rem; height: 2rem; padding: 0; border-radius: .7rem; flex-shrink: 0; }
.app-theme select { font-size: .88rem; color: var(--app-text-muted); background-color: transparent; }
.app-account { display: flex; gap: .45rem; }
.app-account > * { flex: 1; min-width: 0; }
.app-account .btn { width: 100%; padding: .35rem .5rem; font-size: .88rem; }
.app-password { color: #8a5200; border-color: #c98a00; }
html[data-theme="dark"] .app-password { color: #f8d68a; border-color: #d9a441; }
.app-sidebar-toggle { display: none; }
.app-pull { position: fixed; top: calc(max(env(safe-area-inset-top, 0px), var(--app-viewport-top, 0px)) + 3.75rem); left: 0; right: 0; z-index: 1040; display: flex; justify-content: center; pointer-events: none; }
.app-pull-inner { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.5rem; max-width: calc(100vw - 2rem); padding: .5rem .85rem; border: 1px solid var(--app-border-strong); border-radius: 999px; background: var(--app-surface); color: var(--app-heading); font-size: .8rem; font-weight: 600; opacity: 0; transform: translateY(-.75rem) scale(.96); transition: opacity .16s ease, transform .16s ease; box-shadow: var(--app-shadow); }
.app-pull.is-visible .app-pull-inner { opacity: 1; transform: translateY(0) scale(1); }
.app-pull.is-ready .app-pull-inner, .app-pull.is-loading .app-pull-inner { color: var(--app-accent); }
.app-pull-spinner { width: 1rem; height: 1rem; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--app-border-strong); border-top-color: currentColor; transform: rotate(calc(var(--pull-progress, 0) * 270deg)); }
.app-pull.is-loading .app-pull-spinner { animation: appPullSpin .75s linear infinite; }
@keyframes appPullSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .app-pull-inner { transition: none; } .app-pull.is-loading .app-pull-spinner { animation: none; } }
@media (min-width: 992px) {
  .app-main { margin-left: 260px; padding: 1rem 1.25rem 1.25rem; min-height: 100vh; transition: margin-left .18s ease; }
  .app-sidebar.offcanvas-lg { display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: 260px; height: 100dvh; background: var(--app-bg-subtle) !important; border-right: 1px solid var(--app-border); transition: width .18s ease; }
  .app-sidebar .offcanvas-header { display: flex; flex: 0 0 auto; }
  .app-sidebar .offcanvas-header .btn-close { display: none; }
  .app-sidebar .offcanvas-body { height: auto; min-height: 0; flex: 1 1 auto; overflow-y: auto; }
  .app-sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; position: fixed; top: 72vh; left: calc(260px - .925rem); z-index: 1031; width: 1.85rem; height: 2.4rem; padding: 0; border-radius: 999px; background: var(--app-surface); box-shadow: 0 .25rem .8rem rgba(15,23,42,.08); transition: left .18s ease; }
  html[data-sidebar="collapsed"] .app-main { margin-left: 64px; }
  html[data-sidebar="collapsed"] .app-sidebar { width: 64px; }
  html[data-sidebar="collapsed"] .app-sidebar .offcanvas-header { justify-content: center; padding-right: 0; padding-left: 0; }
  html[data-sidebar="collapsed"] .app-sidebar-brand { gap: 0; }
  html[data-sidebar="collapsed"] .app-sidebar-brand-name { display: none; }
  html[data-sidebar="collapsed"] .app-sidebar-toggle { left: calc(64px - .925rem); }
  html[data-sidebar="collapsed"] .app-sidebar-toggle i { transform: rotate(180deg); }
  html[data-sidebar="collapsed"] .app-sidebar .offcanvas-body { padding: .85rem 0; }
  html[data-sidebar="collapsed"] .app-menu-entry { width: 100%; height: 2.75rem; margin: 0; padding: 0; justify-content: center; border-radius: .9rem; }
  html[data-sidebar="collapsed"] .app-sidebar .menu-label, html[data-sidebar="collapsed"] .app-theme select { display: none; }
  html[data-sidebar="collapsed"] .app-profile-summary { gap: 0; }
  html[data-sidebar="collapsed"] .app-nav { margin: 0; }
  html[data-sidebar="collapsed"] .app-menu-entry i { font-size: 1.08rem; }
  html[data-sidebar="collapsed"] .app-theme { justify-content: center; }
  html[data-sidebar="collapsed"] .app-account { flex-direction: column; align-items: center; }
  html[data-sidebar="collapsed"] .app-account > * { flex: 0 0 auto; }
  html[data-sidebar="collapsed"] .app-account .btn { width: 2.35rem; height: 2.35rem; padding: 0; }
}
@media (max-width: 575.98px) {
  .app-bar { gap: .5rem; }
  .app-bar-title { font-size: .96rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

.inline-fields { display: flex; flex-wrap: wrap; gap: .5rem; align-items: start; }
.inline-field { flex: 1 1 8rem; min-width: 0; }
.inline-field:first-child { flex-grow: 2; }
.inline-field-descricao { order: 2; flex: 1 0 100%; }
.inline-field-descricao textarea { min-height: 4.5rem; resize: vertical; }
.inline-field label { display: block; font-size: .85rem; margin-bottom: .2rem; }
.inline-remove { align-self: end; }
.app-content > form.app-edit-form, .app-content > form.app-customer-form { padding: clamp(1rem, 3vw, 1.5rem); border: 1px solid var(--app-border); border-radius: 1rem; background: var(--app-surface); box-shadow: none; }
.app-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem 1.25rem; }
.app-field { min-width: 0; }
.app-field-wide { grid-column: 1 / -1; }
.app-field > label { color: var(--app-heading); font-size: .84rem; font-weight: 600; margin-bottom: .4rem; }
.app-field .form-control, .app-field .form-select { min-width: 0; width: 100%; min-height: 2.75rem; border-radius: .55rem; }
.app-field .form-text { margin-top: .4rem; font-size: .78rem; line-height: 1.5; }
.app-field .errorlist { margin-top: .4rem; }
.app-field .form-control[aria-invalid="true"], .app-field .form-select[aria-invalid="true"] { border-color: var(--bs-danger); }
.app-form-section { margin: 0; padding: 0; border: 0; }
.app-form-section + .app-form-section { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--app-border); }
.app-form-section > legend { float: none; display: flex; align-items: center; gap: .5rem; margin: 0 0 1rem; font-size: .95rem; font-weight: 700; color: var(--app-heading); }
.app-form-section > legend i { color: var(--app-accent); }
.app-category-options { margin-top: 1.1rem; }
.app-edit-form > .app-form-actions, .app-customer-form > .app-form-actions { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--app-border); }
@media (max-width: 575.98px) { .app-form-grid { grid-template-columns: minmax(0, 1fr); } }
.app-inline-collapse { margin: 1.25rem 0; border-width: 1px 0; border-style: solid; border-color: var(--app-border); }
.app-inline-collapse > summary { display: flex; align-items: center; gap: .5rem; padding: .85rem 0; color: var(--app-heading); font-weight: 700; cursor: pointer; }
.app-inline-count { margin-left: auto; color: var(--app-text-muted); font-size: .78rem; font-weight: 500; }
.app-inline-collapse-body { padding: 0; }
.app-inline-collapse .inline-row { margin: 0 !important; padding: 1rem 0 !important; border-width: 1px 0 0 !important; border-style: solid !important; border-color: var(--app-border) !important; border-radius: 0 !important; }
.app-inline-add { display: inline-flex; align-items: center; gap: .4rem; margin: 0 0 .35rem; padding: .55rem 0; text-decoration: none; font-weight: 600; }
.app-inline-add:hover, .app-inline-add:focus { text-decoration: underline; }
.app-order-statuses .app-menu-entry { font-size: .85rem; }

/* Shared action row: no per-button vertical margin. */
.app-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; width: 100%; min-width: 0; }
.app-form-actions > .btn { min-height: 2.75rem; }
.app-save { margin-left: auto; }
.app-icon-button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 2.75rem; width: 2.75rem; height: 2.75rem; padding: 0; }
.app-search-controls { display: flex; flex-wrap: nowrap; align-items: stretch; gap: .5rem; min-width: 0; }
.app-search-controls input[type="search"] { flex: 1 1 0; width: 0; min-width: 0; }
.app-search-controls .app-icon-button { height: auto; min-height: 2.75rem; }
/* Listing fragments share the same compact layout on initial and AJAX loads. */
.app-list { gap: .5rem; }
.app-list > .app-list-item {
  padding: .75rem; border: 1px solid var(--app-border);
  border-radius: .65rem; min-width: 0;
}
.app-list-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .75rem; min-width: 0; }
.app-list-title { flex: 1 1 12rem; min-width: 0; font-weight: 700; color: var(--app-heading); overflow-wrap: anywhere; }
.app-list-amount { color: var(--app-heading); font-weight: 700; font-variant-numeric: tabular-nums; }
.app-list-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .65rem; margin-top: .4rem; color: var(--app-text-muted); font-size: .82rem; }
.app-list-meta small { font-size: inherit; }
.app-list-badge { display: inline-block; max-width: 100%; padding: .2rem .5rem; border: 1px solid var(--app-border-strong); border-radius: .4rem; background: var(--app-surface-3); color: var(--app-text); font-size: .75rem; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.app-list-badge-accent { background: var(--app-accent-soft); }
.app-list-badge-success { background: var(--app-success-soft); }
.app-list-badge-danger { background: var(--app-danger-soft); }
.fiscal-contact-form { text-align: left; }
.fiscal-contact-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.fiscal-contact-fields > div { min-width: 0; }
.fiscal-contact-fields label { display: block; font-weight: 600; margin-bottom: .25rem; }
.public-tracking-card .fiscal-contact-fields label { font-size: .82rem; font-weight: 500; }
@media (max-width: 575.98px) { .fiscal-contact-fields { grid-template-columns: minmax(0, 1fr); } }
.app-nfe-badge { background: transparent; border-color: currentColor; }
.app-nfe-badge-danger { color: #c62828; }
.app-nfe-badge-success { color: #146c43; }
html[data-theme="dark"] .app-nfe-badge-danger { color: #ffaaaa; }
html[data-theme="dark"] .app-nfe-badge-success { color: #8cdbb4; }
/* Shared order badges: color follows the status code, labels remain explicit. */
.app-order-status[data-order-status] { display: inline-block; max-width: 100%; padding: .2rem .5rem; border: 1px solid transparent; border-radius: .4rem; background: var(--bs-secondary); color: #fff; font-size: .75rem; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.app-order-status[data-order-status="new"], .app-status-group-heading[data-order-status="new"] { background: var(--bs-primary); }
.app-order-status[data-order-status="paid"], .app-status-group-heading[data-order-status="paid"] { background: #6f42c1; }
.app-order-status[data-order-status="ready"], .app-status-group-heading[data-order-status="ready"] { background: #946200; }
.app-order-status[data-order-status="shipped"] { background: #087990; }
.app-order-status[data-order-status="delivered"] { background: var(--bs-success); }
.app-order-status[data-order-status="returned"], .app-order-status[data-order-status="cancelled"] { background: var(--bs-danger); }

/* Keep customer name, order count and caret on the same row at mobile widths. */
.app-customer-heading { flex-wrap: nowrap; align-items: center; }
.app-customer-heading > .app-list-title { flex: 1 1 0; }
.app-customer-heading > .app-list-badge { flex: 0 0 auto; white-space: nowrap; }
.app-list-chevron { flex: 0 0 auto; color: var(--app-text-muted); font-size: .8rem; }
.app-settings-list { display: grid; gap: .65rem; }
.app-settings-card { display: flex; align-items: center; justify-content: space-between; gap: .65rem; min-width: 0; padding: .9rem 1rem; border: 1px solid var(--app-border); border-radius: .75rem; background: var(--app-surface); color: var(--app-text); transition: border-color .15s ease, background-color .15s ease, transform .15s ease; }
.app-member-card-inactive { opacity: .6; }
.app-settings-card:is(a) { gap: 1rem; text-decoration: none; }
.app-settings-card:is(a):hover, .app-settings-card:is(a):focus { border-color: var(--app-border-strong); background: var(--app-surface-2); color: var(--app-text); }
.app-settings-card:is(a):hover { transform: translateY(-1px); }
.app-settings-card:has(.app-settings-card-link:hover), .app-settings-card:has(.app-settings-card-link:focus), .app-settings-card:has(.app-settings-details-link:hover), .app-settings-card:has(.app-settings-details-link:focus) { border-color: var(--app-border-strong); background: var(--app-surface-2); color: var(--app-text); }
.app-settings-card:has(.app-settings-card-link:hover), .app-settings-card:has(.app-settings-details-link:hover) { transform: translateY(-1px); }
.app-settings-card-link { display: flex; flex: 1 1 auto; align-items: center; min-width: 0; color: inherit; text-decoration: none; }
.app-settings-card-link:hover, .app-settings-card-link:focus { color: inherit; }
.app-member-avatar { width: 2.5rem; height: 2.5rem; flex-basis: 2.5rem; margin-right: .65rem; }
.app-impersonate-action { flex: 0 0 auto; margin: 0; }
.app-impersonate-action .btn { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; padding: 0; border-radius: 999px; }
.app-settings-details-link { display: flex; flex: 0 1 auto; align-items: center; gap: .45rem; min-width: 0; color: inherit; text-decoration: none; }
.app-settings-details-link:hover, .app-settings-details-link:focus { color: inherit; }
.app-settings-identity { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; }
.app-settings-title { color: var(--app-heading); font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.app-settings-meta { margin-top: .2rem; color: var(--app-text-muted); font-size: .84rem; line-height: 1.3; overflow-wrap: anywhere; }
.app-settings-badges { display: flex; flex: 0 1 auto; align-items: center; justify-content: flex-end; gap: .45rem; min-width: 0; }
.app-member-presence-badge { white-space: nowrap; }
.app-member-presence-dot { display: inline-block; width: .45rem; height: .45rem; margin-right: .35rem; border-radius: 50%; vertical-align: .06rem; }
.app-settings-chevron { flex: 0 0 auto; margin-left: .15rem; color: var(--app-text-muted); font-size: .8rem; }
.app-settings-empty { padding: 1.25rem; border: 1px dashed var(--app-border-strong); border-radius: .75rem; color: var(--app-text-muted); text-align: center; }
@media (max-width: 575.98px) {
  .app-settings-card:not(a) { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: .7rem .45rem; }
  .app-settings-card:is(a) { align-items: flex-start; flex-direction: column; gap: .7rem; }
  .app-settings-card-link { grid-column: 1; grid-row: 1; align-items: flex-start; width: 100%; }
  .app-impersonate-action { grid-column: 2; grid-row: 1; }
  .app-settings-details-link { grid-column: 1 / -1; grid-row: 2; justify-content: flex-end; }
  .app-settings-badges { justify-content: flex-start; flex-wrap: wrap; }
  .app-settings-chevron { margin-left: 0; align-self: center; }
}
.app-impersonation-bar { position: fixed; left: 50%; bottom: calc(.55rem + env(safe-area-inset-bottom, 0px)); z-index: 1080; display: flex; align-items: center; justify-content: space-between; gap: .8rem; width: max-content; max-width: calc(100vw - 1.5rem); padding: .4rem .45rem .4rem .75rem; transform: translateX(-50%); border: 1px solid var(--app-border-strong); border-radius: 999px; background: var(--app-surface); color: var(--app-text); box-shadow: 0 .55rem 1.5rem rgba(15,23,42,.2); font-size: .78rem; line-height: 1.2; }
.app-impersonation-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 992px) {
  .app-impersonation-bar { left: calc(50% + 130px); max-width: calc(100vw - 260px - 2.5rem); transition: left .18s ease; }
  html[data-sidebar="collapsed"] .app-impersonation-bar { left: calc(50% + 32px); max-width: calc(100vw - 64px - 2.5rem); }
}
@media (prefers-reduced-motion: reduce) { .app-impersonation-bar { transition: none; } }
.app-impersonation-bar form { flex: 0 0 auto; margin: 0; }
.app-impersonation-bar .btn { border-radius: 999px; }
.app-status-groups { display: grid; }
.app-status-group { min-width: 0; padding: .75rem 0; border-bottom: 1px solid var(--app-border); }
.app-status-group:last-child { border-bottom: 0; padding-bottom: 0; }
.app-status-group-heading { display: flex; align-items: center; gap: .5rem; margin: 0 0 .55rem; padding: .55rem .65rem; border-radius: .45rem; background: var(--bs-secondary); color: #fff; font-size: .95rem; font-weight: 650; }
.app-status-group-heading [data-group-count] { margin-left: auto; background: rgb(255 255 255 / 15%); border-color: rgb(255 255 255 / 45%); color: inherit; }
.app-status-group-empty { margin: .15rem 0 0; }
/* Open-order text uses snapshots; the image URL is private and scoped by order. */
.app-list > .app-open-order { display: grid; grid-template-columns: 2rem minmax(0, 1fr) minmax(0, auto); align-items: center; gap: .5rem; padding: .5rem .65rem; }
.app-order-avatar { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; overflow: hidden; border-radius: 50%; background: var(--app-surface-3); color: var(--app-text-muted); }
.app-order-avatar-image { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; color: transparent; font-size: 0; }
.app-order-avatar-brand { object-fit: contain; }
.app-order-customer, .app-order-summary { display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; min-width: 0; }
.app-order-customer .app-list-title { flex: none; width: 100%; }
.app-order-date { color: var(--app-text-muted); font-size: .75rem; }
.app-order-summary { align-items: flex-end; text-align: right; }
.app-order-summary .app-list-amount { max-width: 100%; overflow-wrap: anywhere; }
.app-order-location { padding: .1rem .35rem; font-size: .7rem; }
.app-submenu[hidden] { display: none; }
.app-nav > .app-menu-entry { color: var(--app-heading); font-size: .95rem; font-weight: 650; }
.app-menu-group[aria-expanded="true"] { background: var(--app-surface-2); }
.app-submenu { margin: .15rem .75rem .5rem 1.65rem; padding-left: .45rem; border-left: 1px solid var(--app-border); }
.app-submenu .app-menu-entry { width: 100%; min-height: 2.5rem; margin: 0; padding: .4rem .5rem; gap: .4rem; border-radius: .5rem; font-size: .82rem; font-weight: 400; line-height: 1.35; }
.app-submenu .app-menu-entry i { width: 1rem; flex-basis: 1rem; font-size: .8rem; opacity: .8; }
.app-submenu .menu-label { min-width: 0; overflow-wrap: anywhere; }
.app-submenu .app-menu-entry[aria-current="page"] { font-weight: 600; }
.app-group-chevron { margin-left: auto; transition: transform .18s ease; }
.app-menu-group[aria-expanded="true"] .app-group-chevron { transform: rotate(180deg); }
/* Only the offcanvas container's pointer focus; keyboard focus remains visible. */
#app-menu[data-pointer-focus="true"]:focus { outline: none; }
.app-period-filter { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; }
.app-period-filter > div { flex: 1 1 12rem; }
.app-period-filter .form-select, .app-period-filter .btn { min-height: 2.75rem; }
.app-dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: .8rem; }
.app-dashboard-grid + .app-dashboard-grid { margin-block-start: .8rem; }
/* Opaque Home surfaces keep wallpaper outside cards in every resolved theme. */
.app-dashboard-card { --dashboard-accent: var(--app-accent); min-width: 0; padding: .75rem .85rem; border: 1px solid var(--app-border-strong); background: var(--app-surface); box-shadow: none; }
.app-dashboard-card[data-dashboard-card="revenue"] { --dashboard-accent: #087f7b; }
.app-dashboard-card[data-dashboard-card="commissions_payable"] { --dashboard-accent: #2563eb; }
.app-dashboard-card[data-dashboard-card="sales"] { --dashboard-accent: #7c3aed; }
.app-dashboard-card[data-dashboard-card="commissions_receivable"] { --dashboard-accent: #a16207; }
html[data-theme="dark"] .app-dashboard-card[data-dashboard-card="revenue"] { --dashboard-accent: #5eead4; }
html[data-theme="dark"] .app-dashboard-card[data-dashboard-card="commissions_payable"] { --dashboard-accent: #93c5fd; }
html[data-theme="dark"] .app-dashboard-card[data-dashboard-card="sales"] { --dashboard-accent: #c4b5fd; }
html[data-theme="dark"] .app-dashboard-card[data-dashboard-card="commissions_receivable"] { --dashboard-accent: #fcd34d; }
.app-dashboard-heading { display: flex; align-items: center; gap: .5rem; }
.app-dashboard-icon { display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; flex: 0 0 1.5rem; color: var(--dashboard-accent); font-size: 1rem; }
.app-dashboard-card h2 { margin: 0; color: var(--app-text); font-size: .82rem; font-weight: 650; }
.app-dashboard-value { margin: .4rem 0 .1rem; color: var(--app-heading); font-size: 1.35rem; font-weight: 750; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
@media (min-width: 992px) { .app-dashboard-grid-orders { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.app-password-copy { display: flex; align-items: stretch; gap: .4rem; max-width: 100%; }
.app-password-copy .form-control { flex: 1 1 auto; width: 0; }
.app-password-copy .app-icon-button { flex: 0 0 2.4rem; width: 2.4rem; min-width: 2.4rem; height: auto; min-height: 0; padding: 0; }
.app-period-submit { width: 2.75rem; padding-inline: 0; flex: 0 0 2.75rem; }
.app-customer-autocomplete { position: relative; margin-bottom: 1rem; }
.app-customer-autocomplete > p { margin: 0; }
.app-customer-suggestions { position: absolute; z-index: 1050; top: calc(100% + .25rem); inset-inline: 0; display: grid; gap: .15rem; max-height: 16rem; overflow-y: auto; padding: .3rem; border: 1px solid var(--app-border-strong); border-radius: .65rem; background: var(--app-surface); box-shadow: var(--app-shadow); }
.app-customer-suggestions:empty { display: none; }
.app-customer-option { width: 100%; padding: .55rem .7rem; border: 0; border-radius: .45rem; background: transparent; color: var(--app-text); font: inherit; font-size: .88rem; font-weight: 600; line-height: 1.3; text-align: left; }
.app-customer-option:hover, .app-customer-option:focus { background: var(--app-accent-soft); color: var(--app-heading); }
.app-customer-message:empty { display: none; }
.app-commission-list { display: grid; gap: .75rem; }
.app-commission-card { min-width: 0; }
.app-commission-seller { font-size: 1.125rem; font-weight: 650; line-height: 1.3; }
.app-commission-calculation > summary { display: block; list-style: none; cursor: pointer; }
.app-commission-calculation > summary::-webkit-details-marker { display: none; }
.app-commission-total { color: var(--app-heading); font-size: 1.15rem; font-variant-numeric: tabular-nums; }
/* Explicit red/green: Bootstrap danger-emphasis is brownish in the light theme. */
.app-commission-debt { color: #c62828; }
.app-commission-credit { color: #166534; }
html[data-theme="dark"] .app-commission-debt { color: #ffaaaa; }
html[data-theme="dark"] .app-commission-credit { color: #86efac; }
.app-commission-breakdown { display: grid; gap: .65rem; }
.app-commission-category { padding: .7rem; border: 1px solid var(--app-border); border-radius: .65rem; background: var(--app-surface-2); }
.app-pay-commission { padding-top: .8rem; border-top: 1px solid var(--app-border); }
.app-pay-commission .btn { width: 100%; min-height: 2.75rem; }
.app-commission-renewal-note { padding: .65rem .75rem; border-radius: .5rem; background: var(--app-surface-2); }
.app-commission-details > summary { color: var(--app-accent); cursor: pointer; font-weight: 600; }
@media (min-width: 768px) { .app-commission-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.app-statistics-list { display: grid; gap: 1rem; }
.app-statistics-card { min-width: 0; overflow: hidden; border-color: var(--app-border); border-radius: .7rem; box-shadow: 0 1px 2px rgb(15 23 42 / 5%); }
.app-statistics-card .card-header { padding: .65rem .85rem; border-bottom-color: var(--app-border); background: var(--app-surface-2); }
.app-statistics-card .card-header h2 { margin: 0; color: var(--app-heading); font-size: .9rem; font-weight: 700; }
.app-statistics-table { min-width: 34rem; font-size: .82rem; --bs-table-color: var(--app-text); --bs-table-bg: transparent; --bs-table-border-color: var(--app-border); }
.app-statistics-table > :not(caption) > * > * { padding: .5rem .85rem; border: 0; border-bottom: 1px solid var(--app-border); background: transparent; line-height: 1.3; }
.app-statistics-table th:first-child { width: 40%; }
.app-statistics-table thead { background: var(--app-surface-2); }
.app-statistics-table thead th { color: var(--app-text-muted); font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.app-statistics-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--app-surface-2) 55%, transparent); }
.app-statistics-table tbody th { color: var(--app-text); font-weight: 500; }
.app-statistics-table td, .app-statistics-table tfoot { font-variant-numeric: tabular-nums; white-space: nowrap; }
.app-statistics-table tfoot { color: var(--app-heading); font-weight: 700; background: var(--app-surface-3); }
.app-statistics-table tfoot tr:last-child > * { border-bottom: 0; }
.app-statistics-mobile { display: grid; gap: .65rem; }
.app-statistics-mobile-row { padding: .7rem .75rem; border: 1px solid var(--app-border); border-radius: .65rem; background: var(--app-surface); box-shadow: 0 1px 2px rgb(15 23 42 / 5%); }
.app-statistics-mobile-row h3 { margin: 0 0 .5rem; color: var(--app-heading); font-size: .86rem; font-weight: 700; }
.app-statistics-mobile-metrics { display: grid; grid-template-columns: .7fr 1fr 1fr; gap: .45rem; margin: 0; }
.app-statistics-mobile-metrics div { min-width: 0; }
.app-statistics-mobile-metrics dt { margin: 0 0 .12rem; color: var(--app-text-muted); font-size: .65rem; font-weight: 650; line-height: 1.2; text-transform: uppercase; }
.app-statistics-mobile-metrics dd { margin: 0; color: var(--app-text); font-size: .78rem; font-weight: 600; line-height: 1.25; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.app-statistics-mobile-total { border-color: var(--app-border-strong); background: var(--app-surface-3); }
.app-statistics-empty { margin: 0; padding: .85rem .75rem; border: 1px dashed var(--app-border); border-radius: .65rem; color: var(--app-text-muted); font-size: .82rem; }
@media (max-width: 767.98px) {
  .app-statistics-card { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .app-statistics-card .card-header { margin-bottom: .65rem; padding: 0 .1rem; border: 0; background: transparent; }
  .app-statistics-card .card-header h2 { font-size: .95rem; }
}

/* Mobile safe-area padding stays equal on both sides. */
@media (max-width: 991.98px) {
  .app-main {
    padding-inline: calc(.75rem + max(env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)));
  }
  .app-menu-edge-swipe-zone {
    position: fixed; inset: 0 auto 0 0; width: 32px; z-index: 1039;
    background: transparent; pointer-events: auto; touch-action: none;
  }
}

/* Keep the mobile scroll surface separate from the stationary menu/edge layer.
   Progressive enhancement: login/no-JS, desktop and print retain document scroll.
   Absolute + auto z-index avoids trapping fixed modals under their backdrop. */
@media screen and (max-width: 991.98px) {
  html[data-app-scroll="true"], html[data-app-scroll="true"] body {
    height: 100%; overflow: hidden;
  }
  html[data-app-scroll="true"] .app-main {
    position: absolute; inset: 0; height: 100%; height: 100dvh;
    overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-top: calc(1rem + env(safe-area-inset-top, 0px));
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }
  html[data-app-scroll="true"] .app-impersonating .app-main {
    padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
  }
  html[data-app-scroll="true"][data-mobile-menu="open"] .app-main,
  html[data-app-scroll="true"][data-app-overlay="open"] .app-main { overflow-y: hidden; }
  html[data-app-scroll="true"] .app-menu-edge-swipe-zone { transform: translateZ(0); }
}

/* Separate decorative layer: content keeps full opacity and theme surfaces. */
body { isolation: isolate; }
.tenant-background { position: fixed; inset: 0; z-index: -1; pointer-events: none; background-repeat: repeat; opacity: var(--tenant-opacity, 15%); }
body:has(.tenant-background) .app-content {
  padding: clamp(.85rem, 2.5vw, 1.25rem);
  border: 1px solid var(--app-border-strong);
  border-radius: .75rem;
  background: var(--app-content-surface);
  box-shadow: var(--app-shadow);
}
body:has(.tenant-background) .app-content.app-content-home {
  padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none;
}

/* Django as_p and custom help share the same discreet presentation. */
.helptext, .form-text { font-size: .875em; font-weight: 400; }

.app-dashboard-card h2 a { color: inherit; text-decoration: none; }
.app-dashboard-card h2 a:focus-visible { outline: 2px solid var(--app-accent); outline-offset: 3px; }
.app-dashboard-card.app-dashboard-attention { border-color: var(--app-accent); background: var(--app-accent-soft); }
.app-dashboard-attention .app-dashboard-icon { color: var(--app-accent); }

/* CEP lookup feedback shared by internal and public forms. */
[data-cep-message][aria-busy="true"]::before { content: ""; display: inline-block; width: .85rem; height: .85rem; margin-right: .4rem; vertical-align: -.1em; border: .12em solid currentColor; border-right-color: transparent; border-radius: 50%; animation: app-cep-spin .75s linear infinite; }
@keyframes app-cep-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { [data-cep-message][aria-busy="true"]::before { animation: none; } }

/* Keep fiscal badges centered beside the amount without adding a card row. */
.app-order-name { display: flex; align-items: center; gap: .35rem; min-width: 0; overflow: hidden; }
.app-order-name > .app-list-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-order-total { display: inline-flex; align-items: center; justify-content: flex-end; gap: .4rem; min-width: 0; max-width: 100%; }
.app-order-total > .app-nfe-badge { flex: 0 0 auto; font-size: .64rem; line-height: 1; padding: .22rem .3rem; }
.app-order-total > .app-list-amount { min-width: 0; overflow-wrap: anywhere; }
.app-list-heading > .app-order-name { flex: 1 1 auto; }

.app-order-customer .app-order-name { width: 100%; }
.app-order-customer .app-order-name > .app-list-title { flex: 1 1 auto; width: auto; }
.app-order-row .app-list-meta { flex-wrap: nowrap; white-space: nowrap; overflow: hidden; }
.app-order-row .app-list-meta > small { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.app-order-row .app-list-meta > .app-list-badge { flex-shrink: 0; }

.app-customer-owner { display: inline-flex; flex: 0 0 1.75rem; width: 1.75rem; height: 1.75rem; border-radius: 50%; overflow: hidden; align-items: center; justify-content: center; background: var(--app-surface-3); color: var(--app-text-muted); }
.app-customer-owner img { width: 100%; height: 100%; object-fit: cover; }

/* Shared empty-result alignment, including Ajax fragments and table rows. */
.app-empty, [data-empty], [data-empty] > td, [data-group-empty], .app-statistics-empty, .order-detail-empty { text-align: center; }
