@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* Design Tokens & Reset */
:root {
  --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Color Palette - Dark Mode Premium */
  --bg-app: #09090b;
  --bg-card: rgba(20, 20, 25, 0.6);
  --bg-card-hover: rgba(30, 30, 40, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-glow: rgba(99, 102, 241, 0.35);
  
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  
  /* Theme Accents */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.3);
  --secondary: #a855f7;
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.2);
  --danger: #ef4444;
  --warning: #f59e0b;
  
  /* Activity Colors for Schedule Grid */
  --color-work: #3b82f6;
  --color-gym: #10b981;
  --color-random: #f43f5e;
  --color-rest: #f59e0b;
  --color-study: #8b5cf6;
  --color-empty: rgba(255, 255, 255, 0.03);
  
  /* Glassmorphism settings */
  --backdrop-blur: blur(16px);
  --shadow-lg: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

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

body {
  font-family: var(--font-primary);
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.1) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.1) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(16, 185, 129, 0.03) 0px, transparent 50%);
  background-attachment: fixed;
}

/* Sidebar Navigation */
.sidebar {
  width: 280px;
  background: rgba(10, 10, 12, 0.7);
  backdrop-filter: var(--backdrop-blur);
  border-right: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  transition: var(--transition-smooth);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 3rem;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.logo-icon svg {
  width: 22px;
  height: 22px;
  fill: white;
}

.logo-text {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 1rem;
  transition: var(--transition-smooth);
  border: 1px solid transparent;
}

.nav-item a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active a {
  color: #fff;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.05) 100%);
  border-color: var(--border-color-glow);
  box-shadow: 0 4px 20px -5px rgba(99, 102, 241, 0.15);
}

.nav-item svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  transition: var(--transition-smooth);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* App Main Layout */
.main-content {
  flex: 1;
  margin-left: 280px;
  padding: 2.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 1400px;
  width: calc(100% - 280px);
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
}

.page-title h1 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 0.25rem;
}

.page-title p {
  color: var(--text-secondary);
  font-size: 1rem;
}

.quick-stats-header {
  display: flex;
  gap: 1rem;
}

.stat-badge {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stat-badge-icon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.stat-badge-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.stat-badge-val {
  font-weight: 600;
  color: #fff;
}

/* Tab Container/Routing Views */
.tab-view {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

.tab-view.active {
  display: block;
}

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

/* Universal Card Design */
.card {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  transition: var(--transition-smooth);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-title svg {
  width: 22px;
  height: 22px;
  stroke: var(--primary);
  stroke-width: 2;
  fill: none;
}

/* Grid & Dashboard layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

.dashboard-full-width {
  grid-column: span 2;
}

.metrics-summary-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-lg);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
}

.summary-card.success::before { background: var(--success); }
.summary-card.warning::before { background: var(--warning); }
.summary-card.secondary::before { background: var(--secondary); }

.summary-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.12);
}

.summary-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.summary-card.success .summary-card-icon { color: var(--success); }
.summary-card.warning .summary-card-icon { color: var(--warning); }
.summary-card.secondary .summary-card-icon { color: var(--secondary); }

.summary-card-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.summary-card-info h3 {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-card-info p {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
}

/* Buttons */
.btn {
  font-family: var(--font-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 20px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-sm {
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-icon-only {
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  aspect-ratio: 1;
}

/* Schedule Grid Components */
.schedule-grid-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.schedule-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.day-selector {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  gap: 0.25rem;
}

.day-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.day-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.day-btn.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.weekly-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.75rem;
}

@media (max-width: 1024px) {
  .weekly-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.weekly-day-column {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.weekly-day-title {
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

/* 24-Hour Visual Planner */
.hours-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.hours-timeline::-webkit-scrollbar {
  width: 6px;
}
.hours-timeline::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.hour-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid transparent;
  transition: var(--transition-smooth);
}

.hour-row:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.04);
}

.hour-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  width: 50px;
  text-align: right;
}

.hour-block {
  flex: 1;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--color-empty);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  user-select: none;
}

.hour-block.work {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93c5fd;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.05);
}
.hour-block.gym {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.05);
}
.hour-block.random {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fda4af;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.05);
}
.hour-block.rest {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fde047;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.05);
}
.hour-block.study {
  background: rgba(139, 92, 246, 0.25);
  border: 1px solid rgba(139, 92, 246, 0.6);
  color: #c084fc;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.15);
  font-weight: 600;
}

/* Grid Builder Controls */
.schedule-legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-top: 1rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: var(--transition-smooth);
}

