body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f5f6fa;
  color: #2f3640;
}
h1 {
  font-size: 1.5rem;
}
header {
  background: #b7c8f5;
  color: white;
  padding: 20px;
  text-align: center;
}

nav {
  background: #40739e;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

nav a {
  color: white;
  text-decoration: none;
  margin: 0 15px;
  font-weight: bold;
}

/* Canonical authenticated page chrome. Headers use the same left-to-right
   order as Institute/License: navigation, page actions, then logout. */
.app-auth-nav {
  width: 100%;
  box-sizing: border-box;
  min-height: 52px;
  padding: 10px 16px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.app-auth-nav > .app-nav__links,
.app-auth-nav > .app-nav__actions,
.app-auth-nav > .app-auth-nav__group,
.app-auth-nav > .uk-flex,
.app-auth-nav > .uk-grid-small {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.app-auth-nav > .app-nav__links,
.app-auth-nav > .app-auth-nav__group:first-child,
.app-auth-nav > .uk-flex:first-child,
.app-auth-nav > .uk-grid-small:first-child {
  margin-right: auto;
}

.app-auth-nav > a,
.app-auth-nav > button,
.app-auth-nav .uk-button,
.app-auth-nav .app-nav__links > a,
.app-auth-nav .app-nav__actions > a,
.app-auth-nav .app-nav__actions > button {
  box-sizing: border-box;
  min-height: 34px;
  margin: 0;
  white-space: nowrap;
}

.app-auth-nav .app-nav__logout,
.app-auth-nav a[href="/logout"] {
  margin-left: 0 !important;
}

.app-nav__secondary,
.app-nav__update {
  background: #fff !important;
  color: #273c75 !important;
  border: 1px solid rgba(39, 60, 117, 0.35) !important;
}

.app-nav__back-link {
  background: transparent !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.65) !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding-inline: 10px;
  line-height: 1.2;
}

.app-nav__back-link::before {
  content: none;
}

.app-nav__back-icon {
  color: currentColor;
  font-size: 1.05em;
  line-height: 1;
  flex: 0 0 auto;
}

.app-nav__back-link:hover,
.app-nav__back-link:focus-visible {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #fff !important;
  border-color: #fff !important;
}

body > nav.app-auth-nav a.app-nav__back-link,
body > nav.app-auth-nav a.app-nav__back-link:hover,
body > nav.app-auth-nav a.app-nav__back-link:focus-visible {
  background: transparent !important;
  color: #fff !important;
}

.app-lotie-page table {
  max-width: 100%;
  width: 100%;
  margin-left: 0;
  box-sizing: border-box;
}

.app-lotie-page main {
  max-width: 100%;
  overflow-x: hidden;
}

.app-lotie-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto !important;
  overflow-y: hidden;
  box-sizing: border-box;
}

.app-lotie-page {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  margin: 0;
  box-sizing: border-box;
  overflow-x: visible;
  overflow-y: auto;
}

html:has(body.app-lotie-page),
html.app-lotie-html {
  width: 100vw;
  overflow-y: hidden;
  scrollbar-width: none;
}

html:has(body.app-lotie-page)::-webkit-scrollbar,
html.app-lotie-html::-webkit-scrollbar {
  width: 0;
  height: 0;
}

html.app-help-html {
  width: 100vw;
  overflow-y: hidden;
  scrollbar-width: none;
}

html.app-help-html::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.app-help-page {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  overflow-y: auto;
  overflow-x: visible;
  margin: 0;
  box-sizing: border-box;
}

.app-help-page nav.app-auth-nav {
  width: 100vw;
  max-width: 100vw;
  box-sizing: border-box;
}

.app-help-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto !important;
  overflow-y: hidden;
  box-sizing: border-box;
}

html:has(body.app-lotie-page),
html.app-lotie-html {
  overflow-y: overlay;
  scrollbar-gutter: auto;
}

.app-lotie-page nav.app-auth-nav {
  width: 100vw;
  max-width: 100vw;
  margin: 0;
  box-sizing: border-box;
}

.app-lotie-page nav.app-auth-nav .app-nav__actions {
  justify-self: end;
  margin-right: 0;
}

.app-lotie-page main,
.app-lotie-page .app-lotie-table-wrap {
  width: calc(100% - 20px);
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.app-lotie-table-wrap > div,
.app-lotie-table-wrap table {
  width: calc(100% - 2px) !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .app-lotie-page nav.app-auth-nav {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-inline: 0 !important;
  }
}

body > nav.app-auth-nav > a.app-nav__back-link:not(.app-nav__logout),
body > nav.app-auth-nav > a.app-nav__back-link:not(.app-nav__logout):hover,
body > nav.app-auth-nav > a.app-nav__back-link:not(.app-nav__logout):focus-visible {
  background: transparent !important;
  color: #fff !important;
}

body > nav.app-auth-nav > a.app-nav__back-link--direct:not(.app-nav__logout) {
  justify-self: start !important;
  width: max-content !important;
  max-width: calc(100vw - 100px) !important;
  background: transparent !important;
  color: #fff !important;
}

body > nav.app-auth-nav a.app-nav__back-link--direct {
  display: inline-flex !important;
  align-items: center !important;
  height: 34px !important;
  min-height: 34px !important;
  background: transparent !important;
  color: #fff !important;
  padding: 0 10px !important;
  white-space: nowrap !important;
}

body > nav.app-auth-nav > a.app-nav__back-link {
  display: inline-flex !important;
  align-items: center;
  min-height: 34px !important;
  height: 34px;
  padding: 0 10px;
  background: transparent !important;
  color: #fff !important;
  white-space: nowrap;
}

body > nav.app-auth-nav > a.app-nav__logout {
  justify-self: end;
  align-self: center;
  min-height: 34px !important;
}

.app-auth-nav .app-nav__save {
  order: 1;
}

.app-auth-nav .app-nav__logout {
  order: 2;
}

.app-nav__links,
.app-nav__actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.app-nav__links a,
.app-nav__actions a,
.form-actions a,
.form-actions button {
  margin: 0;
}

.app-user-nav .app-nav__actions {
  margin-left: auto;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.app-user-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  flex-wrap: nowrap;
  overflow-x: hidden;
}

.app-user-nav .app-nav__links {
  min-width: 0;
  flex-wrap: nowrap;
}

.app-user-nav .app-nav__links a,
.app-user-nav .app-nav__actions a {
  margin: 0 !important;
  flex: 0 1 auto;
}

.app-institute-page .uk-overflow-auto {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}

.app-page-header {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  box-sizing: border-box;
}

.app-page-header h1 {
  margin: 0;
  text-align: center;
}

main {
  max-width: 1400px;
  margin: 30px auto;
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

th, td {
  border: 1px solid #ddd;
  padding: 10px;
}

th {
  background: #f1f2f6;
}

footer {
  margin-top: 40px;
  background: #273c75;
  color: white;
  text-align: center;
  padding: 15px;
  font-size: 14px;
}

@media (max-width: 640px) {
  nav,
  .app-auth-nav,
  .app-nav__links,
  .app-nav__actions,
  .app-auth-nav__group,
  .form-actions {
    align-items: stretch;
  }

  .app-nav__links,
  .app-nav__actions,
  .form-actions {
    width: 100%;
  }

  .app-auth-nav > .app-nav__links,
  .app-auth-nav > .app-nav__actions,
  .app-auth-nav > .app-auth-nav__group,
  .app-auth-nav > .uk-flex,
  .app-auth-nav > .uk-grid-small {
    width: 100%;
  }

  .app-auth-nav > .app-nav__actions,
  .app-auth-nav > .app-auth-nav__group:last-child,
  .app-auth-nav > .uk-flex:last-child,
  .app-auth-nav > .uk-grid-small:last-child {
    justify-content: flex-end;
  }

  .app-user-nav .app-nav__actions {
    width: auto !important;
    margin-left: 0;
    overflow-x: hidden;
    min-width: max-content;
    align-items: center !important;
    justify-self: end;
  }

  .app-user-nav .app-nav__links {
    width: auto !important;
    min-width: 0;
  }

  .app-user-nav .app-nav__actions .app-nav__logout {
    flex: 0 0 auto;
  }

  .app-auth-nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    flex-wrap: nowrap;
    overflow-x: hidden;
  }

  .app-auth-nav > .app-nav__links,
  .app-auth-nav > .app-nav__actions,
  .app-auth-nav > .uk-flex {
    width: auto !important;
    min-width: 0;
  }

.app-auth-nav > .app-nav__actions,
.app-auth-nav > .uk-flex:last-child {
  justify-self: end;
  align-items: center !important;
  flex-wrap: nowrap;
}

.app-auth-nav .app-nav__actions {
  justify-self: end;
}

  .app-auth-nav > .app-nav__actions .app-nav__logout,
.app-auth-nav > .uk-flex:last-child .app-nav__logout {
  flex: 0 0 auto;
  margin-left: 0 !important;
}

.app-institute-page .uk-overflow-auto {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}

  .app-nav__links a,
  .app-nav__actions a,
  .form-actions a,
  .form-actions button {
    flex: 1 1 150px;
    text-align: center;
  }

  main {
    margin: 16px 10px;
    padding: 14px;
  }
}
input[type="text"], input[type="number"], select {
	font-size: 14px;
	padding: 5px;
}
input[type="checkbox"], input[type="radio"] {
    width: 25px;
    height: 25px;
}
/* Shared authenticated-screen navigation. Keep action order stable on desktop
   and let the groups wrap cleanly on narrow viewports. */
body > nav.app-auth-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  overflow-x: hidden;
}

body > nav.app-auth-nav > .app-nav__actions,
body > nav.app-auth-nav > .app-auth-nav__group:last-child,
body > nav.app-auth-nav > .uk-flex:last-child,
body > nav.app-auth-nav > .uk-grid-small:last-child {
  justify-self: end;
}

body > nav.app-auth-nav.app-user-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  flex-wrap: nowrap;
  overflow-x: hidden;
}

/* Legacy authenticated templates already inherit the shared nav geometry.
   Normalize only their direct logout link, avoiding relational selectors so older supported
   browsers do not discard the compatibility rule. */
body > nav:not(.un__nav):not(.app-auth-nav) > a[href="/logout"] {
  margin-left: auto !important;
  float: none !important;
}

body > nav.app-auth-nav .app-auth-nav__group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

body > nav.app-auth-nav a,
body > nav.app-auth-nav button {
  float: none !important;
  margin: 0 !important;
}

body > nav.app-auth-nav > a.app-nav__logout {
  margin-left: auto !important;
  flex: 0 0 auto;
}

body > nav.app-auth-nav > a:not(.app-nav__logout) {
  background: #fff !important;
  color: #273c75 !important;
  border: 1px solid rgba(39, 60, 117, 0.35) !important;
}

