@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/geist.woff2") format("woff2");
}

@font-face {
  font-family: "Geist Fallback";
  src: local("Arial");
  ascent-override: 95.94%;
  descent-override: 28.16%;
  line-gap-override: 0%;
  size-adjust: 104.76%;
}

:root {
  color-scheme: light;
  --font-body:
    "Geist", "Geist Fallback", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --text-xs: 0.6875rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-md: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --leading-tight: 1.2;
  --leading-normal: 1.55;
  --leading-relaxed: 1.7;
  --tracking-tight: -0.01em;
  --tracking-wide: 0.06em;
  --tracking-wider: 0.1em;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-raised: #ffffff;
  --bg-muted: #f1f5f9;
  --bg-input: #ffffff;
  --bg-nav: #1e1b4b;
  --bg-nav-hover: rgb(255 255 255 / 8%);
  --bg-nav-active: rgb(255 255 255 / 12%);
  --bg-hover: #e2e8f0;
  --ui-background: #fafafa;
  --border-nav-action: rgb(255 255 255 / 20%);
  --border-nav-action-hover: rgb(255 255 255 / 35%);
  --text-on-dark: #e2e8f0;
  --border-light: #e2e8f0;
  --border-default: #cbd5e1;
  --text-primary: #1e293b;
  --text-secondary: #334155;
  --text-tertiary: #64748b;
  --text-muted: #64748b;
  --text-on-dark-muted: #94a3b8;
  --text-nav-strong: #ffffff;
  --accent-primary: #4f46e5;
  --accent-primary-hover: #4338ca;
  --accent-secondary: #6366f1;
  --accent-secondary-light: #818cf8;
  --primary-foreground: #ffffff;
  --color-warning-bg: #fef9c3;
  --color-warning-text: #854d0e;
  --color-info-bg: #e0e7ff;
  --color-info-text: #3730a3;
  --color-warning-border: #eab308;
  --color-error-bg: #fee2e2;
  --color-error-text: #991b1b;
  --color-error-border: #ef4444;
  --color-success-bg: #dcfce7;
  --color-success-text: #166534;
  --color-success-border: #22c55e;
  --shadow-xs: 0 1px 2px rgb(15 23 42 / 5%);
  --shadow-lg: 0 8px 32px rgb(15 23 42 / 10%);
  --shadow-xl: 0 16px 48px rgb(15 23 42 / 12%);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 999px;
  --shadow-card: 0 1px 3px rgb(15 23 42 / 4%), 0 4px 12px rgb(15 23 42 / 6%);
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --nav-height: 56px;
  --max-width: 1160px;
  --login-label: lab(2.71479 -0.0795871 -3.18422);
  --login-input-border: lab(90.9222 -0.0363588 -2.27569);
  --login-input-text: lab(2.71479 -0.0795871 -3.18422);
  --login-hint: lab(48.4367 -0.527501 -5.59218);
  --login-input-background: transparent;
  --login-icon-color: lab(48.4367 -0.527501 -5.59218);
  --stat-card-border: lab(90.9222 -0.0363588 -2.27569);
}

