/* =========================================
   SKSTUDY – PREMIUM · style.css
   ========================================= */

:root {
  --primary: rgb(38,211,5);
  --primary-hover: #44ca027b;
  --primary-light: rgba(79,70,229,0.1);
  --nevlek-blue: #41ca027b;
  --purple-light: rgba(139,92,246,0.1);
  --success: #17920b;
  --success-light: rgba(16,185,129,0.1);
  --warning: #F4A843;
  --warning-light: rgba(245,158,11,0.1);
  --danger: #ef2525;
  --danger-light: rgba(239,68,68,0.1);

  --bg-main: #F3F4F6;
  --bg-card: #FFFFFF;
  --bg-drawer: #FFFFFF;

  --text-primary: #111827;
  --text-secondary: #4B5563;
  --text-muted: #9CA3AF;

  --border: #E5E7EB;
  --border-strong: #D1D5DB;

  /* Sombras em duas camadas (contacto + difusão) para uma profundidade mais natural */
  --shadow-sm: 0 1px 2px rgba(17,24,39,0.04), 0 1px 3px rgba(17,24,39,0.06);
  --shadow-md: 0 2px 4px rgba(17,24,39,0.04), 0 10px 20px rgba(17,24,39,0.08);
  --shadow-lg: 0 4px 8px rgba(17,24,39,0.05), 0 20px 40px rgba(17,24,39,0.14);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
}

.dark-theme {
  /* O cartão fica mais claro que o fundo — é o que faz "flutuar" e dar profundidade */
  --bg-main: #1C1D21;
  --bg-card: #2A2B31;
  --bg-drawer: #2A2B31;
  --text-primary: #F1F5F9;
  --text-secondary: #96A3B8;
  --text-muted: #6B7A8F;
  --border: #383A42;
  --border-strong: #4E515C;

  /* Sombra preta pura quase não se vê sobre fundo escuro — junta-se um
     contorno subtil de luz (glow) para o cartão se destacar do fundo */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.045);
  --shadow-md: 0 6px 16px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.05);
  --shadow-lg: 0 16px 36px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.06);
}
@font-face {
  font-family: 'nevlek-title-font';
  src: url('../font/nevlek-montserrat-SemiBoldItalic-title.otf') format('opentype');
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: 'nevlek-title-font2';
  src: url('../font/nevlek-montserrat-bold.otf') format('opentype');
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: 'nevlek-subtitle-font';
  src: url('../font/nevlek-montserrat-Italic-subtitle.otf') format('opentype');
  font-weight: normal;
  font-style: italic;
  font-display: swap;
}
/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

/* ── Utilities ── */
.hidden         { display: none !important; }
.text-green     { color: var(--success) !important; }
.text-red       { color: var(--danger) !important; }
.text-nevlek-blue    { color: var(--nevlek-blue) !important; }
.text-secondary { color: var(--text-secondary); }
.w-full         { width: 100%; }
.mt-2           { margin-top: 0.5rem; }
.mt-4           { margin-top: 1rem; }
.mb-2           { margin-bottom: 0.5rem; }
.mb-4           { margin-bottom: 1rem; }
.flex-between   { display: flex; justify-content: space-between; align-items: center; }
.form-row       { display: flex; gap: 1rem; }
.flex-2         { flex: 2; }
.flex-1         { flex: 1; }
.auth-logo-text,
.user-name {
   font-family: 'nevlek-title-font', sans-serif;
   font-weight: bold;
}
.status-dot {
  font-family: 'nevlek-subtitle-font';
}
.nevlek-bar {
 font-size: 20px;
}
#page-title,
.nav-item {
  font-family: 'nevlek-title-font2';
}
.nevlek-nav {
  font-size: 25px;
}
.icon-nav {
  background: #07080916;
  border-radius: 2px;
  padding: 3px;
  box-shadow: 1px 1px 1px  #0e0e0e87;
}
.gold { color: gold; font-size: 24px;}
.silver { color: silver; font-size: 24px;}
.bronze { color: #cd7f32; font-size: 24px;}

/* ── Inputs ── */
.input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-main);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  transition: var(--transition);
}
.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.input::placeholder { color: var(--text-muted); }

