:root {
  --bg: #0a0a0a;
  --bg-2: #111111;
  --card: #1c1c1c;
  --card-2: #242424;
  --gold: #d4af37;
  --gold-2: #f1d675;
  --gold-soft: rgba(212, 175, 55, 0.22);
  --text: #ffffff;
  --muted: #b8b8b8;
  --line: rgba(212, 175, 55, 0.2);
  --green: #22c55e;
  --red: #dc2626;
  --orange: #c2410c;
  --blue: #38bdf8;
  --purple: #8b5cf6;
  --radius: 18px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --user-font-scale: 1;
  --space-factor: 1;
  color-scheme: dark;
  font-family: Inter, "Segoe UI", sans-serif;
}

.user-admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.95fr);
  gap: 20px;
  align-items: start;
}

.user-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 14px;
}

.permission-shell {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
}

.permission-shell-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.permission-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

.permission-item input {
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
}

.detail-pre {
  margin: 0 0 16px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
}

.stack-list {
  display: grid;
  gap: 10px;
}

.list-select-button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.list-select-button:hover {
  transform: translateY(-1px);
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.05);
}

.list-select-button span {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1080px) {
  .user-admin-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .permission-grid {
    grid-template-columns: 1fr;
  }

  .user-admin-actions {
    flex-direction: column;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-size: calc(16px * var(--user-font-scale));
  background:
    radial-gradient(circle at top left, rgba(212, 175, 55, 0.16), transparent 34rem),
    linear-gradient(135deg, #050505 0%, #0a0a0a 42%, #14110a 100%);
  color: var(--text);
  overflow-x: hidden;
}

body[data-density="compacto"] {
  --space-factor: 0.84;
}

body[data-density="confortavel"] {
  --space-factor: 1;
}

body[data-visualizacao="alto_contraste"] {
  --line: rgba(255, 255, 255, 0.28);
  --gold-soft: rgba(212, 175, 55, 0.3);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.boot-screen,
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.boot-screen {
  text-align: center;
}

.brand-mark {
  width: 76px;
  height: 76px;
  display: inline-grid;
  place-items: center;
  border-radius: 24px;
  color: #0a0a0a;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  font: 800 28px Poppins, sans-serif;
  box-shadow: 0 18px 50px rgba(212, 175, 55, 0.26);
}

h1,
h2,
h3 {
  font-family: Poppins, Inter, sans-serif;
  margin: 0;
}

p {
  color: var(--muted);
}

.loader {
  display: inline-block;
  width: 44px;
  height: 44px;
  margin-top: 20px;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--gold);
  animation: spin 0.85s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.auth-grid {
  width: min(1120px, 100%);
  min-height: 680px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: rgba(10, 10, 10, 0.72);
  box-shadow: var(--shadow);
}

.premium-auth {
  background:
    radial-gradient(circle at 20% 10%, rgba(212, 175, 55, 0.18), transparent 26rem),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.07), transparent 24rem),
    #050505;
}

.premium-auth .auth-grid {
  animation: authReveal 420ms ease both;
}

@keyframes authReveal {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-brand {
  padding: 56px;
  background:
    linear-gradient(145deg, rgba(212, 175, 55, 0.18), transparent 42%),
    linear-gradient(180deg, #090909, #161616);
}

.auth-brand::after {
  content: "";
  display: block;
  width: min(280px, 80%);
  height: 1px;
  margin-top: 42px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.auth-brand .brand-mark {
  margin-bottom: 30px;
}

.auth-brand h1 {
  font-size: clamp(36px, 4vw, 58px);
  line-height: 0.94;
}

.auth-brand h1 span {
  display: block;
  color: var(--gold);
}

.feature-list {
  display: grid;
  gap: 14px;
  margin-top: 36px;
}

.feature-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: #f8f8f8;
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: 34px;
  background:
    radial-gradient(circle at top right, rgba(212, 175, 55, 0.18), transparent 18rem),
    #0f0f0f;
  color: var(--text);
}

.auth-card {
  width: min(430px, 100%);
  padding: 34px;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(25, 20, 8, 0.18);
}

.auth-card-premium {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), transparent),
    #171717;
  color: var(--text);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
}

.auth-card p,
.auth-card .muted {
  color: var(--muted);
}

.auth-card form {
  margin-top: 20px;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.field {
  position: relative;
  display: grid;
  gap: 7px;
  margin: 14px 0;
}

.field label {
  font-weight: 700;
  color: inherit;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid #d8d0bb;
  border-radius: 14px;
  outline: none;
  background: #fffdf8;
  color: #111827;
  transition: border 160ms ease, box-shadow 160ms ease;
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.18);
}

.auth-card-premium .field input,
.auth-card-premium .field textarea,
.auth-card-premium .field select,
.modal-card .field input,
.modal-card .field textarea,
.modal-card .field select {
  border-color: rgba(212, 175, 55, 0.26);
  background: #101010;
  color: var(--text);
}

.password-shell {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  border: 1px solid rgba(212, 175, 55, 0.26);
  border-radius: 14px;
  background: #101010;
  transition: border 160ms ease, box-shadow 160ms ease;
}

.password-shell:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-soft);
}

