:root {
  --bg-color: #101216;
  --card-bg: #17191f;
  --card-hover: #1e212a;
  --modal-bg: #16181d;
  --input-bg: #0d0f13;
  --border-color: #262b35;
  --text-main: #edeff3;
  --text-muted: #8f97a6;
  --accent-color: #f0a63c;      /* Âmbar */
  --accent-hover: #db8f22;
  --accent-glow: rgba(240, 166, 60, 0.22);
  --success-color: #34d399;
  --danger-color: #f87171;
  --radius: 14px;
  --shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
}

::selection {
  background: var(--accent-color);
  color: #131110;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
}

/* ---------- Estrutura lateral ---------- */
.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  width: 240px;
  height: 100vh;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 24px 16px 20px;
  background: var(--card-bg);
  border-right: 1px solid var(--border-color);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
  padding: 0 8px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-nav .nav-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-radius: 10px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 11px 14px;
  cursor: pointer;
  transition: 0.18s;
}

.side-nav .nav-btn svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

.side-nav .nav-btn:hover { color: var(--text-main); background: var(--card-hover); }

.side-nav .nav-btn.active {
  background: linear-gradient(160deg, rgba(240, 166, 60, 0.16), rgba(240, 166, 60, 0.07));
  color: var(--accent-color);
}

.nav-badge,
.tab-badge {
  position: absolute;
  top: 6px;
  right: 8px;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger, #e5484d);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  line-height: 1;
}

.nav-badge[hidden],
.tab-badge[hidden] {
  display: none;
}

.tab-badge {
  top: 2px;
  right: calc(50% - 24px);
  margin-right: 0;
}

.sidebar-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.donate-link {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s, color 0.2s;
}
.donate-link:hover {
  opacity: 1;
  color: var(--accent-color);
}

.donate-card {
  text-align: center;
}
.donate-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.donate-card-body .btn {
  margin-top: 4px;
}

/* ---------- Conteúdo principal ---------- */
main {
  flex: 1;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 40px 36px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: block;
  filter: drop-shadow(0 0 10px rgba(240, 166, 60, 0.3));
  transition: transform 0.25s ease;
}

.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.1); }

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s;
}

.chip-btn:hover { border-color: var(--accent-color); }

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.sync-dot.ok { background: var(--success-color); }
.sync-dot.warn { background: #f59e0b; }
.sync-dot.busy {
  background: var(--accent-color);
  animation: pulseDot 1s ease infinite;
}
.sync-dot.off { background: var(--danger-color); }

.sync-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}
.sync-row .chip-btn {
  width: 100%;
  justify-content: center;
}
.btn-sync {
  padding: 5px 10px !important;
  font-size: 0.78rem !important;
}
.btn-sync:disabled { opacity: 0.55; cursor: default; }
.card-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.avatar-wrap { position: relative; display: flex; align-items: center; gap: 10px; }

.avatar-btn {
  font-family: inherit;
  cursor: pointer;
  transition: box-shadow 0.18s;
}

.avatar-btn:hover { box-shadow: 0 0 0 3px var(--accent-glow); }

.user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 210px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 8px;
  box-shadow: var(--shadow);
  z-index: 500;
  animation: fadeUp 0.15s ease;
}

.menu-email {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 8px 10px;
  word-break: break-all;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 6px;
}

.menu-item {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  padding: 9px 10px;
  border-radius: 7px;
  cursor: pointer;
}

.menu-item:hover { background: var(--card-hover); }
.menu-item.danger { color: var(--danger-color); }
.menu-item.danger:hover { background: rgba(239, 68, 68, 0.1); }

.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: var(--card-bg);
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent-color);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.foot-name {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-main);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: color 0.15s;
}

button.foot-name { color: var(--accent-color); }
button.foot-name:hover { text-decoration: underline; }

/* ---------- Views ---------- */
.view { display: none; flex-direction: column; gap: 20px; }
.view.active { display: flex; animation: fadeUp 0.25s ease; }

/* Grade de Ajustes: 1 coluna no mobile, 2 no desktop */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  width: 100%;
}

.settings-grid .card {
  margin: 0;
}

.settings-grid .settings-card {
  display: flex;
  flex-direction: column;
}

/* Alinha as ações (botões) na base dos cards, deixando os pares simétricos */
.settings-grid .settings-card .modal-actions,
.settings-grid .settings-card .row-btns {
  margin-top: auto;
  padding-top: 14px;
}

