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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: "Noto Sans Georgian", "Segoe UI", Sylfaen, -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  background: var(--brand-primary);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  z-index: 9999;
  text-decoration: none;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 16px;
  outline: none;
  box-shadow: var(--focus-ring);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: var(--brand-primary);
  text-decoration: none;
}

ul {
  list-style: none;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.sidebar-brand {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.15;
}

.brand-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--brand-secondary);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.94rem;
  text-align: left;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.nav-item:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background-color: var(--brand-primary-soft);
  color: var(--brand-primary);
  font-weight: 700;
}

.nav-item .nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-item .nav-pill {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background-color: var(--bg-surface-muted);
  color: var(--text-muted);
}

.nav-item.active .nav-pill {
  background-color: var(--brand-primary);
  color: #ffffff;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-muted);
}

.sidebar-footer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-success);
  display: inline-block;
  margin-right: 6px;
}

.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

.topbar {
  height: var(--topbar-height);
  background-color: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  gap: 16px;
}

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

.mobile-brand {
  display: none;
  align-items: center;
  gap: 8px;
}

.mobile-brand img {
  width: 32px;
  height: 32px;
}

.page-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  background-color: var(--bg-surface-muted);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.stat-pill:hover {
  background-color: var(--bg-surface-hover);
}

.stat-pill--level {
  background-color: var(--brand-primary-soft);
  color: var(--brand-primary);
  border-color: transparent;
}

.stat-pill--streak {
  background-color: var(--color-streak-soft);
  color: var(--color-streak);
  border-color: transparent;
}

.stat-pill--xp {
  background-color: var(--color-xp-soft);
  color: var(--color-xp);
  border-color: transparent;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-surface-muted);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.icon-btn:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-primary);
}

.main-content {
  flex: 1;
  padding: 28px;
  max-width: 1260px;
  width: 100%;
  margin: 0 auto;
}

.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-normal);
}

.card-interactive:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.section-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.94rem;
  line-height: 1.25;
  transition: background-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  min-height: 44px;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background-color: var(--brand-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background-color: var(--brand-primary-hover);
}

.btn-secondary {
  background-color: var(--brand-secondary);
  color: #ffffff;
}

.btn-secondary:hover {
  background-color: var(--brand-secondary-hover);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
}

.btn-outline:hover {
  background-color: var(--bg-surface-hover);
}

.btn-danger {
  background-color: var(--color-danger);
  color: #ffffff;
}

.btn-danger:hover {
  opacity: 0.92;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.84rem;
  min-height: 36px;
}

.progress-wrapper {
  width: 100%;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.progress-track {
  width: 100%;
  height: 10px;
  background-color: var(--bg-surface-muted);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
  border-radius: var(--radius-full);
  transition: width 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-fill--xp {
  background: linear-gradient(90deg, var(--color-xp), var(--brand-primary));
}

.progress-fill--success {
  background: var(--color-success);
}

.dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero-banner {
  background: linear-gradient(135deg, #1e40af 0%, #0d9488 100%);
  color: #ffffff;
  border-radius: var(--radius-xl);
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.hero-content {
  max-width: 620px;
  z-index: 1;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.18);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.hero-title {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 10px;
}

.hero-subtitle {
  font-size: 0.96rem;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 20px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-hero-primary {
  background-color: #ffffff;
  color: #1e40af;
  font-weight: 800;
}

.btn-hero-primary:hover {
  background-color: #f1f5f9;
}

.btn-hero-secondary {
  background-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.btn-hero-secondary:hover {
  background-color: rgba(255, 255, 255, 0.25);
}

.hero-goal-card {
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: 20px;
  min-width: 265px;
  z-index: 1;
}

.hero-goal-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 6px;
}

.hero-goal-Numbers {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.cefr-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.cefr-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 10px;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface-muted);
  border: 2px solid transparent;
  transition: all var(--transition-fast);
  min-height: 70px;
}

.cefr-btn:hover {
  background-color: var(--bg-surface-hover);
}

.cefr-btn.active {
  background-color: var(--brand-primary-soft);
  border-color: var(--brand-primary);
}

.cefr-code {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.cefr-btn.active .cefr-code {
  color: var(--brand-primary);
}

.cefr-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
  text-align: center;
}

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

.stat-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.stat-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-box--xp {
  background-color: var(--color-xp-soft);
  color: var(--color-xp);
}

.stat-icon-box--streak {
  background-color: var(--color-streak-soft);
  color: var(--color-streak);
}

.stat-icon-box--lessons {
  background-color: var(--brand-primary-soft);
  color: var(--brand-primary);
}

.stat-icon-box--vocab {
  background-color: var(--brand-secondary-soft);
  color: var(--brand-secondary);
}

.stat-icon-box--quiz {
  background-color: var(--color-warning-soft);
  color: var(--color-warning);
}

.stat-icon-box--overall {
  background-color: var(--color-success-soft);
  color: var(--color-success);
}

.stat-info {
  flex: 1;
  min-width: 0;
}

.stat-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.stat-value {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
}

.stat-meta {
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

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

.module-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
  cursor: pointer;
}

.module-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.module-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background-color: var(--brand-primary-soft);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.phase-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  background-color: var(--bg-surface-muted);
  color: var(--text-muted);
}

.phase-tag--ready {
  background-color: var(--color-success-soft);
  color: var(--color-success);
}

.module-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.module-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.module-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-primary);
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface-muted);
}

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

.activity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--brand-primary);
  flex-shrink: 0;
}

.activity-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.activity-time {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.activity-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background-color: var(--color-xp-soft);
  color: var(--color-xp);
  white-space: nowrap;
}

.empty-state-card {
  max-width: 640px;
  margin: 28px auto;
  text-align: center;
  padding: 42px 28px;
}

.empty-state-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background-color: var(--brand-primary-soft);
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.empty-state-badge {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background-color: var(--color-info-soft);
  color: var(--color-info);
  margin-bottom: 12px;
}

.empty-state-title {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.empty-state-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.empty-state-meta {
  background-color: var(--bg-surface-muted);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 24px;
  text-align: left;
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.empty-state-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 20px;
  gap: 14px;
  color: var(--text-secondary);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-subtle);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.setting-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.setting-info {
  flex: 1;
  min-width: 220px;
}

.setting-label {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
}

.setting-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.setting-control {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.select-input,
.text-input {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background-color: var(--bg-surface-muted);
  color: var(--text-primary);
  font-weight: 600;
  min-height: 42px;
}

.segmented-control {
  display: inline-flex;
  background-color: var(--bg-surface-muted);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.segment-btn {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.segment-btn.active {
  background-color: var(--bg-surface);
  color: var(--brand-primary);
  box-shadow: var(--shadow-xs);
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
  width: calc(100% - 32px);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface-elevated);
  color: var(--text-primary);
  border-left: 4px solid var(--brand-primary);
  box-shadow: var(--shadow-lg);
  animation: toastSlideIn 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

.toast-message {
  font-size: 0.9rem;
  font-weight: 600;
}

.toast-close {
  color: var(--text-muted);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.toast-close:hover {
  color: var(--text-primary);
}

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

.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: var(--bg-backdrop);
  backdrop-filter: blur(4px);
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  max-width: 500px;
  width: 100%;
  padding: 26px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.96);
  transition: transform var(--transition-fast);
}

.modal-backdrop.open .modal-dialog {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
}

.modal-body {
  font-size: 0.94rem;
  color: var(--text-secondary);
  margin-bottom: 22px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.mobile-bottom-nav {
  display: none;
}

.mobile-drawer-backdrop {
  display: none;
}