.password-shell input {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.password-shell input:focus {
  box-shadow: none;
}

.password-toggle {
  min-width: 78px;
  padding: 0 12px;
  border: 0;
  border-left: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: 0 14px 14px 0;
  background: rgba(212, 175, 55, 0.08);
  color: var(--gold);
  font-weight: 900;
}

.auth-feedback {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(220, 38, 38, 0.35);
  border-radius: 14px;
  background: rgba(220, 38, 38, 0.12);
  color: #fecaca;
  font-weight: 800;
}

.auth-feedback.success {
  border-color: rgba(34, 197, 94, 0.38);
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
}

.auth-feedback[hidden] {
  display: none;
}

.autocomplete-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  max-height: 292px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(circle at top left, var(--gold-soft), transparent 12rem),
    #111111;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.42);
}

.autocomplete-menu[hidden] {
  display: none;
}

.autocomplete-item {
  width: 100%;
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.autocomplete-item:hover,
.autocomplete-item.active {
  border-color: var(--gold);
  background: var(--gold-soft);
}

.autocomplete-item strong {
  font-size: 14px;
}

.autocomplete-item span,
.autocomplete-empty {
  color: var(--muted);
  font-size: 12px;
}

.autocomplete-empty {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  text-align: center;
}

.btn {
  min-height: calc(44px * var(--space-factor));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(212, 175, 55, 0.18);
}

.btn-primary {
  color: #0a0a0a;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
}

.btn-wide {
  width: 100%;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.72;
  transform: none;
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(10, 10, 10, 0.3);
  border-top-color: #0a0a0a;
  border-radius: 999px;
  animation: spin 0.75s linear infinite;
}

.btn-secondary {
  color: var(--text);
  background: #2a2a2a;
}

.btn-danger {
  color: white;
  background: var(--red);
}

.link-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
}

.link-button {
  border: 0;
  background: none;
  color: var(--gold);
  font-weight: 800;
}

.link-button:hover {
  text-decoration: underline;
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar-backdrop,
.mobile-header,
.sidebar-close {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: calc(22px * var(--space-factor));
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: rgba(10, 10, 10, 0.92);
}

.sidebar-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sidebar-brand h2 {
  font-size: 18px;
}

.sidebar-brand small {
  color: var(--muted);
}

.user-card {
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, var(--gold-soft), transparent 12rem),
    rgba(255, 255, 255, 0.045);
}

.user-card strong,
.user-card small {
  display: block;
}

.user-card small {
  margin-top: 4px;
  color: var(--muted);
  word-break: break-word;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-weight: 800;
}

.nav button.active,
.nav button:hover {
  color: var(--text);
  border-color: var(--line);
  background: rgba(212, 175, 55, 0.11);
}

.main {
  min-width: 0;
  padding: calc(24px * var(--space-factor));
}