@media (max-width: 639px) {
  body > nav:not(.un__nav):not(.app-auth-nav) > a[href="/logout"] {
    flex: 1 1 140px;
    text-align: center;
  }

  body > nav.app-auth-nav .app-auth-nav__group {
    width: 100%;
  }

  body > nav.app-auth-nav .app-auth-nav__group:last-child {
    justify-content: flex-end;
  }

  body > nav.app-auth-nav > a.app-nav__logout {
    margin-left: auto !important;
  }

  .app-user-nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    flex-wrap: nowrap;
    overflow-x: hidden;
  }

  .app-user-nav .app-nav__links {
    width: auto !important;
    min-width: 0;
    flex: 1 1 auto;
    flex-wrap: nowrap;
  }

  .app-user-nav .app-nav__links a {
    min-width: 0;
    flex: 0 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .app-user-nav .app-nav__actions {
    width: auto !important;
    flex: 0 0 auto;
    min-width: max-content;
    justify-content: flex-end;
    align-items: center !important;
    justify-self: end;
  }

  .app-report-nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    max-width: 100%;
    overflow-x: hidden;
  }

  .app-report-nav .app-nav__links,
  .app-report-nav .app-nav__actions {
    width: auto !important;
    min-width: 0;
  }

  .app-report-nav .app-nav__actions {
    justify-content: flex-end;
    flex-wrap: nowrap;
    align-items: center !important;
    justify-self: end;
  }

  .user-search,
  .report-filter {
    display: block !important;
    width: 100% !important;
  }

  .user-search > .uk-inline,
  .report-filter > .uk-inline {
    display: flex;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap;
  }

  .user-search > .uk-inline > .uk-inline,
  .report-filter > .uk-inline > .uk-inline {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    flex: 1 1 100%;
  }

  .user-search input,
  .report-filter input[name="search"] {
    width: 100% !important;
    min-width: 0 !important;
  }

  .user-search button,
  .report-filter button {
    margin-left: 0 !important;
    margin-top: 8px;
  }

  .report-filter,
  .report-filter > * {
    min-width: 0 !important;
    max-width: 100%;
  }

  .report-filter input,
  .report-filter select {
    width: 100%;
    min-width: 0 !important;
    max-width: 100%;
    box-sizing: border-box;
  }

  .report-filter input[name="search"] {
    min-width: 0 !important;
    width: min(100%, 340px);
  }

  .report-filter .uk-inline {
    min-width: 0;
    max-width: 100%;
  }

  #employee-table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }

  #items-modal,
  #payment-modal {
    max-width: 100vw;
    overflow-x: hidden;
  }

  .report-modal:not(.uk-open) {
    display: none !important;
  }

  #items-modal .uk-modal-dialog,
  #payment-modal .uk-modal-dialog {
    max-width: calc(100vw - 8px) !important;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  #orders-table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }
}

/* Final mobile override: action groups stay compact instead of inheriting the
   legacy full-width form-action rule. */
@media (max-width: 640px) {
  body > nav.app-auth-nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body > nav.app-auth-nav > .app-nav__links,
  body > nav.app-auth-nav > .app-nav__actions,
  body > nav.app-auth-nav > .uk-flex,
  body > nav.app-auth-nav > .uk-grid-small {
    width: auto !important;
    min-width: 0;
    flex-wrap: nowrap;
  }

  body > nav.app-auth-nav > .app-nav__actions,
  body > nav.app-auth-nav > .uk-flex:last-child,
  body > nav.app-auth-nav > .uk-grid-small:last-child {
    justify-self: end;
    justify-content: flex-end;
  }

  body > nav.app-institute-nav > .uk-flex:first-child {
    margin-right: 0;
  }

  body > nav.app-institute-nav {
    grid-template-columns: auto minmax(0, 1fr);
  }

  body > nav.app-institute-nav .uk-grid-small {
    display: flex !important;
    align-items: center;
    flex-wrap: nowrap !important;
    min-width: 0;
  }

  body > nav.app-auth-nav a,
  body > nav.app-auth-nav button {
    flex: 0 1 auto !important;
    min-width: 0;
    white-space: nowrap;
  }

  body > nav.app-auth-nav .app-nav__logout {
    flex: 0 0 auto !important;
  }

  body > nav.app-auth-nav .app-nav__links > a:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .app-report-nav,
  .app-user-nav {
    grid-template-columns: minmax(0, 1fr) auto;
    max-width: 100%;
    overflow-x: hidden;
  }

  .app-institute-page .uk-overflow-auto,
  .app-institute-page table,
  #orders-table,
  #employee-table {
    max-width: 100%;
    min-width: 0;
  }
}

/* Search/report filters use a generated suffix; match only the intended
   table-form-filter class token rather than unrelated class names. */
[class^="table-form-filter"],
[class*=" table-form-filter"] {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}

[class^="table-form-filter"] > *,
[class*=" table-form-filter"] > * {
  min-width: min(190px, 100%);
  flex: 1 1 190px;
}

.FiltersBusinessAnalises,
.baFilterDate {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}

.baFilterDate > div {
  flex: 1 1 180px;
  min-width: min(180px, 100%);
}