/* ── Field with validation ── */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
}
.field label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field-error {
  font-size: 0.72rem;
  color: var(--danger);
  display: none;
}
.field.has-error .field-error { display: block; }
.field.has-error .input { border-color: var(--danger); }

/* ── Ver/ocultar senha ── */
.pass-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.pass-wrapper .input {
  padding-right: 2.5rem;
}
.btn-toggle-pass {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  transition: var(--transition);
}
.btn-toggle-pass:hover { color: var(--text-secondary); }
.btn-toggle-pass:focus-visible {
  outline: none;
  color: var(--primary);
}

/* ── Aviso de bloqueio por tentativas erradas ── */
.field-hint {
  font-size: 0.75rem;
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.7rem;
  margin-top: -0.2rem;
}

/* ── Buttons ── */
button {
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.55rem 1.1rem;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
button:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-primary);
}
.btn-outline:hover:not(:disabled) { background: var(--bg-main); }
.btn-google {
  background: #fff;
  border: 1.5px solid var(--border);
  color: #3C4043;
  font-weight: 600;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
}
.btn-google:hover:not(:disabled) {
  background: var(--bg-main);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.dark-theme .btn-google { background: #fff; color: #3C4043; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #DC2626; transform: translateY(-1px); }
.btn-text {
  background: none;
  border: none;
  color: var(--primary);
  padding: 0;
  font-size: 0.875rem;
  text-decoration: underline;
}
.btn-icon {
  background: none;
  border: none;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}
.btn-icon:hover { background: var(--bg-main); color: var(--text-primary); }

/* Loading spinner inside button */
.btn-spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
button.loading .btn-spinner { display: inline-block; }
button.loading .btn-label   { display: none; }

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

/* ── Toast ── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 500;
  max-width: 320px;
  pointer-events: all;
  animation: toastIn 0.3s ease forwards;
}
.toast.out { animation: toastOut 0.3s ease forwards; }
.toast.success { border-left: 4px solid var(--success); }
.toast.error   { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info    { border-left: 4px solid var(--primary); }

@keyframes toastIn  { from { opacity:0; transform:translateX(100%); } to { opacity:1; transform:translateX(0); } }
@keyframes toastOut { from { opacity:1; transform:translateX(0); } to { opacity:0; transform:translateX(100%); } }

/* ── Confirm Dialog ── */
#confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 800;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
#confirm-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  max-width: 360px; width: 100%;
  box-shadow: var(--shadow-lg);
}
#confirm-title { font-weight: 700; font-size: 1rem; margin-bottom: 0.5rem; }
#confirm-msg   { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 1.5rem; }
#confirm-actions { display: flex; gap: 0.75rem; justify-content: flex-end; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}
.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 100%; max-width: 480px;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.25s ease;
}
.modal-title   { font-size: 1.1rem; font-weight: 700; margin-bottom: 1.25rem; }
.modal-body    { display: flex; flex-direction: column; gap: 0.9rem; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.5rem; }

.modal-box-lg { max-width: 600px; }
.modal-box-sm { max-width: 360px; padding: 1.5rem; }
.privacy-body {
  max-height: 55vh;
  overflow-y: auto;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-secondary);
}
.privacy-body p { margin-bottom: 0.9rem; }
.privacy-body strong { color: var(--text); }