/* Preferência do sistema; o cookie de tema escreve .light/.dark no <html>. */
@media (prefers-color-scheme: dark) {
  :root:not(.light) {
    color-scheme: dark;
    --bg-page: #0f172a;
    --bg-surface: #111827;
    --bg-surface-raised: #1e293b;
    --bg-muted: #1e293b;
    --bg-hover: #334155;
    --bg-input: #0f172a;
    --bg-nav: #020617;
    --bg-nav-hover: rgb(148 163 184 / 14%);
    --bg-nav-active: rgb(129 140 248 / 18%);
    --ui-background: #0c1021;
    --border-light: #334155;
    --border-default: #475569;
    --border-nav-action: rgb(148 163 184 / 28%);
    --border-nav-action-hover: rgb(129 140 248 / 48%);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --text-muted: #94a3b8;
    --text-on-dark: #f8fafc;
    --text-on-dark-muted: #cbd5e1;
    --text-nav-strong: #ffffff;
    --accent-primary: #818cf8;
    --accent-primary-hover: #a5b4fc;
    --accent-secondary: #a5b4fc;
    --accent-secondary-light: #c4b5fd;
    --primary-foreground: #0f172a;
    --color-success-bg: #052e16;
    --color-success-text: #bbf7d0;
    --color-success-border: #22c55e;
    --color-warning-bg: #422006;
    --color-warning-text: #fde68a;
    --color-info-bg: #1e1b4b;
    --color-info-text: #c7d2fe;
    --color-warning-border: #eab308;
    --color-error-bg: #450a0a;
    --color-error-text: #fecaca;
    --color-error-border: #ef4444;
    --shadow-xs: 0 1px 2px rgb(0 0 0 / 24%);
    --shadow-card: 0 1px 3px rgb(0 0 0 / 24%), 0 4px 12px rgb(0 0 0 / 28%);
    --shadow-lg: 0 8px 32px rgb(0 0 0 / 36%);
  --shadow-xl: 0 16px 48px rgb(0 0 0 / 40%);
    --login-label: #f8fafc;
    --login-input-border: rgb(255 255 255 / 15%);
    --login-input-text: #f8fafc;
    --login-hint: lab(66.0702 -0.553966 -5.60573);
    --login-input-background: rgb(255 255 255 / 4.5%);
    --login-icon-color: lab(66.0702 -0.553966 -5.60573);
    --stat-card-border: #334155;
  }
}
:root.dark {
  color-scheme: dark;
  --bg-page: #0f172a;
  --bg-surface: #111827;
  --bg-surface-raised: #1e293b;
  --bg-muted: #1e293b;
  --bg-hover: #334155;
  --bg-input: #0f172a;
  --bg-nav: #020617;
  --bg-nav-hover: rgb(148 163 184 / 14%);
  --bg-nav-active: rgb(129 140 248 / 18%);
  --ui-background: #0c1021;
  --border-light: #334155;
  --border-default: #475569;
  --border-nav-action: rgb(148 163 184 / 28%);
  --border-nav-action-hover: rgb(129 140 248 / 48%);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --text-muted: #94a3b8;
  --text-on-dark: #f8fafc;
  --text-on-dark-muted: #cbd5e1;
  --text-nav-strong: #ffffff;
  --accent-primary: #818cf8;
  --accent-primary-hover: #a5b4fc;
  --accent-secondary: #a5b4fc;
  --accent-secondary-light: #c4b5fd;
  --primary-foreground: #0f172a;
  --color-success-bg: #052e16;
  --color-success-text: #bbf7d0;
  --color-success-border: #22c55e;
  --color-warning-bg: #422006;
  --color-warning-text: #fde68a;
  --color-warning-border: #eab308;
  --color-error-bg: #450a0a;
  --color-error-text: #fecaca;
  --color-error-border: #ef4444;
  --shadow-xs: 0 1px 2px rgb(0 0 0 / 24%);
  --shadow-card: 0 1px 3px rgb(0 0 0 / 24%), 0 4px 12px rgb(0 0 0 / 28%);
  --shadow-lg: 0 8px 32px rgb(0 0 0 / 36%);
  --shadow-xl: 0 16px 48px rgb(0 0 0 / 40%);
  --login-label: #f8fafc;
  --login-input-border: rgb(255 255 255 / 15%);
  --login-input-text: #f8fafc;
  --login-hint: lab(66.0702 -0.553966 -5.60573);
  --login-input-background: rgb(255 255 255 / 4.5%);
  --login-icon-color: lab(66.0702 -0.553966 -5.60573);
  --stat-card-border: #334155;
}

:root.dark .theme-form-dark {
  display: none;
}

:root.dark .theme-form-light {
  display: contents;
}

:root.light .theme-form-dark {
  display: contents;
}

