/* ==========================================================================
   UmZeroDois — design system
   Camada visual sobre o Bootstrap 4 (grid, utilitários e plugins JS).
   Layout: sidebar grafite com a marca + workspace claro e denso para dados.

   Índice
   1. Fontes            6. Botões              11. Tabelas de dados
   2. Tokens            7. Formulários         12. Campos (dl)
   3. Base              8. Busca segmentada    13. Feedback (alertas, toasts, loading, vazio)
   4. Shell             9. Painéis              14. Componentes de domínio (placa, KPIs)
   5. Cabeçalho página 10. Badges/chips        15. Autenticação · 16. Utilitários
   ========================================================================== */

/* 1. Fontes (auto-hospedadas, licença OFL) -------------------------------- */
@font-face {
  font-family: "Sora";
  src: url("../fonts/Sora/Sora-latin-wght.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("../fonts/HankenGrotesk/HankenGrotesk-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/JetBrainsMono/JetBrainsMono-latin-wght.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

/* 2. Tokens ---------------------------------------------------------------- */
:root {
  /* Marca */
  --uz-yellow: #FDE000;
  --uz-yellow-hover: #F0D200;
  --uz-yellow-soft: #FFF7C2;
  --uz-ink: #121417;
  --uz-plate-blue: #003399;

  /* Neutros (ardósia com leve viés azul, para contrastar com o amarelo) */
  --bg: #F3F4F6;
  --surface: #FFFFFF;
  --surface-2: #F8F9FA;
  --surface-sunken: #EDEFF2;
  --border: #E1E4E9;
  --border-strong: #C9CED6;
  --control-border: #878E99;
  --text: #15181D;
  --text-2: #475060;
  --text-3: #687080;
  --on-accent: #121417;

  /* Semânticas (nunca usadas como acento) */
  --success: #157F3B;  --success-bg: #E7F5EC;
  --warning: #A84B05;  --warning-bg: #FDF0E1;
  --danger: #BF2A20;   --danger-bg: #FCEAE8;
  --info: #1D5BC9;     --info-bg: #E8EFFC;

  /* Interação */
  --focus: #15181D;
  --ring: rgba(253, 224, 0, .55);
  --row-hover: #F7F8FA;
  --row-selected: #FFFAD6;
  --link-underline: #E3C800;
  --overlay: rgba(13, 15, 18, .55);

  /* Sidebar (acompanha o tema; item ativo em amarelo da marca) */
  --side-bg: #FFFFFF;
  --side-border: #E1E4E9;
  --side-text: #475060;
  --side-text-strong: #15181D;
  --side-section: #687080;
  --side-hover: #F1F2F4;
  --side-active-bg: #FEF2A0;
  --side-active-text: #121417;
  --side-scroll: #D5D9DF;
  --side-focus: #15181D;

  /* Tipografia */
  --font-display: "Sora", ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  --font-body: "Hanken Grotesk", ui-sans-serif, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  --fs-xs: .75rem;     /* 12 */
  --fs-sm: .8125rem;   /* 13 */
  --fs-base: .9375rem; /* 15 */
  --fs-md: 1rem;       /* 16 */
  --fs-lg: 1.125rem;   /* 18 */
  --fs-xl: 1.375rem;   /* 22 */
  --fs-2xl: 1.75rem;   /* 28 */
  --fs-3xl: 2.125rem;  /* 34 */

  /* Espaço (base 4px) */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;

  /* Forma e profundidade */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-2: 0 4px 14px rgba(16, 24, 40, .08);
  --shadow-pop: 0 14px 36px rgba(16, 24, 40, .18);

  /* Layout */
  --sidebar-w: 248px;
  --sidebar-w-mini: 72px;
  --topbar-h: 60px;
  --content-max: 1320px;
  --control-h: 42px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  color-scheme: light;
}

@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D0F12;
    --surface: #15181D;
    --surface-2: #1A1E24;
    --surface-sunken: #101216;
    --border: #252A31;
    --border-strong: #353B45;
    --control-border: #636A77;
    --text: #E8EAED;
    --text-2: #B3B9C3;
    --text-3: #8C94A0;
    --success: #5BD38A;  --success-bg: rgba(91, 211, 138, .12);
    --warning: #F5A44B;  --warning-bg: rgba(245, 164, 75, .13);
    --danger: #FF7B70;   --danger-bg: rgba(255, 123, 112, .13);
    --info: #7FAEFF;     --info-bg: rgba(127, 174, 255, .13);
    --focus: #FDE000;
    --ring: rgba(253, 224, 0, .35);
    --row-hover: #1B1F25;
    --row-selected: rgba(253, 224, 0, .09);
    --link-underline: #FDE000;
    --overlay: rgba(0, 0, 0, .62);
    --side-bg: #0A0B0D;
    --side-border: #1B1E23;
    --side-text: #A7AEB8;
    --side-text-strong: #FFFFFF;
    --side-section: #7E8693;
    --side-hover: rgba(255, 255, 255, .06);
    --side-active-bg: rgba(253, 224, 0, .12);
    --side-active-text: #FDE000;
    --side-scroll: #2B3038;
    --side-focus: #FDE000;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 4px 14px rgba(0, 0, 0, .35);
    --shadow-pop: 0 16px 40px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
@media screen {
:root[data-theme="dark"] {
  --bg: #0D0F12;
  --surface: #15181D;
  --surface-2: #1A1E24;
  --surface-sunken: #101216;
  --border: #252A31;
  --border-strong: #353B45;
  --control-border: #636A77;
  --text: #E8EAED;
  --text-2: #B3B9C3;
  --text-3: #8C94A0;
  --success: #5BD38A;  --success-bg: rgba(91, 211, 138, .12);
  --warning: #F5A44B;  --warning-bg: rgba(245, 164, 75, .13);
  --danger: #FF7B70;   --danger-bg: rgba(255, 123, 112, .13);
  --info: #7FAEFF;     --info-bg: rgba(127, 174, 255, .13);
  --focus: #FDE000;
  --ring: rgba(253, 224, 0, .35);
  --row-hover: #1B1F25;
  --row-selected: rgba(253, 224, 0, .09);
  --link-underline: #FDE000;
  --overlay: rgba(0, 0, 0, .62);
  --side-bg: #0A0B0D;
  --side-border: #1B1E23;
  --side-text: #A7AEB8;
  --side-text-strong: #FFFFFF;
  --side-section: #7E8693;
  --side-hover: rgba(255, 255, 255, .06);
  --side-active-bg: rgba(253, 224, 0, .12);
  --side-active-text: #FDE000;
  --side-scroll: #2B3038;
  --side-focus: #FDE000;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 4px 14px rgba(0, 0, 0, .35);
  --shadow-pop: 0 16px 40px rgba(0, 0, 0, .55);
  color-scheme: dark;
}
}

/* 3. Base ------------------------------------------------------------------ */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01" 0;
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text);
  letter-spacing: -.01em;
  text-wrap: balance;
}
a { color: inherit; }
a:hover { color: inherit; }
p a, .link {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--link-underline);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
p a:hover, .link:hover { background: var(--uz-yellow-soft); color: var(--uz-ink); text-decoration-color: var(--uz-yellow); }
::selection { background: var(--uz-yellow); color: var(--uz-ink); }
hr { border-color: var(--border); }
.text-muted { color: var(--text-3) !important; }
small, .small { font-size: var(--fs-sm); }
code, kbd, .mono {
  font-family: var(--font-mono);
  font-size: .95em;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.num { font-variant-numeric: tabular-nums; }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -60px;
  z-index: 2000;
  padding: var(--sp-2) var(--sp-4);
  background: var(--uz-yellow);
  color: var(--uz-ink);
  font-weight: 700;
  border-radius: var(--r-md);
  transition: top .15s;
}
.skip-link:focus { top: var(--sp-3); color: var(--uz-ink); text-decoration: none; }
.sr-only-focusable:focus { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 4. Shell ----------------------------------------------------------------- */
.app-shell { min-height: 100vh; }

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  background: var(--side-bg);
  border-right: 1px solid var(--side-border);
}
/* Anima só quando o usuário aciona o menu (evita deslizes ao cruzar o breakpoint) */
body.sidebar-anim .app-sidebar { transition: width .2s var(--ease), transform .25s var(--ease); }
body.sidebar-anim .app-main { transition: margin-left .2s var(--ease); }
.sidebar-brand {
  display: flex;
  align-items: center;
  height: var(--topbar-h);
  padding: 0 var(--sp-5);
  border-bottom: 1px solid var(--side-border);
  flex-shrink: 0;
}
.sidebar-brand a { display: flex; align-items: center; border-radius: var(--r-md); }
.sidebar-brand .brand-full { display: flex; }
.sidebar-brand .brand-full img { height: 30px; width: auto; }
.sidebar-brand .brand-mini { height: 32px; width: 32px; display: none; }
/* Logo com texto escuro no tema claro e texto branco no escuro */
.sidebar-brand .logo-dark { display: none; }
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sidebar-brand .logo-light { display: none; }
  :root:not([data-theme="light"]) .sidebar-brand .logo-dark { display: block; }
}
@media screen {
  [data-theme="dark"] .sidebar-brand .logo-light { display: none; }
  [data-theme="dark"] .sidebar-brand .logo-dark { display: block; }
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-2) var(--sp-3) var(--sp-6);
  scrollbar-width: thin;
  scrollbar-color: var(--side-scroll) transparent;
}
.sidebar-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav-section {
  margin: var(--sp-5) var(--sp-3) var(--sp-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--side-section);
  white-space: nowrap;
}
.sidebar-nav .nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 40px;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  color: var(--side-text);
  font-size: var(--fs-base);
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color .15s, color .15s;
}
.sidebar-nav .nav-link .mdi { font-size: 20px; line-height: 1; width: 22px; text-align: center; flex-shrink: 0; }
.sidebar-nav .nav-link:hover { background: var(--side-hover); color: var(--side-text-strong); }
.sidebar-nav .nav-link.is-active {
  background: var(--side-active-bg);
  color: var(--side-text-strong);
  font-weight: 600;
}
.sidebar-nav .nav-link.is-active .mdi { color: var(--side-active-text); }
.sidebar-nav .nav-link:focus-visible { outline-color: var(--side-focus); outline-offset: -2px; }


