@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&display=swap');

/* ══════════════════════════════════════
   Revisa — tema (cores, fonte, formas)
   Editar só este arquivo muda o visual.
   Pesos: 400 texto, 500 rótulos e botões,
   600 títulos e números. Nada passa de 600.
   ══════════════════════════════════════ */

:root {
  /* Marca */
  --color-primary: #3b5bdb;
  --color-primary-light: #4c6ef5;
  --color-primary-soft: #e8edff;
  --color-primary-contrast: #ffffff;
  --color-accent: #ff7a45;

  /* Superfícies */
  --color-bg: #e9edf4;
  --color-surface: #ffffff;
  --color-soft: #f3f5f9;
  --color-border: #dfe4ee;

  /* Texto */
  --color-text: #18213a;
  --color-muted: #6b7489;

  /* Menu e faixa escura */
  --color-sidebar: #131a2c;
  --color-sidebar-2: #1e2742;
  --color-sidebar-line: rgba(255, 255, 255, 0.08);
  --color-sidebar-text: #c3cadb;
  --color-sidebar-muted: #7d87a3;

  /* Estados */
  --color-success: #10b981;
  --color-success-soft: #ecfdf5;
  --color-warning: #f59e0b;
  --color-warning-soft: #fffbeb;
  --color-danger: #ef4444;
  --color-danger-soft: #fef2f2;
  --color-overlay: rgba(15, 23, 42, 0.45);

  /* Cores das disciplinas */
  --color-subject-1: #f59e0b;
  --color-subject-2: #06b6d4;
  --color-subject-3: #6366f1;
  --color-subject-4: #eab308;
  --color-subject-5: #ef4444;
  --color-subject-6: #38bdf8;
  --color-subject-7: #10b981;
  --color-subject-8: #a855f7;

  /* Fonte */
  --font-heading: 'Fredoka', ui-rounded, 'Varela Round', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Fredoka', ui-rounded, 'Varela Round', 'Segoe UI', system-ui, sans-serif;

  /* Formas */
  --radius: 12px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --radius-pill: 9999px;

  /* Sombras suaves (tingidas de azul-marinho) */
  --shadow-color: 222 40% 12%;
  --shadow-xs: 0 1px 2px hsl(var(--shadow-color) / 0.04);
  --shadow-sm: 0 1px 3px hsl(var(--shadow-color) / 0.05), 0 2px 8px -2px hsl(var(--shadow-color) / 0.05);
  --shadow-md: 0 2px 6px hsl(var(--shadow-color) / 0.05), 0 8px 18px -6px hsl(var(--shadow-color) / 0.10);
  --shadow-lg: 0 4px 10px hsl(var(--shadow-color) / 0.06), 0 16px 32px -10px hsl(var(--shadow-color) / 0.18);
  --shadow-inset: inset 0 1px 2px hsl(var(--shadow-color) / 0.06);

  /* Barra de rolagem */
  --scrollbar-size: 10px;
  --scrollbar-track: var(--color-bg);
  --scrollbar-thumb: var(--color-sidebar-2);
  --scrollbar-thumb-hover: var(--color-primary);
}

/* ── Base ── */
html {
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

*,
*::before,
*::after {
  font-family: inherit;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

a {
  text-decoration: none;
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Textos de apoio */
.text-\[11px\] {
  font-size: 0.8125rem !important;
}

.font-bold {
  font-weight: 600 !important;
}

.font-semibold {
  font-weight: 500 !important;
}

.uppercase {
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.tracking-widest {
  letter-spacing: 0.02em !important;
}

/* ── Cartões ── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

a.card:hover,
button.card:hover,
.card.cursor-pointer:hover,
.card.hover\:shadow-md:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* ── Botões ── */
.btn-primary {
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.875rem;
  box-shadow: var(--shadow-xs);
  transition: background 0.18s, transform 0.12s, box-shadow 0.18s;
}

.btn-primary:hover {
  background: var(--color-primary-light);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-ghost {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.8125rem;
  transition: background 0.15s, border-color 0.15s;
}

.btn-ghost:hover {
  background: var(--color-soft);
  border-color: var(--color-primary-soft);
}

.btn-ghost:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-danger {
  background: var(--color-danger);
  color: var(--color-primary-contrast);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: filter 0.15s, transform 0.12s;
}

.btn-danger:hover {
  filter: brightness(1.05);
}

.btn-danger:active {
  transform: scale(0.98);
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 10px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.9375rem;
  font-weight: 500;
  box-shadow: var(--shadow-xs);
}

.btn-google:hover:not(:disabled) {
  background: var(--color-soft);
}

.btn-google:disabled {
  opacity: 0.6;
  cursor: wait;
}

.btn-google svg {
  width: 18px;
  height: 18px;
}

.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 14px;
  color: var(--color-muted);
  font-size: 0.8125rem;
}

.auth-or::before,
.auth-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--color-muted);
  transition: background 0.15s, color 0.15s;
}

.icon-btn svg {
  width: 17px;
  height: 17px;
  display: block;
}

.icon-btn:hover {
  background: var(--color-soft);
  color: var(--color-text);
}

.icon-btn:active {
  transform: scale(0.92);
}

.icon-btn.bordered {
  border-color: var(--color-border);
  background: var(--color-surface);
}

.icon-btn.danger:hover {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

/* Botões da faixa escura */
main>header .icon-btn.bordered,
#view-list>header .icon-btn.bordered {
  border-color: var(--color-sidebar-line);
  background: transparent;
  color: var(--color-sidebar-text);
}

main>header .icon-btn.bordered:hover,
#view-list>header .icon-btn.bordered:hover {
  background: var(--color-sidebar-2);
  color: var(--color-primary-contrast);
}

main>header .btn-ghost,
#view-list>header .btn-ghost {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: transparent;
}

/* ── Campos ── */
.field {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  background: var(--color-surface);
  color: var(--color-text);
  box-sizing: border-box;
  font-size: 0.875rem;
  box-shadow: var(--shadow-inset);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field::placeholder {
  color: var(--color-muted);
  opacity: 0.75;
}

.field:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 14%, transparent);
  outline: none;
}