:root.light .theme-form-light {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not(.light) .theme-form-dark {
    display: none;
  }

  :root:not(.light) .theme-form-light {
    display: contents;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure {
  margin: 0;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

h1 {
  margin: 0;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-primary-hover);
}

:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.login-shell {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-8);
  background: var(--bg-page);
}

.login-card {
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 420px;
  padding: var(--space-10) var(--space-8);
  width: 100%;
  animation: cardEnter 0.5s var(--transition-slow) both;
}

.login-card-header {
  display: grid;
  gap: var(--space-1);
  padding: 0 var(--space-4);
}

.login-card-content {
  padding: 0 var(--space-4);
}

.login-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  margin: 0 0 var(--space-2);
  color: var(--text-primary);
}

.login-subtitle {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
  margin: 0 0 var(--space-8);
  line-height: var(--leading-normal);
}

.login-notice {
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  color: var(--color-warning-text);
  line-height: var(--leading-normal);
}

.login-error {
  background: var(--color-error-bg);
  border: 1px solid var(--color-error-border);
  border-radius: var(--radius-sm);
  color: var(--color-error-text);
  font-size: var(--text-sm);
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  line-height: var(--leading-normal);
  animation: shake 0.4s ease;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-field label {
  color: var(--login-label);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 1;
}

.login-input-wrap {
  position: relative;
}

.login-icon {
  color: var(--login-icon-color);
  height: 16px;
  left: var(--space-3);
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
}

.login-card input {
  background: var(--login-input-background);
  border: 1px solid var(--login-input-border);
  border-radius: var(--radius-md);
  color: var(--login-input-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  height: 32px;
  line-height: 1.42857;
  padding: 4px 10px;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
  width: 100%;
}

.login-card input.login-email {
  padding-left: 36px;
}

.login-card input::placeholder {
  color: var(--login-hint);
}

.login-card input:focus {
  background: var(--bg-input);
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgb(79 70 229 / 10%);
  outline: none;
}

.login-card input[aria-invalid="true"] {
  border-color: var(--color-error-border);
}

.login-card input:focus-visible,
.btn-primary:focus-visible,
.nav-logout:focus-visible {
  outline: 3px solid var(--accent-primary);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent-primary);
  background-clip: padding-box;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--primary-foreground);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  height: 32px;
  line-height: 1.42857;
  margin-top: var(--space-2);
  padding: 0 10px;
  transition:
    background-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
  width: 100%;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-primary-hover);
  box-shadow: 0 2px 8px rgb(67 56 202 / 25%);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  box-shadow: none;
  transform: translateY(0);
}