.app-main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  height: var(--topbar-h);
  padding: 0 var(--sp-6);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
  .app-topbar { background: var(--surface); }
}
.topbar-brand { display: none; align-items: center; }
.topbar-brand img { height: 30px; width: 30px; }
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: var(--sp-2); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text-2);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-sunken); color: var(--text); }
.dropdown .icon-btn[aria-expanded="true"] { background: var(--surface-sunken); color: var(--text); }

.credit-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  height: 36px;
  padding: 0 var(--sp-2) 0 var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-sm);
  white-space: nowrap;
}
.credit-pill .mdi { color: var(--text-3); font-size: 18px; }
.credit-pill strong { font-family: var(--font-display); font-weight: 600; font-variant-numeric: tabular-nums; font-size: var(--fs-base); }
.credit-pill .credit-label { color: var(--text-3); }
.credit-pill .credit-add {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-left: var(--sp-1);
  border-radius: 50%;
  background: var(--uz-yellow);
  color: var(--uz-ink);
  font-size: 16px;
  text-decoration: none;
  transition: background-color .15s, transform .15s;
}
.credit-pill .credit-add:hover { background: var(--uz-yellow-hover); transform: scale(1.06); }
.credit-pill:not(:has(.credit-add)) { padding-right: var(--sp-3); }
.credit-pill.is-updated strong { animation: credit-flash 1.2s var(--ease); }
@keyframes credit-flash {
  0% { background: var(--uz-yellow); color: var(--uz-ink); border-radius: 4px; }
  100% { background: transparent; }
}

.profile-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  height: 38px;
  padding: 0 var(--sp-2) 0 4px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text);
  font-weight: 600;
  font-size: var(--fs-sm);
  cursor: pointer;
}
.profile-btn:hover, .profile-btn[aria-expanded="true"] { background: var(--surface-sunken); }
.profile-btn .mdi { color: var(--text-3); font-size: 18px; }
.avatar {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--uz-ink);
  color: var(--uz-yellow);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
}
@media screen { [data-theme="dark"] .avatar { background: var(--uz-yellow); color: var(--uz-ink); } }
@media screen and (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar { background: var(--uz-yellow); color: var(--uz-ink); } }

.app-content {
  flex: 1;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--sp-8) var(--sp-6) var(--sp-10);
  min-width: 0;
}
.app-content:focus { outline: none; }
.app-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-2);
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--sp-5) var(--sp-6) var(--sp-6);
  color: var(--text-3);
  font-size: var(--fs-xs);
}

/* Sidebar recolhida (desktop) */
@media (min-width: 992px) {
  body.sidebar-collapsed .app-sidebar { width: var(--sidebar-w-mini); }
  body.sidebar-collapsed .app-main { margin-left: var(--sidebar-w-mini); }
  body.sidebar-collapsed .sidebar-brand { padding: 0; justify-content: center; }
  body.sidebar-collapsed .sidebar-brand .brand-full { display: none; }
  body.sidebar-collapsed .sidebar-brand .brand-mini { display: block; }
  body.sidebar-collapsed .nav-section { height: 1px; margin: var(--sp-3) var(--sp-2); overflow: hidden; color: transparent; background: var(--side-border); }
  body.sidebar-collapsed .sidebar-nav .nav-link { justify-content: center; padding: var(--sp-2); }
  body.sidebar-collapsed .sidebar-nav .nav-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .sidebar-backdrop { display: none !important; }
}

/* Sidebar como gaveta (tablet/celular) */
@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-100%); box-shadow: none; }
  body.sidebar-open .app-sidebar { transform: none; box-shadow: var(--shadow-pop); }
  .app-main { margin-left: 0; }
  .topbar-brand { display: flex; }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1035;
    background: var(--overlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s, visibility .2s;
  }
  body.sidebar-open .sidebar-backdrop { opacity: 1; visibility: visible; }
  body.sidebar-open { overflow: hidden; }
}
@media (max-width: 767.98px) {
  .app-topbar { padding: 0 var(--sp-3); gap: var(--sp-1); }
  .app-content { padding: var(--sp-6) var(--sp-4) var(--sp-8); }
  .app-footer { padding: var(--sp-4); }
  .credit-pill .credit-label, .profile-btn .profile-name, .profile-btn .mdi { display: none; }
  .profile-btn { padding: 0 4px; }
}

/* Dropdowns */
.dropdown-menu {
  min-width: 240px;
  padding: var(--sp-2);
  margin-top: var(--sp-2) !important;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  color: var(--text);
  font-size: var(--fs-base);
}
.dropdown-header {
  padding: var(--sp-2) var(--sp-3);
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  color: var(--text);
  font-weight: 500;
}
.dropdown-item .mdi { font-size: 18px; color: var(--text-3); }
.dropdown-item:hover, .dropdown-item:focus { background: var(--surface-sunken); color: var(--text); }
.dropdown-item:active { background: var(--uz-yellow-soft); color: var(--uz-ink); }
.dropdown-item.is-danger, .dropdown-item.is-danger .mdi { color: var(--danger); }
.dropdown-divider { border-top-color: var(--border); margin: var(--sp-2) 0; }
.dropdown-profile { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3) var(--sp-3); }
.dropdown-profile strong { display: block; font-size: var(--fs-base); line-height: 1.2; }
.dropdown-profile span { color: var(--text-3); font-size: var(--fs-sm); }
.dropdown-empty { padding: var(--sp-6) var(--sp-4); text-align: center; color: var(--text-3); font-size: var(--fs-sm); }
.dropdown-empty .mdi { display: block; font-size: 28px; margin-bottom: var(--sp-2); color: var(--border-strong); }

/* 5. Cabeçalho da página --------------------------------------------------- */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}
.page-header > div:first-child { min-width: 0; max-width: 72ch; }
.page-eyebrow {
  margin: 0 0 var(--sp-1);
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.page-title {
  margin: 0;
  font-size: var(--fs-2xl);
  font-weight: 600;
  line-height: 1.2;
}
.page-subtitle { margin: var(--sp-2) 0 0; color: var(--text-2); font-size: var(--fs-md); }
.page-header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  margin-bottom: var(--sp-3);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
}
.back-link:hover { color: var(--text); text-decoration: none; }
@media (max-width: 767.98px) {
  .page-title { font-size: var(--fs-xl); }
  .page-subtitle { font-size: var(--fs-base); }
}