label>span.text-sm,
dialog[id] label>span.text-sm {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text);
}

input.field:not([type="checkbox"]):not([type="radio"]),
select.field {
  min-height: 40px;
}

input,
select,
textarea {
  font-size: 0.875rem;
}

/* Seletores personalizados */
.crm-select {
  position: relative;
  display: inline-flex;
  width: 100%;
  min-width: 0;
  vertical-align: middle;
}

.crm-select.is-auto {
  width: auto;
  max-width: 100%;
}

.crm-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.crm-select-trigger.field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 40px;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

.crm-select-trigger:hover:not(:disabled) {
  background: var(--color-soft);
}

.crm-select-trigger[aria-expanded="true"],
.crm-select-trigger:focus-visible {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 14%, transparent);
  outline: none;
}

.crm-select-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-select-chevron {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--color-muted);
  transition: transform 0.15s;
}

.crm-select-trigger[aria-expanded="true"] .crm-select-chevron {
  transform: rotate(180deg);
}

.crm-select-trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.crm-select-menu {
  position: fixed;
  inset: auto;
  margin: 0;
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  font-size: 0.875rem;
}

.crm-select-menu:popover-open {
  display: block;
}

.crm-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.crm-select-option+.crm-select-option {
  margin-top: 2px;
}

.crm-select-option.is-focused {
  background: var(--color-soft);
}

.crm-select-option[aria-selected="true"] {
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-weight: 500;
}

.crm-select-option[aria-disabled="true"] {
  color: var(--color-muted);
  opacity: 0.6;
  cursor: not-allowed;
}

.crm-select-check {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.crm-select-group {
  padding: 10px 12px 6px;
  color: var(--color-muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.crm-select-group:not(:first-child) {
  margin-top: 6px;
  border-top: 1px solid var(--color-border);
}

.checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 4px;
}

/* ── Menu lateral escuro ── */
body>div>aside[class] {
  background: var(--color-sidebar);
  border-right: none;
  color: var(--color-sidebar-text);
  box-shadow: 4px 0 18px -10px hsl(var(--shadow-color) / 0.5);
  padding-top: 22px;
}

body>div>aside[class]>a:first-child {
  color: var(--color-primary-contrast);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

body>div>aside[class]>a:first-child>span:first-child {
  background: var(--color-primary) !important;
  border-radius: 10px !important;
  color: #fff;
  font-weight: 600;
}

body>div>aside[class] nav {
  margin-top: 30px;
}

body>div>aside[class] .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 2px;
  color: var(--color-sidebar-text);
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius-xs);
  transition: background 0.15s, color 0.15s;
}

body>div>aside[class] .nav-link:hover {
  background: var(--color-sidebar-2);
  color: var(--color-primary-contrast);
}

body>div>aside[class] .nav-link.active {
  background: var(--color-sidebar-2);
  color: var(--color-primary-contrast);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--color-accent);
}

/* Ícone do menu: SVG de traço, cinza; ativo fica branco */
.nav-link .nav-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--color-sidebar-muted);
}

.nav-link .nav-icon svg {
  width: 19px;
  height: 19px;
  display: block;
  stroke-width: 1.7;
}

.nav-link.active .nav-icon {
  color: var(--color-primary-contrast);
}

body>div>aside[class] .border-t {
  border-color: var(--color-sidebar-line) !important;
}

body>div>aside[class] [data-user-name] {
  color: var(--color-primary-contrast);
  font-size: 0.9375rem;
  font-weight: 500;
}

body>div>aside[class] [data-user-initial] {
  background: var(--color-accent) !important;
  color: #fff;
  border-radius: 10px !important;
  font-weight: 600;
}

body>div>aside[class] [data-reset-all],
body>div>aside[class] [data-logout] {
  color: var(--color-sidebar-muted);
  font-size: 0.8125rem;
}

body>div>aside[class] [data-logout]:hover,
body>div>aside[class] [data-reset-all]:hover {
  color: var(--color-primary-contrast);
}

body>div>aside[class] .text-\[var\(--color-muted\)\] {
  color: var(--color-sidebar-muted) !important;
}

/* ── Faixa escura do título ── */
main>header.animate-in,
#view-list>header {
  background: linear-gradient(180deg, var(--color-sidebar-2) 0%, var(--color-sidebar) 100%);
  color: var(--color-primary-contrast);
  padding: 22px 24px;
  border-radius: var(--radius);
  box-shadow: inset 0 -3px 0 var(--color-primary), var(--shadow-md);
}

main>header p,
#view-list>header p {
  color: var(--color-sidebar-muted);
  font-size: 0.8125rem;
}

main>header h1,
#view-list>header h1 {
  color: var(--color-primary-contrast);
  font-size: 1.5rem;
  font-weight: 600;
}

main>header .text-xs {
  font-size: 0.8125rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

/* ── Etiquetas e selos ── */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-weight: 500;
  font-size: 0.8125rem;
  padding: 3px 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.tag .i-svg {
  width: 12px;
  height: 12px;
  vertical-align: 0;
}

.tag-study {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.tag-review {
  background: var(--color-warning-soft);
  color: #b45309;
}

.tag-questions {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-pill);
  background: currentColor;
  flex-shrink: 0;
}

/* ── Abas ── */
.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--color-muted);
  transition: background 0.15s, color 0.15s;
}

.tab .i-svg {
  width: 14px;
  height: 14px;
}

.tab.active {
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  box-shadow: var(--shadow-xs);
}

.tab:not(.active):hover {
  color: var(--color-text);
  background: var(--color-soft);
}

.tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--color-soft);
  color: var(--color-muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.tab.active .tab-count {
  background: rgba(255, 255, 255, 0.22);
  color: var(--color-primary-contrast);
}

[role="tablist"] {
  gap: 6px;
}

/* ── Ícones dos cartões de número ── */
.stat-icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.stat-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  stroke-width: 1.7;
}