.dashboard-shell {
  background: var(--bg-page);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.nav-bar {
  align-items: center;
  background: var(--bg-nav);
  box-shadow: 0 1px 8px rgb(0 0 0 / 12%);
  color: var(--text-on-dark);
  display: flex;
  gap: var(--space-4);
  height: var(--nav-height);
  padding: 0 var(--space-8);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  color: var(--text-nav-strong);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  margin-right: var(--space-4);
  padding: var(--space-3) 0;
}

.nav-links {
  display: flex;
  gap: var(--space-1);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  align-items: center;
  border-radius: var(--radius-sm);
  color: var(--text-on-dark-muted);
  display: flex;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  position: relative;
  text-decoration: none;
  transition:
    background var(--transition-fast),
    color var(--transition-fast);
}

.nav-links a:hover {
  background: var(--bg-nav-hover);
  color: var(--text-nav-strong);
}

.nav-links a.active {
  background: var(--bg-nav-active);
  color: var(--text-nav-strong);
}

.nav-links a.active::after {
  background: var(--accent-secondary-light);
  border-radius: 1px;
  bottom: -1px;
  content: "";
  height: 2px;
  left: var(--space-3);
  position: absolute;
  right: var(--space-3);
}

.nav-links a svg {
  display: inline-block;
  vertical-align: -2px;
}

.nav-user {
  align-items: center;
  display: flex;
  gap: var(--space-3);
  margin-left: auto;
}

.nav-form,
.theme-switch,
.theme-form {
  display: contents;
}

.theme-form-light {
  display: none;
}

.nav-email {
  color: var(--text-on-dark-muted);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
}

/* Botões compactos da barra, equivalentes ao Button xs/outline do Next. */
.btn-ui {
  align-items: center;
  background: var(--ui-background);
  border: 1px solid var(--border-nav-action);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  gap: 4px;
  height: 24px;
  justify-content: center;
  letter-spacing: var(--tracking-wide);
  line-height: 1.33333;
  padding: 0 8px;
  white-space: nowrap;
}

.btn-ui:hover {
  background: var(--bg-nav-hover);
  border-color: var(--border-nav-action-hover);
  color: var(--text-nav-strong);
}

.btn-ui svg {
  display: block;
  height: 12px;
  width: 12px;
}

/* O Button do Next pinta o fundo fora da borda; a borda translúcida cai sobre a nav. */
.nav-logout,
.theme-toggle {
  background-clip: padding-box;
}

.nav-logout svg {
  margin-right: 4px;
}

.nav-hamburger {
  align-items: center;
  background: transparent;
  border: 1px solid var(--border-nav-action);
  border-radius: var(--radius-sm);
  color: var(--text-on-dark-muted);
  cursor: pointer;
  display: none;
  height: 44px;
  justify-content: center;
  list-style: none;
  margin-left: auto;
  padding: 0;
  width: 44px;
}

.nav-hamburger::-webkit-details-marker {
  display: none;
}

.nav-hamburger:hover {
  background: var(--bg-nav-hover);
  border-color: var(--border-nav-action-hover);
  color: var(--text-nav-strong);
}

dialog.nav-mobile-menu {
  background: transparent;
  border: 0;
  color: var(--text-on-dark);
  height: auto;
  inset: 0 0 auto;
  margin: 0;
  max-height: none;
  max-width: 100vw;
  overflow: visible;
  padding: 0;
  position: fixed;
  width: 100vw;
}

.nav-mobile-head {
  align-items: center;
  background: var(--bg-nav);
  display: flex;
  height: var(--nav-height);
  padding: 0 var(--space-4);
  position: relative;
}

.nav-mobile-close {
  align-items: center;
  background: var(--bg-nav-hover);
  border: 1px solid var(--border-nav-action-hover);
  border-radius: var(--radius-sm);
  color: var(--text-nav-strong);
  cursor: pointer;
  display: flex;
  height: 44px;
  justify-content: center;
  padding: 0;
  position: absolute;
  right: var(--space-4);
  top: 6px;
  width: 44px;
}

.nav-mobile-panel {
  background: var(--bg-nav);
  border-top: 1px solid var(--border-nav-action);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  padding: var(--space-2) 0 var(--space-4);
}

dialog.nav-mobile-menu[open] .nav-mobile-panel {
  animation: navMobileMenuEnter var(--transition-slow) both;
}

dialog.nav-mobile-menu::backdrop {
  background: rgb(0 0 0 / 50%);
  animation: fadeIn var(--transition-fast) both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes navMobileMenuEnter {
  from {
    transform: translateY(-8px);
  }

  to {
    transform: translateY(0);
  }
}

.nav-mobile-menu:not([open]) {
  display: none;
}

.nav-mobile-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-mobile-links a {
  align-items: center;
  border-radius: var(--radius-sm);
  color: var(--text-on-dark-muted);
  display: flex;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  gap: var(--space-3);
  min-height: 44px;
  padding: var(--space-3) var(--space-4);
  text-decoration: none;
}

.nav-mobile-links a:hover,
.nav-mobile-links a.active {
  background: var(--bg-nav-active);
  color: var(--text-nav-strong);
}

.nav-mobile-user {
  align-items: center;
  border-top: 1px solid var(--border-nav-action);
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-4) 0;
}

.nav-mobile-account {
  align-items: flex-start;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}

.nav-mobile-email {
  color: var(--text-on-dark-muted);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
}

.dashboard-main {
  flex: 1;
  margin: 0 auto;
  max-width: var(--max-width);
  padding: var(--space-8) var(--space-6);
  width: 100%;
}

.page-header {
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
}

.page-header h1 {
  color: var(--text-primary);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
}

.stats-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stat-card {
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  padding: var(--space-5);
}

.stat-label {
  color: var(--accent-primary);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wider);
  margin: 0 0 var(--space-2);
  text-transform: uppercase;
}