/* 6. Botões ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--control-h);
  padding: 0 var(--sp-5);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: .005em;
  white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
}
.btn .mdi { font-size: 18px; line-height: 1; }
.btn:focus, .btn.focus { box-shadow: none; }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { min-height: 34px; padding: 0 var(--sp-3); font-size: var(--fs-sm); }
.btn-lg { min-height: 48px; padding: 0 var(--sp-6); font-size: var(--fs-md); }
.btn-block { display: flex; width: 100%; }

.btn-primary,
.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active,
.btn-primary:disabled {
  background: var(--uz-yellow);
  border-color: var(--uz-yellow);
  color: var(--on-accent);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .08);
}
.btn-primary:hover, .btn-primary:focus { background: var(--uz-yellow-hover); border-color: var(--uz-yellow-hover); color: var(--on-accent); }

.btn-secondary, .btn-outline, .btn-light,
.btn-secondary:not(:disabled):not(.disabled):active,
.btn-secondary:disabled {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
  box-shadow: var(--shadow-1);
}
.btn-secondary:hover, .btn-secondary:focus, .btn-outline:hover, .btn-light:hover {
  background: var(--surface-2);
  border-color: var(--text-3);
  color: var(--text);
}

.btn-dark, .btn-dark:not(:disabled):not(.disabled):active {
  background: var(--uz-ink);
  border-color: var(--uz-ink);
  color: #fff;
}
.btn-dark:hover, .btn-dark:focus { background: #000; border-color: #000; color: var(--uz-yellow); }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}
.btn-ghost:hover, .btn-ghost:focus { background: var(--surface-sunken); color: var(--text); }

/* Variantes legadas do Bootstrap mantidas coerentes */
.btn-success, .btn-warning, .btn-info, .btn-danger,
.btn-success:not(:disabled):not(.disabled):active,
.btn-warning:not(:disabled):not(.disabled):active {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-success .mdi { color: var(--success); }
.btn-danger { color: var(--danger); }
.btn-success:hover, .btn-warning:hover, .btn-info:hover, .btn-danger:hover { background: var(--surface-2); color: var(--text); border-color: var(--text-3); }

.btn .spinner-border { width: 1rem; height: 1rem; border-width: 2px; }
.btn-group-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }

/* 7. Formulários ----------------------------------------------------------- */
label, .form-label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.label-hint { color: var(--text-3); font-weight: 500; }
.form-group { margin-bottom: var(--sp-4); }
.form-control,
.custom-select {
  height: var(--control-h);
  padding: 0 var(--sp-3);
  background-color: var(--surface);
  border: 1px solid var(--control-border);
  border-radius: var(--r-md);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  box-shadow: var(--shadow-1);
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
select.form-control { padding-right: var(--sp-2); cursor: pointer; }
textarea.form-control { height: auto; padding: var(--sp-2) var(--sp-3); }
.form-control::placeholder { color: var(--text-3); opacity: .85; }
.form-control:hover { border-color: var(--text-2); }
.form-control:focus,
.custom-select:focus {
  background-color: var(--surface);
  border-color: var(--text);
  color: var(--text);
  box-shadow: 0 0 0 3px var(--ring);
  outline: none;
}
.form-control[readonly], .form-control:disabled {
  background: var(--surface-sunken);
  color: var(--text-2);
  box-shadow: none;
  cursor: not-allowed;
}
.form-control.is-invalid { border-color: var(--danger); background-image: none; padding-right: var(--sp-3); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px var(--danger-bg); }
.invalid-feedback { color: var(--danger); font-size: var(--fs-sm); }
.form-text { margin-top: 6px; color: var(--text-3); font-size: var(--fs-sm); }
.form-control-lg { height: 48px; font-size: var(--fs-md); }
.mono-input { font-family: var(--font-mono); letter-spacing: .02em; }

.input-icon { position: relative; }
.input-icon > .mdi {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 18px;
  pointer-events: none;
}
.input-icon > .form-control { padding-left: 38px; }
.input-icon > .input-action {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
}

/* Switch (Bootstrap custom-switch) */
.custom-control-label { color: var(--text); font-size: var(--fs-base); font-weight: 500; cursor: pointer; }
.custom-control-label::before {
  background: var(--surface-sunken);
  border: 1px solid var(--control-border);
}
.custom-switch .custom-control-label::after { background-color: var(--text-3); }
.custom-control-input:checked ~ .custom-control-label::before { background: var(--uz-ink); border-color: var(--uz-ink); }
.custom-switch .custom-control-input:checked ~ .custom-control-label::after { background-color: var(--uz-yellow); }
.custom-control-input:focus ~ .custom-control-label::before { box-shadow: 0 0 0 3px var(--ring); }
.custom-control-input:focus:not(:checked) ~ .custom-control-label::before { border-color: var(--text); }
@media screen { [data-theme="dark"] .custom-control-input:checked ~ .custom-control-label::before { background: var(--uz-yellow); border-color: var(--uz-yellow); } }
@media screen { [data-theme="dark"] .custom-switch .custom-control-input:checked ~ .custom-control-label::after { background-color: var(--uz-ink); } }
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .custom-control-input:checked ~ .custom-control-label::before { background: var(--uz-yellow); border-color: var(--uz-yellow); }
  :root:not([data-theme="light"]) .custom-switch .custom-control-input:checked ~ .custom-control-label::after { background-color: var(--uz-ink); }
}

/* Upload em área de soltar (Bootstrap custom-file) */
.dropzone-file.custom-file { height: auto; display: block; }
.dropzone-file .custom-file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  z-index: 2;
  opacity: 0;
  cursor: pointer;
}
.dropzone-file .custom-file-label {
  position: static;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  height: auto;
  min-height: 160px;
  margin: 0;
  padding: var(--sp-6);
  background: var(--surface-2);
  border: 1.5px dashed var(--control-border);
  border-radius: var(--r-lg);
  color: var(--text-2);
  font-size: var(--fs-base);
  font-weight: 500;
  text-align: center;
  transition: border-color .15s, background-color .15s;
}
.dropzone-file .custom-file-label::after { display: none; }
.dropzone-file .custom-file-label .mdi { font-size: 32px; color: var(--text-3); }
.dropzone-file .custom-file-label strong { color: var(--text); }
.dropzone-file:hover .custom-file-label,
.dropzone-file.is-dragover .custom-file-label { border-color: var(--text); background: var(--surface); }
.dropzone-file .custom-file-input:focus-visible ~ .custom-file-label { border-color: var(--text); box-shadow: 0 0 0 3px var(--ring); }
.dropzone-file.has-file .custom-file-label { border-style: solid; border-color: var(--success); background: var(--success-bg); }
.dropzone-file.has-file .custom-file-label .mdi { color: var(--success); }
.file-name { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text); word-break: break-all; }

/* 8. Busca segmentada ------------------------------------------------------ */
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  max-width: 100%;
}
.segmented-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 var(--sp-4);
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s, color .15s, box-shadow .15s;
}
.segmented-item .mdi { font-size: 16px; }
.segmented-item:hover { color: var(--text); background: color-mix(in srgb, var(--surface) 55%, transparent); }
.segmented-item.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .1), 0 0 0 1px var(--border);
}
.segmented-item.active .mdi { color: var(--text); }
.segmented-item:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
@media (max-width: 575.98px) {
  .segmented { display: flex; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .segmented::-webkit-scrollbar { display: none; }
  .segmented-item { flex: 1 0 auto; justify-content: center; padding: 0 var(--sp-3); }
}

.search-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-4);
  align-items: start;
}
.search-grid > .form-group { margin: 0; }
.search-grid .span-2 { grid-column: span 2; }
.search-grid .span-full { grid-column: 1 / -1; }
@media (max-width: 991.98px) { .search-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) {
  .search-grid { grid-template-columns: minmax(0, 1fr); }
  .search-grid .span-2, .search-grid .span-full { grid-column: auto; }
}
.search-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-top: var(--sp-5);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border);
}
.search-options .custom-control { margin: 0; }
.option-hint { display: block; color: var(--text-3); font-size: var(--fs-sm); font-weight: 400; }
.section-label {
  margin: 0 0 var(--sp-3);
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* 9. Painéis --------------------------------------------------------------- */
.panel,
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  color: var(--text);
}
.panel + .panel { margin-top: var(--sp-5); }
.panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
}
.panel-title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 600;
}
.panel-title .mdi { color: var(--text-3); font-size: 18px; }
.panel-meta { color: var(--text-3); font-size: var(--fs-sm); }
.panel-actions { margin-left: auto; display: flex; gap: var(--sp-2); align-items: center; }
.panel-body { padding: var(--sp-5); }
.panel-body > :last-child { margin-bottom: 0; }
.panel-flush { padding: 0; }
.panel-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.panel-grid { display: grid; gap: var(--sp-5); margin-top: var(--sp-5); }
.panel-grid > .panel { margin: 0; min-width: 0; }
.panel-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel-grid.detail-split { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.panel-grid > .panel:only-child { grid-column: 1 / -1; }
@media (max-width: 991.98px) { .panel-grid.cols-2, .panel-grid.detail-split { grid-template-columns: minmax(0, 1fr); } }
.stack > * + * { margin-top: var(--sp-5); }
@media (max-width: 767.98px) {
  .panel-header, .panel-body, .panel-footer { padding-left: var(--sp-4); padding-right: var(--sp-4); }
}

/* Compatibilidade com o markup Bootstrap/Corona das telas legadas */
.card-body { padding: var(--sp-6); }
.card-title {
  margin-bottom: var(--sp-5);
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--text);
  text-transform: none;
}
.card-description { color: var(--text-2); margin-bottom: var(--sp-5); }
.grid-margin { margin-bottom: var(--sp-5); }
.stretch-card { display: flex; align-items: stretch; }
.stretch-card > .card { width: 100%; min-width: 0; }
@media (max-width: 767.98px) { .card-body { padding: var(--sp-4); } }