@media (min-width: 860px) {
  .settings-grid {
    grid-template-columns: 1fr 1fr;
  }
  .settings-grid .span-2 {
    grid-column: 1 / -1;
  }
}

/* Comutador interno da view Progresso */
.progress-tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  align-self: flex-start;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.progress-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.18s, background 0.18s, box-shadow 0.18s;
}

.progress-tab:hover { color: var(--text-main); }

.progress-tab.active {
  background: var(--card-bg);
  color: var(--accent-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.progress-tab i { font-size: 1.1rem; }

@media (min-width: 860px) {
  .progress-tabs { width: 320px; }
  .progress-tabs .progress-tab { flex: 1; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card {
  width: 100%;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 10px;
  flex-wrap: wrap;
}

.card-collapse-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  margin-bottom: 14px;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.card-collapse-chevron {
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: transform 0.22s ease;
}

.card-collapse-head[aria-expanded="false"] .card-collapse-chevron {
  transform: rotate(-90deg);
}

.profile-card-body[hidden] {
  display: none;
}

.panel-title {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent-color);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }

.chip {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  padding: 4px 12px;
  border-radius: 999px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ---------- Timer ---------- */
.timer-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 22px 34px;
}

.timer-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
}

.timer-display {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: clamp(3.4rem, 10vw, 5.5rem);
  font-weight: 700;
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.timer-display.running { color: var(--accent-color); text-shadow: 0 0 30px var(--accent-glow); }
.timer-display.paused { color: var(--text-muted); }

.timer-controls {
  display: flex;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ---------- Sessão em outro aparelho (pausar/retomar) ---------- */
.timer-sync-card {
  margin-top: 16px;
}
.timer-sync-body {
  display: flex;
  align-items: center;
  gap: 14px;
}
.timer-sync-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}
.timer-sync-icon.paused {
  background: rgba(240, 166, 60, 0.14);
  color: var(--accent-color);
}
.timer-sync-icon.running {
  background: rgba(74, 222, 128, 0.14);
  color: #4ade80;
}
.timer-sync-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.timer-sync-title {
  font-weight: 700;
  font-size: 0.96rem;
}
.timer-sync-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ---------- Buttons ---------- */
.btn {
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  transition: 0.18s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  line-height: 1;
  white-space: nowrap;
}

.btn:hover { background-color: var(--card-hover); }
.btn:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 2px; }

.btn-lg { padding: 13px 30px; font-size: 1rem; min-height: 50px; }
.btn-icon { font-size: 0.8em; opacity: 0.9; }

.btn-primary { background-color: var(--accent-color); border-color: var(--accent-color); color: #fff; }
.btn-primary:hover { background-color: var(--accent-hover); transform: translateY(-1px); }

/* Botão de compra de bordas: cor única fixa, não muda com o tema do usuário */
.btn-crystal {
  background: linear-gradient(135deg, #22c55e, #10b981) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  color: #fff !important;
}
.btn-crystal:hover,
.btn-crystal:active {
  background: linear-gradient(135deg, #16a34a, #059669) !important;
  transform: translateY(-1px);
  color: #fff !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.btn-success { background-color: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.45); color: var(--success-color); }
.btn-success:hover { background-color: rgba(34, 197, 94, 0.22); }

.btn-danger { background: transparent; border-color: var(--danger-color); color: var(--danger-color); }
.btn-danger:hover { background-color: var(--danger-color); color: #fff; }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; border-radius: 8px; min-height: 34px; }

/* ---------- Métricas ---------- */
.dashboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  padding: 22px;
}

.metric-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Simetria: grade fixa 3x2 no desktop com divisores verticais e horizontais */
@media (min-width: 860px) {
  .dashboard { grid-template-columns: repeat(3, 1fr); }
  .metric-card:nth-child(3n) { border-right: none; padding-right: 0; }
  .metric-card:not(:nth-child(3n)) { border-right: 1px solid var(--border-color); padding-right: 18px; }
  .metric-card:nth-child(-n+3) { border-bottom: 1px solid var(--border-color); padding-bottom: 14px; }
}

.metric-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.metric-value {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.metric-sub { font-size: 0.75rem; color: var(--text-muted); }

.highlight { color: var(--accent-color); }

/* ---------- Tira da Semana ---------- */
.week-strip { padding: 22px; }

.strip-row {
  display: flex;
  gap: 6px;
}

.strip-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.strip-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  font-weight: 800;
  color: transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.strip-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.strip-day.done .strip-circle {
  background: linear-gradient(160deg, var(--accent-hover), var(--accent-color));
  border-color: var(--accent-color);
  color: #241e17;
  box-shadow: 0 0 16px var(--accent-glow);
}

.strip-day.done .strip-label { color: var(--accent-color); }

.strip-day.missed .strip-circle {
  color: rgba(248, 113, 113, 0.65);
  border-color: rgba(248, 113, 113, 0.35);
}

.strip-day.future .strip-circle {
  border-style: dashed;
  opacity: 0.55;
}

.strip-day.today .strip-circle {
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.strip-day.today .strip-label { color: var(--text-main); }

@media (max-width: 480px) {
  .strip-circle { width: 34px; height: 34px; font-size: 0.9rem; }
}

/* ---------- Histórico / Feed ---------- */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.day-group-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 8px;
}
.day-group-label:first-child { margin-top: 0; }

.history-item {
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: 10px;
  display: grid;
  grid-template-columns: 1fr auto auto auto auto;
  align-items: stretch;        /* subject preenche a altura para a obs rolar */
  gap: 14px;
  height: 114px;               /* grade perfeita: todas as linhas com a mesma altura */
  box-sizing: border-box;
  transition: border-color 0.18s;
}

.history-item:hover { border-color: var(--accent-color); }

.history-item .hc-subject {
  min-width: 0;
  min-height: 0;               /* permite encolher até a altura do card (114px) */
  overflow: hidden;            /* evita que a obs vaze para fora do card */
  display: flex;
  flex-direction: column;
}

.hc-subject-name {
  font-size: 0.95rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}

.hc-topic {
  font-size: 0.8rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Observação: sempre visível, mas com scroll interno se passar do espaço,
   para nunca aumentar a altura do card (grade mantida). */
.hc-obs {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}

.hc-time,
.hc-questions,
.hc-clock,
.hc-actions {
  align-self: start;           /* dados ficam no topo, nivelados entre todos os cards */
}

.hc-time,
.hc-questions,
.hc-clock {
  text-align: right;
  flex-shrink: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.hc-time strong {
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.hc-clock .meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.hc-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.hc-actions .edit-btn,
.hc-actions .delete-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  border-radius: 8px;
  padding: 6px 9px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: 0.18s;
  line-height: 1;
}
.hc-actions .edit-btn:hover {
  color: var(--accent-color);
  border-color: var(--accent-color);
  background: rgba(240, 166, 60, 0.08);
}
.hc-actions .delete-btn:hover {
  color: var(--danger-color);
  border-color: var(--danger-color);
  background: rgba(239, 68, 68, 0.08);
}

/* editor inline (edição de matéria/legenda) */
.history-item.editing {
  display: block;
}
.hc-editor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}
.hc-editor .field-error { grid-column: 1 / -1; margin: 0; }
.hc-editor .hc-editor-obs { grid-column: 1 / -1; }
.hc-editor textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  font-family: inherit;
}
.hc-editor-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .history-item {
    grid-template-columns: 1fr auto auto auto;
    row-gap: 8px;
    height: auto;
  }
  .history-item .hc-subject { grid-column: 1 / -1; height: auto; }
  .hc-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .hc-editor { grid-template-columns: 1fr; }
}

.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(240, 166, 60, 0.14);
  color: var(--accent-color);
  margin-left: 8px;
}

.empty {
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: center;
  padding: 24px 0;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 18px 0;
}

.empty-seal {
  width: 64px;
  height: auto;
  opacity: 0.95;
  animation: sealFloat 3s ease-in-out infinite;
}

@keyframes sealFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-5px) rotate(-3deg); }
}

.search-input { width: 100%; margin-bottom: 14px; }

.delete-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  border-radius: 8px;
  padding: 6px 9px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: 0.18s;
  flex-shrink: 0;
}

.delete-btn:hover { color: var(--danger-color); border-color: var(--danger-color); background: rgba(239, 68, 68, 0.08); }

/* ---------- Stats ---------- */
.chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  align-items: end;
  height: 220px;
  padding-top: 10px;
}

.chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar {
  width: 100%;
  max-width: 52px;
  min-height: 4px;
  background: linear-gradient(180deg, var(--accent-color), var(--accent-hover));
  border-radius: 8px 8px 4px 4px;
  position: relative;
  transition: filter 0.18s;
}

.chart-bar.zero { background: var(--border-color); }

.chart-col:hover .chart-bar { filter: brightness(1.25); }

.chart-value {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-main);
  opacity: 0;
  transition: 0.18s;
  white-space: nowrap;
}

.chart-col:hover .chart-value { opacity: 1; }

.chart-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.chart-label.today { color: var(--accent-color); }

.subject-stats { display: flex; flex-direction: column; gap: 14px; }

.subject-row { display: flex; flex-direction: column; gap: 6px; }

.subject-row-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.subject-row-head strong { font-weight: 600; }

.subject-row-head span { color: var(--text-muted); font-variant-numeric: tabular-nums; }

.bar-track {
  height: 8px;
  background: var(--input-bg);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-hover), var(--accent-color));
  border-radius: 999px;
  transition: width 0.4s ease;
}

.summary-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.88rem;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 10px;
}

.summary-list li:last-child { border-bottom: none; padding-bottom: 0; }

.summary-list .k { color: var(--text-muted); }
.summary-list .v { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 20, 0.78);
  backdrop-filter: blur(4px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.active { display: flex; }

.modal {
  max-width: 520px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  animation: popIn 0.2s ease;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal h2 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.modal-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.modal-close {
  margin-left: auto;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.2rem;
  line-height: 1;
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.18s, background 0.18s;
}

.modal-close:hover {
  color: var(--text-main);
  background: var(--hover-bg, rgba(128, 128, 128, 0.12));
}

.modal-duration {
  font-size: 0.85rem;
  color: var(--accent-color);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-left: auto;
  white-space: nowrap;
}

.modal-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: -8px;
}

.auth-switch { align-self: center; margin-top: -6px; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.optional { font-weight: 400; opacity: 0.7; }

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

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

input,
select,
textarea {
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  width: 100%;
  transition: border-color 0.18s;
}

input::placeholder,
textarea::placeholder { color: #55617e; }

input:focus,
select:focus,
textarea:focus { border-color: var(--accent-color); }

select option { background-color: var(--modal-bg); }

.field-error {
  font-size: 0.78rem;
  color: var(--danger-color);
  font-weight: 600;
  margin-top: 8px;
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  user-select: none;
}

.checkbox-container input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-color);
  cursor: pointer;
}

.questions-box {
  background: var(--input-bg);
  padding: 15px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.confirm-modal {
  width: 100%;
  max-width: 380px;
}

.confirm-modal .modal-header {
  justify-content: flex-start;
}

.confirm-text {
  color: var(--text-muted);
  margin: 4px 0 18px;
  line-height: 1.45;
}

.profile-view-modal {
  width: 100%;
  max-width: 620px;
}

.profile-view-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 6px 0 20px;
}

.profile-view-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--accent-glow);
  color: var(--text-main);
  font-size: 1.6rem;
  font-weight: 700;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}