/* ── FAQ: acordeão com animação suave ── */
.faq-list {
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* ── Página FAQ independente (faq.html) ── */
.faq-page-body {
  background: var(--bg-main);
}
.faq-page-wrapper {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 2.5rem 1rem;
}
.faq-page-card {
  width: 100%;
  max-width: 640px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  height: fit-content;
}
.faq-page-card .faq-list {
  max-height: none;
  overflow: visible;
}
.faq-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 1.5rem;
  transition: var(--transition);
}
.faq-back-link:hover { color: var(--primary); }
.faq-page-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 1.25rem 0 0.4rem;
  color: var(--text);
}
.faq-page-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
  line-height: 1.5;
}
.faq-page-return-btn {
  margin-top: 1.75rem;
  text-decoration: none;
  text-align: center;
  display: block;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-main);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  background: none;
  border: none;
  text-align: left;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: color 0.2s ease;
}
.faq-question:hover { color: var(--primary); }
.faq-question i {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.faq-item.open .faq-question i { transform: rotate(180deg); color: var(--primary); }

/* Técnica grid-template-rows: anima a altura de 0 → auto de forma
   suave, sem precisar de saber a altura exata do texto antecipadamente
   (ao contrário de max-height, que obriga a "adivinhar" um valor). */
.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.faq-item.open .faq-answer {
  grid-template-rows: 1fr;
}
.faq-answer-inner {
  overflow: hidden;
  min-height: 0;
}
.faq-answer-inner p {
  padding: 0 1.1rem 1rem;
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--text-secondary);
}
.faq-answer-inner strong { color: var(--text); }

.drawer-footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  row-gap: 0.35rem;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.dashboard-footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  row-gap: 0.4rem;
  gap: 0.6rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
}
.btn-link-sm {
  background: none; border: none; padding: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
}
.btn-link-sm:hover { color: var(--text-secondary); }
.btn-link-danger:hover { color: var(--danger); }

@keyframes scaleIn {
  from { opacity:0; transform:scale(0.95) translateY(8px); }
  to   { opacity:1; transform:scale(1) translateY(0); }
}
@keyframes fadeInUp {
  from { opacity:0; transform:translateY(-6px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ── Auth ── */
.auth-wrapper {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  position: relative; overflow: hidden;
}
.auth-wrapper::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--primary-light) 0%, transparent 70%);
  top: -150px; right: -150px;
  pointer-events: none;
}
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
  position: relative; z-index: 1;
  animation: scaleIn 0.35s ease;
}
.auth-logo {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 2rem;
}
.auth-logo-icon {
  width: 44px; height: 44px;
  background: #080808c8;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}
.auth-logo-icon img {
  width: 90px;
  height: 90px;
}
.auth-logo-text { font-size: 1.1rem;}
.auth-logo-sub  { font-size: 0.72rem; color: var(--text-muted); font-family: 'nevlek-subtitle-font'; font-style: italic;}

.auth-tagline {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: -1.25rem 0 1.5rem;
  line-height: 1.5;
}

.shared-device-check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-main);
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}
.shared-device-check:hover { border-color: var(--primary); }
.shared-device-check input {
  margin-top: 0.1rem;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.auth-google-hint {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0.6rem 0 1.5rem;
}

.auth-toggle-email {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.5rem;
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  cursor: pointer;
  transition: var(--transition);
}
.auth-toggle-email:hover { color: var(--primary); }
.auth-toggle-email i { font-size: 0.7rem; transition: transform 0.25s ease; }
.auth-toggle-email.expanded i { transform: rotate(180deg); }

.auth-email-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.5rem;
  animation: fadeInUp 0.25s ease;
}
.auth-email-section.hidden { display: none; }
.auth-email-section .auth-tabs { margin-bottom: 0; }