.stat-icon--success {
  background: var(--color-success-soft);
  color: var(--color-success);
}

.stat-icon--warning {
  background: var(--color-warning-soft);
  color: var(--color-warning);
}

.stat-icon--danger {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.i-svg {
  display: inline-block;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  vertical-align: -2px;
  stroke-width: 1.7;
}

.empty-icon .i-svg,
.empty-icon svg {
  width: 22px;
  height: 22px;
}

/* ── Listas de sessões ── */
.session-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 22px;
  border-top: 1px solid var(--color-border);
  transition: background 0.12s;
}

.session-row:hover {
  background: var(--color-soft);
}

.session-row.done .session-title {
  text-decoration: line-through;
  color: var(--color-muted);
  opacity: 0.7;
}

.session-title {
  font-size: 0.9375rem;
  font-weight: 500;
}

.review-day {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 22px;
  border-top: 1px solid var(--color-border);
  background: var(--color-soft);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-muted);
}

.review-day span:first-child {
  color: var(--color-text);
  font-weight: 600;
}

/* Cabeçalhos de cartão e tabela */
.card.overflow-hidden>.p-5:first-child {
  border-bottom: 1px solid var(--color-border);
}

thead tr {
  background: var(--color-soft);
}

thead th {
  padding: 10px 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-muted);
  white-space: nowrap;
}

tbody td {
  padding: 12px;
  vertical-align: middle;
  font-size: 0.875rem;
}

tbody tr:hover {
  background: var(--color-soft);
}

/* ── Barra de progresso ── */
progress {
  height: 6px;
  width: 100%;
  border-radius: var(--radius-pill);
  overflow: hidden;
  border: none;
}

progress::-webkit-progress-bar {
  background: var(--color-soft);
  border-radius: var(--radius-pill);
  box-shadow: inset 0 1px 2px hsl(var(--shadow-color) / 0.08);
}

progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
}

progress::-moz-progress-bar {
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
  border-radius: var(--radius-pill);
}

/* ── Janelas ── */
dialog[id] {
  width: min(500px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 28px;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.22s ease-out;
}

dialog[id] form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

dialog[id] form>* {
  margin: 0;
}

dialog[id] h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

dialog[id] .field {
  margin-top: 6px;
}

dialog[id] textarea.field {
  min-height: 96px;
  line-height: 1.5;
}

dialog[id] button[id^="btn-close"] {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--color-soft);
  font-size: 1.25rem;
  line-height: 1;
  color: var(--color-muted);
}

dialog[id] button[id^="btn-close"]:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

dialog[id] button[type="submit"] {
  margin-top: 4px;
  padding-top: 11px;
  padding-bottom: 11px;
  font-size: 0.9375rem;
}

dialog[id] p[role="alert"]:empty {
  display: none;
}

dialog[id] p[role="alert"] {
  font-size: 0.8125rem;
}

dialog::backdrop {
  background: var(--color-overlay);
  backdrop-filter: blur(3px);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeInUp 0.35s ease-out both;
}

/* Janela de confirmação */
dialog#dlg-confirm {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  overflow: hidden;
}

.confirm-body {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px 24px 20px;
}

.confirm-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.confirm-icon.danger {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.confirm-icon svg {
  width: 19px;
  height: 19px;
  display: block;
}

#dlg-confirm .confirm-title {
  margin: 2px 0 0;
  font-size: 1.0625rem;
  font-weight: 600;
}

.confirm-message {
  margin: 6px 0 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--color-muted);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 24px;
  background: var(--color-soft);
  border-top: 1px solid var(--color-border);
}

.confirm-actions button {
  min-width: 108px;
  padding: 10px 16px;
  font-size: 0.875rem;
}

/* Aviso rápido */
#toast-container>.card {
  border-left: 3px solid var(--color-primary);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Guia de balões */
.tour-blocker {
  position: fixed;
  inset: 0;
  z-index: 9000;
}

.tour-spot {
  position: fixed;
  z-index: 9001;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 9999px var(--color-overlay), 0 0 0 3px var(--color-primary-light);
  pointer-events: none;
  transition: top 0.25s ease, left 0.25s ease, width 0.25s ease, height 0.25s ease;
}

.tour-tip {
  position: fixed;
  z-index: 9002;
  box-sizing: border-box;
  width: min(320px, calc(100vw - 24px));
  padding: 18px 18px 14px;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.22s ease-out;
}

.tour-arrow {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  transform: rotate(45deg);
}

.tour-tip[data-place="below"] .tour-arrow {
  top: -7px;
  border-right: none;
  border-bottom: none;
}

.tour-tip[data-place="above"] .tour-arrow {
  bottom: -7px;
  border-left: none;
  border-top: none;
}

.tour-tip[data-place="inside"] .tour-arrow {
  display: none;
}

.tour-step {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-primary);
}

.tour-title {
  margin: 4px 0 0;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
}

.tour-text {
  margin: 6px 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-muted);
}

.tour-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.tour-skip {
  margin-right: auto;
  padding: 6px 0;
  border: none;
  background: none;
  font-size: 0.8125rem;
  color: var(--color-muted);
}

.tour-skip:hover {
  color: var(--color-text);
}

/* ── Planos ── */
.plan-chip {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  padding: 0 6px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.8125rem;
}

.plan-chip.lg {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  font-size: 1.375rem;
  background: var(--color-primary);
}

.plan-main-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
}

.plan-main-badge.hidden {
  display: none;
}

.plan-main-badge svg {
  width: 12px;
  height: 12px;
  color: var(--color-accent);
}

.card.is-main-plan {
  border-color: color-mix(in srgb, var(--color-primary) 40%, var(--color-border));
}

.card.is-new {
  border-color: var(--color-primary);
  animation: planPulse 1.2s ease-out 2;
}

@keyframes planPulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-primary) 40%, transparent);
  }

  100% {
    box-shadow: 0 0 0 12px transparent;
  }
}

.subject-card {
  border-left: 4px solid var(--color-subject-1);
  cursor: pointer;
}