.profile-view-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-view-names {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.profile-view-names h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  word-break: break-word;
}

.profile-view-user {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.profile-view-bio {
  margin: 0 0 18px;
  color: var(--text-main);
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 220px;
  overflow-y: auto;
}

.profile-view-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0 0 16px;
}

.profile-view-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 10px;
  margin-bottom: 4px;
}

.profile-view-stat {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}

.profile-view-stat-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-color);
  line-height: 1.2;
  word-break: break-word;
  max-width: 100%;
}

.profile-view-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-achievements-wrap {
  margin: 16px 0 4px;
}

.profile-achievements-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.profile-achievements {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.ach-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 8px 10px;
  transition: border-color 0.18s;
}

.ach-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ach-item.unlocked {
  border-color: var(--accent-color);
  background: rgba(240, 166, 60, 0.06);
}

.ach-item.locked {
  opacity: 0.45;
}

.ach-icon {
  flex-shrink: 0;
  width: 34px;
  height: 38px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.ach-medal {
  width: 34px;
  height: 38px;
  display: block;
  transition: filter 0.18s;
}

.ach-medal.locked {
  filter: grayscale(1);
}

.ach-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.ach-desc {
  font-size: 0.62rem;
  color: var(--text-muted);
  line-height: 1.25;
  overflow-wrap: break-word;
}

.profile-achievements-section {
  padding-top: 2px;
}

.profile-achievements-pick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.ach-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 8px 10px;
  cursor: pointer;
  font: inherit;
  color: var(--text-main);
  transition: border-color 0.18s, background 0.18s;
}