/* 10. Badges e chips ------------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 500;
  white-space: nowrap;
}
.chip .mdi { font-size: 15px; color: var(--text-3); }
.chip strong { color: var(--text); font-weight: 650; }
.chip-cost { background: var(--uz-yellow-soft); border-color: transparent; color: #5A4A00; }
.chip-cost .mdi { color: #5A4A00; }
@media screen { [data-theme="dark"] .chip-cost { background: rgba(253, 224, 0, .12); color: var(--uz-yellow); } }
@media screen { [data-theme="dark"] .chip-cost .mdi { color: var(--uz-yellow); } }
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .chip-cost { background: rgba(253, 224, 0, .12); color: var(--uz-yellow); }
  :root:not([data-theme="light"]) .chip-cost .mdi { color: var(--uz-yellow); }
}

.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--r-pill);
  background: var(--surface-sunken);
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px 2px 7px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--surface-sunken);
  color: var(--text-2);
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-success { background: var(--success-bg); color: var(--success); }
.status-warning { background: var(--warning-bg); color: var(--warning); }
.status-danger { background: var(--danger-bg); color: var(--danger); }
.status-info { background: var(--info-bg); color: var(--info); }

.badge { font-weight: 600; border-radius: var(--r-pill); }

.score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.score-dots { display: inline-flex; gap: 3px; }
.score-dots i { width: 6px; height: 6px; border-radius: 2px; background: var(--border-strong); }
.score-dots i.on { background: var(--text); }

/* 11. Tabelas de dados ----------------------------------------------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table {
  margin: 0;
  color: var(--text);
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
  background: transparent;
}
.table th, .table td {
  padding: 11px var(--sp-4);
  border-top: 0;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding-top: 10px;
  padding-bottom: 10px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody + tbody { border-top: 1px solid var(--border); }
.table-bordered, .table-bordered th, .table-bordered td { border-left: 0; border-right: 0; }
.table-bordered { border: 0; }
.table-hover tbody tr:hover, .data-table tbody tr:hover { background: var(--row-hover); color: var(--text); }
.data-table td.cell-strong, .data-table td .cell-strong { font-weight: 600; }
.data-table .cell-muted { color: var(--text-3); }
.data-table .cell-end { text-align: right; }
.data-table .col-action { width: 44px; text-align: right; color: var(--text-3); }
.data-table tr.is-clickable { cursor: pointer; }
.data-table tr.is-clickable:hover .col-action { color: var(--text); }
.data-table tr.is-clickable:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; background: var(--row-selected); }
.data-table tr.is-selected { background: var(--row-selected); }
.data-table a.row-link {
  color: var(--text);
  text-decoration: none;
}
.data-table a.row-link:hover { text-decoration: underline; text-decoration-color: var(--link-underline); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.panel > .table-wrap:last-child .table tbody tr:last-child td:first-child { border-bottom-left-radius: var(--r-lg); }
.empty-cell { color: var(--text-3); }

/* Tabelas viram cartões no celular (td[data-title]) */
@media screen and (max-width: 767.98px) {
  .responsive-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .responsive-table, .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; }
  .responsive-table tr {
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--border);
  }
  .responsive-table tbody tr:last-child { border-bottom: 0; }
  .responsive-table td {
    display: grid;
    grid-template-columns: minmax(96px, 38%) minmax(0, 1fr);
    gap: var(--sp-3);
    padding: 5px 0;
    border: 0;
    justify-items: start;
    text-align: left !important;
    overflow-wrap: anywhere;
  }
  .responsive-table td::before {
    content: attr(data-title);
    color: var(--text-3);
    font-family: var(--font-body);
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding-top: 2px;
  }
  .responsive-table td:not([data-title])::before { content: none; }
  .responsive-table td:not([data-title]) { display: block; }
  .responsive-table td.col-action { display: none; }
  .responsive-table td[colspan] { display: block; }
  .responsive-table td[colspan]::before { content: none; }
}

/* 12. Campos (fichas de registro) ----------------------------------------- */
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: var(--sp-5) var(--sp-6);
  margin: 0;
}
.field { min-width: 0; }
.field dt, .field-label {
  margin: 0 0 4px;
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.field dd, .field-value {
  margin: 0;
  color: var(--text);
  font-size: var(--fs-base);
  font-weight: 500;
  overflow-wrap: anywhere;
}
.field dd.mono { font-size: .9rem; }
.field dd.field-big { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.15; }
.field--wide { grid-column: span 2; }
.field--full { grid-column: 1 / -1; }
@media (max-width: 575.98px) {
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
  .field--wide { grid-column: 1 / -1; }
}
.field-empty { color: var(--text-3); font-weight: 400; }
.field-group + .field-group { margin-top: var(--sp-6); padding-top: var(--sp-6); border-top: 1px solid var(--border); }

/* 13. Feedback ------------------------------------------------------------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-size: var(--fs-base);
}
.alert > .mdi { font-size: 20px; line-height: 1.2; flex-shrink: 0; }
.alert .alert-body { flex: 1; min-width: 0; }
.alert .alert-body strong { display: block; }
.alert a { color: inherit; font-weight: 700; text-decoration: underline; }
.alert .close { position: static; padding: 0 4px; margin-left: auto; color: inherit; opacity: .7; text-shadow: none; font-size: 22px; line-height: 1; }
.alert .close:hover { opacity: 1; }
.alert-success { background: var(--success-bg); border-color: color-mix(in srgb, var(--success) 25%, transparent); color: var(--success); }
.alert-danger { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 25%, transparent); color: var(--danger); }
.alert-warning { background: var(--warning-bg); border-color: color-mix(in srgb, var(--warning) 25%, transparent); color: var(--warning); }
.alert-info { background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 25%, transparent); color: var(--info); }
.alert .alert-body { color: var(--text); }

/* Toasts */
.toast-stack {
  position: fixed;
  right: var(--sp-5);
  bottom: var(--sp-5);
  z-index: 1090;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.uz-toast {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  color: var(--text);
  pointer-events: auto;
  animation: toast-in .25s var(--ease);
}
.uz-toast.is-leaving { animation: toast-out .2s var(--ease) forwards; }
.uz-toast > .mdi { font-size: 20px; line-height: 1.25; }
.uz-toast-body { flex: 1; min-width: 0; font-size: var(--fs-base); }
.uz-toast-body strong { display: block; font-weight: 650; }
.uz-toast-body p { margin: 2px 0 0; color: var(--text-2); font-size: var(--fs-sm); }
.uz-toast-body a { display: inline-block; margin-top: 6px; font-size: var(--fs-sm); }
.uz-toast .icon-btn { width: 28px; height: 28px; font-size: 16px; }
.uz-toast.is-success > .mdi { color: var(--success); }
.uz-toast.is-error > .mdi { color: var(--danger); }
.uz-toast.is-warning > .mdi { color: var(--warning); }
.uz-toast.is-info > .mdi { color: var(--info); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }
@media (max-width: 575.98px) {
  .toast-stack { left: 50%; right: auto; transform: translateX(-50%); bottom: var(--sp-4); }
}

/* Carregamento */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  background: var(--overlay);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.loading-card {
  width: min(420px, 100%);
  padding: var(--sp-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-pop);
  color: var(--text);
  text-align: left;
}
.loading-card h2 { margin: var(--sp-4) 0 var(--sp-1); font-size: var(--fs-lg); font-weight: 600; }
.loading-card p { margin: 0; color: var(--text-2); font-size: var(--fs-base); }
.loading-card .loading-note { margin-top: var(--sp-4); color: var(--text-3); font-size: var(--fs-sm); display: flex; gap: 6px; align-items: center; }
.progress-indeterminate {
  position: relative;
  height: 6px;
  margin-top: var(--sp-5);
  overflow: hidden;
  border-radius: var(--r-pill);
  background: var(--surface-sunken);
}
.progress-indeterminate::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  border-radius: inherit;
  background: var(--uz-yellow);
  animation: indeterminate 1.4s var(--ease) infinite;
}
@keyframes indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(260%); }
}
.spinner-ring {
  display: inline-block;
  width: 36px;
  height: 36px;
  border: 3px solid var(--surface-sunken);
  border-top-color: var(--uz-ink);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@media screen { [data-theme="dark"] .spinner-ring { border-top-color: var(--uz-yellow); } }
@media screen and (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .spinner-ring { border-top-color: var(--uz-yellow); } }
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  display: block;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--surface-sunken) 0%, var(--surface-2) 50%, var(--surface-sunken) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton-row td { padding-top: 16px; padding-bottom: 16px; }