.subject-card h3 {
  font-size: 0.9375rem;
  font-weight: 600;
}

.option-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: box-shadow 0.18s, border-color 0.18s;
}

.option-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
}

.option-card .stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

.add-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 150px;
  border: 1.5px dashed var(--color-border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--color-muted);
  font-weight: 500;
  font-size: 0.875rem;
}

.add-card:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-soft);
}

.add-card svg {
  width: 22px;
  height: 22px;
}

.topic-list {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.topic-list:empty {
  display: none;
}

.topic-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 12px;
  border-top: 1px solid var(--color-border);
}

.topic-row:first-child {
  border-top: none;
}

.topic-row:hover {
  background: var(--color-soft);
}

.topic-name {
  font-size: 0.875rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.topic-row.done .topic-name {
  text-decoration: line-through;
  color: var(--color-muted);
}

.topic-next {
  font-size: 0.8125rem;
  color: var(--color-muted);
  margin-top: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topic-next strong {
  color: var(--color-text);
  font-weight: 500;
}

/* ── Painel: resumo do plano e constância ── */
.kpi-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 18px 20px;
}

.kpi-big {
  margin-top: 6px;
  font-family: var(--font-heading);
  font-size: 1.875rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--color-text);
}

.kpi-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
}

.kpi-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-muted);
}

.kpi-line-num {
  color: var(--color-text);
  font-weight: 600;
}

.kpi-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: var(--radius-pill);
}

.quote-card {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-primary);
  background: var(--color-primary-soft);
  border-color: transparent;
  box-shadow: none;
  font-weight: 500;
}

.streak-strip {
  display: grid;
  grid-template-columns: repeat(30, minmax(0, 1fr));
  gap: 4px;
  margin-top: 14px;
}

.streak-cell {
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--color-soft);
  color: var(--color-muted);
}

.streak-cell svg {
  width: 11px;
  height: 11px;
  opacity: 0.7;
}

.streak-cell.on {
  background: var(--color-success);
  color: var(--color-primary-contrast);
}

.streak-cell.on svg {
  opacity: 1;
}

.streak-cell.pending {
  background: var(--color-soft);
}

.streak-cell.today {
  outline: 2px solid var(--color-primary-light);
  outline-offset: 1px;
}

@media (max-width: 639px) {
  .streak-strip {
    grid-template-columns: repeat(15, minmax(0, 1fr));
  }

  .kpi-big {
    font-size: 1.5rem;
  }
}

/* ── Simulados: catálogo ── */
.sim-free-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--color-success-soft);
  color: var(--color-success);
  font-size: 0.8125rem;
  font-weight: 500;
}

.sim-toolbar {
  padding: 0;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
}

.sim-toolbar-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--color-border);
}

.sim-search {
  position: relative;
  flex: 1 1 260px;
  min-width: 0;
}

.sim-search .i-svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-muted);
  pointer-events: none;
}

.sim-search .field {
  padding-left: 36px;
}

.sim-levels {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--color-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.sim-level {
  min-height: 34px;
  padding: 0 14px;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--color-muted);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.sim-level:hover {
  color: var(--color-text);
}

.sim-level.active {
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.sim-toolbar-chips {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  min-width: 0;
  max-width: 100%;
}

.sim-toolbar-label {
  flex-shrink: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-muted);
}

.sim-chips-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sim-chips {
  --fade-l: 0px;
  --fade-r: 40px;
  flex: 1;
  min-width: 0;
  contain: inline-size;
  display: flex;
  gap: 8px;
  padding: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%);
}

.sim-chips::-webkit-scrollbar {
  display: none;
}

.sim-chips.dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

.sim-chips.dragging .sim-chip {
  pointer-events: none;
}

.sim-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 6px 0 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.sim-chip:hover {
  border-color: color-mix(in srgb, var(--color-primary) 40%, var(--color-border));
  color: var(--color-primary);
}

.sim-chip .i-svg {
  width: 14px;
  height: 14px;
  color: var(--color-accent);
}

.sim-chip-count {
  min-width: 20px;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--color-soft);
  color: var(--color-muted);
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
}

.sim-chip.active {
  background: var(--color-primary-soft);
  border-color: color-mix(in srgb, var(--color-primary) 45%, transparent);
  color: var(--color-primary);
}

.sim-chip.active .sim-chip-count {
  background: var(--color-primary);
  color: var(--color-primary-contrast);
}

.sim-arrow {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-xs);
  transition: background 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s;
}

.sim-arrow svg {
  width: 16px;
  height: 16px;
  display: block;
}

.sim-arrow:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--color-primary) 40%, var(--color-border));
  color: var(--color-primary);
}

.sim-arrow:disabled {
  opacity: 0.35;
  cursor: default;
  box-shadow: none;
}

.sim-toolbar-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  background: var(--color-soft);
  border-top: 1px solid var(--color-border);
  font-size: 0.8125rem;
  color: var(--color-muted);
}

.sim-toolbar-foot p {
  margin: 0;
  min-width: 0;
  overflow-wrap: break-word;
}

.sim-toolbar-foot strong {
  color: var(--color-text);
  font-weight: 600;
}

.sim-clear {
  padding: 0;
  border: none;
  background: none;
  color: var(--color-primary);
  font-size: 0.8125rem;
  font-weight: 500;
}

.sim-clear:hover {
  text-decoration: underline;
}

.sim-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  min-height: 196px;
  overflow: hidden;
  padding: 20px;
  cursor: pointer;
  text-align: left;
}

.sim-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md), 0 0 0 1px color-mix(in srgb, var(--color-primary) 18%, transparent);
}

.sim-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.sim-banca {
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sim-level-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-muted);
  font-size: 0.8125rem;
  font-weight: 500;
}

.sim-level-tag .i-svg {
  width: 14px;
  height: 14px;
}

.sim-card-title {
  margin: 14px 0 0;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: break-word;
}