.ach-pick:hover {
  border-color: var(--accent-color);
}

.ach-pick.on {
  border-color: var(--accent-color);
  background: rgba(240, 166, 60, 0.08);
}

.ach-pick-medal {
  flex-shrink: 0;
  width: 26px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ach-pick-medal .ach-medal {
  width: 26px;
  height: 30px;
}

.ach-pick-name {
  flex: 1;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  min-width: 0;
}

.ach-pick-check {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ach-pick.on .ach-pick-check {
  color: var(--accent-color);
}

.friend-view {
  flex-shrink: 0;
}

.profile-view-modal .modal-actions {
  justify-content: center;
}

/* ---------- Toasts ---------- */
.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-color);
  color: var(--text-main);
  padding: 12px 18px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-size: 0.88rem;
  font-weight: 500;
  animation: toastIn 0.25s ease;
  max-width: 340px;
}

.toast.success { border-left-color: var(--success-color); }
.toast.error { border-left-color: var(--danger-color); }

.toast.out {
  animation: toastOut 0.25s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(30px); }
}

/* ---------- Tab bar (mobile) ---------- */
.tabbar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  background: var(--card-bg);
  border-top: 1px solid var(--border-color);
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
}

.tab-btn {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 7px 4px;
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.18s;
}

.tab-btn svg { width: 21px; height: 21px; }
.tab-btn.active { color: var(--accent-color); }

/* ---------- Responsivo ---------- */
@media (max-width: 860px) {
  .sidebar { display: none; }
  .tabbar { display: flex; }
  main {
    max-width: 100%;
    padding: 22px 16px calc(90px + env(safe-area-inset-bottom));
  }
  .grid-2 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .metric-card {
    border-right: none;
    padding-right: 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
  }
  .metric-card:last-child { border-bottom: none; padding-bottom: 0; }
  .chart { height: 160px; gap: 6px; }
}

/* ---------- Tema claro (toggle) ---------- */
body.light {
  --bg-color: #f2f4f8;
  --card-bg: #fff;
  --card-hover: #eef1f6;
  --modal-bg: #fff;
  --input-bg: #eceff4;
  --border-color: #d8dde6;
  --text-main: #161a22;
  --text-muted: #5b6472;
  --shadow: 0 10px 32px rgba(23, 28, 45, 0.10);
}

body.light ::selection { color: #fff; }

/* ---------- Aparência: paletas de cor ---------- */
.seg-row { display: flex; gap: 8px; flex-wrap: wrap; }

.seg-btn.active {
  border-color: var(--accent-color);
  color: var(--accent-color);
  background: var(--accent-glow);
}

.swatch-row { display: flex; gap: 10px; flex-wrap: wrap; }

.swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid transparent;
  box-shadow: inset 0 0 0 2px var(--card-bg);
  cursor: pointer;
  transition: transform 0.18s, border-color 0.18s;
  padding: 0;
}

.swatch:hover { transform: scale(1.1); }
.swatch.active { border-color: var(--text-main); }

/* ---------- Histórico: filtros avançados ---------- */
.filter-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.filter-row select,
.filter-row input[type="date"] {
  width: auto;
  min-width: 140px;
  padding: 8px 10px;
  font-size: 0.85rem;
}

.checkbox-container.slim {
  font-size: 0.85rem;
  font-weight: 500;
}

.field-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.field-counter {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 4px;
}

.field-counter:empty {
  display: none;
}

.muted-p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ---------- Compartilhar sessão ---------- */
.share-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  border-radius: 8px;
  padding: 6px 9px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: 0.18s;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

.share-btn:hover {
  color: var(--accent-color);
  border-color: var(--accent-color);
  background: var(--accent-glow);
}

/* ---------- Perfil ---------- */
/* ---------- Perfil ---------- */
.profile-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-card-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.profile-card-name {
  font-weight: 600;
  font-size: 1.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-card-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.profile-card-actions {
  display: flex;
  flex-shrink: 0;
}

.profile-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
  animation: fadeUp 0.2s ease;
}

.profile-edit-avatar-row {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}