/* Estado vazio */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-10) var(--sp-5);
  text-align: center;
  color: var(--text-2);
}
.empty-state .empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: var(--sp-2);
  border-radius: 50%;
  background: var(--surface-sunken);
  color: var(--text-3);
  font-size: 26px;
}
.empty-state h3 { margin: 0; font-size: var(--fs-md); font-weight: 600; }
.empty-state p { margin: 0; max-width: 46ch; font-size: var(--fs-base); }
.empty-state .btn { margin-top: var(--sp-3); }
.empty-state.is-error .empty-icon { background: var(--danger-bg); color: var(--danger); }
.empty-state.is-warning .empty-icon { background: var(--warning-bg); color: var(--warning); }
.empty-state.is-success .empty-icon { background: var(--success-bg); color: var(--success); }
.empty-state h2 { margin: 0; font-size: var(--fs-lg); font-weight: 600; }

/* Modal */
.modal-backdrop.show { opacity: 1; background: var(--overlay); }
.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-pop);
  color: var(--text);
}
.modal-header, .modal-footer { border-color: var(--border); padding: var(--sp-4) var(--sp-5); }
.modal-body { padding: var(--sp-5); color: var(--text-2); }
.modal-title { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 600; }
.modal-header .close { color: var(--text-2); text-shadow: none; opacity: .8; }
.modal-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; margin-bottom: var(--sp-3); font-size: 22px; }
.modal-icon.is-success { background: var(--success-bg); color: var(--success); }
.modal-icon.is-error { background: var(--danger-bg); color: var(--danger); }

/* 14. Componentes de domínio ---------------------------------------------- */

/* Placa Mercosul */
.plate {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 168px;
  overflow: hidden;
  border: 2px solid #1A1C20;
  border-radius: 7px;
  background: #FFFFFF;
  color: #111;
  box-shadow: var(--shadow-1);
}
.plate-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 8px;
  background: var(--uz-plate-blue);
  color: #fff;
  font-family: var(--font-body);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .28em;
  line-height: 1.3;
}
.plate-band::before, .plate-band::after { content: ""; width: 10px; height: 7px; border-radius: 1px; background: rgba(255, 255, 255, .35); }
.plate-band::after { background: linear-gradient(180deg, #009C3B 0 50%, #FFDF00 50% 100%); }
.plate-chars {
  padding: 2px 12px 4px;
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.15;
  text-align: center;
  text-transform: uppercase;
}
.plate-input { display: inline-flex; flex-direction: column; width: 100%; max-width: 280px; }
.plate-input .plate { width: 100%; transition: box-shadow .15s, border-color .15s; }
.plate-input input {
  width: 100%;
  border: 0;
  background: transparent;
  color: #111;
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .1em;
  text-align: center;
  text-transform: uppercase;
  padding: 2px 8px 4px;
  outline: none;
}
.plate-input input::placeholder { color: #B9BEC6; letter-spacing: .1em; }
.plate-input .plate:focus-within { box-shadow: 0 0 0 4px var(--ring); border-color: #000; }

.plate-search { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sp-4); }
.plate-search .form-group { flex: 0 1 280px; }
@media (max-width: 575.98px) {
  .plate-search .form-group, .plate-input { flex-basis: 100%; max-width: none; }
  .plate-search .btn-group-actions { width: 100%; }
  .plate-search .btn-group-actions .btn-primary { flex: 1; }
}

/* Ficha do veículo */
.vehicle-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-5);
}
.vehicle-hero .vehicle-name { margin: 0; font-size: var(--fs-xl); font-weight: 600; }
.vehicle-hero .vehicle-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); }
.fipe-value { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }

/* Ficha de pessoa / empresa */
.profile-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-5);
}
.profile-photo, .profile-initials {
  width: 72px;
  height: 72px;
  border-radius: var(--r-lg);
  flex-shrink: 0;
  object-fit: cover;
}
.profile-initials {
  display: grid;
  place-items: center;
  background: var(--uz-ink);
  color: var(--uz-yellow);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
}
.profile-hero .profile-main { flex: 1; min-width: 220px; }
.profile-hero h1, .profile-hero h2 { margin: 0; font-size: var(--fs-xl); font-weight: 600; line-height: 1.25; }
.profile-hero .profile-id { margin-top: 4px; color: var(--text-2); font-family: var(--font-mono); font-size: var(--fs-sm); }
.profile-hero .profile-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-3); }

.section-nav {
  position: sticky;
  top: var(--topbar-h);
  z-index: 5;
  display: flex;
  gap: var(--sp-1);
  margin: var(--sp-5) calc(-1 * var(--sp-1)) 0;
  padding: var(--sp-2) var(--sp-1);
  overflow-x: auto;
  background: var(--bg);
  scrollbar-width: none;
}
.section-nav::-webkit-scrollbar { display: none; }
.section-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-pill);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}
.section-nav a:hover { background: var(--surface-sunken); color: var(--text); }
.section-nav a .count-badge { height: 18px; min-width: 18px; font-size: 11px; background: var(--surface); }
[id^="sec-"] { scroll-margin-top: calc(var(--topbar-h) + 64px); }
#empresaInfo, #veiculoInfo { scroll-margin-top: calc(var(--topbar-h) + var(--sp-4)); }

/* Recarga de créditos ----------------------------------------------------- */
/* Checkout em página única: escolhas à esquerda, resumo fixo com a "carteira" à direita. */
.recarga-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--sp-8); align-items: start; }
.recarga-main { display: grid; gap: var(--sp-8); min-width: 0; container-type: inline-size; }
.recarga-side { position: sticky; top: calc(var(--topbar-h) + var(--sp-6)); min-width: 0; }
@media (max-width: 1199.98px) { .recarga-grid { grid-template-columns: minmax(0, 1fr) 340px; gap: var(--sp-6); } }
@media (max-width: 991.98px) {
  .recarga-grid { grid-template-columns: minmax(0, 1fr); }
  .recarga-side { position: static; }
}

.step-title { display: flex; align-items: center; gap: var(--sp-3); margin: 0 0 var(--sp-4); font-size: var(--fs-lg); font-weight: 600; }
.step-num {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--uz-ink);
  color: var(--uz-yellow);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
}
.step-note { display: flex; align-items: center; gap: 6px; margin: var(--sp-4) 0 0; color: var(--text-3); font-size: var(--fs-sm); }
.step-note .mdi { color: var(--success); font-size: 16px; }