.sim-card-sub {
  margin: 4px 0 18px;
  color: var(--color-muted);
  font-size: 0.875rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.sim-card-meta {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  color: var(--color-muted);
  font-size: 0.875rem;
}

.sim-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.sim-card-meta strong {
  color: var(--color-text);
  font-weight: 600;
}

.sim-card-go {
  margin-left: auto;
  color: var(--color-primary);
  font-weight: 500;
  transition: gap 0.15s;
}

.sim-card:hover .sim-card-go {
  gap: 9px;
}

/* ── Simulados: prova ── */
main.exam-mode> :not(#view-exam):not(footer),
main.result-mode> :not(#view-result):not(footer) {
  display: none !important;
}

.exam-top {
  padding: 16px 20px;
}

.exam-top-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.exam-top-info {
  flex: 1;
  min-width: 0;
}

.exam-sub {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

main .exam-title {
  margin: 2px 0 0;
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exam-timer {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--color-sidebar);
  color: var(--color-primary-contrast);
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.exam-timer .i-svg {
  color: var(--color-accent);
}

.exam-timer.is-low {
  background: var(--color-danger);
}

.exam-timer.is-low .i-svg {
  color: var(--color-primary-contrast);
}

.exam-progress-wrap {
  margin-top: 14px;
}

.exam-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 0.8125rem;
  color: var(--color-muted);
}

.exam-progress-head span:first-child {
  color: var(--color-text);
  font-weight: 500;
}

.exam-notice {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 0.875rem;
  line-height: 1.5;
}

.exam-notice:empty {
  display: none;
}

.exam-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: start;
  margin-bottom: 32px;
}

.exam-question {
  padding: 24px;
  min-width: 0;
}

.exam-question-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.exam-number {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 600;
}

.exam-text {
  margin: 18px 0 22px;
  font-size: 0.9375rem;
  line-height: 1.7;
  overflow-wrap: break-word;
  white-space: pre-line;
}

.exam-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.exam-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.9375rem;
  line-height: 1.45;
  text-align: left;
  overflow-wrap: anywhere;
  transition: border-color 0.15s, background 0.15s;
}

.exam-option:hover {
  border-color: color-mix(in srgb, var(--color-primary) 45%, var(--color-border));
  background: var(--color-soft);
}

.exam-letter {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  background: var(--color-soft);
  color: var(--color-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.exam-option.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 12%, transparent);
}

.exam-option.selected .exam-letter {
  background: var(--color-primary);
  color: var(--color-primary-contrast);
}

.exam-options.is-ce {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.exam-options.is-ce .exam-option {
  justify-content: center;
  min-height: 56px;
  font-weight: 500;
}

.exam-option.ce-certo.selected {
  border-color: var(--color-success);
  background: var(--color-success-soft);
  color: var(--color-success);
}

.exam-option.ce-certo.selected .exam-letter {
  background: var(--color-success);
}

.exam-option.ce-errado.selected {
  border-color: var(--color-danger);
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.exam-option.ce-errado.selected .exam-letter {
  background: var(--color-danger);
}

.exam-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--color-border);
}

.exam-nav button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.exam-side {
  position: sticky;
  top: 20px;
  padding: 18px;
}

.exam-side-title {
  margin: 0 0 12px;
  font-size: 0.9375rem;
  font-weight: 600;
}

.exam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: 6px;
}

.exam-num {
  height: 36px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  background: var(--color-surface);
  color: var(--color-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.exam-num:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.exam-num.is-answered {
  background: var(--color-primary-soft);
  border-color: transparent;
  color: var(--color-primary);
}

.exam-num.is-current {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
  color: var(--color-text);
}

.exam-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 14px 0 16px;
  font-size: 0.8125rem;
  color: var(--color-muted);
}

.exam-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.exam-dot {
  width: 10px;
  height: 10px;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  background: var(--color-surface);
}

.exam-dot.is-answered {
  background: var(--color-primary-soft);
  border-color: transparent;
}

.exam-dot.is-current {
  border: 2px solid var(--color-primary);
}

.exam-side-hint {
  margin: 10px 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--color-muted);
  text-align: center;
}

/* ── Simulados: resultado e histórico ── */
.result-hero {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 24px;
}

.result-ring {
  --pct: 0;
  --ring-color: var(--color-primary);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  border-radius: var(--radius-pill);
  background: conic-gradient(var(--ring-color) calc(var(--pct) * 1%), var(--color-soft) 0);
  transition: background 0.4s ease;
}

.result-ring.is-good {
  --ring-color: var(--color-success);
}

.result-ring.is-mid {
  --ring-color: var(--color-warning);
}

.result-ring.is-low {
  --ring-color: var(--color-danger);
}

.result-ring-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 102px;
  height: 102px;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
}

.result-score {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1;
}

.result-score-label {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--color-muted);
}

.result-info {
  flex: 1;
  min-width: 0;
}

.result-message {
  margin: 8px 0 0;
  font-size: 0.9375rem;
  line-height: 1.55;
}

.result-net {
  margin: 8px 0 0;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 0.875rem;
  font-weight: 500;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.result-subjects {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.result-subject-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 0.875rem;
}

.result-subject-head span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.result-subject-head span:last-child {
  flex-shrink: 0;
  color: var(--color-muted);
}

.result-bar {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--color-soft);
  overflow: hidden;
}

.result-bar>span {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--color-success);
  transition: width 0.5s ease;
}

.result-bar.is-mid>span {
  background: var(--color-warning);
}

.result-bar.is-low>span {
  background: var(--color-danger);
}

.review-item {
  padding: 20px 22px;
  border-top: 1px solid var(--color-border);
  border-left: 3px solid transparent;
}

.review-item.is-correct {
  border-left-color: var(--color-success);
}

.review-item.is-wrong {
  border-left-color: var(--color-danger);
}

.review-item.is-blank {
  border-left-color: var(--color-warning);
}

.review-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.review-head .exam-number {
  min-width: 28px;
  height: 28px;
  font-size: 0.875rem;
}

.review-text {
  margin: 12px 0 0;
  font-size: 0.9375rem;
  line-height: 1.65;
  overflow-wrap: break-word;
  white-space: pre-line;
}