.profile-avatar {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  display: grid;
  place-items: center;
  background: var(--accent-glow);
  border: 2px solid var(--border-color);
  transition: border-color 0.18s;
}
.profile-avatar:hover { border-color: var(--accent-color); }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-empty {
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  color: var(--text-muted);
}
.profile-avatar-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 1.1rem;
  opacity: 1;
  transition: opacity 0.18s;
  pointer-events: none;
  border-radius: 50%;
}
.profile-avatar:hover .profile-avatar-overlay { background: rgba(0, 0, 0, 0.55); }

.profile-section-divider {
  height: 1px;
  background: var(--border-color);
  margin: 14px 0;
}

.profile-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

/* ---------- Conta (Perfil) ---------- */
.profile-account-section { animation: fadeUp 0.2s ease; }

.profile-account-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
  color: inherit;
  text-align: left;
}

.profile-account-row:hover { background: var(--card-hover); }

.profile-account-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.profile-account-left > i {
  font-size: 1.15rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.profile-account-label {
  font-size: 0.9rem;
  font-weight: 500;
}

.profile-account-info {
  display: flex;
  flex-direction: column;
}

.profile-account-value {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-account-sub {
  padding: 8px 12px 4px;
  animation: fadeUp 0.2s ease;
}

.profile-account-danger .profile-account-left > i,
.profile-account-danger .profile-account-label {
  color: var(--danger-color);
}

.profile-account-danger:hover { background: rgba(248, 113, 113, 0.08); }

.profile-chevron {
  font-size: 1.1rem;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

/* ---------- Amigos ---------- */
.friends-list, .friends-requests-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.friend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-secondary);
  transition: background 0.15s;
}

.friend-row:hover { background: var(--card-hover); }

.friend-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-glow);
  color: var(--text-main);
  font-weight: 700;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.friend-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.friend-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.friend-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-user {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.friend-result-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 10px;
  margin-top: 8px;
}

.friend-result-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.friend-result-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.friend-result-user {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.friend-result-status {
  font-size: 0.8rem;
  color: var(--success-color);
  font-weight: 600;
}

/* ---------- Mini timer flutuante ---------- */
.mini-timer {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 850;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-main);
  box-shadow: var(--shadow);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.95rem;
  animation: fadeUp 0.2s ease;
  transition: border-color 0.18s;
}

.mini-timer:hover { border-color: var(--accent-color); }

.mini-timer .mini-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.mini-timer.running { border-color: var(--accent-color); }

.mini-timer.running .mini-dot {
  background: var(--accent-color);
  animation: pulseDot 1s ease infinite;
}

@media (max-width: 860px) {
  .mini-timer {
    left: 12px;
    bottom: calc(84px + env(safe-area-inset-bottom));
  }
}

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

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* ---------- Loading Screen ---------- */
.loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loader-overlay.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-ring {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: #fff;
  border-radius: 50%;
  animation: loaderSpin 0.7s linear infinite;
}

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

/* ---------- Welcome Overlay ---------- */
.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.3s ease;
}
.welcome-overlay[hidden] { display: none; }
.welcome-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 40px 36px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  animation: scaleIn 0.35s ease;
}
.welcome-icon { font-size: 3rem; margin-bottom: 12px; }
.welcome-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text-primary);
}
.welcome-text {
  font-size: 1rem;
  margin: 0 0 4px;
  color: var(--text-primary);
}
.welcome-text strong { color: var(--accent-color); }
.welcome-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 20px;
}
.welcome-card .btn { width: 100%; }

@keyframes scaleIn {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ---------- Login Screen ---------- */
.login-body { margin: 0; }

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.login-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  animation: fadeUp 0.4s ease;
}

.login-logo {
  width: 80px;
  height: 80px;
  margin-bottom: 8px;
}

.login-brand {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.btn-block { width: 100%; }

.pass-wrap {
  position: relative;
}
.pass-wrap input {
  width: 100%;
  padding-right: 40px;
}
.pass-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
  line-height: 1;
}
.pass-eye:hover { color: var(--text-main); }