.auth-tabs {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px; gap: 0;
  margin-bottom: 1.75rem;
}
.auth-tab {
  flex: 1;
  padding: 0.65rem;
  border-radius: calc(var(--radius-md) - 2px);
  font-size: 0.875rem; font-weight: 500;
  text-align: center;
  border: none; background: transparent;
  margin: 2px;
  color: var(--text-secondary);
  transition: var(--transition);
}
.auth-tab.active { background: var(--primary); color: #fff; }

.auth-panel { display: none; flex-direction: column; gap: 0.9rem; }
.auth-panel.active { display: flex; }

.auth-divider {
  display: flex; align-items: center; gap: 0.75rem;
  color: var(--text-muted); font-size: 0.8rem;
}
.auth-divider::before,
.auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.auth-hint {
  padding: 0.75rem 1rem;
  background: var(--primary-light);
  border-radius: var(--radius-md);
  font-size: 0.8rem; color: var(--primary); line-height: 1.6;
}

/* ── Ecrã "Confirme o seu e-mail" ── */
.verify-card { text-align: center; }
.verify-card .auth-logo { justify-content: center; }
.verify-icon {
  width: 64px; height: 64px;
  margin: 0.5rem auto 1.25rem;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
}
.verify-title { font-size: 1.15rem; margin-bottom: 0.6rem; }
.verify-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}
.verify-text strong { color: var(--text); }
.verify-spam-hint {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  text-align: left;
  background: color-mix(in srgb, var(--warning) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.9rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}
.verify-spam-hint i { color: var(--warning); margin-top: 0.15rem; flex-shrink: 0; }
.verify-spam-hint strong { color: var(--text); }
#btn-verify-resend:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── App Layout ── */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Drawer Overlay ── */
.drawer-overlay {
  position: fixed; 
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 49;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: all;
}

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

/* ── Drawer / Sidebar ── */
.drawer {
  width: 260px;
  background: var(--bg-drawer);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  z-index: 50;
}

.drawer-header {
  padding: 1.1rem 1.1rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 0.5rem;
}

/* Close button - only visible on mobile when drawer is open */
#close-drawer {
  display: none;
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1.5rem;
  line-height: 1;
  transition: color var(--transition);
  flex-shrink: 0;
}

#close-drawer:hover {
  color: var(--text-primary);
}

.profile-card {
  display: flex; align-items: center; gap: 0.75rem;
  flex: 1; min-width: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
}
.profile-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.profile-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.avatar {
  width: 60px; height: 60px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700; font-size: 1.9rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── Wrapper do avatar (sidebar) — o clique é tratado pelo .profile-card ── */
.avatar-btn {
  position: relative;
  flex-shrink: 0;
  border-radius: var(--radius-full);
}
.avatar-edit-badge {
  position: absolute; bottom: -2px; right: -2px;
  width: 20px; height: 20px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem;
  border: 2px solid var(--bg-card, var(--bg-main));
}

/* ── Grelha de seleção de avatar (modal) ── */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}
.avatar-option {
  background: none;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 0.3rem;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
  transition: var(--transition);
}
.avatar-option:hover { background: var(--bg-main); }
.avatar-option.active { border-color: var(--primary); background: var(--primary-light); }
.avatar-option img {
  width: 42px; height: 42px;
  border-radius: var(--radius-full);
  object-fit: cover;
}
.avatar-option-initials {
  width: 42px; height: 42px; font-size: 1.05rem;
}
.avatar-option-label {
  font-size: 0.62rem;
  color: var(--text-secondary);
  text-align: center;
}
@media (max-width: 420px) {
  .avatar-grid { grid-template-columns: repeat(3, 1fr); }
}
.user-details { display: flex; flex-direction: column; gap: 0.1rem; overflow: hidden; min-width: 0; flex: 1; }