.review-answers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.review-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--color-soft);
  font-size: 0.8125rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.review-chip.is-ok {
  background: var(--color-success-soft);
  color: var(--color-success);
}

.review-chip.is-bad {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.review-explain {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-soft);
  color: var(--color-text);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.review-explain strong {
  color: var(--color-primary);
  font-weight: 600;
}

.review-ai {
  margin-top: 12px;
}

.review-ai-text {
  margin: 10px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--color-soft);
  font-size: 0.9375rem;
  line-height: 1.6;
  white-space: pre-line;
}

.review-ai-text.is-error {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.hist-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  border-top: 1px solid var(--color-border);
  transition: background 0.15s;
}

.hist-row:hover {
  background: var(--color-soft);
}

.hist-score {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--color-success-soft);
  color: var(--color-success);
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 600;
}

.hist-score.is-mid {
  background: var(--color-warning-soft);
  color: var(--color-warning);
}

.hist-score.is-low {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.hist-info {
  flex: 1;
  min-width: 0;
}

.hist-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hist-meta {
  margin: 2px 0 0;
  font-size: 0.8125rem;
  color: var(--color-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hist-stats {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
  font-size: 0.8125rem;
  font-weight: 500;
}

.hist-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* ── Flashcards ── */
.fc-study {
  max-width: 720px;
  margin: 0 auto;
}

.fc-study-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.fc-exit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.fc-exit:hover {
  background: var(--color-soft);
  color: var(--color-text);
}

.fc-exit svg {
  width: 16px;
  height: 16px;
}

.fc-counter {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-muted);
}

.fc-progress {
  margin-bottom: 24px;
}

.fc-card {
  display: flex;
  flex-direction: column;
  min-height: 260px;
  padding: 24px;
}

.fc-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8125rem;
  color: var(--color-muted);
}

.fc-deck {
  font-weight: 500;
  color: var(--color-primary);
}

.fc-side {
  font-size: 0.75rem;
  font-weight: 500;
}

.fc-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 0;
}

.fc-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-muted);
}

.fc-face {
  margin-top: 8px;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--color-text);
  white-space: pre-line;
  overflow-wrap: break-word;
}

.fc-back {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

.fc-show {
  width: 100%;
  margin-top: 16px;
}

.fc-kbd {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  border: 1px solid var(--color-border);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--color-surface);
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--color-muted);
}

.fc-grades {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.fc-grade {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 60px;
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  transition: background 0.15s, border-color 0.15s;
}

.fc-grade span {
  font-size: 0.9375rem;
  font-weight: 500;
}

.fc-grade small {
  font-size: 0.75rem;
  color: var(--color-muted);
}

.fc-grade.is-again:hover {
  border-color: var(--color-danger);
  background: var(--color-danger-soft);
}

.fc-grade.is-hard:hover {
  border-color: var(--color-warning);
  background: var(--color-warning-soft);
}

.fc-grade.is-good:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}

.fc-grade.is-easy:hover {
  border-color: var(--color-success);
  background: var(--color-success-soft);
}

.fc-keys {
  margin-top: 16px;
  font-size: 0.8125rem;
  color: var(--color-muted);
  text-align: center;
}

/* ── Sugestões de disciplina (IA) ── */
.ia-combo {
  position: relative;
}

.ia-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}

.ia-suggest.hidden {
  display: none;
}

.ia-suggest-head {
  padding: 8px 12px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-muted);
}

.ia-suggest-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 0.875rem;
}