.remember-check {
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  margin-top: -8px;
  -webkit-user-select: none;
  user-select: none;
}
.remember-check input[type="checkbox"] {
  cursor: pointer;
  margin: 0 6px 0 0;
  accent-color: var(--accent, #6c5ce7);
  width: 15px;
  height: 15px;
}

/* ---------- Toggle switch (privacidade) ---------- */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
}
.toggle-info { flex: 1; }
.toggle-label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 2px;
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background: var(--border, #444);
  transition: background 0.25s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.25s;
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--accent, #6c5ce7);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}
.toggle-switch input:focus-visible + .toggle-slider {
  box-shadow: 0 0 0 2px var(--accent, #6c5ce7);
}

.auth-switch {
  margin-top: 14px;
  font-size: 0.85rem;
}

.login-skip {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.login-skip:hover { color: var(--text-main); }

/* ---------- Loja ---------- */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.crystal-ico {
  display: inline-block;
  vertical-align: -0.15em;
  flex-shrink: 0;
}

.chip .crystal-ico {
  vertical-align: -0.12em;
}

.shop-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 14px;
  position: relative;
}

.shop-item.equipped {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 1px var(--accent-color);
}

.shop-item.owned {
  cursor: default;
}

.shop-check {
  font-size: 30px;
  line-height: 1;
  color: var(--success-color, #22c55e);
  padding: 2px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}

.shop-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--card-hover);
  color: var(--text-main);
  font-weight: 700;
  font-size: 1.1rem;
  overflow: hidden;
}

.shop-preview-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.shop-avatar span {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
}

.shop-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.shop-item-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-main);
}

.shop-item-cost {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.shop-btn-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.shop-section-title {
  margin: 1.1rem 0 0.6rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.shop-section-title + .shop-grid {
  margin-top: 0;
}

.shop-group-title {
  grid-column: 1 / -1;
  margin: 10px 0 2px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.shop-group-title:first-child {
  margin-top: 0;
}

/* ---------- Premium ---------- */
.premium-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-main);
}
.premium-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(135deg, #7b2ff7, #f72fb8);
  padding: 2px 8px;
  border-radius: 999px;
}
.premium-item {
  border-width: 1px;
  border-style: solid;
  border-color: rgba(123, 47, 247, 0.45);
  box-shadow: 0 0 0 1px rgba(247, 47, 184, 0.12), 0 4px 18px rgba(123, 47, 247, 0.16);
}
.premium-badge {
  display: inline-flex;
  margin-left: 5px;
  color: #f72fb8;
  vertical-align: middle;
}
.shop-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.14);
}
.shop-premium-note {
  margin-top: 10px;
  font-size: 0.82rem;
  color: #e0b3ff;
}
.profile-border-opt.locked {
  opacity: 0.6;
}
.profile-border-opt.locked .profile-border-lock {
  margin-left: auto;
  color: #f59e0b;
}
.premium-mini-badge {
  display: inline-flex;
  margin-left: 5px;
  color: #f72fb8;
  vertical-align: middle;
}
.admin-premium-group {
  grid-column: 1 / -1;
}
.admin-premium-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.admin-premium-status {
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}
.admin-premium-status.is-on {
  color: #08090b;
  background: linear-gradient(135deg, #c084fc, #f0a6ff);
}

/* ---------- Pacotes de cristais ---------- */
.pkg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.pkg-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 14px;
  background: var(--card-bg);
}
.pkg-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pkg-amount {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 1.05rem;
  font-weight: 800;
}
.pkg-bonus {
  font-size: 0.68rem;
  font-weight: 700;
  color: #0d8a4e;
  background: rgba(16, 185, 129, 0.14);
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}
.pkg-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.shop-subcard {
  margin-top: 14px;
  padding: 16px;
}

.shop-subcard-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 2px;
}

.shop-subcard-hint {
  margin: 0 0 4px;
}

.profile-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 6px;
}

.profile-border-section {
  margin-top: 4px;
}

.profile-border-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.profile-border-opt {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 92px;
  padding: 10px 8px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.12s ease, transform 0.12s ease;
}

.profile-border-opt:hover {
  border-color: var(--accent-color);
  transform: translateY(-1px);
}

.profile-border-opt.active {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 1px var(--accent-color);
}

.profile-border-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--card-hover);
}