.user-name  { font-weight: 600; font-size: 1.2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-card:hover .user-name,
.profile-card:focus-visible .user-name { color: var(--primary); }

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

/* ── Modal "Editar perfil": pré-visualização em tempo real ── */
.profile-edit-preview {
  display: flex; align-items: center; gap: 0.75rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.1rem;
}
.avatar-xl {
  width: 60px; height: 60px;
  font-size: 1.6rem;
  flex-shrink: 0;
}
.profile-edit-preview-info {
  display: flex; flex-direction: column; gap: 0.2rem;
  min-width: 0; overflow: hidden;
}
.profile-edit-preview-name {
  font-family: 'nevlek-title-font', sans-serif;
  font-weight: bold;
  font-size: 1.15rem;
  color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.profile-edit-preview-email {
  font-size: 0.85rem;
  color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.online-status {
  display: flex; align-items: center; gap: 0.35rem;
  font-size: 0.82rem; color: var(--text-secondary);
}
.status-dot {
  width: 7px; height: 7px;
  background: var(--success);
  border-radius: 50%;
}

.drawer-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex; flex-direction: column;
  gap: 2px; overflow-y: auto;
}
.nav-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500; font-size: 0.875rem;
  background: transparent; border: none;
  width: 100%; text-align: left;
  transition: var(--transition);
}
.nav-item:hover { background: var(--bg-main); color: var(--text-primary); }
.nav-item.active { background: var(--primary-light); color: var(--primary); }
.nav-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }

.drawer-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

/* ── Main Content ── */
.main-content {
  flex: 1;
  display: flex; flex-direction: column;
  overflow-y: auto;
}

.topbar {
  padding: 1rem 1.75rem;
  display: flex; align-items: center;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
  gap: 1rem;
}
.topbar h1 {
  font-size: 1.25rem; font-weight: 700; flex: 1;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar-actions { display: flex; gap: 0.75rem; }

#open-drawer { display: none; }

/* ── View Sections ── */
.view-section {
  padding: 1.75rem 2rem;
  display: none;
}
.view-section.active {
  display: block;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from { opacity:0; transform:translateY(6px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ── Card ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

/* ── Smart Alert ── */
.smart-alert {
  margin: 1rem 2rem 0;
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem; font-weight: 500;
  display: flex; align-items: center; gap: 0.75rem;
  border: 1px solid;
}
.smart-alert.info    { background: var(--primary-light); border-color: rgba(79,70,229,0.2); color: var(--primary); }
.smart-alert.success { background: var(--success-light); border-color: rgba(16,185,129,0.2); color: var(--success); }
.smart-alert.danger  { background: var(--danger-light); border-color: rgba(239,68,68,0.2); color: var(--danger); }

/* ── Dashboard ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.stats-card h3 { font-size: 0.8rem; color: var(--text-secondary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.stats-card .value { font-size: 2rem; font-weight: 700; margin-top: 0.35rem; }
.stat-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.2rem; }

.dashboard-columns { display: flex; gap: 1.25rem; }

.task-list { margin-top: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }
.task-item {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  background: var(--bg-main);
  border-left: 3px solid var(--primary);
  font-size: 0.825rem;
}
.task-item strong { display: block; font-weight: 600; }
.task-item span { color: var(--text-secondary); }

.motivational-quote {
  padding: 0.85rem 1rem;
  font-style: italic;
  color: var(--text-secondary);
  font-size: 0.8rem;
  background: var(--purple-light);
  border-left: 3px solid var(--nevlek-blue);
  border-radius: var(--radius-md);
}

.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.chart-container { width: 100%; height: 280px; position: relative; margin-top: 0.75rem; }
.chart-container canvas { width: 100%; height: 100%; }

/* ── Grades Table ── */
.table-responsive { overflow-x: auto; }
.grades-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.825rem;
  margin-top: 0.75rem;
}
.grades-table th, .grades-table td {
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--border);
  text-align: center;
}
.grades-table th {
  background: var(--bg-main);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.grades-table td:first-child { text-align: left; font-weight: 600; }
.term-header { background: var(--primary-light) !important; color: var(--primary) !important; }

.grade-input {
  width: 50px;
  padding: 0.25rem;
  text-align: center;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--text-primary);
  transition: var(--transition);
}
.grade-input:focus { outline: none; border-bottom-color: var(--primary); }
.grade-input:hover { border-bottom-color: var(--border-strong); }
.grade-input.invalid { border-bottom-color: var(--danger) !important; color: var(--danger); }

.badge-status {
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem; font-weight: 700;
  display: inline-block;
}
.b-excelente { background: var(--success-light); color: var(--success); }
.b-bom       { background: var(--primary-light); color: var(--primary); }
.b-medio     { background: var(--warning-light); color: var(--warning); }
.b-ruim      { background: var(--danger-light);  color: var(--danger); }

.subject-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1rem;
}
.subject-card { padding: 1rem; }
.subject-card h4 { font-size: 0.875rem; margin-bottom: 0.5rem; }
.subject-avg { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.subject-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ── Timer ── */
.timer-container { text-align: center; padding: 2.5rem 2rem; }
.time-presets {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  justify-content: center; margin-top: 0.75rem;
}
.preset-btn {
  padding: 0.45rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-main);
  color: var(--text-primary);
  font-size: 0.85rem;
}
.preset-btn:hover, .preset-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.custom-time { display: flex; gap: 0.75rem; justify-content: center; max-width: 320px; margin: 0 auto; margin-top: 0.75rem;}

.time-left {
  font-size: 5rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -3px;
  margin: 1.75rem 0;
  transition: color 0.5s ease;
}
.time-left.warning { color: var(--warning); }
.time-left.danger  { color: var(--danger); }

.progress-bar {
  width: 100%; max-width: 400px;
  height: 7px;
  background: var(--bg-main);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 0 auto 1.5rem;
}
.progress-fill {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width 1s linear, background 0.5s ease;
  border-radius: var(--radius-full);
}
.progress-fill.warning { background: var(--warning); }
.progress-fill.danger  { background: var(--danger); }

.timer-controls { display: flex; gap: 0.75rem; justify-content: center; }

/* ── Badges ── */
.badges-container { margin-top: 1rem; }
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem; margin-top: 0.75rem;
}
.badge {
  display: flex; flex-direction: column; align-items: center;
  padding: 1.1rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-main);
  border: 1px solid var(--border);
  text-align: center;
  gap: 0.4rem;
  transition: var(--transition);
}
.badge-icon { font-size: 2rem; }
.badge span { font-size: 0.75rem; font-weight: 500; }
.badge.locked { opacity: 0.35; filter: grayscale(1); }
.badge:not(.locked) { border-color: var(--nevlek-blue); box-shadow: 0 0 0 1px var(--nevlek-blue); }
.badge:not(.locked):hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ── Goals ── */
.goals-grid { display: flex; flex-direction: column; gap: 0.75rem; }
.goal-card {
  padding: 1.1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; gap: 1rem;
  transition: box-shadow var(--transition);
}
.goal-card:hover { box-shadow: var(--shadow-md); }
.goal-card.completed { opacity: 0.55; }
.goal-info { flex: 1; min-width: 0; overflow: hidden; }
.goal-info h4 { font-weight: 600; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-info h4.done { text-decoration: line-through; }
.goal-meta { font-size: 0.75rem; color: var(--text-secondary); display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.4rem; }
.goal-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }

/* Progress bar inside goal */
.goal-progress { margin-top: 0.5rem; }
.goal-progress-bar { height: 4px; background: var(--border); border-radius: var(--radius-full); overflow: hidden; }
.goal-progress-fill { height: 100%; background: var(--primary); border-radius: var(--radius-full); transition: width 0.5s ease; }
.goal-progress-label { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.2rem; }

/* Priority badge */
.priority { display: inline-block; padding: 0.15rem 0.5rem; border-radius: var(--radius-full); font-size: 0.68rem; font-weight: 700; }
.priority-alta  { background: var(--danger-light);  color: var(--danger); }
.priority-media { background: var(--warning-light); color: var(--warning); }
.priority-baixa { background: var(--success-light); color: var(--success); }

/* Status chip */
.status-chip { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.15rem 0.5rem; border-radius: var(--radius-full); font-size: 0.68rem; font-weight: 600; }
.sc-pending   { background: var(--bg-main);          color: var(--text-secondary); }
.sc-progress  { background: var(--primary-light);    color: var(--primary); }
.sc-done      { background: var(--success-light);    color: var(--success); }
.sc-cancelled { background: var(--danger-light);     color: var(--danger); }

/* ── Agenda ── */
.agenda-list { display: flex; flex-direction: column; gap: 0.75rem; }
.agenda-card {
  padding: 1.1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; gap: 1rem;
  transition: box-shadow var(--transition);
}
.agenda-card:hover { box-shadow: var(--shadow-md); }
.agenda-card.past { opacity: 0.5; }
.event-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.event-info { flex: 1; min-width: 0; overflow: hidden; }
.event-info h4 { font-weight: 600; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-meta { font-size: 0.75rem; color: var(--text-secondary); display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.3rem; }
.event-type-label { display: inline-block; padding: 0.15rem 0.5rem; border-radius: var(--radius-full); font-size: 0.68rem; font-weight: 600; }
.et-exam     { background: var(--danger-light);  color: var(--danger); }
.et-homework { background: var(--warning-light); color: var(--warning); }
.et-revision { background: var(--primary-light); color: var(--primary); }
.et-study    { background: var(--success-light); color: var(--success); }
.event-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }

/* ── Focus Mode ── */
body.focus-mode .drawer, body.focus-mode .topbar { display: none !important; }
body.focus-mode .main-content { justify-content: center; align-items: center; }
body.focus-mode .time-left { font-size: 8rem; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .drawer {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

  .drawer.open {
    transform: translateX(0);
  }

  #open-drawer {
    display: flex;
  }

  #close-drawer {
    display: none;
  }

  .drawer.open #close-drawer {
    display: block;
  }

  .dashboard-columns { flex-direction: column; }
  .sm-hidden { display: none; }
  .form-row { flex-direction: column; }
  .view-section { padding: 1rem; }
}

@media (min-width: 769px) {
  .mobile-only { display: none; }
  
  .drawer {
    position: relative;
    transform: translateX(0) !important;
    width: 260px;
    height: auto;
    border-right: 1px solid var(--border);
  }

  #open-drawer {
    display: none !important;
  }

  #close-drawer {
    display: none;
  }

  .drawer-overlay {
    display: none !important;
  }
}

/* ── Print ── */
@media print {
  body { background: #fff; color: #000; }
  .drawer, .topbar, .smart-alert, #timer-setup, .timer-controls, button { display: none !important; }
  .view-section { display: block !important; opacity: 1 !important; page-break-after: always; }
  .card { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
  h2, h3 { color: #000 !important; }
}

/* ════════════════════════════════════════════════════════
   PATCHES & FIXES —  SKSTUDY
   ════════════════════════════════════════════════════════ */

/* ── Média por trimestre na tabela ──────────────────────── */
.term-avg-header {
  background: var(--bg-alt, #f0f4ff) !important;
  font-weight: 700;
  color: var(--primary);
  border-left: 2px solid var(--primary-light, #818CF8);
}
.dark-theme .term-avg-header {
  background: #1e2a4a !important;
}
.term-avg-cell {
  background: var(--bg-alt, #f8fafc);
  border-left: 2px solid var(--border);
  color: var(--primary);
}
.dark-theme .term-avg-cell {
  background: #1e293b;
}

/* ── Cards de matéria — linhas de trimestre ─────────────── */
.subject-terms {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.4rem 0;
}
.term-mini {
  font-size: 0.72rem;
  background: var(--bg-alt, #f1f5f9);
  color: var(--text-muted);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  font-family: monospace;
  font-weight: 600;
}
.dark-theme .term-mini {
  background: #334155;
}

/* ── Filtros de metas ───────────────────────────────────── */
.goal-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.goal-filter-btn {
  padding: 0.35rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
}
.goal-filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.goal-filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ── Estatísticas de estudo ─────────────────────────────── */
.study-stats-grid {
  display: flex;
  gap: 2rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.study-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}
.study-stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  font-family: monospace;
}
.study-stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Past event label ───────────────────────────────────── */
.past-label {
  font-size: 0.7rem;
  background: var(--bg-alt, #f1f5f9);
  color: var(--text-muted);
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
}

/* ── Confirm dialog melhorado ───────────────────────────── */
.confirm-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}

/* ── Input inválido ─────────────────────────────────────── */
.grade-input.invalid {
  border-color: var(--danger) !important;
  background: #FEF2F2;
}
.dark-theme .grade-input.invalid {
  background: #450A0A;
}

/* ── Toast clicável ─────────────────────────────────────── */
.toast { cursor: pointer; }

/* ── Responsividade tabela de notas ─────────────────────── */
@media (max-width: 768px) {
  .term-avg-header, .term-avg-cell { display: none; }
  .grades-table th, .grades-table td { padding: 0.3rem 0.2rem; font-size: 0.7rem; }
  .grade-input { width: 36px; font-size: 0.7rem; }
}

/* Desktop: tabela normal com scroll horizontal */
@media (min-width: 700px) {
  .grades-mobile-list {
    display: none !important;
  }
  .table-responsive { 
    display: block;
  }
}

/* Mobile: esconde tabela, mostra cards */
@media (max-width: 699px) {
  .table-responsive    { display: none !important; }
  .grades-mobile-list  { display: flex; flex-direction: column; gap: 10px; margin-top: 1rem; }
  /* Redundante no mobile — cada cartão de disciplina já tem o seu próprio botão "Guardar" */
  #btn-save-grades { display: none; }
}

/* Card de matéria no mobile */
.gm-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
}

/* Cabeçalho clicável */
.gm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  cursor: pointer;
  user-select: none;
  gap: 0.5rem;
}

.gm-header:active { opacity: 0.8; }

.gm-subject {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gm-avg-pill {
  font-size: 0.8rem;
  font-weight: 700;
  font-family: monospace;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  background: var(--bg-main);
  min-width: 42px;
  text-align: center;
}

.gm-chevron {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.gm-body {
  display: none;
  padding: 1rem;
  border-top: 1px solid var(--border);
}

.gm-card.open .gm-body {
  display: block;
}

.gm-card.open .gm-chevron {
  transform: rotate(180deg);
}

.gm-terms {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.gm-save-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 1.25rem;
  padding: 0.75rem;
  border: none;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  animation: fadeInUp 0.2s ease;
  transition: var(--transition);
}
.gm-save-btn:active { transform: scale(0.97); }
.gm-save-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.gm-term-label {
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.02em;
  margin-bottom: 0.75rem;
}

.gm-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.gm-field {
  display: flex;
  flex-direction: column;
}

.gm-field label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 0.35rem;
  letter-spacing: 0.02em;
}

.gm-field input {
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-main);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
  font-family: monospace;
}

.gm-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.gm-field input.invalid {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.05);
}

.gm-term-avg {
  font-size: 0.8rem;
  padding: 0.65rem;
  background: var(--bg-main);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-align: center;
  margin-top: 0.5rem;
}

.gm-term-avg span {
  font-weight: 700;
  color: var(--primary);
  font-family: monospace;
}

.add-subject-bar {
  display: flex;
  gap: 0.75rem;
}

.add-subject-bar .input {
  flex: 1;
}

.subjects-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.subject-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
}

.subject-tag-default {
  background: rgba(79, 70, 229, 0.1);
  border-color: rgba(79, 70, 229, 0.3);
  color: var(--primary);
}

.subject-tag-extra {
  background: var(--bg-main);
  border-color: var(--border);
  color: var(--text-primary);
}

.subject-tag-del {
  background: none;
  border: none;
  padding: 0;
  margin: 0 -0.3rem 0 0.25rem;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  color: inherit;
  transition: color var(--transition);
}

.subject-tag-del:hover {
  color: var(--danger);
}

.subject-tag-hint {
  display: block;
  width: 100%;
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: center;
  padding: 0.5rem;
}