.stat-value {
  color: var(--text-primary);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  margin: 0;
}

.stat-hint {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
  margin: var(--space-2) 0 0;
}

.detail-card {
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: var(--space-6);
}

.section-title {
  color: var(--text-primary);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  margin: var(--space-6) 0 var(--space-3);
}

.section-title--flush {
  margin: 0;
}

.dashboard-section {
  margin-top: var(--space-6);
}

.quick-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.quick-action {
  align-items: center;
  display: inline-flex;
  gap: var(--space-2);
}

.btn-secondary {
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  padding: var(--space-2) var(--space-5);
  text-decoration: none;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--bg-page);
  border-color: var(--accent-secondary);
  box-shadow: var(--shadow-xs);
}

.btn-secondary svg {
  display: inline-block;
  margin-right: 4px;
  vertical-align: -2px;
}

.usage-header {
  align-items: center;
  display: flex;
  gap: var(--space-4);
  justify-content: space-between;
}

.usage-alert {
  align-items: center;
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius-md);
  color: var(--color-warning-text);
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding: var(--space-3);
}

.usage-metrics {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-5);
}

.usage-metric-labels {
  align-items: center;
  display: flex;
  gap: var(--space-3);
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.progress-track {
  background: var(--bg-muted);
  border-radius: var(--radius-full);
  height: 8px;
  overflow: hidden;
}

.progress-value {
  background: var(--accent-primary);
  height: 100%;
  transition: width var(--transition-slow);
}

.progress-value--warning {
  background: var(--color-warning-border);
}

.progress-value--error {
  background: var(--color-error-border);
}

.mono {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
}

.muted {
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.form-notice {
  background: var(--color-success-bg);
  border: 1px solid var(--color-success-border);
  border-radius: var(--radius-sm);
  color: var(--color-success-text);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-4px);
  }
  40%,
  80% {
    transform: translateX(4px);
  }
}

@media (min-width: 768px) {
  .login-card input {
    font-size: var(--text-sm);
  }
}

@media (max-width: 768px) {
  .nav-bar {
    gap: var(--space-2);
    padding: 0 var(--space-4);
    position: relative;
  }

  .nav-brand {
    font-size: var(--text-sm);
    margin-right: var(--space-2);
  }

  .nav-links,
  .nav-user {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }

  .page-header {
    flex-wrap: wrap;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-main {
    padding: var(--space-4) var(--space-4);
  }

  .login-card {
    padding: var(--space-6) var(--space-5);
  }

  .nav-bar {
    gap: var(--space-2);
    padding: 0 var(--space-4);
    position: relative;
  }

  .nav-brand {
    font-size: var(--text-sm);
    margin-right: var(--space-2);
  }

  .nav-email {
    display: none;
  }
}

@media (max-width: 480px) {
  .login-shell {
    padding: var(--space-4);
  }

  .login-card {
    padding: var(--space-5) var(--space-4);
  }
}

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

/* Tabelas, selos e estados das telas de folha e holerites.
   Portado de frontend/app/styles.css para o SSR usar o mesmo desenho. */
.table-scroll-wrapper {
  border-radius: var(--radius-md);
  overflow-x: auto;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-light);
  border-collapse: collapse;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  width: 100%;
}

.data-table thead {
  background: var(--bg-muted);
}

.data-table th {
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  text-transform: uppercase;
}

.data-table td {
  border-top: 1px solid var(--border-light);
  color: var(--text-primary);
  font-size: var(--text-sm);
  padding: var(--space-3) var(--space-4);
}

.data-table tbody tr:hover td {
  background: var(--bg-hover);
}

.status-badge {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 26px;
  display: inline-flex;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  gap: var(--space-1);
  height: 20px;
  justify-self: start;
  letter-spacing: normal;
  line-height: 1.333333;
  padding: 2px 8px;
  width: fit-content;
}

.status-badge--outline {
  background: var(--bg-muted);
  color: var(--text-secondary);
}