.baFilterIpunt {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.buttonSaveFooter {
  box-sizing: border-box;
  min-height: 36px;
}

@media (max-width: 639px) {
  [class^="table-form-filter"] > *,
  [class*=" table-form-filter"] > *,
  .baFilterDate > div {
    flex-basis: 100%;
  }
}

/* ==========================================================================
   Mobile-First Administrative App Theme (Package A — Base Visual)
   Scoped to app-screen; app-preview excludes customer content within the page.
   ========================================================================== */

body.app-screen {
  /* Surface & Brand Tokens */
  --app-bg: #f6f8fc;
  --app-surface: #ffffff;
  --app-text: #15243b;
  --app-text-muted: #526782;
  --app-border: #dce5f1;
  --app-primary: #086ca2;
  --app-primary-hover: #075985;
  --app-primary-contrast: #ffffff;
  --app-teal: #0b7b86;
  --app-teal-hover: #0a6b76;
  --app-highlight: #e9f7f8;
  --app-danger: #bd263d;
  --app-danger-bg: #fff0f2;
  --app-danger-border: #f8c2cb;
  --app-success: #137548;
  --app-success-bg: #eaf9f0;
  --app-success-border: #bcecd2;

  /* Spacing Scale */
  --app-space-1: 4px;
  --app-space-2: 8px;
  --app-space-3: 12px;
  --app-space-4: 16px;
  --app-space-6: 24px;
  --app-space-8: 32px;

  /* Border Radii */
  --app-radius-sm: 8px;
  --app-radius-btn: 10px;
  --app-radius-input: 10px;
  --app-radius-card: 12px;

  /* Shadows */
  --app-shadow-card: 0 2px 8px rgba(21, 36, 59, 0.04);
  --app-shadow-float: 0 4px 16px rgba(21, 36, 59, 0.08);

  /* Typography */
  --app-font-family: Arial, Helvetica, system-ui, -apple-system, sans-serif;
  --app-font-size-body: 14px;
  --app-font-size-mobile: 15px;
  --app-font-size-input: 16px;
  --app-font-size-title: 24px;
  --app-font-size-title-mobile: 20px;
  --app-font-size-label: 12px;

  /* Layout Boundaries */
  --app-max-width: 1600px;
  --app-page-gutter: 24px;

  /* Safe Area Insets */
  --app-safe-top: env(safe-area-inset-top, 0px);
  --app-safe-bottom: env(safe-area-inset-bottom, 0px);
  --app-safe-left: env(safe-area-inset-left, 0px);
  --app-safe-right: env(safe-area-inset-right, 0px);

  /* Applied Base Properties */
  background-color: var(--app-bg);
  color: var(--app-text);
  font-family: var(--app-font-family);
  font-size: var(--app-font-size-body);
  line-height: 1.5;
  margin: 0;
  padding-top: var(--app-safe-top);
  padding-bottom: var(--app-safe-bottom);
  padding-left: var(--app-safe-left);
  padding-right: var(--app-safe-right);
  min-height: 100vh;
  box-sizing: border-box;
}

@media (min-width: 768px) and (max-width: 1023px) {
  body.app-screen {
    --app-page-gutter: 16px;
  }
}

@media (max-width: 767px) {
  body.app-screen {
    --app-page-gutter: 12px;
    font-size: var(--app-font-size-mobile);
  }
}

/* --------------------------------------------------------------------------
   Header & Brand Chrome
   -------------------------------------------------------------------------- */

body.app-screen > header:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-page-header:not(:where(.app-preview, .app-preview *)) {
  background: var(--app-surface) !important;
  color: var(--app-text) !important;
  border-bottom: 1px solid var(--app-border);
  padding: var(--app-space-3) var(--app-page-gutter);
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  box-sizing: border-box;
}

body.app-screen > header h1:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-page-header h1:not(:where(.app-preview, .app-preview *)) {
  font-size: var(--app-font-size-title);
  color: var(--app-text);
  font-weight: 700;
  margin: 0;
  text-align: left;
  letter-spacing: -0.01em;
}

@media (max-width: 767px) {
  body.app-screen > header:not(:where(.app-preview, .app-preview *)),
  body.app-screen .app-page-header:not(:where(.app-preview, .app-preview *)) {
    padding: var(--app-space-2) var(--app-page-gutter);
    min-height: 48px;
  }

  body.app-screen > header h1:not(:where(.app-preview, .app-preview *)),
  body.app-screen .app-page-header h1:not(:where(.app-preview, .app-preview *)) {
    font-size: var(--app-font-size-title-mobile);
  }
}

/* --------------------------------------------------------------------------
   Navigation Chrome (nav / Voltar / Salvar / Sair)
   -------------------------------------------------------------------------- */

body.app-screen > nav:not(:where(.app-preview, .app-preview *)),
body.app-screen > nav.app-auth-nav:not(:where(.app-preview, .app-preview *)) {
  background: var(--app-surface) !important;
  color: var(--app-text) !important;
  border-bottom: 1px solid var(--app-border);
  padding: var(--app-space-2) var(--app-page-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--app-space-3);
  flex-wrap: wrap;
  box-sizing: border-box;
}

body.app-screen > nav a:not(:where(.app-preview, .app-preview *)),
body.app-screen > nav.app-auth-nav a:not(:where(.app-preview, .app-preview *)) {
  color: var(--app-primary);
  text-decoration: none;
  font-weight: 600;
}

/* Back Link (Voltar) */
body.app-screen > nav a.app-nav__back-link:not(:where(.app-preview, .app-preview *)),
body.app-screen > nav.app-auth-nav a.app-nav__back-link:not(:where(.app-preview, .app-preview *)),
body.app-screen a.app-nav__back-link:not(:where(.app-preview, .app-preview *)),
body.app-screen a.app-nav__back-link--direct:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-nav__back-link:not(:where(.app-preview, .app-preview *)) {
  background: var(--app-surface) !important;
  color: var(--app-primary) !important;
  border: 1px solid var(--app-border) !important;
  border-radius: var(--app-radius-btn);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  min-width: 44px;
  padding: 6px 14px;
  font-weight: 600;
  font-size: var(--app-font-size-body);
  text-decoration: none;
  box-sizing: border-box;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

body.app-screen > nav a.app-nav__back-link:hover:not(:where(.app-preview, .app-preview *)),
body.app-screen > nav a.app-nav__back-link:focus-visible:not(:where(.app-preview, .app-preview *)),
body.app-screen a.app-nav__back-link:hover:not(:where(.app-preview, .app-preview *)),
body.app-screen a.app-nav__back-link:focus-visible:not(:where(.app-preview, .app-preview *)),
body.app-screen a.app-nav__back-link--direct:hover:not(:where(.app-preview, .app-preview *)),
body.app-screen a.app-nav__back-link--direct:focus-visible:not(:where(.app-preview, .app-preview *)) {
  background: var(--app-highlight) !important;
  border-color: var(--app-teal) !important;
  color: var(--app-teal) !important;
}

body.app-screen .app-nav__back-icon:not(:where(.app-preview, .app-preview *)) {
  color: currentColor;
  font-size: 1.1em;
  line-height: 1;
}

/* Save Action (Salvar) — highlighted */
body.app-screen > nav .app-nav__save:not(:where(.app-preview, .app-preview *)),
body.app-screen > nav.app-auth-nav .app-nav__save:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-nav__save:not(:where(.app-preview, .app-preview *)),
body.app-screen .buttonSaveFooter:not(:where(.app-preview, .app-preview *)),
body.app-screen button[class*="btnSave"]:not(:where(.app-preview, .app-preview *)),
body.app-screen .btnSave:not(:where(.app-preview, .app-preview *)),
body.app-screen .cp__button__default:not(:where(.app-preview, .app-preview *)) {
  background: var(--app-teal) !important;
  color: #ffffff !important;
  border: 1px solid var(--app-teal) !important;
  border-radius: var(--app-radius-btn);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  min-width: 44px;
  padding: 8px 18px;
  font-weight: 600;
  font-size: var(--app-font-size-body);
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

body.app-screen > nav .app-nav__save:hover:not(:where(.app-preview, .app-preview *)),
body.app-screen > nav .app-nav__save:focus-visible:not(:where(.app-preview, .app-preview *)),
body.app-screen > nav.app-auth-nav .app-nav__save:hover:not(:where(.app-preview, .app-preview *)),
body.app-screen > nav.app-auth-nav .app-nav__save:focus-visible:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-nav__save:hover:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-nav__save:focus-visible:not(:where(.app-preview, .app-preview *)),
body.app-screen .buttonSaveFooter:hover:not(:where(.app-preview, .app-preview *)),
body.app-screen button[class*="btnSave"]:hover:not(:where(.app-preview, .app-preview *)),
body.app-screen .cp__button__default:hover:not(:where(.app-preview, .app-preview *)) {
  background: var(--app-teal-hover) !important;
  border-color: var(--app-teal-hover) !important;
  color: #ffffff !important;
}

/* Logout Action (Sair) — secondary with danger styling */
body.app-screen > nav .app-nav__logout:not(:where(.app-preview, .app-preview *)),
body.app-screen > nav a[href*="/logout"]:not(:where(.app-preview, .app-preview *)),
body.app-screen > nav.app-auth-nav .app-nav__logout:not(:where(.app-preview, .app-preview *)),
body.app-screen > nav.app-auth-nav a[href*="/logout"]:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-nav__logout:not(:where(.app-preview, .app-preview *)),
body.app-screen a[href*="/logout"]:not(:where(.app-preview, .app-preview *)) {
  background: var(--app-danger-bg) !important;
  color: var(--app-danger) !important;
  border: 1px solid var(--app-danger-border) !important;
  border-radius: var(--app-radius-btn);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  min-width: 44px;
  padding: 6px 14px;
  font-weight: 600;
  font-size: var(--app-font-size-body);
  text-decoration: none;
  box-sizing: border-box;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

body.app-screen > nav .app-nav__logout:hover:not(:where(.app-preview, .app-preview *)),
body.app-screen > nav .app-nav__logout:focus-visible:not(:where(.app-preview, .app-preview *)),
body.app-screen > nav.app-auth-nav .app-nav__logout:hover:not(:where(.app-preview, .app-preview *)),
body.app-screen > nav.app-auth-nav .app-nav__logout:focus-visible:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-nav__logout:hover:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-nav__logout:focus-visible:not(:where(.app-preview, .app-preview *)),
body.app-screen a[href*="/logout"]:hover:not(:where(.app-preview, .app-preview *)) {
  background: #ffe3e6 !important;
  border-color: var(--app-danger) !important;
  color: var(--app-danger) !important;
}

/* Secondary Navigation Controls */
body.app-screen .app-nav__secondary:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-nav__update:not(:where(.app-preview, .app-preview *)) {
  background: var(--app-surface) !important;
  color: var(--app-primary) !important;
  border: 1px solid var(--app-border) !important;
  border-radius: var(--app-radius-btn);
  min-height: 40px;
  min-width: 44px;
  padding: 6px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

body.app-screen .app-nav__secondary:hover:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-nav__update:hover:not(:where(.app-preview, .app-preview *)) {
  background: var(--app-highlight) !important;
  border-color: var(--app-teal) !important;
  color: var(--app-teal) !important;
}

@media (max-width: 767px) {
  body.app-screen > nav:not(:where(.app-preview, .app-preview *)),
  body.app-screen > nav.app-auth-nav:not(:where(.app-preview, .app-preview *)) {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: var(--app-space-2) !important;
    padding: var(--app-space-2) var(--app-page-gutter) !important;
    min-height: 48px;
  }

  body.app-screen > nav .app-nav__links:not(:where(.app-preview, .app-preview *)),
  body.app-screen > nav.app-auth-nav > .app-nav__links:not(:where(.app-preview, .app-preview *)) {
    display: flex;
    align-items: center;
    gap: var(--app-space-2);
    flex: 1 1 auto;
    min-width: 0;
  }

  body.app-screen > nav .app-nav__actions:not(:where(.app-preview, .app-preview *)),
  body.app-screen > nav.app-auth-nav > .app-nav__actions:not(:where(.app-preview, .app-preview *)) {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--app-space-2);
    flex: 0 0 auto;
    margin-left: auto;
  }

  body.app-screen > nav a:not(:where(.app-preview, .app-preview *)),
  body.app-screen > nav button:not(:where(.app-preview, .app-preview *)),
  body.app-screen > nav.app-auth-nav a:not(:where(.app-preview, .app-preview *)),
  body.app-screen > nav.app-auth-nav button:not(:where(.app-preview, .app-preview *)) {
    min-height: 44px !important;
    min-width: 44px !important;
  }
}

/* --------------------------------------------------------------------------
   Layout & Content Containers
   -------------------------------------------------------------------------- */

body.app-screen main:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-main:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-content:not(:where(.app-preview, .app-preview *)) {
  max-width: calc(var(--app-max-width) + 2 * var(--app-page-gutter));
  margin: var(--app-space-4) auto;
  padding: 0 var(--app-page-gutter);
  box-sizing: border-box;
  width: 100%;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

@media (max-width: 767px) {
  body.app-screen main:not(:where(.app-preview, .app-preview *)),
  body.app-screen .app-main:not(:where(.app-preview, .app-preview *)),
  body.app-screen .app-content:not(:where(.app-preview, .app-preview *)) {
    margin: var(--app-space-3) auto;
    padding: 0 var(--app-page-gutter);
  }
}

/* --------------------------------------------------------------------------
   Shared Hooks
   -------------------------------------------------------------------------- */

/* .app-surface — Section Surface / Card Container */
body.app-screen .app-surface:not(:where(.app-preview, .app-preview *)) {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-card);
  box-shadow: var(--app-shadow-card);
  padding: var(--app-space-4);
  box-sizing: border-box;
  margin-bottom: var(--app-space-4);
}

@media (max-width: 767px) {
  body.app-screen .app-surface:not(:where(.app-preview, .app-preview *)) {
    padding: 14px 16px;
    margin-bottom: var(--app-space-3);
  }
}

/* .app-toolbar — Responsive Action / Tool Bar */
body.app-screen .app-toolbar:not(:where(.app-preview, .app-preview *)) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--app-space-3);
  flex-wrap: wrap;
  margin-bottom: var(--app-space-4);
  box-sizing: border-box;
  width: 100%;
}

@media (max-width: 767px) {
  body.app-screen .app-toolbar:not(:where(.app-preview, .app-preview *)) {
    gap: var(--app-space-2);
    margin-bottom: var(--app-space-3);
  }
}

/* .app-filter-grid — Responsive Filters Bar */
body.app-screen .app-filter-grid:not(:where(.app-preview, .app-preview *)) {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-card);
  box-shadow: var(--app-shadow-card);
  padding: var(--app-space-3) var(--app-space-4);
  display: flex;
  align-items: flex-end;
  gap: var(--app-space-3);
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: var(--app-space-4);
}

body.app-screen .app-filter-grid > *:not(:where(.app-preview, .app-preview *)) {
  flex: 1 1 180px;
  min-width: 0;
  box-sizing: border-box;
}

body.app-screen .app-filter-grid > .app-filter-grow:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-filter-grid input[type="search"]:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-filter-grid input[name="search"]:not(:where(.app-preview, .app-preview *)) {
  flex: 2 1 260px;
}

body.app-screen .app-filter-grid .app-filter-actions:not(:where(.app-preview, .app-preview *)) {
  flex: 0 0 auto;
  display: flex;
  gap: var(--app-space-2);
}

@media (max-width: 767px) {
  body.app-screen .app-filter-grid:not(:where(.app-preview, .app-preview *)) {
    padding: 12px 14px;
    gap: var(--app-space-2);
    margin-bottom: var(--app-space-3);
  }

  body.app-screen .app-filter-grid > *:not(:where(.app-preview, .app-preview *)) {
    flex: 1 1 100%;
    width: 100%;
  }

  body.app-screen .app-filter-grid .app-filter-actions:not(:where(.app-preview, .app-preview *)) {
    flex: 1 1 100%;
    width: 100%;
    justify-content: flex-end;
  }
}

/* .app-form-grid — Responsive Form Grid */
body.app-screen .app-form-grid:not(:where(.app-preview, .app-preview *)) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--app-space-4);
  width: 100%;
  box-sizing: border-box;
  margin-bottom: var(--app-space-4);
}

body.app-screen .app-form-grid--2col:not(:where(.app-preview, .app-preview *)) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.app-screen .app-form-grid--3col:not(:where(.app-preview, .app-preview *)) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.app-screen .app-form-grid--4col:not(:where(.app-preview, .app-preview *)) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.app-screen .app-form-col-span-full:not(:where(.app-preview, .app-preview *)) {
  grid-column: 1 / -1;
}

@media (min-width: 768px) and (max-width: 1023px) {
  body.app-screen .app-form-grid--3col:not(:where(.app-preview, .app-preview *)),
  body.app-screen .app-form-grid--4col:not(:where(.app-preview, .app-preview *)) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--app-space-3);
  }
}

@media (max-width: 767px) {
  body.app-screen .app-form-grid:not(:where(.app-preview, .app-preview *)),
  body.app-screen .app-form-grid--2col:not(:where(.app-preview, .app-preview *)),
  body.app-screen .app-form-grid--3col:not(:where(.app-preview, .app-preview *)),
  body.app-screen .app-form-grid--4col:not(:where(.app-preview, .app-preview *)) {
    grid-template-columns: 1fr;
    gap: var(--app-space-3);
    margin-bottom: var(--app-space-3);
  }

  body.app-screen .app-form-grid--paired:not(:where(.app-preview, .app-preview *)) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--app-space-2);
  }
}