.ia-suggest-item.is-active {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.ia-suggest-name mark {
  background: var(--color-warning-soft);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

.ia-suggest-count {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--color-muted);
}

.ia-suggest-empty {
  padding: 12px;
  font-size: 0.8125rem;
  color: var(--color-muted);
  line-height: 1.5;
}

/* ── Mapas mentais ── */
.mm-tab {
  padding: 8px 16px;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.mm-tab[aria-selected="true"] {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.mm-chip {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 0.875rem;
}

.mm-chip.is-on {
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 500;
}

.mm-tool {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 0.875rem;
}

.mm-tool.danger:hover:not(:disabled) {
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.mm-tool:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.mm-tpl {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.mm-tpl-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-weight: 600;
}

/* ── Ranking ── */
.rk-hero {
  background: linear-gradient(135deg, var(--color-sidebar-2), var(--color-sidebar));
  color: var(--color-primary-contrast);
  border: none;
}

.rk-bar {
  height: 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.rk-bar>span {
  display: block;
  height: 100%;
  background: var(--color-accent);
  border-radius: var(--radius-pill);
}

.rk-goal {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--color-border);
  font-size: 0.875rem;
}

.rk-dot {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-pill);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.rk-dot.on {
  background: var(--color-success);
  color: #fff;
}

.rk-dot.off {
  background: var(--color-soft);
  color: var(--color-muted);
}

.rk-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-top: 1px solid var(--color-border);
}

.rk-pos {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  display: grid;
  place-items: center;
  font-weight: 600;
  background: var(--color-soft);
  color: var(--color-muted);
}

.rk-pos.gold {
  background: #fde68a;
  color: #92400e;
}

.rk-pos.silver {
  background: #e5e7eb;
  color: #374151;
}

.rk-pos.bronze {
  background: #fed7aa;
  color: #9a3412;
}

/* ── Acesso (entrar) ── */
.blocked-msg {
  color: var(--color-danger);
}

/* ── Modo celular ── */
.app-topbar,
.app-bottomnav,
.app-sheet-wrap,
.app-backdrop {
  display: none;
}

@media (max-width: 1023px) {
  body {
    overscroll-behavior-y: none;
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  body>div>aside {
    display: flex !important;
    position: fixed !important;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 70 !important;
    background: var(--color-sidebar);
    width: min(300px, 84vw);
    overflow-y: auto;
    padding-top: calc(20px + env(safe-area-inset-top));
    transform: translateX(-105%);
    transition: transform 0.25s ease;
  }

  body.menu-open>div>aside {
    transform: none !important;
    box-shadow: var(--shadow-lg);
  }

  .app-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 65;
    background: var(--color-overlay);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  body.menu-open .app-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  body.menu-open {
    overflow: hidden;
  }

  .app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 30;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    background: var(--color-sidebar);
    color: var(--color-primary-contrast);
    box-shadow: var(--shadow-md);
  }

  .app-topbar .top-left {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .app-topbar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--color-primary-contrast);
  }

  .app-topbar .brand-logo {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    font-size: 0.875rem;
    background: var(--color-primary);
    color: var(--color-primary-contrast);
  }

  .app-menu-btn {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    margin-left: -8px;
    border: none;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--color-primary-contrast);
  }

  .app-menu-btn:active {
    background: var(--color-sidebar-2);
  }

  .app-avatar {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.875rem;
    background: var(--color-accent);
    color: #fff;
  }

  .app-bottomnav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -4px 14px -8px hsl(var(--shadow-color) / 0.25);
  }

  .app-bottomnav a {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 2px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-muted);
  }

  .app-bottomnav a .ico {
    display: grid;
    place-items: center;
    padding: 2px 14px;
    border-radius: var(--radius-pill);
    line-height: 1;
  }

  .app-bottomnav a .ico svg {
    width: 21px;
    height: 21px;
    display: block;
    stroke-width: 1.7;
  }

  .app-bottomnav a>span:last-child {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .app-bottomnav a.active {
    color: var(--color-primary);
    font-weight: 600;
  }

  .app-bottomnav a.active .ico {
    background: var(--color-primary-soft);
  }

  .app-sheet-wrap.open {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 60;
    align-items: flex-end;
    background: var(--color-overlay);
  }

  .app-sheet {
    width: 100%;
    padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
    background: var(--color-surface);
    border-radius: 22px 22px 0 0;
    animation: slideUp 0.22s ease-out;
  }

  .app-sheet button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 14px 4px;
    border: none;
    background: none;
    font-size: 0.9375rem;
    border-top: 1px solid var(--color-border);
  }

  #toast-container {
    left: 16px;
    right: 16px;
    bottom: calc(88px + env(safe-area-inset-bottom));
  }

  main {
    padding: 16px 14px 0;
  }

  main h1 {
    font-size: 1.375rem;
  }

  main>header.animate-in,
  #view-list>header {
    padding: 16px 18px;
  }

  main>header h1,
  #view-list>header h1 {
    font-size: 1.25rem;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  dialog[id] {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
    border-bottom: none;
    max-height: 92vh;
  }

  dialog#dlg-confirm {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    padding: 0;
  }

  .confirm-body {
    padding: 24px 20px 18px;
  }

  .confirm-actions {
    padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  }

  .confirm-actions button {
    flex: 1;
    min-height: 46px;
  }

  .overflow-x-auto {
    -webkit-overflow-scrolling: touch;
  }

  .overflow-x-auto table {
    min-width: 600px;
  }

  .overflow-x-auto th,
  .overflow-x-auto td {
    white-space: nowrap;
  }

  .apexcharts-canvas {
    max-width: 100%;
  }

  [role="tablist"] {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-left: -14px;
    margin-right: -14px;
    padding: 0 14px 4px;
    scrollbar-width: none;
  }

  [role="tablist"]::-webkit-scrollbar {
    display: none;
  }

  [role="tablist"] .tab {
    flex-shrink: 0;
    padding: 9px 16px;
    white-space: nowrap;
  }

  .session-row {
    padding: 15px 14px;
    min-height: 62px;
  }

  .session-row:active {
    background: var(--color-soft);
  }

  .checkbox {
    width: 22px;
    height: 22px;
  }

  .btn-primary,
  .btn-ghost {
    min-height: 44px;
  }

  .card:active {
    transform: scale(0.99);
    transition: transform 0.1s;
  }

  .card.p-5 {
    padding: 16px;
  }

  .card input.field {
    width: 100% !important;
  }

  .card select.field {
    width: auto !important;
    max-width: 55%;
  }

  .card.flex-wrap select.field {
    flex: 1 1 140px;
    max-width: 100%;
  }

  .card p,
  .card h2,
  .card h3 {
    overflow-wrap: break-word;
    word-break: normal;
  }

  .badge,
  .tag {
    white-space: nowrap;
  }

  .plan-head {
    flex-direction: column;
  }

  .plan-chip.lg {
    width: 54px;
    height: 54px;
    font-size: 1.125rem;
  }

  .review-day {
    padding: 10px 14px;
  }

  .sim-level {
    flex: 1;
    min-height: 40px;
  }

  .sim-levels {
    width: 100%;
  }

  .sim-toolbar-top {
    padding: 14px;
  }

  .sim-toolbar-chips {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px 0 12px 14px;
  }

  .sim-chip {
    height: 38px;
  }

  .sim-arrow {
    display: none;
  }

  .sim-chips {
    cursor: auto;
  }

  .sim-card {
    min-height: 0;
  }

  .exam-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .exam-side {
    position: static;
  }

  .exam-question {
    padding: 18px 16px;
  }

  .exam-nav button {
    flex: 1;
    justify-content: center;
  }

  .exam-option {
    min-height: 52px;
  }

  .result-hero {
    flex-direction: column;
    text-align: center;
    padding: 20px 16px;
  }

  .result-actions {
    justify-content: center;
  }

  .result-actions button {
    flex: 1 1 140px;
  }

  .review-item {
    padding: 16px;
  }

  .hist-row {
    padding: 14px 16px;
    gap: 10px;
  }

  .hist-stats {
    display: none;
  }

  .fc-grades {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fc-card {
    min-height: 220px;
    padding: 20px;
  }

  .fc-face {
    font-size: 1rem;
  }

  .fc-kbd,
  .fc-keys {
    display: none;
  }
}

/* ── Barra de rolagem ── */
::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
  border: 2px solid var(--scrollbar-track);
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-hover);
}

::-webkit-scrollbar-corner {
  background: var(--scrollbar-track);
}