.main-content {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.topbar h1 {
  font-size: clamp(24px, 3vw, 36px);
}

.topbar p {
  margin: 4px 0 0;
}

.grid {
  display: grid;
  gap: 16px;
}

.split-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  padding: calc(20px * var(--space-factor));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent), var(--card);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.22);
}

.desktop-module {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: calc(16px * var(--space-factor));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    rgba(10, 10, 10, 0.48);
}

.desktop-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: calc(14px * var(--space-factor)) calc(16px * var(--space-factor));
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #111111;
}

.desktop-titlebar h2 {
  font-size: 18px;
}

.desktop-titlebar p {
  margin: 4px 0 0;
  font-size: 13px;
}

.operational-form,
.side-items-card {
  border-radius: 20px;
  background: #1b1b1b;
}

.operational-form {
  border-left: 5px solid var(--gold);
}

.side-items-card {
  position: sticky;
  top: 20px;
  min-height: 520px;
  background:
    radial-gradient(circle at top right, var(--gold-soft), transparent 14rem),
    #171717;
}

.side-items-card table {
  min-width: 760px;
}

.operation-grid .field {
  margin: 8px 0;
}

.operation-grid .field input,
.operation-grid .field select,
.operation-grid .field textarea {
  min-height: 42px;
  border-color: rgba(212, 175, 55, 0.26);
  background: #101010;
  color: #ffffff;
}

.operation-grid .field input:focus,
.operation-grid .field select:focus,
.operation-grid .field textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.cadastro-layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(460px, 1.1fr);
  gap: 16px;
  align-items: start;
}

.ponto-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.85fr) minmax(520px, 1.15fr);
  gap: 16px;
  align-items: start;
}

.metric-label {
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.metric-value {
  display: block;
  margin-top: 10px;
  font: 800 30px Poppins, sans-serif;
}

.gold {
  color: var(--gold);
}

.green {
  color: var(--green);
}

.red {
  color: var(--red);
}

.orange {
  color: var(--orange);
}

.blue {
  color: var(--blue);
}

.purple {
  color: var(--purple);
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 16px;
  margin-top: 16px;
}

.dashboard-desktop-shell {
  display: grid;
  gap: 16px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top right, rgba(212, 175, 55, 0.18), transparent 18rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
}

.dashboard-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--gold);
  background: rgba(212, 175, 55, 0.12);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dashboard-hero h1 {
  margin: 0;
  font: 800 clamp(28px, 3vw, 42px) "Poppins", sans-serif;
  line-height: 1.05;
}

.dashboard-hero p {
  margin: 12px 0 0;
  max-width: 58ch;
  color: var(--muted);
}

.dashboard-hero-actions {
  display: grid;
  gap: 12px;
  align-content: start;
}

.dashboard-hero-status {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.dashboard-hero-status strong {
  color: var(--text);
  font-size: 13px;
}

.dashboard-hero-status span {
  color: var(--muted);
  font-size: 13px;
}

.dashboard-query-card,
.dashboard-summary-card,
.dashboard-actions-card,
.dashboard-alert-card,
.dashboard-rank-card {
  border: 1px solid var(--line);
}

.dashboard-card-head {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.dashboard-card-head h2,
.dashboard-card-head h3 {
  margin: 0;
}

.dashboard-card-head p {
  margin: 0;
  color: var(--muted);
}

.dashboard-query-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.75fr) minmax(220px, 0.8fr);
  gap: 12px;
  align-items: end;
}

.dashboard-query-result {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  padding: 16px;
  border-radius: 18px;
  background: #121212;
  border: 1px solid var(--line);
}

.dashboard-query-result strong {
  color: var(--gold);
  font: 800 24px "Poppins", sans-serif;
}

.dashboard-query-result span {
  color: var(--muted);
  font-size: 13px;
}

.dashboard-kpis {
  margin-top: 0;
}

.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: 16px;
}

.dashboard-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.dashboard-detail-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.dashboard-detail-list p {
  margin: 0;
}

.dashboard-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-side-note {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.dashboard-side-note strong {
  color: var(--text);
  font-size: 13px;
}

.dashboard-side-note span {
  color: var(--muted);
  font-size: 13px;
}

.dashboard-ranking-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.dashboard-rank-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #121212;
}