.status-badge--secondary {
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
}

.status-badge--default {
  background: var(--color-success-bg);
  color: var(--color-success-text);
}

.empty-state {
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-style: italic;
  padding: var(--space-8) 0;
  text-align: center;
}

.form-error {
  background: var(--color-error-bg);
  border: 1px solid var(--color-error-border);
  border-radius: var(--radius-sm);
  color: var(--color-error-text);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
}

.link-action {
  align-items: center;
  justify-content: center;
  min-width: 24px;
  color: var(--accent-primary);
  display: inline-flex;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  min-height: 24px;
  text-decoration: none;
}

.link-action:hover {
  color: var(--accent-primary-hover);
  text-decoration: underline;
}

.detail-card-header {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.detail-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  margin: 0;
}

.detail-grid dt {
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.detail-grid dd {
  color: var(--text-primary);
  font-size: var(--text-sm);
  margin: var(--space-1) 0 0;
}

.sr-only {
  border-width: 0;
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.inline-form {
  align-items: flex-end;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  padding: var(--space-5);
}

.inline-form-field,
.inline-form .field {
  display: grid;
  gap: var(--space-2);
}

.inline-form-field label,
.inline-form .field span {
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.inline-form-field input,
.inline-form select {
  min-height: 38px;
  padding: 8px 12px;
}

.inline-form .field input {
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font: inherit;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
}

.inline-form .btn-primary {
  padding: 0 var(--space-5);
  width: auto;
}

.run-id {
  overflow-wrap: anywhere;
}

.download-button {
  align-items: center;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--accent-primary);
  display: inline-flex;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  justify-content: center;
  min-height: 32px;
  padding: var(--space-1) var(--space-3);
  text-decoration: none;
  width: 100%;
}

.download-button:hover {
  border-color: var(--accent-primary);
}

.totals-cell {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  white-space: nowrap;
}

@media (max-width: 600px) {
  .table-scroll-wrapper {
    overflow: visible;
  }

  .data-table {
    background: transparent;
    border: 0;
    box-shadow: none;
    display: block;
    min-width: 0;
  }

  .data-table thead {
    block-size: 1px;
    clip-path: inset(50%);
    inline-size: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
  }

  .data-table tbody {
    display: grid;
    gap: var(--space-3);
  }

  .data-table tbody tr {
    background: var(--bg-surface-raised);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    display: grid;
    padding: var(--space-2) var(--space-4);
  }

  .data-table td {
    align-items: start;
    border-bottom: 1px solid var(--border-light);
    border-top: 0;
    display: grid;
    gap: var(--space-3);
    grid-template-columns: minmax(5.75rem, 0.42fr) minmax(0, 1fr);
    overflow-wrap: anywhere;
    padding: var(--space-3) 0;
  }

  .data-table td::before {
    color: var(--text-tertiary);
    content: attr(data-label);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
  }

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

  .data-table tbody tr:hover td {
    background: transparent;
  }

  .run-id {
  overflow-wrap: anywhere;
}

.download-button {
  align-items: center;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--accent-primary);
  display: inline-flex;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  justify-content: center;
  min-height: 32px;
  padding: var(--space-1) var(--space-3);
  text-decoration: none;
  width: 100%;
}

.download-button:hover {
  border-color: var(--accent-primary);
}

.totals-cell {
    white-space: normal;
  }
}

@media (max-width: 768px) {
  .inline-form {
    align-items: stretch;
    flex-direction: column;
  }

  .inline-form-field {
    min-width: 100%;
  }

  .inline-form .btn-primary {
    width: 100%;
  }
}

.link-action svg {
  margin-right: 4px;
  position: relative;
  top: 2px;
}

/* Na lista de folhas o Next alinha o ícone pela baseline em -2px. */
.data-table[data-testid="payroll-runs-table"] .link-action svg {
  position: static;
  top: auto;
  vertical-align: -2px;
}

@media (max-width: 640px) {
  .inline-form {
    align-items: stretch;
    flex-direction: column;
  }
  .inline-form .btn-primary {
    width: 100%;
  }
}

/* Medidas correspondentes aos componentes Next usados nas telas de folha. */
.inline-form .field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 160px;
}