/* Pacotes (rótulos de rádio) */
.pkg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); padding-top: 10px; }
@container (min-width: 620px) { .pkg-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pkg, .method { margin: 0; color: var(--text); font-size: var(--fs-base); font-weight: 400; cursor: pointer; }
.pkg {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: var(--sp-4);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-1);
  transition: border-color .15s, box-shadow .2s, transform .15s;
}
.pkg:hover { border-color: var(--border-strong); box-shadow: var(--shadow-2); transform: translateY(-2px); }
.pkg:has(input:checked) { border-color: var(--focus); box-shadow: 0 0 0 4px var(--ring), var(--shadow-2); }
.pkg:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 4px; }
.pkg--featured { background: linear-gradient(180deg, color-mix(in srgb, var(--uz-yellow) 16%, var(--surface)) 0%, var(--surface) 72%); }
.pkg-badge {
  position: absolute;
  top: -10px;
  left: 14px;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  background: var(--uz-ink);
  color: var(--uz-yellow);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.pkg-check {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  color: transparent;
  font-size: 14px;
  transition: background-color .15s, border-color .15s;
}
.pkg:has(input:checked) .pkg-check { background: var(--uz-yellow); border-color: var(--uz-yellow); color: var(--uz-ink); animation: pop .28s var(--ease); }
.pkg-qty {
  margin-top: var(--sp-2);
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.03em;
  line-height: 1;
}
.pkg-label { margin-top: 2px; color: var(--text-3); font-size: var(--fs-sm); }
.pkg-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px dashed var(--border-strong);
}
.pkg-price strong { font-family: var(--font-display); font-size: var(--fs-md); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pkg-off { padding: 1px 7px; border-radius: var(--r-pill); background: var(--success-bg); color: var(--success); font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pkg-unit { margin-top: 4px; color: var(--text-3); font-size: var(--fs-xs); }
@keyframes pop { 0% { transform: scale(.6); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* Forma de pagamento */
.method-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-4); }
@container (max-width: 459.98px) { .method-grid { grid-template-columns: minmax(0, 1fr); } }
.method {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-1);
  transition: border-color .15s, box-shadow .2s;
}
.method:hover { border-color: var(--border-strong); }
.method:has(input:checked) { border-color: var(--focus); box-shadow: 0 0 0 4px var(--ring); }
.method:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 4px; }
.method-icon { display: grid; place-items: center; width: 42px; height: 42px; flex-shrink: 0; border-radius: 10px; background: var(--surface-sunken); color: var(--text); font-size: 22px; }
.method-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.method-text strong { font-weight: 650; }
.method-text small { color: var(--text-3); font-size: var(--fs-sm); }
.method-radio { width: 20px; height: 20px; flex-shrink: 0; border: 1.5px solid var(--control-border); border-radius: 50%; transition: border-width .15s, border-color .15s; }
.method:has(input:checked) .method-radio { border: 6px solid var(--focus); }

.pay-panel { border-radius: 14px; }
.checkout-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.checkout-fields .form-group { margin: 0; }
.checkout-fields .span-full { grid-column: 1 / -1; }
@container (max-width: 399.98px) { .checkout-fields { grid-template-columns: minmax(0, 1fr); } }
.mp-field { display: flex; align-items: center; padding-top: 0; padding-bottom: 0; }
/* O SDK grava color-scheme: normal no iframe; com a página escura o Chrome pinta o campo de branco */
.mp-field iframe { display: block; width: 100%; height: 100%; border: 0; color-scheme: light !important; }
.mp-field:focus-within { border-color: var(--text); box-shadow: 0 0 0 3px var(--ring); }
.mp-field-wrap { position: relative; }
.mp-field-wrap .mp-field { padding-right: 56px; }
.card-brand { position: absolute; top: 50%; right: 12px; height: 22px; width: auto; transform: translateY(-50%); pointer-events: none; }
.field-errors { margin-top: var(--sp-4); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--danger-bg); color: var(--danger); font-size: var(--fs-sm); }
.field-errors:empty { display: none; }
.field-errors p { margin: 0; }
#cartaoIndisponivel:not(:empty) { margin-top: var(--sp-4); }