.legend-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.legend-item.selected {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.legend-color {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}
.legend-color.work { background: var(--color-work); }
.legend-color.gym { background: var(--color-gym); }
.legend-color.random { background: var(--color-random); }
.legend-color.rest { background: var(--color-rest); }
.legend-color.study { background: var(--color-study); }
.legend-color.empty {
  background: transparent;
  border: 1px dashed var(--text-muted);
}

/* Study Cycle Progress Panels */
.cycle-progress-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.progress-bar-wrapper {
  margin-bottom: 1rem;
}

.progress-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.progress-bar-outer {
  height: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  position: relative;
}

.progress-bar-inner {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
  width: 0%;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.meta-status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.meta-status-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
}

.meta-status-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.meta-status-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
}

/* Disciplines Grid */
.disciplines-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.discipline-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  transition: var(--transition-smooth);
}

.discipline-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.discipline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.discipline-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: #fff;
}

.discipline-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.discipline-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.discipline-percentage {
  font-weight: 600;
  color: var(--success);
}

.discipline-badge {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 4px;
  font-weight: 600;
}

.discipline-badge.high { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.discipline-badge.medium { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.discipline-badge.low { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

/* Checklist Container */
.checklist-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition-smooth);
}

.checklist-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.checklist-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 2px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.checklist-item.checked .checklist-checkbox {
  background: var(--success);
  border-color: var(--success);
}

.checklist-checkbox svg {
  width: 12px;
  height: 12px;
  stroke: white;
  stroke-width: 3;
  fill: none;
  display: none;
}

.checklist-item.checked .checklist-checkbox svg {
  display: block;
}

.checklist-text {
  flex: 1;
  font-size: 0.95rem;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}

.checklist-item.checked .checklist-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.checklist-meta {
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  color: var(--text-muted);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-card {
  background: #0f0f13;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 550px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), var(--shadow-glow);
  overflow: hidden;
  transform: scale(0.95);
  transition: var(--transition-smooth);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.5rem;
}

.modal-body {
  padding: 1.5rem;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font-primary);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.form-control:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* Statistics page layouts */
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }
}

.chart-container {
  height: 280px;
  position: relative;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.history-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: var(--transition-smooth);
}

.history-card:hover {
  background: rgba(255, 255, 255, 0.04);
}

.history-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.history-card-title {
  font-weight: 600;
  font-size: 1.05rem;
  color: #fff;
}

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

.history-stats-row {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.history-stat-item {
  display: flex;
  flex-direction: column;
}

.history-stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.history-stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

/* History logs list */
.logs-table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.logs-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.logs-table th {
  background: rgba(255, 255, 255, 0.03);
  padding: 0.85rem 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.logs-table td {
  padding: 0.85rem 1rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
}

.logs-table tr:last-child td {
  border-bottom: none;
}

.logs-table tr:hover td {
  background: rgba(255, 255, 255, 0.01);
}

.badge-study-type {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 4px;
  font-weight: 600;
}
.badge-study-type.theory { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-study-type.questions { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-study-type.revision { background: rgba(168, 85, 247, 0.15); color: #c084fc; }

.star-rating {
  color: var(--warning);
}

/* Responsive Overrides */
@media (max-width: 900px) {
  .sidebar {
    width: 80px;
    padding: 2rem 0.5rem;
    align-items: center;
  }
  .logo-text, .nav-item span, .sidebar-footer {
    display: none;
  }
  .logo-container {
    margin-bottom: 2rem;
  }
  .main-content {
    margin-left: 80px;
    width: calc(100% - 80px);
    padding: 1.5rem;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-full-width {
    grid-column: span 1;
  }
  .metrics-summary-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .metrics-summary-row {
    grid-template-columns: 1fr;
  }
  .meta-status-grid {
    grid-template-columns: 1fr;
  }
}

/* Styles to hide sidebar and expand main content in iframe mode */
.sidebar {
    display: none !important;
}

body {
    display: flex !important;
    flex-direction: column !important;
}

.main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 1.5rem !important;
}

/* Custom nav-item active styling for horizontal bar links */
.nav-links li.nav-item.active a {
    background-color: var(--primary-light) !important;
    color: var(--primary) !important;
}

.nav-links li.nav-item a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary) !important;
}

.nav-links li.nav-item a {
    color: var(--text-secondary) !important;
}

/* Custom layout fixes for horizontal nav bar inside iframe */
.planner-nav-list {
    display: flex !important;
    flex-direction: row !important;
    padding: 0 !important;
    margin: 0 !important;
    gap: 8px !important;
    list-style: none !important;
}

.planner-nav-list li.planner-horizontal-nav-item a {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 10px 20px !important;
    background-color: transparent !important;
    color: #94a3b8 !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    transition: all 0.2s ease !important;
}

.planner-nav-list li.planner-horizontal-nav-item.active a {
    background-color: rgba(168, 85, 247, 0.15) !important;
    color: #c084fc !important;
    border: 1px solid rgba(168, 85, 247, 0.3) !important;
}

.planner-nav-list li.planner-horizontal-nav-item a:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #ffffff !important;
}

/* Prevent text hiding on small viewports for horizontal nav items */
.planner-nav-list li.planner-horizontal-nav-item span {
    display: inline !important;
}