.dashboard-rank-list li span {
  color: var(--text);
  font-size: 13px;
}

.dashboard-rank-list li strong {
  font-size: 13px;
}

.dashboard-rank-list .empty-row span,
.dashboard-rank-list .empty-row strong {
  color: var(--muted);
}

.dashboard-alert-list {
  display: grid;
  gap: 10px;
}

.dashboard-alert-list p {
  margin: 0;
  padding: 12px 14px;
  border-left: 4px solid var(--red);
  border-radius: 0 14px 14px 0;
  background: rgba(239, 68, 68, 0.08);
}

.desktop-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.tab-pill {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 800;
}

.tab-pill.active {
  color: #0a0a0a;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
}

.operation-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(420px, 1.2fr);
  gap: 16px;
  align-items: start;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.summary-box {
  padding: calc(14px * var(--space-factor));
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #121212;
}

.summary-box span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-box strong {
  display: block;
  margin-top: 6px;
  font: 800 20px Poppins, sans-serif;
}

.bonus-helper {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.quick-client-box {
  margin-top: 16px;
  border-style: solid;
  background:
    radial-gradient(circle at top right, var(--gold-soft), transparent 14rem),
    rgba(255, 255, 255, 0.04);
}

.quick-client-header {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.edit-state-banner {
  display: grid;
  gap: 4px;
  margin: 12px 0 6px;
  padding: 12px 14px;
  border: 1px solid rgba(56, 189, 248, 0.34);
  border-radius: 16px;
  background: rgba(56, 189, 248, 0.1);
}

.edit-state-banner strong {
  color: var(--blue);
  font-size: 13px;
}

.edit-state-banner span {
  color: var(--text);
  font-size: 13px;
}

.history-titlebar {
  margin-bottom: 14px;
}

.history-primary {
  display: grid;
  gap: 4px;
}

.history-actions {
  min-width: 280px;
}

.modal-card-wide {
  width: min(920px, 100%);
}

.modal-card-xl {
  width: min(1240px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.client-sheet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.fornecedor-modal-shell {
  display: grid;
  gap: 14px;
}

.fornecedor-tabs {
  margin-bottom: 0;
}

.fornecedor-panel {
  display: none;
  gap: 14px;
}

.fornecedor-panel.active {
  display: grid;
}

.fornecedor-inline-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.fornecedor-inline-bar .mini-note {
  margin: 0;
}

.fornecedor-summary-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.fornecedor-inner-card {
  padding: 16px;
}

.fornecedor-inner-card h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.fornecedor-delivery-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 14px;
}

.fornecedor-section-head {
  margin-bottom: 10px;
}

.fornecedor-finance-preview {
  display: grid;
  gap: 6px;
}

.fornecedor-actions-row {
  margin-top: 12px;
}

.fornecedor-inline-actions {
  min-width: 280px;
}

.fornecedor-inline-actions .btn {
  min-height: 34px;
}

.supplier-text-preview {
  margin: 0;
  min-height: 220px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdf7;
  color: #111827;
  white-space: pre-wrap;
  word-break: break-word;
  font: 400 13px/1.42 Consolas, "Courier New", monospace;
}

.client-sheet-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, var(--gold-soft), transparent 14rem),
    rgba(255, 255, 255, 0.03);
}

.client-sheet-card h3 {
  margin-bottom: 12px;
  font-size: 15px;
}

.client-sheet-card-full {
  grid-column: 1 / -1;
}

.client-sheet-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.client-sheet-line:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.client-sheet-line span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.client-sheet-line strong {
  text-align: right;
  word-break: break-word;
}

.bonus-preview {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #121212;
}

.bonus-preview strong {
  display: block;
  margin-top: 4px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.06);
}

.status-chip.green {
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.34);
}

.status-chip.orange {
  background: rgba(194, 65, 12, 0.16);
  border: 1px solid rgba(194, 65, 12, 0.38);
}

.status-chip.red {
  background: rgba(220, 38, 38, 0.16);
  border: 1px solid rgba(220, 38, 38, 0.38);
}