.pix-intro { display: flex; align-items: center; gap: var(--sp-4); }
.pix-intro-icon { display: grid; place-items: center; width: 48px; height: 48px; flex-shrink: 0; border-radius: 12px; background: color-mix(in srgb, #32BCAD 14%, var(--surface)); }
.pix-intro p { margin: 0; color: var(--text-2); }
.pix-payer { margin: var(--sp-5) 0 0; padding: var(--sp-4); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); }

/* Resumo com a carteira */
.order-card { overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-2); }
.wallet {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: var(--sp-6);
  background: radial-gradient(120% 100% at 100% 0%, rgba(253, 224, 0, .22) 0%, rgba(253, 224, 0, 0) 55%), var(--uz-ink);
  color: #fff;
}
.wallet::before {
  content: "1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2";
  position: absolute;
  z-index: -1;
  right: -30px;
  bottom: -40px;
  width: 300px;
  color: rgba(253, 224, 0, .07);
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: .5em;
  word-break: break-all;
  transform: rotate(-12deg);
  -webkit-mask-image: linear-gradient(200deg, #000 15%, transparent 80%);
  mask-image: linear-gradient(200deg, #000 15%, transparent 80%);
  pointer-events: none;
}
.wallet-head { display: flex; align-items: center; justify-content: space-between; }
.wallet-label { margin: 0; color: #B9BFC8; font-family: var(--font-body); font-size: var(--fs-sm); font-weight: 600; letter-spacing: .02em; }
.wallet-mark { width: 28px; height: 28px; }
.wallet-qty { margin: var(--sp-3) 0 0; color: #fff; font-size: var(--fs-lg); font-weight: 600; }
.wallet-qty span {
  margin-right: 6px;
  color: var(--uz-yellow);
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.03em;
  line-height: 1;
}
.wallet-unit { margin: var(--sp-1) 0 0; color: #B9BFC8; font-size: var(--fs-sm); }
.wallet-balance {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
  padding: var(--sp-3) var(--sp-4);
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
}
.wallet-balance span { display: block; color: #9AA1AC; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.wallet-balance strong { color: #fff; font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 600; font-variant-numeric: tabular-nums; }
.wallet-balance div:last-child { text-align: right; }
.wallet-balance div:last-child strong { color: var(--uz-yellow); }
.wallet-balance .mdi { color: #6E7581; font-size: 18px; }

.order-body { padding: var(--sp-5) var(--sp-6) var(--sp-6); }
.order-lines { display: grid; gap: var(--sp-2); margin: 0; font-size: var(--fs-sm); }
.order-lines > div { display: flex; justify-content: space-between; gap: var(--sp-3); }
.order-lines dt { color: var(--text-2); font-weight: 500; }
.order-lines dd { margin: 0; font-variant-numeric: tabular-nums; }
.order-lines s { color: var(--text-3); }
.order-lines .is-discount dd { color: var(--success); font-weight: 600; }
.order-total { display: flex; align-items: baseline; justify-content: space-between; margin: var(--sp-4) 0 var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--border); }
.order-total span { color: var(--text-2); font-weight: 600; }
.order-total strong { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.btn-pay { min-height: 54px; border-radius: 12px; font-size: var(--fs-md); box-shadow: 0 10px 24px -10px rgba(253, 224, 0, .85), inset 0 -1px 0 rgba(0, 0, 0, .08); }
.btn-pay:hover { box-shadow: 0 12px 28px -10px rgba(253, 224, 0, .95), inset 0 -1px 0 rgba(0, 0, 0, .08); }
.btn-pay img { width: 18px; height: 18px; }
#pagamentoErro .alert { margin-bottom: var(--sp-4); }
.pay-error-actions { margin-top: var(--sp-2); }
.order-body .secure-note { display: flex; align-items: flex-start; gap: 6px; margin: var(--sp-4) 0 0; color: var(--text-3); font-size: var(--fs-xs); line-height: 1.5; }
.order-body .secure-note .mdi { font-size: 15px; }

/* Barra de pagamento no celular */
.mobile-paybar { display: none; }
@media (max-width: 991.98px) {
  .recarga { padding-bottom: 76px; }
  .mobile-paybar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    padding: var(--sp-3) max(16px, env(safe-area-inset-right, 0px)) calc(var(--sp-3) + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -10px 30px rgba(16, 24, 40, .1);
    transform: translateY(110%);
    transition: transform .25s var(--ease);
  }
  .mobile-paybar.is-visible { transform: none; }
  .mobile-paybar.is-off { display: none; }
  .mobile-paybar-info { display: flex; flex-direction: column; line-height: 1.2; }
  .mobile-paybar-info span { color: var(--text-3); font-size: var(--fs-sm); }
  .mobile-paybar-info strong { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 600; font-variant-numeric: tabular-nums; }
  .mobile-paybar .btn { min-width: 140px; min-height: 46px; }
}

/* Pix */
.pix-dialog { max-width: 440px; }
.pix-dialog .modal-title { display: flex; align-items: center; gap: var(--sp-2); }
.pix-dialog .modal-body { color: var(--text); }
.pix-amount { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 var(--sp-4); color: var(--text-2); font-weight: 600; }
.pix-amount strong { color: var(--text); font-family: var(--font-display); font-size: var(--fs-xl); font-variant-numeric: tabular-nums; }
.pix-qr { display: grid; place-items: center; padding: var(--sp-4); background: #fff; border: 1px solid var(--border); border-radius: 16px; line-height: 0; }
.pix-qr img { width: 220px; height: 220px; max-width: 100%; image-rendering: pixelated; }
.pix-hint { margin: var(--sp-4) 0 var(--sp-2); color: var(--text-2); font-size: var(--fs-sm); }
.pix-copy { display: flex; gap: var(--sp-2); }
.pix-copy .form-control { flex: 1; min-width: 0; font-size: var(--fs-sm); }
.pix-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.pix-status > span:not(.pix-pulse) { flex: 1; min-width: 0; }
.pix-status strong { display: block; color: var(--text); font-size: var(--fs-sm); }
.pix-status small { color: var(--text-3); font-size: var(--fs-xs); }
.pix-status > .mdi { font-size: 22px; }
.pix-status.is-recusado > .mdi { color: var(--danger); }
.pix-status.is-expirado > .mdi { color: var(--warning); }
.pix-pulse { position: relative; width: 10px; height: 10px; margin: 0 4px; flex-shrink: 0; border-radius: 50%; background: var(--success); }
.pix-pulse::after { content: ""; position: absolute; inset: -5px; border: 2px solid var(--success); border-radius: 50%; opacity: 0; animation: pulse-ring 1.6s var(--ease) infinite; }
@keyframes pulse-ring { 0% { transform: scale(.5); opacity: .8; } 100% { transform: scale(1.4); opacity: 0; } }

/* Resultado */
.result-view { padding: var(--sp-12) var(--sp-6); text-align: center; }
.result-view h2 { margin: var(--sp-5) 0 var(--sp-2); font-size: var(--fs-2xl); font-weight: 600; }
.result-view p { max-width: 46ch; margin: 0 auto; color: var(--text-2); font-size: var(--fs-md); }
.result-icon { position: relative; display: inline-grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; font-size: 38px; }
.result-icon .mdi { animation: pop .4s var(--ease); }
.result-icon.is-success { background: var(--success-bg); color: var(--success); }
.result-icon.is-success::after { content: ""; position: absolute; inset: -8px; border: 2px solid var(--success); border-radius: 50%; opacity: 0; animation: pulse-ring 1.2s var(--ease) 2; }
.result-icon.is-warning { background: var(--warning-bg); color: var(--warning); }
.result-balance { display: inline-flex; align-items: baseline; gap: var(--sp-2); margin-top: var(--sp-5); padding: var(--sp-3) var(--sp-5); border-radius: var(--r-pill); background: var(--uz-ink); color: #B9BFC8; font-size: var(--fs-sm); }
.result-balance strong { color: var(--uz-yellow); font-family: var(--font-display); font-size: var(--fs-xl); font-variant-numeric: tabular-nums; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-3); margin-top: var(--sp-8); }
.result-view .result-meta { margin-top: var(--sp-5); color: var(--text-3); font-size: var(--fs-sm); }

/* Tema escuro: número das etapas e selo em amarelo */
@media screen { [data-theme="dark"] .step-num, [data-theme="dark"] .pkg-badge { background: var(--uz-yellow); color: var(--uz-ink); } }
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .step-num, :root:not([data-theme="light"]) .pkg-badge { background: var(--uz-yellow); color: var(--uz-ink); }
}

/* Ações do resultado (ex.: Imprimir) */
.hero-main { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-5); flex: 1; min-width: 0; }
.hero-main > .profile-main { flex: 1; min-width: 220px; }
.hero-actions { display: flex; gap: var(--sp-2); margin-left: auto; align-self: flex-start; }
@media (max-width: 575.98px) { .hero-actions { margin-left: 0; } }

/* KPIs */
.kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); }
.kpi {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  min-width: 0;
}
.kpi-label { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; }
.kpi-label .mdi { font-size: 17px; color: var(--text-3); }
.kpi-value {
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  line-height: 1.1;
  margin-top: auto;
  padding-top: var(--sp-2);
}
.kpi-unit { color: var(--text-3); font-family: var(--font-body); font-size: var(--fs-base); font-weight: 500; letter-spacing: 0; margin-left: 4px; }
.kpi-foot { margin-top: auto; padding-top: var(--sp-3); color: var(--text-3); font-size: var(--fs-sm); }
.kpi--brand { background: var(--uz-ink); border-color: var(--uz-ink); color: #fff; }
.kpi--brand .kpi-label, .kpi--brand .kpi-label .mdi { color: #B9BFC8; }
.kpi--brand .kpi-value { color: var(--uz-yellow); }
.kpi--brand .kpi-unit { color: #B9BFC8; }
.kpi--brand .kpi-foot { color: #B9BFC8; }
.kpi--brand .btn-primary { align-self: flex-start; }
.kpi-row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; margin-top: auto; }
@media (max-width: 991.98px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi--brand { grid-column: 1 / -1; } }
@media (max-width: 575.98px) { .kpi-value { font-size: var(--fs-2xl); } .kpi { padding: var(--sp-4); } }

/* Ações rápidas */
.action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--sp-4); }
.action-card {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.action-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-2); color: var(--text); text-decoration: none; transform: translateY(-1px); }
.action-card:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.action-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--r-md);
  background: var(--surface-sunken);
  color: var(--text);
  font-size: 22px;
  flex-shrink: 0;
  transition: background-color .15s, color .15s;
}
.action-card:hover .action-icon { background: var(--uz-yellow); color: var(--uz-ink); }
.action-body { flex: 1; min-width: 0; }
.action-body h3 { margin: 0 0 4px; font-size: var(--fs-md); font-weight: 600; }
.action-body p { margin: 0; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.45; }
.action-body .chip { margin-top: var(--sp-3); height: 24px; font-size: var(--fs-xs); }
.action-arrow { color: var(--text-3); font-size: 20px; align-self: center; transition: transform .15s, color .15s; }
.action-card:hover .action-arrow { color: var(--text); transform: translateX(2px); }

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  margin: var(--sp-8) 0 var(--sp-4);
}
.section-heading h2 { margin: 0; font-size: var(--fs-lg); font-weight: 600; }
.section-heading p { margin: 0; color: var(--text-3); font-size: var(--fs-sm); }

/* Checkout embutido */
.embed-frame { display: block; width: 100%; height: 800px; border: 0; border-radius: var(--r-lg); background: #fff; }

/* Acessos (administração): lista de contas, status e ajuste de créditos */
.acessos-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3) var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
}
.acessos-busca { flex: 1 1 320px; max-width: 520px; }
.acessos-ordem { display: flex; align-items: center; gap: var(--sp-2); margin-left: auto; }
.acessos-ordem label { margin: 0; white-space: nowrap; }
.acessos-ordem .custom-select { width: auto; min-width: 210px; }
.acessos-pager { display: flex; gap: var(--sp-2); margin-left: auto; }