.card,
.topic-list,
dialog[id],
.crm-select-menu {
  --scrollbar-track: var(--color-surface);
}

body>div>aside[class] {
  --scrollbar-track: var(--color-sidebar);
  --scrollbar-thumb: var(--color-sidebar-2);
  --scrollbar-thumb-hover: var(--color-accent);
}

/* ── Movimento reduzido ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Sidebar: hover e ativo sem deslocamento */
body > div > aside[class] .nav-link {
  transform: none !important;
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

body > div > aside[class] .nav-link:hover {
  transform: none !important;
  background: #223052;
  color: var(--color-primary-contrast);
  box-shadow: inset 0 0 0 1px var(--color-sidebar-line);
}

body > div > aside[class] .nav-link.active {
  transform: none !important;
  background: var(--color-sidebar-2);
  color: var(--color-primary-contrast);
  box-shadow: inset 3px 0 0 var(--color-accent);
}

body > div > aside[class] .nav-link.active:hover {
  transform: none !important;
  background: var(--color-sidebar-2);
  box-shadow: inset 3px 0 0 var(--color-accent);
}

/* Sidebar: lock item position across hover and active states */
body > div > aside[class] .nav-link {
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease !important;
}

body > div > aside[class] .nav-link:hover,
body > div > aside[class] .nav-link.active,
body > div > aside[class] .nav-link.active:hover {
  transform: translate3d(0, 0, 0) !important;
  translate: none !important;
  left: 0 !important;
  margin-left: 0 !important;
}

/* Sidebar: mantem exatamente a mesma geometria nos estados interativos */
body > div > aside[class] nav .nav-link,
body > div > aside[class] nav .nav-link:hover,
body > div > aside[class] nav .nav-link.active,
body > div > aside[class] nav .nav-link.active:hover {
  box-sizing: border-box !important;
  position: relative !important;
  inset: auto !important;
  transform: none !important;
  translate: none !important;
  margin: 0 0 2px 0 !important;
  padding: 10px 12px !important;
  min-height: 40px !important;
  border-width: 0 !important;
  outline-offset: 0 !important;
}

body > div > aside[class] nav .nav-link {
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease !important;
}

body > div > aside[class] nav .nav-link:hover {
  background: #223052 !important;
  box-shadow: inset 0 0 0 1px var(--color-sidebar-line) !important;
}

body > div > aside[class] nav .nav-link.active,
body > div > aside[class] nav .nav-link.active:hover {
  background: var(--color-sidebar-2) !important;
  box-shadow: inset 3px 0 0 var(--color-accent) !important;
}

/* ══════════════════════════════════════
   Ajustes finais: sombras sutis, menu menor
   e animação ao passar o mouse no menu
   ══════════════════════════════════════ */

/* Sombras mais leves em todo o app */
:root {
  --shadow-xs: 0 1px 2px hsl(var(--shadow-color) / 0.035);
  --shadow-sm: 0 1px 2px hsl(var(--shadow-color) / 0.04), 0 2px 6px -3px hsl(var(--shadow-color) / 0.05);
  --shadow-md: 0 2px 4px hsl(var(--shadow-color) / 0.04), 0 6px 14px -6px hsl(var(--shadow-color) / 0.08);
  --shadow-lg: 0 4px 10px hsl(var(--shadow-color) / 0.05), 0 14px 28px -12px hsl(var(--shadow-color) / 0.14);
}

a.card:hover,
button.card:hover,
.card.cursor-pointer:hover,
.card.hover\:shadow-md:hover {
  transform: translateY(-1px);
}

body>div>aside[class] {
  box-shadow: 1px 0 0 var(--color-sidebar-line);
}

/* Textos do menu: menores, mas legíveis */
body>div>aside[class]>a:first-child {
  font-size: 1.125rem;
}

body>div>aside[class] nav {
  margin-top: 24px;
}

body>div>aside[class] [data-user-name] {
  font-size: 0.8125rem;
}

body>div>aside[class] [data-reset-all],
body>div>aside[class] [data-logout] {
  font-size: 0.75rem;
}

body > div > aside[class] nav .nav-link,
body > div > aside[class] nav .nav-link:hover,
body > div > aside[class] nav .nav-link.active,
body > div > aside[class] nav .nav-link.active:hover {
  isolation: isolate;
  overflow: hidden;
  gap: 10px !important;
  padding: 8px 12px !important;
  min-height: 36px !important;
  font-size: 0.8125rem !important;
  line-height: 1.25 !important;
}

body > div > aside[class] .nav-link .nav-icon {
  width: 20px;
  height: 20px;
}

body > div > aside[class] .nav-link .nav-icon svg {
  width: 17px;
  height: 17px;
  transition: transform 0.22s ease, color 0.22s ease;
}

/* Animação no hover: um brilho azul que preenche o item
   da esquerda para a direita, sem mover o item de lugar */
body > div > aside[class] nav .nav-link::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(90deg,
      color-mix(in srgb, var(--color-primary-light) 24%, transparent),
      color-mix(in srgb, var(--color-primary-light) 4%, transparent));
  opacity: 0;
  transform: scaleX(0.4);
  transform-origin: left center;
  transition: opacity 0.22s ease, transform 0.25s ease;
  pointer-events: none;
}

body > div > aside[class] nav .nav-link:hover {
  background: var(--color-sidebar) !important;
  color: var(--color-primary-contrast);
  box-shadow: inset 0 0 0 1px var(--color-sidebar-line) !important;
}

body > div > aside[class] nav .nav-link:hover::before {
  opacity: 1;
  transform: scaleX(1);
}

body > div > aside[class] nav .nav-link:hover .nav-icon {
  color: var(--color-primary-contrast);
}

body > div > aside[class] nav .nav-link:hover .nav-icon svg {
  transform: scale(1.12) rotate(-4deg);
}

/* Item ativo: fundo escuro e barrinha laranja, sem o brilho */
body > div > aside[class] nav .nav-link.active::before {
  opacity: 0 !important;
}

body > div > aside[class] nav .nav-link.active .nav-icon svg {
  transform: none;
}