.status-chip.blue {
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.34);
}

.bonus-metric.blue {
  border-color: rgba(56, 189, 248, 0.28);
}

.bonus-metric.green {
  border-color: rgba(34, 197, 94, 0.28);
}

.bonus-metric.orange {
  border-color: rgba(194, 65, 12, 0.34);
}

.bonus-metric.purple {
  border-color: rgba(139, 92, 246, 0.28);
}

.bonus-cards {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.progress-track {
  width: 100%;
  height: 12px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}

.progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  transition: width 180ms ease;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inline-actions .btn {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 12px;
}

.mini-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.receipt-preview {
  min-height: 280px;
  white-space: pre-wrap;
  font-family: Consolas, monospace;
  background: #fffdf7;
  color: #111827;
}

.company-logo-uploader {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
}

.company-logo-preview-shell {
  min-height: 140px;
  border: 1px dashed rgba(212, 175, 55, 0.35);
  border-radius: 16px;
  background:
    radial-gradient(circle at top right, rgba(212, 175, 55, 0.12), transparent 7rem),
    #111111;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.company-logo-preview {
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
  display: block;
}

.company-logo-preview-empty {
  padding: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.company-logo-controls input[type="file"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #101010;
  color: var(--text);
}

.company-logo-controls input[readonly] {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #101010;
  color: var(--text);
}

.company-logo-actions {
  margin-top: 10px;
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: calc(13px * var(--space-factor)) calc(12px * var(--space-factor));
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  text-align: left;
}

.metric-label,
.mini-note,
.sidebar-brand small,
.user-card small,
th {
  font-size: calc(12px * var(--user-font-scale));
}

.nav button,
.btn,
.field label,
.field input,
.field textarea,
.field select,
td,
p,
.status-pill {
  font-size: calc(14px * var(--user-font-scale));
}

.metric-value {
  font-size: calc(30px * var(--user-font-scale));
}

.topbar h1 {
  font-size: calc(2rem * var(--user-font-scale));
}

.card h2,
.modal-titlebar h2,
.desktop-titlebar h2 {
  font-size: calc(1.2rem * var(--user-font-scale));
}

th {
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tr:hover td {
  background: rgba(212, 175, 55, 0.06);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.full {
  grid-column: 1 / -1;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  width: min(420px, calc(100% - 40px));
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #151515;
  box-shadow: var(--shadow);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  color: #0a0a0a;
  background: var(--gold);
  font-weight: 900;
  font-size: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(8px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: min(520px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, var(--gold-soft), transparent 16rem),
    #171717;
  box-shadow: var(--shadow);
  animation: authReveal 220ms ease both;
}

.modal-titlebar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.modal-titlebar p {
  margin: 4px 0 0;
  word-break: break-word;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-weight: 900;
}

.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.plan-card {
  position: relative;
  overflow: hidden;
}

.plan-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(212, 175, 55, 0.18), transparent 18rem);
  pointer-events: none;
}

.price {
  font: 800 38px Poppins, sans-serif;
  color: var(--gold);
}

.empty {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 980px) {
  .auth-grid,
  .layout,
  .panel-grid,
  .operation-grid,
  .cadastro-layout,
  .ponto-grid,
  .plans {
    grid-template-columns: 1fr;
  }

  .side-items-card {
    position: static;
  }

  .auth-brand {
    min-height: 360px;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .grid.cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bonus-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .auth-page,
  .main {
    padding: 16px;
  }

  .auth-grid {
    border-radius: 22px;
  }

  .auth-brand,
  .auth-card {
    padding: 24px;
  }

  .topbar,
  .link-row {
    align-items: stretch;
    flex-direction: column;
  }

  .grid.cards,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .bonus-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  body.menu-open {
    overflow: hidden;
  }

  .layout {
    display: block;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(0, 0, 0, 0.72);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background:
      radial-gradient(circle at top right, var(--gold-soft), transparent 12rem),
      rgba(15, 15, 15, 0.96);
    backdrop-filter: blur(16px);
  }

  .mobile-menu-toggle,
  .sidebar-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    padding: 0;
  }

  .mobile-header-copy {
    min-width: 0;
  }

  .mobile-header-copy strong,
  .mobile-header-copy small {
    display: block;
  }

  .mobile-header-copy small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 70;
    width: min(86vw, 320px);
    height: 100vh;
    padding: 16px;
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  }

  body.menu-open .sidebar {
    transform: translateX(0);
  }

  body.menu-open .sidebar-backdrop {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .main {
    width: 100%;
    padding: 12px;
  }

  .topbar,
  .desktop-titlebar,
  .link-row {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    gap: 12px;
    margin-bottom: 16px;
  }

  .topbar h1 {
    font-size: calc(1.45rem * var(--user-font-scale));
  }

  .topbar p,
  .desktop-titlebar p,
  p,
  .mini-note {
    font-size: calc(13px * var(--user-font-scale));
  }

  .desktop-module,
  .card,
  .desktop-titlebar,
  .modal-card {
    padding: 14px;
    border-radius: 18px;
  }

  .desktop-module {
    padding: 12px;
  }

  .grid.cards,
  .split-grid,
  .bonus-cards,
  .form-grid,
  .panel-grid,
  .dashboard-main-grid,
  .dashboard-ranking-grid,
  .dashboard-query-grid,
  .operation-grid,
  .cadastro-layout,
  .ponto-grid,
  .plans,
  .summary-strip {
    grid-template-columns: 1fr;
  }

  .grid.cards,
  .bonus-cards {
    gap: 12px;
  }

  .dashboard-hero,
  .dashboard-summary-grid,
  .dashboard-actions-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-hero {
    padding: 16px;
  }

  .dashboard-hero h1 {
    font-size: clamp(24px, 8vw, 34px);
  }

  .dashboard-query-result strong {
    font-size: 22px;
  }

  .field {
    margin: 10px 0;
  }

  .field input,
  .field select,
  .field textarea {
    min-height: 48px;
    padding: 12px 14px;
    font-size: 16px;
    border-radius: 12px;
  }

  .field textarea {
    min-height: 104px;
  }

  .btn {
    width: 100%;
    min-height: 44px;
  }

  .button-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .inline-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .history-actions,
  .client-sheet-grid,
  .fornecedor-summary-strip,
  .fornecedor-delivery-grid {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .fornecedor-inline-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .inline-actions .btn {
    width: 100%;
    min-height: 44px;
    font-size: 13px;
  }

  .side-items-card {
    position: static;
    top: auto;
    min-height: 0;
  }

  .table-wrap {
    overflow: visible;
  }

  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap th,
  .table-wrap td {
    display: block;
    width: 100%;
  }

  .table-wrap table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap tbody {
    display: grid;
    gap: 12px;
  }

  .table-wrap tr {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background:
      radial-gradient(circle at top right, var(--gold-soft), transparent 12rem),
      rgba(255, 255, 255, 0.03);
  }

  .table-wrap td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    text-align: right;
    word-break: break-word;
  }

  .table-wrap td::before {
    content: attr(data-label);
    flex: 1 1 auto;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: left;
  }

  .table-wrap td[data-mobile-primary="true"] {
    display: block;
    margin-bottom: 8px;
    padding: 0 0 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text);
    font-size: 16px;
    font-weight: 800;
    text-align: left;
  }

  .table-wrap td[data-mobile-primary="true"]::before {
    display: block;
    margin-bottom: 6px;
    font-size: 10px;
  }

  .table-wrap td[data-cell-type="actions"] {
    display: block;
    padding-bottom: 0;
    border-bottom: 0;
    text-align: left;
  }

  .table-wrap td[data-cell-type="actions"]::before {
    display: block;
    margin-bottom: 8px;
  }

  .table-wrap td:last-child {
    border-bottom: 0;
  }

  .summary-box strong,
  .metric-value,
  .price {
    font-size: calc(1.45rem * var(--user-font-scale));
  }

  .brand-mark {
    width: 62px;
    height: 62px;
    border-radius: 20px;
    font-size: 24px;
  }
}