.inline-form select {
  min-height: 38px;
  padding: 8px 12px;
}

.inline-form .field input {
  font-size: 13px;
  height: 38.14px;
  line-height: var(--leading-normal);
  min-height: 38.14px;
  padding: var(--space-2) var(--space-3);
}

.inline-form .btn-primary {
  border: 0;
  border-radius: var(--radius-sm);
  font-weight: var(--weight-semibold);
  height: auto;
  letter-spacing: var(--tracking-wide);
  line-height: var(--leading-normal);
  margin-top: 0;
  padding: var(--space-2) var(--space-5);
  width: auto;
}

.data-table .status-badge {
  justify-self: start;
}

.status-badge--default {
  background: var(--accent-primary);
  color: var(--primary-foreground);
}

.status-badge--outline {
  background: transparent;
  border-color: var(--border-light);
  color: var(--text-primary);
}

.status-badge--secondary {
  background: oklch(0.968 0.014 268);
  color: oklch(0.205 0.015 262);
}

:root.dark .status-badge--secondary {
  background: oklch(0.269 0.025 262);
  color: oklch(0.985 0 0);
}

@media (prefers-color-scheme: dark) {
  :root:not(.light) .status-badge--secondary {
    background: oklch(0.269 0.025 262);
    color: oklch(0.985 0 0);
  }
}

.download-button {
  background: var(--ui-background);
  border-color: var(--login-input-border);
  border-radius: var(--radius-md);
  gap: var(--space-1);
  height: 24px;
  line-height: 1.333333;
  min-height: 24px;
  padding: 0 8px 0 6px;
  width: auto;
}

.download-button svg {
  height: 12px;
  width: 12px;
}

:root.dark .download-button {
  background: var(--login-input-background);
}

@media (prefers-color-scheme: dark) {
  :root:not(.light) .download-button {
    background: var(--login-input-background);
  }
}

@media (max-width: 768px) {
  .data-table {
    font-size: var(--text-xs);
  }

  .inline-form .btn-primary {
    width: 100%;
  }
}

@media (min-width: 601px) and (max-width: 768px) {
  .data-table th,
  .data-table td {
    padding: var(--space-2) var(--space-3);
  }
}

@media (max-width: 600px) {
  .data-table tbody tr:last-child td {
    border-bottom: 0;
  }

  .data-table tbody td {
    font-size: 13px;
  }
}

/* Metadados da tela de detalhe da folha. */
.detail-meta {
  display: grid;
  gap: var(--space-1) var(--space-4);
  grid-template-columns: max-content 1fr;
  margin: 0 0 var(--space-4);
}