/* .app-field & .app-field-label */
body.app-screen .app-field:not(:where(.app-preview, .app-preview *)) {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin-bottom: var(--app-space-3);
}

body.app-screen .app-field-label:not(:where(.app-preview, .app-preview *)),
body.app-screen .cp__form__sublabel:not(:where(.app-preview, .app-preview *)),
body.app-screen label.app-label:not(:where(.app-preview, .app-preview *)) {
  font-size: var(--app-font-size-label);
  font-weight: 600;
  color: var(--app-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: block;
}

/* .app-page-intro */
body.app-screen .app-page-intro:not(:where(.app-preview, .app-preview *)) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--app-space-3);
  flex-wrap: wrap;
  margin-bottom: var(--app-space-4);
  box-sizing: border-box;
}

body.app-screen .app-page-intro h1:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-page-intro h2:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-page-intro__title:not(:where(.app-preview, .app-preview *)) {
  font-size: var(--app-font-size-title);
  font-weight: 700;
  color: var(--app-text);
  margin: 0;
}

body.app-screen .app-page-intro__desc:not(:where(.app-preview, .app-preview *)) {
  font-size: var(--app-font-size-body);
  color: var(--app-text-muted);
  margin: 4px 0 0 0;
}

/* --------------------------------------------------------------------------
   Table System (.app-record-table & .app-table-scroll)
   -------------------------------------------------------------------------- */

/* Shared grids can replace UIkit geometry without retaining its gutters. */
body.app-screen .app-filter-grid:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-form-grid:not(:where(.app-preview, .app-preview *)) {
  margin-left: 0;
  margin-right: 0;
}

body.app-screen .app-filter-grid > *:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-form-grid > *:not(:where(.app-preview, .app-preview *)) {
  min-width: 0;
  margin-top: 0;
  padding-left: 0;
  padding-right: 0;
}

/* Preserve full values while allowing URLs, email and codes to wrap. */
body.app-screen table th:not(:where(.app-preview, .app-preview *)),
body.app-screen table td:not(:where(.app-preview, .app-preview *)) {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Standard Desktop Tables in App Screen */
body.app-screen table:not(.app-record-table):not(:where(.app-preview, .app-preview *)) {
  width: 100%;
  border-collapse: collapse;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
}

body.app-screen table:not(.app-record-table) th:not(:where(.app-preview, .app-preview *)) {
  background: #f8fafc;
  color: var(--app-text-muted);
  font-weight: 600;
  font-size: 13px;
  border: 1px solid var(--app-border);
  padding: 10px 14px;
  text-align: left;
}

body.app-screen table:not(.app-record-table) td:not(:where(.app-preview, .app-preview *)) {
  border: 1px solid var(--app-border);
  padding: 10px 14px;
  color: var(--app-text);
}

/* .app-record-table — Desktop Appearance */
body.app-screen table.app-record-table:not(:where(.app-preview, .app-preview *)) {
  width: 100%;
  border-collapse: collapse;
  background: var(--app-surface);
  border-radius: var(--app-radius-card);
  border: 1px solid var(--app-border);
  box-shadow: var(--app-shadow-card);
  overflow: hidden;
  box-sizing: border-box;
}

body.app-screen table.app-record-table th:not(:where(.app-preview, .app-preview *)) {
  background: #f8fafc;
  color: var(--app-text-muted);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 12px 14px;
  border-bottom: 1px solid var(--app-border);
  text-align: left;
}

body.app-screen table.app-record-table td:not(:where(.app-preview, .app-preview *)) {
  padding: 12px 14px;
  border-bottom: 1px solid var(--app-border);
  color: var(--app-text);
  font-size: var(--app-font-size-body);
  vertical-align: middle;
}

body.app-screen table.app-record-table tbody tr:hover:not(:where(.app-preview, .app-preview *)) {
  background: #fbfcfe;
}

/* .app-record-table — Mobile Cards Transformation (<= 767px) */
@media (max-width: 767px) {
  body.app-screen table.app-record-table:not(:where(.app-preview, .app-preview *)),
  body.app-screen table.app-record-table thead:not(:where(.app-preview, .app-preview *)),
  body.app-screen table.app-record-table tbody:not(:where(.app-preview, .app-preview *)),
  body.app-screen table.app-record-table tr:not(:where(.app-preview, .app-preview *)),
  body.app-screen table.app-record-table th:not(:where(.app-preview, .app-preview *)),
  body.app-screen table.app-record-table td:not(:where(.app-preview, .app-preview *)) {
    display: block;
    box-sizing: border-box;
    width: 100%;
  }

  body.app-screen table.app-record-table:not(:where(.app-preview, .app-preview *)) {
    border: none;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  body.app-screen table.app-record-table thead:not(:where(.app-preview, .app-preview *)) {
    position: absolute;
    top: -9999px;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
    height: 0;
    width: 0;
    overflow: hidden;
  }

  body.app-screen table.app-record-table tbody tr:not(:where(.app-preview, .app-preview *)) {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-card);
    box-shadow: var(--app-shadow-card);
    margin-bottom: var(--app-space-3);
    padding: 14px 16px;
    transition: box-shadow 0.15s ease;
  }

  body.app-screen table.app-record-table tbody td:not(:where(.app-preview, .app-preview *)) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border: none;
    border-bottom: 1px solid #f1f4f9;
    font-size: var(--app-font-size-mobile);
    text-align: right;
    min-height: 36px;
  }

  body.app-screen table.app-record-table tbody td:last-child:not(:where(.app-preview, .app-preview *)) {
    border-bottom: none;
    padding-bottom: 0;
  }

  body.app-screen table.app-record-table tbody td[data-label]:not(:where(.app-preview, .app-preview *))::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: var(--app-font-size-label);
    color: var(--app-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: left;
    margin-right: auto;
    max-width: 45%;
    min-width: 0;
    flex-shrink: 1;
    overflow-wrap: anywhere;
  }

  body.app-screen table.app-record-table td.app-record-actions:not(:where(.app-preview, .app-preview *)),
  body.app-screen table.app-record-table td[data-label="Ações"]:not(:where(.app-preview, .app-preview *)),
  body.app-screen table.app-record-table td[data-label="Ação"]:not(:where(.app-preview, .app-preview *)),
  body.app-screen table.app-record-table td[data-label="Actions"]:not(:where(.app-preview, .app-preview *)) {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding-top: 10px;
    margin-top: 4px;
    border-top: 1px dashed var(--app-border);
  }
}

/* .app-table-scroll — Horizontal Local Scroll for Dense Tables */
body.app-screen .app-table-scroll:not(:where(.app-preview, .app-preview *)) {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-card);
  box-shadow: var(--app-shadow-card);
  margin-bottom: var(--app-space-4);
  scrollbar-width: thin;
}

body.app-screen .app-table-scroll table:not(:where(.app-preview, .app-preview *)) {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  margin: 0;
}