.acessos-table td { vertical-align: middle; }
@media (min-width: 768px) {
  .acessos-table .col-doc { width: 180px; }
  .acessos-table .col-data { width: 120px; }
  .acessos-table .col-acesso { width: 170px; }
  .acessos-table .col-creditos { width: 190px; }
  .acessos-table .col-status { width: 130px; }
}
.user-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.user-id { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500; color: var(--text-3); }
.user-meta { color: var(--text-3); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.credit-cell { display: inline-flex; align-items: center; justify-content: flex-end; gap: var(--sp-2); }
.credit-value { min-width: 6ch; font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.acessos-table .custom-switch { min-height: 24px; }
.acessos-table .custom-control-label { font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; cursor: pointer; }
.acessos-table .custom-control-input:disabled ~ .custom-control-label { cursor: not-allowed; }

/* Conta inativa: dados recuam, o controle de status continua legível */
.acessos-table tr.is-inactive td:not(.col-status),
.acessos-table tr.is-inactive .cell-strong { color: var(--text-3); }
.acessos-table tr.is-inactive .credit-value { font-weight: 500; }
.acessos-table tr.is-inactive [data-ativo-texto] { color: var(--danger); }

.credit-editor > td { background: var(--row-selected); padding: var(--sp-4) var(--sp-5) var(--sp-5); }
.acessos-table tr.is-selected > td { border-bottom-color: transparent; }
.credit-form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.credit-amount .form-control { width: 150px; }
.credit-quick { display: flex; gap: var(--sp-1); }
.credit-quick .btn { min-width: 48px; padding: 0 var(--sp-2); font-variant-numeric: tabular-nums; }
.credit-preview { order: 1; flex-basis: 100%; margin: 0; color: var(--text-2); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.credit-preview b { color: var(--text); font-weight: 700; }
.credit-preview .mdi { color: var(--text-3); vertical-align: -1px; }
.credit-preview.is-invalid { color: var(--danger); }
.credit-preview.is-invalid b { color: var(--danger); }
.credit-form-actions { display: flex; gap: var(--sp-2); margin-left: auto; }
@media (max-width: 767.98px) {
  .acessos-toolbar { padding: var(--sp-3) var(--sp-4); }
  .acessos-busca { max-width: none; }
  .acessos-ordem { margin-left: 0; width: 100%; }
  .acessos-ordem .custom-select { flex: 1; min-width: 0; }
  .credit-cell { justify-content: flex-start; }
  .credit-value { min-width: 0; text-align: left; }
  .acessos-table tr.credit-editor { padding: 0; }
  .acessos-table .credit-editor > td { padding: var(--sp-4); }
  .credit-form .segmented { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .credit-form .segmented-item { justify-content: center; min-width: 0; padding: 0 var(--sp-1); white-space: normal; text-align: center; line-height: 1.15; }
  .credit-form .segmented-item .mdi { display: none; }
  .credit-amount, .credit-amount .form-control { width: 100%; }
  .credit-quick { width: 100%; }
  .credit-quick .btn { flex: 1; }
  .credit-form-actions { width: 100%; margin-left: 0; }
  .credit-form-actions .btn { flex: 1; }
}

/* 15. Autenticação --------------------------------------------------------- */
.auth {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: 100vh;
  background: var(--bg);
}
.auth-aside {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--sp-8);
  padding: var(--sp-10) var(--sp-12);
  overflow: hidden;
  background: var(--uz-ink);
  color: #fff;
}
.auth-aside .brand-full { height: 40px; width: auto; align-self: flex-start; position: relative; }
.auth-pitch { position: relative; max-width: 30rem; }
.auth-pitch .pitch-title { margin: 0 0 var(--sp-4); color: #fff; font-family: var(--font-display); font-size: clamp(1.75rem, 2.6vw, 2.5rem); font-weight: 600; line-height: 1.15; letter-spacing: -.02em; }
.auth-pitch .pitch-title em { font-style: normal; color: var(--uz-yellow); }
.auth-pitch p:not(.pitch-title) { margin: 0; color: #B9BFC8; font-size: var(--fs-md); max-width: 40ch; }
.auth-features { position: relative; display: grid; gap: var(--sp-3); margin: var(--sp-8) 0 0; padding: 0; list-style: none; }
.auth-features li { display: flex; align-items: center; gap: var(--sp-3); color: #DDE1E6; font-size: var(--fs-base); }
.auth-features .mdi { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-md); background: rgba(255, 255, 255, .07); color: var(--uz-yellow); font-size: 18px; }
.auth-aside small { position: relative; color: #7D8490; font-size: var(--fs-xs); }
/* Padrão binário 1·0·2 ao fundo */
.auth-aside::before {
  content: "1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2";
  position: absolute;
  right: -40px;
  bottom: -30px;
  width: 520px;
  color: rgba(253, 224, 0, .055);
  -webkit-mask-image: linear-gradient(200deg, #000 10%, transparent 75%);
  mask-image: linear-gradient(200deg, #000 10%, transparent 75%);
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: .5em;
  word-break: break-all;
  transform: rotate(-12deg);
  pointer-events: none;
}
.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-10) var(--sp-6);
}
.auth-card { width: min(420px, 100%); }
.auth-card .brand-mobile { display: none; margin-bottom: var(--sp-8); }
.auth-card .brand-mobile img { height: 44px; width: 44px; }
.auth-card h1 { margin: 0 0 var(--sp-1); font-size: var(--fs-2xl); font-weight: 600; }
.auth-card .auth-sub { margin: 0 0 var(--sp-8); color: var(--text-2); }
.auth-card .form-group { margin-bottom: var(--sp-5); }
.auth-card .btn-block { margin-top: var(--sp-6); }
.auth-switch { margin: var(--sp-6) 0 0; color: var(--text-2); text-align: center; font-size: var(--fs-base); }
.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.auth-row .form-group { margin-bottom: var(--sp-5); }
.form-error { margin-top: var(--sp-4); }
.form-error:empty { display: none; }
@media (max-width: 991.98px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-aside { display: none; }
  .auth-card .brand-mobile { display: block; }
  .auth-main { align-items: flex-start; padding: var(--sp-10) var(--sp-5); }
}
@media (max-width: 419.98px) { .auth-row { grid-template-columns: minmax(0, 1fr); gap: 0; } }

/* 16. Utilitários ---------------------------------------------------------- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gap-2 { gap: var(--sp-2); }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.bg-dark { background-color: var(--uz-ink) !important; }
.fade-in { animation: fade-in .25s var(--ease); }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } }
[hidden] { display: none !important; }

/* 17. Impressão ------------------------------------------------------------ */
.print-header, .print-only { display: none; }

@media print {
  @page { size: A4; margin: 12mm; }
  html { font-size: 13px; }
  /* Neutraliza o print do Bootstrap 4 (body com 992px e células com fundo branco forçado) */
  body { background: #fff; min-width: 0 !important; }
  .table td, .table th { background-color: transparent !important; }
  *, *::before, *::after { animation: none !important; transition: none !important; }

  .app-sidebar, .sidebar-backdrop, .app-topbar, .app-footer, .skip-link,
  .toast-stack, .loading-overlay, .back-link, .section-nav, .page-header-actions,
  .page-subtitle, .panel-meta, .hero-actions, .col-action, .profile-initials,
  .no-print, [data-print] { display: none !important; }

  .app-main { margin-left: 0 !important; min-height: 0; display: block; }
  .app-content { max-width: none; padding: 0; }
  .page-header { margin-bottom: var(--sp-4); }

  .print-header {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    margin-bottom: var(--sp-5);
    padding-bottom: var(--sp-3);
    border-bottom: 2px solid var(--uz-ink);
    font-size: var(--fs-sm);
    color: var(--text-2);
  }
  .print-header img { width: 22px; height: 22px; }
  .print-header strong { font-family: var(--font-display); font-size: var(--fs-md); color: var(--text); }
  .print-header > span { margin-left: auto; }
  .print-only { display: block; }
  .print-criteria { margin: 0; padding: var(--sp-2) var(--sp-5); border-bottom: 1px solid var(--border); color: var(--text-2); font-size: var(--fs-sm); }

  .panel, .card, .kpi { box-shadow: none; }
  .panel-grid { gap: var(--sp-4); }
  .panel-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-grid.detail-split { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .panel-header { padding: var(--sp-3) var(--sp-4); break-after: avoid; }
  .panel-body { padding: var(--sp-4); }
  .profile-hero, .vehicle-hero, tr, .field { break-inside: avoid; }

  .table-wrap { overflow: visible; }
  .table { font-size: 11.5px; }
  .table th, .table td { padding: 6px var(--sp-2); }
  .table th:first-child, .table td:first-child { padding-left: var(--sp-4); }
  .table th:last-child, .table td:last-child { padding-right: var(--sp-4); }
  .table .mono { white-space: nowrap; }
  .table thead th { position: static; }
  .data-table a.row-link { text-decoration: none; }

  .plate, .status { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