.detail-meta dt {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.detail-meta dd {
  color: var(--text-primary);
  font-size: var(--text-sm);
  margin: 0;
}

.detail-header {
  align-items: center;
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.detail-header h2 {
  font-size: var(--text-lg);
  margin: 0;
  font-weight: var(--weight-bold);
}

/* Métricas de tabela do Next: 12/16 no desktop e 8/12 abaixo de 768px. */
.data-table th,
.data-table td {
  padding: 12px 16px;
}

@media (max-width: 768px) {
  .data-table th,
  .data-table td {
    padding: 8px 12px;
  }
}

/* Botão do formulário com a tipografia do Next (600, tracking 0.06em). */
.inline-form .btn-primary {
  font-weight: var(--weight-semibold);
  letter-spacing: 0.06em;
  padding: 8px 20px;
}

.inline-form .field input,
.inline-form-field input {
  padding: 8px 12px;
}

/* Abaixo de 600px a tabela vira cartões: a célula não tem padding lateral. */
@media (max-width: 600px) {
  .data-table td {
    padding: 12px 0;
  }
}

/* Botão de download do holerite com a métrica do Next (24px, largura do conteúdo). */
.download-button {
  font-size: 11px;
  gap: 2px;
  height: 24px;
  min-height: 24px;
  padding: 0 8px;
  width: auto;
}

.space-y-6 > * + * {
  margin-top: var(--space-6);
}

.vacation-checkbox {
  align-items: center;
  display: flex;
  gap: var(--space-2);
}

.vacation-checkbox input {
  margin: 0;
}

.vacation-approve {
  display: contents;
}

.vacation-notes {
  background: transparent;
  border: 1px solid oklch(0.922 0.006 268);
  border-radius: 10px;
  color: var(--text-primary);
  font: inherit;
  font-size: var(--text-base);
  height: 32px;
  line-height: 1.5;
  min-height: 0;
  padding: 4px 10px;
  width: 100%;
}

.vacation-notes::placeholder {
  color: oklch(0.556 0.015 262);
}

:root.dark .vacation-notes {
  background: rgb(255 255 255 / 4.5%);
  border-color: oklch(1 0 0 / 0.15);
}

:root.dark .vacation-notes::placeholder {
  color: oklch(0.708 0.015 262);
}

@media (prefers-color-scheme: dark) {
  :root:not(.light) .vacation-notes {
    background: rgb(255 255 255 / 4.5%);
    border-color: oklch(1 0 0 / 0.15);
  }

  :root:not(.light) .vacation-notes::placeholder {
    color: oklch(0.708 0.015 262);
  }
}

.vacation-page .muted {
  color: var(--text-muted);
}

.vacation-form.inline-form {
  box-shadow: var(--shadow-xs);
}

.vacation-form {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: 0;
}

.vacation-form .field {
  align-items: center;
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  gap: 4px;
  line-height: 1;
  width: auto;
}

.vacation-form .field span {
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  line-height: 1;
  text-transform: uppercase;
}

.vacation-form .btn-primary {
  padding: 0 10px;
  width: auto;
}

.vacation-employee .vacation-form {
  margin-top: 0;
}

.vacation-employee .field {
  align-items: center;
  margin: 0 auto;
  text-align: center;
  width: 100%;
}

@media (max-width: 768px) {
  .vacation-form {
    align-items: stretch;
    flex-direction: column;
  }

  .vacation-form .field {
    width: 100%;
  }

  .vacation-form .btn-primary {
    width: 100%;
  }
}

.vacation-form .field input,
.vacation-employee .field select {
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  font-size: var(--text-sm);
  padding: 8px 12px;
}

.vacation-form .field input {
  height: 32px;
  line-height: var(--leading-normal);
  min-height: 0;
  width: 100%;
}

.vacation-employee .field select {
  border-radius: var(--radius-sm);
  font: inherit;
  height: 37px;
}

.vacation-preview-button,
.inline-form .vacation-preview-button,
.vacation-approve-button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  display: flex;
  font-size: var(--text-sm);
  font-weight: 500;
  gap: 6px;
  height: 44px;
  justify-content: center;
  letter-spacing: normal;
  line-height: 1.42857;
  margin-top: 0;
  min-height: 44px;
  padding: 0 10px;
}

.vacation-approve-button {
  width: auto;
}

@media (min-width: 768px) {
  .vacation-notes {
    font-size: var(--text-sm);
    line-height: 1.42857;
  }
}

@media (max-width: 768px) {
  .vacation-page .data-table {
    font-size: var(--text-xs);
  }
}

@media (max-width: 600px) {
  .vacation-page .data-table td {
    border-bottom: 0;
  }
}

@media (min-width: 601px) and (max-width: 768px) {
  .vacation-page .data-table th,
  .vacation-page .data-table td {
    padding: var(--space-2) var(--space-3);
  }
}

@media (min-width: 601px) {
  .vacation-approve-button {
    display: inline-flex;
  }
}


.vacation-page .stats-grid {
  margin-top: 0;
}

/* A linha entre cabeçalho e primeira linha vem de um único elemento. */
.payroll-page .data-table tbody tr:first-child td {
  border-top: 0;
}

/* Compensa o arredondamento sub-pixel da origem da tabela no Chromium. */
.payroll-page .table-scroll-wrapper {
  margin-top: 0.02px;