.profile-border-avatar .shop-preview-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.profile-border-avatar span {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.profile-border-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  text-align: center;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.profile-border-check {
  position: absolute;
  top: -6px;
  right: -6px;
  font-size: 20px;
  color: var(--success-color, #22c55e);
}

@property --a {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.border-eff {
  position: relative;
  overflow: visible !important;
}

.border-eff::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  animation: borderSpin var(--dur, 3s) linear infinite;
  z-index: 1;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
}

@keyframes borderSpin {
  to { --a: 360deg; }
}

/* corta a foto em círculo mesmo quando overflow:visible do anel estiver ativo */
.border-eff img,
.border-eff .shop-preview-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50% !important;
  overflow: hidden !important;
}

/* RGB arco-íris */
.border-eff[data-effect="rgb"]::before {
  --dur: 3s;
  background: conic-gradient(from var(--a),
    #ff004c, #ff9f00, #ffe600, #2bff6b, #00d4ff, #7a5cff, #ff004c);
}

/* Dourado metálico com brilho viajando */
.border-eff[data-effect="gold"]::before {
  --dur: 2.6s;
  background: conic-gradient(from var(--a),
    #8a6d1a, #ffd700, #fff7cc, #ffd700, #8a6d1a, #b8860b, #fff2a8, #ffd700, #8a6d1a);
}

/* Rubi profundo com brilho quente */
.border-eff[data-effect="ruby"]::before {
  --dur: 2.8s;
  background: conic-gradient(from var(--a),
    #6b0000, #e11d48, #ff9eb8, #e11d48, #6b0000, #800020, #ff7ba1, #e11d48, #6b0000);
}

/* Prisma: refração de luz com brilho branco percorrendo */
.border-eff[data-effect="prism"]::before {
  --dur: 2.2s;
  background: conic-gradient(from var(--a),
    #ffffff, #ff5e8a, #ffd166, #80ffdb, #7b9cff, #c9b8ff, #ffffff, #ff5e8a, #ffffff);
}

/* ===== Bordas premium (animadas, raras) ===== */

/* Ice: gelo cristalino gelado */
.border-eff[data-effect="ice"]::before {
  --dur: 2.4s;
  background: conic-gradient(from var(--a),
    #0ea5e9, #7dd3fc, #e0f2fe, #a5f3fc, #38bdf8, #bae6fd, #67e8f9, #0ea5e9);
}

/* Neon: neon vibrante de rotação rápida */
.border-eff[data-effect="neon"]::before {
  --dur: 1.1s;
  background: conic-gradient(from var(--a),
    #22ff88, #00d1ff, #ff2ec4, #faff00, #22ff88);
}

/* Aurora: luz de aurora boreal */
.border-eff[data-effect="aurora"]::before {
  --dur: 2.6s;
  background: conic-gradient(from var(--a),
    #00f5a0, #00d9f5, #7b2ff7, #f72fb8, #00f5a0);
}

/* Lava: magma quente pulsante */
.border-eff[data-effect="lava"]::before {
  --dur: 1.6s;
  background: conic-gradient(from var(--a),
    #7f1d1d, #f97316, #fde047, #ff7a18, #b91c1c, #ff5722, #7f1d1d);
}

/* Cosmic: cosmos profundo */
.border-eff[data-effect="cosmic"]::before {
  --dur: 2.6s;
  background: conic-gradient(from var(--a),
    #4a148c, #7b1fa2, #d500f9, #3a0ca3, #7209b7, #b5179e, #4a148c);
}

/* ---------- Painel Admin ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.stat-tile {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-tile-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-color);
}
.stat-tile-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.feedback-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}
.feedback-row:last-child { border-bottom: none; }
.feedback-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.feedback-msg {
  color: var(--text-main);
  white-space: pre-wrap;
}
.feedback-date {
  font-size: 0.72rem;
  white-space: nowrap;
}

.owner-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #5b8cff, #8a4fff);
  vertical-align: middle;
}

@media (max-width: 600px) {
  .feedback-head { flex-direction: column; gap: 2px; }
}

/* ---------- Admin: abas ---------- */
.admin-tabs {
  display: flex;
  gap: 8px;
  margin: 14px 0;
  flex-wrap: wrap;
}
.admin-tab {
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.admin-tab:hover { filter: brightness(1.05); }
.admin-tab.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
}

/* ---------- Admin: usuários ---------- */
.admin-search {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}
.admin-search input {
  flex: 1;
}
.admin-user-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0;
}
.admin-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--card-bg);
}
.admin-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-color), #8a4fff);
  color: #fff;
}
.admin-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.admin-user-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.admin-user-info strong {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
}
.admin-user-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}
.admin-user-row .btn { flex-shrink: 0; }

.admin-user-editor {
  margin-top: 14px;
  padding-top: 6px;
  border-top: 1px solid var(--border-color);
}
.admin-editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.admin-num-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.admin-num-row input { flex: 1; }
.admin-editor-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .admin-user-row { flex-wrap: wrap; }
  .admin-user-meta { width: 100%; padding-left: 50px; }
}