body.app-screen .app-table-scroll:focus-visible:not(:where(.app-preview, .app-preview *)) {
  outline: 2px solid var(--app-primary);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Inputs, Controls & Buttons
   -------------------------------------------------------------------------- */

body.app-screen input[type="text"]:not(:where(.app-preview, .app-preview *)),
body.app-screen input[type="search"]:not(:where(.app-preview, .app-preview *)),
body.app-screen input[type="number"]:not(:where(.app-preview, .app-preview *)),
body.app-screen input[type="email"]:not(:where(.app-preview, .app-preview *)),
body.app-screen input[type="password"]:not(:where(.app-preview, .app-preview *)),
body.app-screen input[type="tel"]:not(:where(.app-preview, .app-preview *)),
body.app-screen input[type="url"]:not(:where(.app-preview, .app-preview *)),
body.app-screen input[type="date"]:not(:where(.app-preview, .app-preview *)),
body.app-screen select:not(:where(.app-preview, .app-preview *)),
body.app-screen textarea:not(:where(.app-preview, .app-preview *)),
body.app-screen .uk-input:not(:where(.app-preview, .app-preview *)),
body.app-screen .uk-select:not(:where(.app-preview, .app-preview *)),
body.app-screen .uk-textarea:not(:where(.app-preview, .app-preview *)) {
  background-color: var(--app-surface);
  color: var(--app-text);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-input);
  padding: 8px 12px;
  font-family: var(--app-font-family);
  font-size: var(--app-font-size-body);
  box-sizing: border-box;
  min-height: 40px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.app-screen select:not(:where(.app-preview, .app-preview *)),
body.app-screen .uk-select:not(:where(.app-preview, .app-preview *)) {
  height: 40px;
  line-height: normal;
  padding-top: 0;
  padding-bottom: 0;
  vertical-align: middle;
}

body.app-screen input[type="text"]:focus:not(:where(.app-preview, .app-preview *)),
body.app-screen input[type="search"]:focus:not(:where(.app-preview, .app-preview *)),
body.app-screen input[type="number"]:focus:not(:where(.app-preview, .app-preview *)),
body.app-screen input[type="email"]:focus:not(:where(.app-preview, .app-preview *)),
body.app-screen input[type="password"]:focus:not(:where(.app-preview, .app-preview *)),
body.app-screen input[type="tel"]:focus:not(:where(.app-preview, .app-preview *)),
body.app-screen input[type="url"]:focus:not(:where(.app-preview, .app-preview *)),
body.app-screen input[type="date"]:focus:not(:where(.app-preview, .app-preview *)),
body.app-screen select:focus:not(:where(.app-preview, .app-preview *)),
body.app-screen textarea:focus:not(:where(.app-preview, .app-preview *)),
body.app-screen .uk-input:focus:not(:where(.app-preview, .app-preview *)),
body.app-screen .uk-select:focus:not(:where(.app-preview, .app-preview *)),
body.app-screen .uk-textarea:focus:not(:where(.app-preview, .app-preview *)) {
  outline: none;
  border-color: var(--app-primary);
  box-shadow: 0 0 0 2px rgba(8, 108, 162, 0.2);
}

@media (max-width: 767px) {
  body.app-screen input[type="text"]:not(:where(.app-preview, .app-preview *)),
  body.app-screen input[type="search"]:not(:where(.app-preview, .app-preview *)),
  body.app-screen input[type="number"]:not(:where(.app-preview, .app-preview *)),
  body.app-screen input[type="email"]:not(:where(.app-preview, .app-preview *)),
  body.app-screen input[type="password"]:not(:where(.app-preview, .app-preview *)),
  body.app-screen input[type="tel"]:not(:where(.app-preview, .app-preview *)),
  body.app-screen input[type="url"]:not(:where(.app-preview, .app-preview *)),
  body.app-screen input[type="date"]:not(:where(.app-preview, .app-preview *)),
  body.app-screen select:not(:where(.app-preview, .app-preview *)),
  body.app-screen textarea:not(:where(.app-preview, .app-preview *)),
  body.app-screen .uk-input:not(:where(.app-preview, .app-preview *)),
  body.app-screen .uk-select:not(:where(.app-preview, .app-preview *)),
  body.app-screen .uk-textarea:not(:where(.app-preview, .app-preview *)) {
    font-size: var(--app-font-size-input);
    min-height: 44px;
  }

  body.app-screen select:not(:where(.app-preview, .app-preview *)),
  body.app-screen .uk-select:not(:where(.app-preview, .app-preview *)) {
    height: 44px;
    padding-top: 0;
    padding-bottom: 0;
  }
}

body.app-screen input[type="checkbox"]:not(:where(.app-preview, .app-preview *)),
body.app-screen input[type="radio"]:not(:where(.app-preview, .app-preview *)),
body.app-screen .uk-checkbox:not(:where(.app-preview, .app-preview *)),
body.app-screen .uk-radio:not(:where(.app-preview, .app-preview *)) {
  width: 20px;
  height: 20px;
  accent-color: var(--app-primary);
  cursor: pointer;
  box-sizing: border-box;
}

body.app-screen button:not(:where(.app-preview, .app-preview *)),
body.app-screen .uk-button:not(:where(.app-preview, .app-preview *)),
body.app-screen input[type="submit"]:not(:where(.app-preview, .app-preview *)),
body.app-screen input[type="button"]:not(:where(.app-preview, .app-preview *)) {
  border-radius: var(--app-radius-btn);
  font-family: var(--app-font-family);
  font-size: var(--app-font-size-body);
  font-weight: 600;
  min-height: 40px;
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

@media (max-width: 767px) {
  body.app-screen .dataTables_paginate .paginate_button:not(:where(.app-preview, .app-preview *)),
  body.app-screen .dt-button:not(:where(.app-preview, .app-preview *)) {
    min-width: 44px;
    min-height: 44px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  body.app-screen button:not(:where(.app-preview, .app-preview *)),
  body.app-screen .uk-button:not(:where(.app-preview, .app-preview *)),
  body.app-screen input[type="submit"]:not(:where(.app-preview, .app-preview *)),
  body.app-screen input[type="button"]:not(:where(.app-preview, .app-preview *)) {
    min-height: 44px;
    min-width: 44px;
    font-size: var(--app-font-size-mobile);
  }
}

body.app-screen .uk-button-primary:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-btn-primary:not(:where(.app-preview, .app-preview *)) {
  background-color: var(--app-primary);
  color: #ffffff;
  border: 1px solid var(--app-primary);
}

body.app-screen .uk-button-primary:hover:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-btn-primary:hover:not(:where(.app-preview, .app-preview *)) {
  background-color: var(--app-primary-hover);
  border-color: var(--app-primary-hover);
}

body.app-screen .uk-button-default:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-btn-secondary:not(:where(.app-preview, .app-preview *)) {
  background-color: var(--app-surface);
  color: var(--app-primary);
  border: 1px solid var(--app-border);
}

body.app-screen .uk-button-default:hover:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-btn-secondary:hover:not(:where(.app-preview, .app-preview *)) {
  background-color: var(--app-highlight);
  border-color: var(--app-teal);
  color: var(--app-teal);
}

body.app-screen .uk-button-danger:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-btn-danger:not(:where(.app-preview, .app-preview *)) {
  background-color: var(--app-danger-bg);
  color: var(--app-danger);
  border: 1px solid var(--app-danger-border);
}

body.app-screen .uk-button-danger:hover:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-btn-danger:hover:not(:where(.app-preview, .app-preview *)) {
  background-color: #ffe3e6;
  border-color: var(--app-danger);
}

body.app-screen .uk-button-success:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-btn-success:not(:where(.app-preview, .app-preview *)) {
  background-color: var(--app-success-bg);
  color: var(--app-success);
  border: 1px solid var(--app-success-border);
}

body.app-screen .uk-button-success:hover:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-btn-success:hover:not(:where(.app-preview, .app-preview *)) {
  background-color: #daf5e5;
  border-color: var(--app-success);
}

/* --------------------------------------------------------------------------
   Modals, Tabs & Cards
   -------------------------------------------------------------------------- */

body.app-screen .uk-modal-dialog:not(:where(.app-preview, .app-preview *)) {
  max-width: min(92vw, 800px);
  border-radius: var(--app-radius-card);
  box-shadow: var(--app-shadow-float);
  border: 1px solid var(--app-border);
  box-sizing: border-box;
  overflow: hidden;
  background: var(--app-surface);
}

body.app-screen .uk-modal-header:not(:where(.app-preview, .app-preview *)) {
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-border);
  padding: var(--app-space-3) var(--app-space-4);
}

body.app-screen .uk-modal-body:not(:where(.app-preview, .app-preview *)) {
  padding: var(--app-space-4);
  max-height: calc(85vh - 120px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.app-screen .uk-modal-footer:not(:where(.app-preview, .app-preview *)) {
  background: #f8fafc;
  border-top: 1px solid var(--app-border);
  padding: var(--app-space-3) var(--app-space-4);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--app-space-2);
  flex-wrap: wrap;
}

@media (max-width: 767px) {
  body.app-screen .uk-modal-dialog:not(:where(.app-preview, .app-preview *)) {
    max-width: calc(100vw - 20px) !important;
    margin: 10px auto !important;
    padding: 0 !important;
  }

  body.app-screen .uk-modal-header:not(:where(.app-preview, .app-preview *)),
  body.app-screen .uk-modal-body:not(:where(.app-preview, .app-preview *)),
  body.app-screen .uk-modal-footer:not(:where(.app-preview, .app-preview *)) {
    padding: 12px 14px !important;
  }
}

body.app-screen .uk-tab:not(:where(.app-preview, .app-preview *)) {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-bottom: 2px solid var(--app-border);
  margin-bottom: var(--app-space-4);
  padding-bottom: 0;
  gap: 4px;
}

body.app-screen .uk-tab:not(:where(.app-preview, .app-preview *))::-webkit-scrollbar {
  display: none;
}

body.app-screen .uk-tab > li:not(:where(.app-preview, .app-preview *)) {
  flex: 0 0 auto;
}

body.app-screen .uk-tab > li > a:not(:where(.app-preview, .app-preview *)) {
  color: var(--app-text-muted);
  font-weight: 600;
  padding: 10px 16px;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

body.app-screen .uk-tab > li.uk-active > a:not(:where(.app-preview, .app-preview *)),
body.app-screen .uk-tab > li > a[aria-selected="true"]:not(:where(.app-preview, .app-preview *)) {
  color: var(--app-primary);
  border-color: var(--app-primary);
  background: transparent;
}

body.app-screen .uk-tab > li > a:hover:not(:where(.app-preview, .app-preview *)),
body.app-screen .uk-tab > li > a:focus-visible:not(:where(.app-preview, .app-preview *)) {
  color: var(--app-primary);
}

body.app-screen .uk-card-default:not(:where(.app-preview, .app-preview *)) {
  background: var(--app-surface);
  color: var(--app-text);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-card);
  box-shadow: var(--app-shadow-card);
}

body.app-screen > footer:not(:where(.app-preview, .app-preview *)) {
  background: var(--app-surface);
  color: var(--app-text-muted);
  border-top: 1px solid var(--app-border);
  padding: 16px var(--app-page-gutter);
  margin-top: 32px;
  text-align: center;
  font-size: 13px;
}

@media (max-width: 767px) {
  body.app-screen input[type="file"]:not(:where(.app-preview, .app-preview *)) {
    max-width: 100%;
    font-size: var(--app-font-size-input);
  }

  body.app-screen .uk-alert:not(:where(.app-preview, .app-preview *)) {
    padding-right: 56px;
  }

  body.app-screen .uk-alert-close:not(:where(.app-preview, .app-preview *)) {
    top: 0;
    right: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
  }
}

body.app-screen button:disabled:not(:where(.app-preview, .app-preview *)),
body.app-screen input:disabled:not(:where(.app-preview, .app-preview *)),
body.app-screen select:disabled:not(:where(.app-preview, .app-preview *)) {
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   Accessibility: Focus Rings & Reduced Motion
   -------------------------------------------------------------------------- */

body.app-screen a:focus-visible:not(:where(.app-preview, .app-preview *)),
body.app-screen button:focus-visible:not(:where(.app-preview, .app-preview *)),
body.app-screen input:focus-visible:not(:where(.app-preview, .app-preview *)),
body.app-screen select:focus-visible:not(:where(.app-preview, .app-preview *)),
body.app-screen textarea:focus-visible:not(:where(.app-preview, .app-preview *)),
body.app-screen [tabindex="0"]:focus-visible:not(:where(.app-preview, .app-preview *)) {
  outline: 2px solid var(--app-primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  body.app-screen *:not(:where(.app-preview, .app-preview *)),
  body.app-screen *:not(:where(.app-preview, .app-preview *))::before,
  body.app-screen *:not(:where(.app-preview, .app-preview *))::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Canonical Unified App Header (app-shell-header)
   Single component shared across all application pages.
   ========================================================================== */

.app-shell-header,
body.app-screen .app-shell-header:not(:where(.app-preview, .app-preview *)) {
  background: var(--app-surface, #ffffff);
  border-bottom: 1px solid var(--app-border, #dce5f1);
  width: 100%;
  box-sizing: border-box;
  padding-top: calc(10px + var(--app-safe-top, 0px));
  padding-bottom: 10px;
  padding-left: calc(var(--app-page-gutter, 24px) + var(--app-safe-left, 0px));
  padding-right: calc(var(--app-page-gutter, 24px) + var(--app-safe-right, 0px));
}

@media (max-width: 767px) {
  .app-shell-header,
  body.app-screen .app-shell-header:not(:where(.app-preview, .app-preview *)) {
    padding-left: calc(12px + var(--app-safe-left, 0px));
    padding-right: calc(12px + var(--app-safe-right, 0px));
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .app-shell-header,
  body.app-screen .app-shell-header:not(:where(.app-preview, .app-preview *)) {
    padding-left: calc(16px + var(--app-safe-left, 0px));
    padding-right: calc(16px + var(--app-safe-right, 0px));
  }
}

@media (min-width: 1024px) {
  .app-shell-header,
  body.app-screen .app-shell-header:not(:where(.app-preview, .app-preview *)) {
    padding-left: calc(24px + var(--app-safe-left, 0px));
    padding-right: calc(24px + var(--app-safe-right, 0px));
  }
}

.app-shell-header__inner,
body.app-screen .app-shell-header__inner:not(:where(.app-preview, .app-preview *)) {
  max-width: var(--app-max-width, 1600px);
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-shell-header__main,
body.app-screen .app-shell-header__main:not(:where(.app-preview, .app-preview *)) {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
}

.app-shell-header__title,
body.app-screen .app-shell-header__title:not(:where(.app-preview, .app-preview *)) {
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--app-font-family, sans-serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--app-text, #15243b);
  word-break: break-word;
  overflow-wrap: break-word;
}

.app-shell-header__back,
body.app-screen .app-shell-header__back:not(:where(.app-preview, .app-preview *)) {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  height: 44px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  background: var(--app-surface, #ffffff);
  color: var(--app-text, #15243b);
  border: 1px solid var(--app-border, #dce5f1);
  border-radius: var(--app-radius-btn, 10px);
  text-decoration: none;
  font-family: var(--app-font-family, sans-serif);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.app-shell-header__back:hover,
body.app-screen .app-shell-header__back:hover:not(:where(.app-preview, .app-preview *)) {
  background: var(--app-highlight, #e9f7f8);
  color: var(--app-teal, #0b7b86);
  border-color: var(--app-teal, #0b7b86);
}

.app-shell-header__logout,
body.app-screen .app-shell-header__logout:not(:where(.app-preview, .app-preview *)) {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  height: 44px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  margin-left: auto;
  background: var(--app-danger-bg, #fff0f2);
  color: var(--app-danger, #bd263d);
  border: 1px solid var(--app-danger-border, #f8c2cb);
  border-radius: var(--app-radius-btn, 10px);
  text-decoration: none;
  font-family: var(--app-font-family, sans-serif);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.app-shell-header__logout:hover,
body.app-screen .app-shell-header__logout:hover:not(:where(.app-preview, .app-preview *)) {
  border-color: var(--app-danger, #bd263d);
}

.app-shell-header__icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.app-shell-header__label {
  display: none;
}

/* Actions base */
.app-shell-header__actions,
body.app-screen .app-shell-header__actions:not(:where(.app-preview, .app-preview *)) {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  max-width: 100%;
}

.app-shell-header__action,
body.app-screen .app-shell-header__action:not(:where(.app-preview, .app-preview *)) {
  min-height: 44px;
  height: 44px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0 16px;
  border-radius: var(--app-radius-btn, 10px);
  font-family: var(--app-font-family, sans-serif);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  text-transform: none;
  cursor: pointer;
  white-space: nowrap;
}

.app-shell-header__action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.app-shell-header__action--primary,
body.app-screen .app-shell-header__action--primary:not(:where(.app-preview, .app-preview *)) {
  background-color: var(--app-teal, #0b7b86);
  color: #ffffff;
  border: 1px solid var(--app-teal, #0b7b86);
}

.app-shell-header__action--primary:hover,
body.app-screen .app-shell-header__action--primary:hover:not(:where(.app-preview, .app-preview *)) {
  background-color: var(--app-teal-hover, #0a6b76);
  border-color: var(--app-teal-hover, #0a6b76);
  color: #ffffff;
}

.app-shell-header__action--secondary,
body.app-screen .app-shell-header__action--secondary:not(:where(.app-preview, .app-preview *)) {
  background-color: var(--app-surface, #ffffff);
  color: var(--app-text, #15243b);
  border: 1px solid var(--app-border, #dce5f1);
}

.app-shell-header__action--secondary:hover,
body.app-screen .app-shell-header__action--secondary:hover:not(:where(.app-preview, .app-preview *)) {
  background-color: var(--app-highlight, #e9f7f8);
  color: var(--app-teal, #0b7b86);
  border-color: var(--app-teal, #0b7b86);
}

/* Mobile actions layout: faixa logo abaixo da linha principal só se existem */
@media (max-width: 767px) {
  body.app-screen .app-shell-header__back,
  body.app-screen .app-shell-header__logout {
    width: 44px;
    min-width: 44px;
    padding: 0;
    gap: 0;
  }

  .app-shell-header__actions--single,
  body.app-screen .app-shell-header__actions--single:not(:where(.app-preview, .app-preview *)) {
    width: 100%;
  }

  .app-shell-header__actions--single .app-shell-header__action,
  body.app-screen .app-shell-header__actions--single .app-shell-header__action:not(:where(.app-preview, .app-preview *)) {
    width: 100%;
  }

  .app-shell-header__actions--multiple,
  body.app-screen .app-shell-header__actions--multiple:not(:where(.app-preview, .app-preview *)) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
    gap: 8px;
    width: 100%;
  }

  .app-shell-header__actions--multiple .app-shell-header__action,
  body.app-screen .app-shell-header__actions--multiple .app-shell-header__action:not(:where(.app-preview, .app-preview *)) {
    width: 100%;
    padding: 0 8px;
    font-size: 13px;
  }
}

/* Tablet & Desktop layout (>= 768px):
   - Labels curtos Voltar / Sair
   - Título 23-24px
   - Ações da página à direita, antes de Sair
   - Todos os controles alinhados na mesma linha com 44px de altura
*/
@media (min-width: 768px) {
  .app-shell-header__inner,
  body.app-screen .app-shell-header__inner:not(:where(.app-preview, .app-preview *)) {
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }

  .app-shell-header__main,
  body.app-screen .app-shell-header__main:not(:where(.app-preview, .app-preview *)) {
    display: contents;
  }

  .app-shell-header__back,
  body.app-screen .app-shell-header__back:not(:where(.app-preview, .app-preview *)) {
    order: 1;
    padding: 0 14px;
  }

  .app-shell-header__title,
  body.app-screen .app-shell-header__title:not(:where(.app-preview, .app-preview *)) {
    order: 2;
    font-size: 24px;
    margin-right: auto;
  }

  .app-shell-header__actions,
  body.app-screen .app-shell-header__actions:not(:where(.app-preview, .app-preview *)) {
    order: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
  }

  .app-shell-header__logout,
  body.app-screen .app-shell-header__logout:not(:where(.app-preview, .app-preview *)) {
    order: 4;
    margin-left: 0;
    padding: 0 14px;
  }

  .app-shell-header__label,
  body.app-screen .app-shell-header__label:not(:where(.app-preview, .app-preview *)) {
    display: inline;
  }
}

/* Focus visibility for canonical header controls */
.app-shell-header__back:focus-visible,
.app-shell-header__logout:focus-visible,
.app-shell-header__action:focus-visible {
  outline: 2px solid var(--app-primary, #086ca2);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Simple Search Bar Hooks (Canonical)
   Shared form container for simple search in employees, licenses, institutes.
   -------------------------------------------------------------------------- */

.app-search-bar,
body.app-screen .app-search-bar:not(:where(.app-preview, .app-preview *)) {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--app-surface, #ffffff);
  border: 1px solid var(--app-border, #dce5f1);
  border-radius: var(--app-radius-card, 12px);
  padding: 8px 12px;
  box-sizing: border-box;
  width: 100%;
  max-width: var(--app-max-width, 1600px);
  box-shadow: var(--app-shadow-card, 0 2px 8px rgba(21, 36, 59, 0.04));
}

.app-search-bar__field,
body.app-screen .app-search-bar__field:not(:where(.app-preview, .app-preview *)) {
  flex: 1 1 0%;
  min-width: 0;
  display: flex;
  align-items: center;
}

.app-search-bar__input,
body.app-screen .app-search-bar__input:not(:where(.app-preview, .app-preview *)) {
  width: 100%;
  min-height: 44px;
  height: 44px;
  box-sizing: border-box;
  padding: 0 12px;
  font-family: var(--app-font-family, sans-serif);
  font-size: var(--app-font-size-input, 16px);
  color: var(--app-text, #15243b);
  background: var(--app-surface, #ffffff);
  border: 1px solid var(--app-border, #dce5f1);
  border-radius: var(--app-radius-input, 10px);
}

.app-search-bar__submit,
body.app-screen .app-search-bar__submit:not(:where(.app-preview, .app-preview *)) {
  flex: 0 0 auto;
  min-height: 44px;
  height: 44px;
  min-width: 72px;
  max-width: 90px;
  box-sizing: border-box;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--app-font-family, sans-serif);
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  background-color: var(--app-teal, #0b7b86);
  border: 1px solid var(--app-teal, #0b7b86);
  border-radius: var(--app-radius-btn, 10px);
  cursor: pointer;
  white-space: nowrap;
  text-transform: none;
}

.app-search-bar__submit:hover,
body.app-screen .app-search-bar__submit:hover:not(:where(.app-preview, .app-preview *)) {
  background-color: var(--app-teal-hover, #0a6b76);
  border-color: var(--app-teal-hover, #0a6b76);
}

.app-search-bar__input:focus-visible,
.app-search-bar__submit:focus-visible {
  outline: 2px solid var(--app-primary, #086ca2);
  outline-offset: 2px;
}

/* ==========================================================================
   Canonical Content Action Buttons & Controls (app-btn)
   Unified action system for content, records, filters and navigation.
   Scoped to body.app-screen with exclusion of .app-preview and descendants.
   ========================================================================== */

/* Base Canonical Button (.app-btn)
   - Height: 44px border-box (overrides UIkit line-height/padding summing to 56px)
   - Min-width: 44px, width: auto (no indiscriminate full-width)
   - Typography: 14px, weight: 600, line-height: 1.2
   - Border radius: 10px (var(--app-radius-btn))
   - Gap: 8px, horizontal padding: 12px
   - Normal case: text-transform: none (overrides UIkit uppercase)
   - Focus visible, disabled, and reduced motion states
*/
body.app-screen .app-btn:not(:where(.app-preview, .app-preview *)),
body.app-screen a.app-btn:not(:where(.app-preview, .app-preview *)),
body.app-screen button.app-btn:not(:where(.app-preview, .app-preview *)),
body.app-screen input[type="submit"].app-btn:not(:where(.app-preview, .app-preview *)),
body.app-screen input[type="button"].app-btn:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-action-btn.app-btn:not(:where(.app-preview, .app-preview *)),
body.app-screen .uk-button.app-btn:not(:where(.app-preview, .app-preview *)),
body.app-screen .cp__button.app-btn:not(:where(.app-preview, .app-preview *)) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  min-width: 44px !important;
  width: auto;
  margin: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
  font-family: var(--app-font-family, sans-serif) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  border-radius: var(--app-radius-btn, 10px) !important;
  border-width: 1px !important;
  border-style: solid !important;
  border-color: transparent;
  gap: 8px !important;
  cursor: pointer !important;
  vertical-align: middle !important;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease !important;
}

/* Consistent icon sizing (16-20px) within .app-btn without extra fonts or JS */
body.app-screen .app-btn svg:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-btn i:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-btn [uk-icon]:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-btn .app-btn__icon:not(:where(.app-preview, .app-preview *)) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 18px !important;
  height: 18px !important;
  font-size: 18px !important;
  line-height: 1 !important;
  flex-shrink: 0 !important;
  vertical-align: middle !important;
}

/* Standalone SVG Mask Icon (.app-btn__icon)
   Avoids blank icons from missing external icon fonts.
   Uses currentColor with SVG data URI masks. */
body.app-screen .app-btn__icon:not(:where(.app-preview, .app-preview *)) {
  display: inline-block !important;
  width: 18px !important;
  height: 18px !important;
  flex-shrink: 0 !important;
  background-color: currentColor !important;
  -webkit-mask-repeat: no-repeat !important;
  mask-repeat: no-repeat !important;
  -webkit-mask-position: center !important;
  mask-position: center !important;
  -webkit-mask-size: contain !important;
  mask-size: contain !important;
  vertical-align: middle !important;
}

/* Icon Modifiers */
body.app-screen .app-btn__icon--edit:not(:where(.app-preview, .app-preview *)) {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z'/%3E%3C/svg%3E") !important;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z'/%3E%3C/svg%3E") !important;
}

body.app-screen .app-btn__icon--delete:not(:where(.app-preview, .app-preview *)) {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z'/%3E%3C/svg%3E") !important;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z'/%3E%3C/svg%3E") !important;
}

body.app-screen .app-btn__icon--open:not(:where(.app-preview, .app-preview *)) {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 19H5V5h7V3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z'/%3E%3C/svg%3E") !important;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 19H5V5h7V3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z'/%3E%3C/svg%3E") !important;
}

body.app-screen .app-btn__icon--archive:not(:where(.app-preview, .app-preview *)) {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 2H4c-1.1 0-2 .9-2 2v3.01c0 .72.38 1.36.95 1.7L3 20c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2l.05-11.28c.57-.35.95-.99.95-1.71V4c0-1.1-.9-2-2-2zm-1 5H5V4h14v3zm-3 5H8v-2h8v2z'/%3E%3C/svg%3E") !important;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 2H4c-1.1 0-2 .9-2 2v3.01c0 .72.38 1.36.95 1.7L3 20c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2l.05-11.28c.57-.35.95-.99.95-1.71V4c0-1.1-.9-2-2-2zm-1 5H5V4h14v3zm-3 5H8v-2h8v2z'/%3E%3C/svg%3E") !important;
}

body.app-screen .app-btn__icon--restore:not(:where(.app-preview, .app-preview *)) {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13 3a9 9 0 0 0-9 9H1l3.89 3.89.07.14L9 12H6a7 7 0 1 1 2.05 4.95l-1.41 1.41A9 9 0 1 0 13 3z'/%3E%3C/svg%3E") !important;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13 3a9 9 0 0 0-9 9H1l3.89 3.89.07.14L9 12H6a7 7 0 1 1 2.05 4.95l-1.41 1.41A9 9 0 1 0 13 3z'/%3E%3C/svg%3E") !important;
}

body.app-screen .app-btn__icon--upload:not(:where(.app-preview, .app-preview *)) {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16h6v-6h4l-7-7-7 7h4v6zm-4 2h14v2H5v-2z'/%3E%3C/svg%3E") !important;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16h6v-6h4l-7-7-7 7h4v6zm-4 2h14v2H5v-2z'/%3E%3C/svg%3E") !important;
}

/* Accessible and multi-line compliant button label (.app-btn__label)
   Allows legible label, up to 2 lines within 44px when necessary. */
body.app-screen .app-btn__label:not(:where(.app-preview, .app-preview *)) {
  display: inline-block !important;
  line-height: 1.15 !important;
  min-width: 0;
  max-width: 100%;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: normal !important;
  vertical-align: middle !important;
  text-align: center !important;
}

/* Icon-only button: exact 44x44px square */
body.app-screen .app-btn.app-btn--icon:not(:where(.app-preview, .app-preview *)),
body.app-screen input[type="button"].app-btn--icon:not(:where(.app-preview, .app-preview *)),
body.app-screen input[type="submit"].app-btn--icon:not(:where(.app-preview, .app-preview *)) {
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  padding: 0 !important;
  justify-content: center !important;
}

body.app-screen .app-btn--icon svg:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-btn--icon i:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-btn--icon [uk-icon]:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-btn--icon .app-btn__icon:not(:where(.app-preview, .app-preview *)) {
  width: 20px !important;
  height: 20px !important;
  font-size: 20px !important;
  line-height: 1 !important;
}

/* Focus, Disabled, and Reduced Motion states */
body.app-screen .app-btn:focus-visible:not(:where(.app-preview, .app-preview *)) {
  outline: 2px solid var(--app-primary, #086ca2) !important;
  outline-offset: 2px !important;
}

body.app-screen .app-btn:disabled:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-btn[aria-disabled="true"]:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-btn.app-btn--disabled:not(:where(.app-preview, .app-preview *)) {
  opacity: 0.55 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  box-shadow: none !important;
}

@media (prefers-reduced-motion: reduce) {
  body.app-screen :is(
    .app-btn,
    a.app-btn,
    button.app-btn,
    input[type="submit"].app-btn,
    input[type="button"].app-btn,
    .app-action-btn.app-btn,
    .uk-button.app-btn,
    .cp__button.app-btn,
    .app-segmented__item,
    .app-segmented > a,
    .app-segmented > button,
    .dataTables_paginate .paginate_button,
    .dt-button
  ):not(:where(.app-preview, .app-preview *)) {
    transition: none !important;
  }
}

/* --------------------------------------------------------------------------
   Button Variants
   Consistent colors with high contrast and explicit hover states.
   -------------------------------------------------------------------------- */

/* Primary: Teal (#0b7b86) with white text.
   For Novo, Salvar, Buscar, Filtrar, Adicionar. */
body.app-screen .app-btn--primary:not(:where(.app-preview, .app-preview *)) {
  background-color: var(--app-teal, #0b7b86) !important;
  border-color: var(--app-teal, #0b7b86) !important;
  color: #ffffff !important;
}

body.app-screen .app-btn--primary:hover:not(:where(.app-preview, .app-preview *)) {
  background-color: var(--app-teal-hover, #0a6b76) !important;
  border-color: var(--app-teal-hover, #0a6b76) !important;
  color: #ffffff !important;
}

/* Secondary: White background, soft border (#dce5f1), dark text (#15243b).
   For Limpar, Cancelar. */
body.app-screen .app-btn--secondary:not(:where(.app-preview, .app-preview *)) {
  background-color: var(--app-surface, #ffffff) !important;
  border-color: var(--app-border, #dce5f1) !important;
  color: var(--app-text, #15243b) !important;
}

body.app-screen .app-btn--secondary:hover:not(:where(.app-preview, .app-preview *)) {
  background-color: var(--app-highlight, #e9f7f8) !important;
  border-color: var(--app-teal, #0b7b86) !important;
  color: var(--app-teal, #0b7b86) !important;
}

/* Edit: Light teal surface with teal text (#0b7b86).
   For Editar. */
body.app-screen .app-btn--edit:not(:where(.app-preview, .app-preview *)) {
  background-color: var(--app-highlight, #e9f7f8) !important;
  border-color: #bce6ea !important;
  color: var(--app-teal, #0b7b86) !important;
}

body.app-screen .app-btn--edit:hover:not(:where(.app-preview, .app-preview *)) {
  background-color: var(--app-teal, #0b7b86) !important;
  border-color: var(--app-teal, #0b7b86) !important;
  color: #ffffff !important;
}

/* Archive: Neutral/amber surface (#fef3e2) with high-contrast amber text (#7c4a03).
   For Arquivar and Restaurar. */
body.app-screen .app-btn--archive:not(:where(.app-preview, .app-preview *)) {
  background-color: #fef3e2 !important;
  border-color: #fbd38d !important;
  color: #7c4a03 !important;
}

body.app-screen .app-btn--archive:hover:not(:where(.app-preview, .app-preview *)) {
  background-color: #b45309 !important;
  border-color: #92400e !important;
  color: #ffffff !important;
}

/* Danger (Soft): Light pink surface with red text (#bd263d).
   For Excluir (record action / table row). */
body.app-screen .app-btn--danger:not(:where(.app-preview, .app-preview *)) {
  background-color: var(--app-danger-bg, #fff0f2) !important;
  border-color: var(--app-danger-border, #f8c2cb) !important;
  color: var(--app-danger, #bd263d) !important;
}

body.app-screen .app-btn--danger:hover:not(:where(.app-preview, .app-preview *)) {
  background-color: var(--app-danger, #bd263d) !important;
  border-color: var(--app-danger, #bd263d) !important;
  color: #ffffff !important;
}

/* Danger Solid: Filled red (#bd263d) with white text.
   Exclusively for destructive confirmation in modals/prompts. */
body.app-screen .app-btn--danger-solid:not(:where(.app-preview, .app-preview *)) {
  background-color: var(--app-danger, #bd263d) !important;
  border-color: var(--app-danger, #bd263d) !important;
  color: #ffffff !important;
}

body.app-screen .app-btn--danger-solid:hover:not(:where(.app-preview, .app-preview *)) {
  background-color: #9c1c30 !important;
  border-color: #9c1c30 !important;
  color: #ffffff !important;
}

/* --------------------------------------------------------------------------
   Action Groups (.app-actions & .app-actions--record)
   -------------------------------------------------------------------------- */

/* General Action Group: flex with gap 8px, no implicit width: 100% */
body.app-screen .app-actions:not(:where(.app-preview, .app-preview *)) {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  box-sizing: border-box !important;
  width: auto;
  flex-wrap: wrap !important;
}

/* Record Actions Group (.app-actions--record)
   Desktop: inline-flex natural flow / wrap.
   Mobile (<= 767px): 2 equal columns when space permits; narrow groups stack. */
body.app-screen .app-actions--record:not(:where(.app-preview, .app-preview *)) {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  box-sizing: border-box !important;
  flex-wrap: wrap !important;
}

@media (max-width: 767px) {
  body.app-screen .app-actions--record:not(:where(.app-preview, .app-preview *)) {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(128px, 100%), 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  body.app-screen .app-actions--record > .app-btn:not(:where(.app-preview, .app-preview *)),
  body.app-screen .app-actions--record > a:not(:where(.app-preview, .app-preview *)),
  body.app-screen .app-actions--record > button:not(:where(.app-preview, .app-preview *)) {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    justify-content: center !important;
  }

  /* Single action occupies the full row */
  body.app-screen .app-actions--record > :only-child:not(:where(.app-preview, .app-preview *)),
  body.app-screen .app-actions--record > .app-btn--single:not(:where(.app-preview, .app-preview *)) {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }

  /* When 3 actions are present, the 3rd action spans full width on the 2nd row */
  body.app-screen .app-actions--record > :nth-child(3):last-child:not(:where(.app-preview, .app-preview *)) {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }
}

@media (max-width: 767px) {
  /* Icon modifiers retain their square geometry inside a record grid. */
  body.app-screen .app-actions--record > .app-btn--icon:not(:where(.app-preview, .app-preview *)) {
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    justify-self: center;
  }

}

/* Dense tables keep natural action widths inside their local scroller.
   The mobile card grid must not shrink controls to a narrow table column. */
body.app-screen :is(.app-table-scroll, .dataTables_scrollBody) .app-actions--record:not(:where(.app-preview, .app-preview *)) {
  display: inline-flex !important;
  flex-wrap: nowrap !important;
  width: max-content !important;
  min-width: max-content !important;
}

body.app-screen :is(.app-table-scroll, .dataTables_scrollBody) .app-actions--record > .app-btn:not(.app-btn--icon):not(:where(.app-preview, .app-preview *)) {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 44px !important;
  max-width: none !important;
}

/* Numbered disclosure headings: keep the badge separate from wrapping text. */
body.app-screen .uk-accordion-title.ec-step:not(:where(.app-preview, .app-preview *)) {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  box-sizing: border-box;
}
body.app-screen .uk-accordion-title.ec-step:not(:where(.app-preview, .app-preview *))::before {
  order: 2;
  flex: 0 0 20px;
}
body.app-screen .ec-step > .uk-flex:not(:where(.app-preview, .app-preview *)) {
  flex: 1;
  min-width: 0;
  gap: 12px;
}
body.app-screen .ec-step > .uk-flex > .uk-flex:first-child:not(:where(.app-preview, .app-preview *)) {
  flex: 0 0 auto;
}
body.app-screen .ec-step__ident:not(:where(.app-preview, .app-preview *)) {
  position: static !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  min-width: 32px;
  min-height: 32px;
  margin: 0 !important;
  border-radius: 8px;
}
body.app-screen .ec-step__label:empty:not(:where(.app-preview, .app-preview *)) { display: none; }
body.app-screen .ec-step__title:not(:where(.app-preview, .app-preview *)) {
  flex: 1;
  min-width: 0;
  white-space: normal;
  overflow-wrap: break-word;
}

/* --------------------------------------------------------------------------
   Record Table Action Cell (td.app-action-cell)
   Desktop: preserves table-cell and inline natural wrap.
   Mobile (<= 767px): releases full card width, removes pseudo-label "AÇÕES".
   -------------------------------------------------------------------------- */

@media (min-width: 768px) {
  body.app-screen table.app-record-table td.app-action-cell:not(:where(.app-preview, .app-preview *)) {
    display: table-cell !important;
    vertical-align: middle !important;
  }

  body.app-screen table.app-record-table td.app-action-cell > .app-actions:not(:where(.app-preview, .app-preview *)),
  body.app-screen table.app-record-table td.app-action-cell > .app-actions--record:not(:where(.app-preview, .app-preview *)) {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
  }
}

@media (max-width: 767px) {
  body.app-screen table.app-record-table td.app-action-cell:not(:where(.app-preview, .app-preview *)),
  body.app-screen table.app-record-table td.app-action-cell[data-label]:not(:where(.app-preview, .app-preview *)),
  body.app-screen table.app-record-table tbody td.app-action-cell:not(:where(.app-preview, .app-preview *)),
  body.app-screen table.app-record-table tbody td.app-action-cell[data-label]:not(:where(.app-preview, .app-preview *)) {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px 0 0 0 !important;
    margin-top: 6px !important;
    border: none !important;
    border-top: 1px dashed var(--app-border, #dce5f1) !important;
    text-align: left !important;
    box-sizing: border-box !important;
  }

  body.app-screen table.app-record-table td.app-action-cell:not(:where(.app-preview, .app-preview *))::before,
  body.app-screen table.app-record-table td.app-action-cell[data-label]:not(:where(.app-preview, .app-preview *))::before,
  body.app-screen table.app-record-table tbody td.app-action-cell:not(:where(.app-preview, .app-preview *))::before,
  body.app-screen table.app-record-table tbody td.app-action-cell[data-label]:not(:where(.app-preview, .app-preview *))::before {
    content: none !important;
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   Filter Actions (.app-filter-actions)
   Filtrar and Limpar side-by-side on the same line on mobile without overflow.
   -------------------------------------------------------------------------- */

body.app-screen .app-filter-actions:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-filter-grid .app-filter-actions:not(:where(.app-preview, .app-preview *)) {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
  box-sizing: border-box !important;
}

body.app-screen .app-filter-actions > .app-btn:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-filter-actions > a:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-filter-actions > button:not(:where(.app-preview, .app-preview *)) {
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  line-height: 1.2 !important;
  box-sizing: border-box !important;
}

@media (max-width: 767px) {
  body.app-screen .app-filter-actions:not(:where(.app-preview, .app-preview *)),
  body.app-screen .app-filter-grid .app-filter-actions:not(:where(.app-preview, .app-preview *)) {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    flex: 1 1 100% !important;
  }

  body.app-screen .app-filter-actions > .app-btn:not(:where(.app-preview, .app-preview *)),
  body.app-screen .app-filter-actions > a:not(:where(.app-preview, .app-preview *)),
  body.app-screen .app-filter-actions > button:not(:where(.app-preview, .app-preview *)) {
    flex: 1 1 50% !important;
    min-width: 0 !important;
    width: 50% !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    justify-content: center !important;
    text-align: center !important;
  }
}

/* --------------------------------------------------------------------------
   Segmented Controls (.app-segmented)
   Ativos / Arquivados grouped together, exact 44px height, aria-current="page".
   -------------------------------------------------------------------------- */

body.app-screen .app-segmented:not(:where(.app-preview, .app-preview *)) {
  display: inline-flex !important;
  align-items: center !important;
  box-sizing: border-box !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  background: var(--app-surface, #ffffff) !important;
  border: 1px solid var(--app-border, #dce5f1) !important;
  border-radius: var(--app-radius-btn, 10px) !important;
  padding: 0 !important;
  gap: 0 !important;
  overflow: hidden !important;
}

body.app-screen .app-segmented > .app-btn:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-segmented__item:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-segmented > a:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-segmented > button:not(:where(.app-preview, .app-preview *)) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  padding: 0 16px !important;
  margin: 0 !important;
  border: none !important;
  border-right: 1px solid var(--app-border, #dce5f1) !important;
  border-radius: 0 !important;
  font-family: var(--app-font-family, sans-serif) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  text-transform: none !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  background: var(--app-surface, #ffffff) !important;
  color: var(--app-text, #15243b) !important;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease !important;
}

body.app-screen .app-segmented__item:last-child:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-segmented > a:last-child:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-segmented > button:last-child:not(:where(.app-preview, .app-preview *)) {
  border-right: none !important;
}

body.app-screen .app-segmented__item:hover:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-segmented > a:hover:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-segmented > button:hover:not(:where(.app-preview, .app-preview *)) {
  background: var(--app-highlight, #e9f7f8) !important;
  color: var(--app-teal, #0b7b86) !important;
}

body.app-screen .app-segmented__item:focus-visible:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-segmented > a:focus-visible:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-segmented > button:focus-visible:not(:where(.app-preview, .app-preview *)) {
  outline: 2px solid var(--app-primary, #086ca2) !important;
  outline-offset: -2px !important;
  z-index: 1;
}

/* Active Segmented Item: highlighted in teal with white text */
body.app-screen .app-segmented__item[aria-current="page"]:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-segmented > a[aria-current="page"]:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-segmented > button[aria-current="page"]:not(:where(.app-preview, .app-preview *)) {
  background: var(--app-teal, #0b7b86) !important;
  color: #ffffff !important;
  border-color: var(--app-teal, #0b7b86) !important;
}

@media (max-width: 767px) {
  body.app-screen .app-segmented:not(:where(.app-preview, .app-preview *)) {
    display: flex !important;
    width: 100% !important;
  }

  body.app-screen .app-segmented__item:not(:where(.app-preview, .app-preview *)),
  body.app-screen .app-segmented > a:not(:where(.app-preview, .app-preview *)),
  body.app-screen .app-segmented > button:not(:where(.app-preview, .app-preview *)) {
    flex: 1 1 50% !important;
    width: 50% !important;
    min-width: 0 !important;
    text-align: center !important;
    justify-content: center !important;
  }
}

/* --------------------------------------------------------------------------
   Canonical DataTables Pagination Controls
   Standardizes pagination links across desktop and mobile (44px)
   -------------------------------------------------------------------------- */

body.app-screen .dataTables_paginate:not(:where(.app-preview, .app-preview *)) {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 4px !important;
  flex-wrap: wrap !important;
  margin-top: 12px !important;
  padding-top: 8px !important;
}

body.app-screen .dataTables_paginate .paginate_button:not(:where(.app-preview, .app-preview *)),
body.app-screen .dt-button:not(:where(.app-preview, .app-preview *)) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  min-width: 44px !important;
  min-height: 44px !important;
  height: 44px !important;
  padding: 0 10px !important;
  margin: 0 !important;
  font-family: var(--app-font-family, sans-serif) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  cursor: pointer !important;
  border: 1px solid var(--app-border, #dce5f1) !important;
  border-radius: var(--app-radius-btn, 10px) !important;
  background: var(--app-surface, #ffffff) !important;
  color: var(--app-text, #15243b) !important;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease !important;
}

body.app-screen .dataTables_paginate .paginate_button:hover:not(:where(.app-preview, .app-preview *)),
body.app-screen .dt-button:hover:not(:where(.app-preview, .app-preview *)) {
  background: var(--app-highlight, #e9f7f8) !important;
  border-color: var(--app-teal, #0b7b86) !important;
  color: var(--app-teal, #0b7b86) !important;
}

body.app-screen .dataTables_paginate .paginate_button.current:not(:where(.app-preview, .app-preview *)),
body.app-screen .dataTables_paginate .paginate_button.current:hover:not(:where(.app-preview, .app-preview *)) {
  background: var(--app-teal, #0b7b86) !important;
  border-color: var(--app-teal, #0b7b86) !important;
  color: #ffffff !important;
}

body.app-screen .dataTables_paginate .paginate_button.disabled:not(:where(.app-preview, .app-preview *)),
body.app-screen .dataTables_paginate .paginate_button.disabled:hover:not(:where(.app-preview, .app-preview *)) {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  background: #f8fafc !important;
  border-color: var(--app-border, #dce5f1) !important;
  color: var(--app-text-muted, #526782) !important;
}

body.app-screen .dataTables_paginate .paginate_button:focus-visible:not(:where(.app-preview, .app-preview *)) {
  outline: 2px solid var(--app-primary, #086ca2) !important;
  outline-offset: 2px !important;
}

@media (max-width: 767px) {
  body.app-screen .dataTables_paginate:not(:where(.app-preview, .app-preview *)) {
    justify-content: center !important;
  }

  body.app-screen .dataTables_paginate .paginate_button:not(:where(.app-preview, .app-preview *)),
  body.app-screen .dt-button:not(:where(.app-preview, .app-preview *)) {
    min-width: 44px !important;
    min-height: 44px !important;
    height: 44px !important;
    font-size: 14px !important;
  }
}

/* --------------------------------------------------------------------------
   Dense Table Scroller Headers & Action Columns (.app-table-scroll)
   Ensures multi-column tables retain legible headers and unbroken actions
   -------------------------------------------------------------------------- */

body.app-screen .app-table-scroll table th:not(:where(.app-preview, .app-preview *)) {
  white-space: nowrap !important;
}

body.app-screen .app-table-scroll table td.app-action-cell:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-table-scroll table td:last-child:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-table-scroll table th:last-child:not(:where(.app-preview, .app-preview *)) {
  white-space: nowrap !important;
}

body.app-screen .app-table-scroll table td.app-action-cell > *:not(:where(.app-preview, .app-preview *)),
body.app-screen .app-table-scroll table td:last-child > *:not(:where(.app-preview, .app-preview *)) {
  white-space: nowrap !important;
}

body.app-screen .FindServiceTableView table:not(:where(.app-preview, .app-preview *)) {
  min-width: 960px !important;
}

/* Layout hooks must preserve the native and UIkit hidden states. */
body.app-screen :is(.app-btn, .app-actions, .app-actions--record, .app-filter-actions, .app-segmented, .app-segmented__item):is([hidden], .uk-hidden):not(:where(.app-preview, .app-preview *)),
body.app-screen table.app-record-table tbody td.app-action-cell:is([hidden], .uk-hidden):not(:where(.app-preview, .app-preview *)),
body.app-screen td.app-action-cell:is([hidden], .uk-hidden):not(:where(.app-preview, .app-preview *)),
body.app-screen input.app-btn[type="hidden"]:not(:where(.app-preview, .app-preview *)) {
  display: none !important;
}
