/* ===== TeqStudy Dashboard — Matching Approved Design ===== */
:root {
  --bg: #0b0f1a;
  --bg-elevated: #121826;
  --bg-card: #161e2e;
  --bg-card-hover: #1c2638;
  --border: #243044;
  --border-soft: #1e2a3d;
  --text: #e8eef7;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --primary: #38bdf8;
  --primary-soft: rgba(56, 189, 248, 0.14);
  --accent: #fbbf24;
  --accent-soft: rgba(251, 191, 36, 0.14);
  --success: #34d399;
  --purple: #a78bfa;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse 90% 55% at 50% -20%, rgba(56, 189, 248, 0.12), transparent),
    radial-gradient(ellipse 50% 40% at 85% 30%, rgba(251, 191, 36, 0.06), transparent);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ===== Layout ===== */
.app {
  display: grid;
  grid-template-columns: 240px 1fr 300px;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
  background: rgba(11, 15, 26, 0.9);
  border-right: 1px solid var(--border-soft);
  padding: 24px 14px;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(14px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px 28px;
}

.logo-mark {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
  color: #0b0f1a;
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.4);
}

.logo-name {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.3px;
}

.logo-tag {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 1px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.18s ease;
}

.nav-item:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.18), rgba(56, 189, 248, 0.05));
  color: var(--primary);
  box-shadow: inset 3px 0 0 var(--primary);
}

.nav-item svg { flex-shrink: 0; opacity: 0.9; }

.user-card {
  margin-top: auto;
  padding: 11px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  transition: background 0.15s;
}
.user-card:hover { background: var(--bg-card-hover); }

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 13px;
  color: #0b0f1a;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; }
.user-status { font-size: 11px; color: var(--success); margin-top: 1px; }
.user-card svg { color: var(--text-muted); flex-shrink: 0; }

/* ===== Main ===== */
.main {
  padding: 32px 36px 40px;
  overflow-y: auto;
}

.hero { margin-bottom: 28px; }

.hero h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #e8eef7, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 15px;
}

.hero-highlight {
  margin-top: 4px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
}

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.35fr;
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-label {
  font-size: 11.5px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 12px;
}

.stat-ring {
  position: relative;
  width: 72px;
  height: 72px;
  margin-bottom: 10px;
}

.stat-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: rgba(255,255,255,0.08);
  stroke-width: 3.2;
}

.ring-fill {
  fill: none;
  stroke-width: 3.2;
  stroke-linecap: round;
}

.stat-ring.cyan .ring-fill { stroke: #34d399; }
.stat-ring.blue .ring-fill { stroke: #38bdf8; }
.stat-ring.amber .ring-fill { stroke: #fbbf24; }

.stat-ring > span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
}

.stat-ring .of {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  display: block;
}

.stat-footer {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Big Streak */
.streak-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.streak-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 35%, rgba(251, 191, 36, 0.13), transparent 70%);
  pointer-events: none;
}

.streak-ring {
  position: relative;
  width: 118px;
  height: 118px;
}

.streak-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.streak-bg {
  fill: none;
  stroke: rgba(255,255,255,0.07);
  stroke-width: 7;
}

.streak-fill {
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 280;
  stroke-dashoffset: 45;
}

.streak-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.streak-flame { font-size: 16px; line-height: 1; margin-bottom: 2px; }
.streak-number {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -1px;
}
.streak-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-top: 3px;
}

.streak-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Continue Learning */
.continue-section { margin-bottom: 28px; }

.continue-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.continue-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #38bdf8, #fbbf24);
  pointer-events: none;
}

.continue-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.continue-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 4px;
}
.continue-title span { color: var(--primary); }

.continue-desc {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 10px;
}

.continue-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #0ea5e9);
  border-radius: 3px;
}

.progress-pct {
  font-size: 12.5px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.btn-continue {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #0b0f1a;
  font-weight: 600;
  font-size: 14px;
  padding: 11px 20px;
  border-radius: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(251, 191, 36, 0.3);
}
.btn-continue:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(251, 191, 36, 0.42);
}

.continue-visual {
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: grid;
  place-items: center;
  padding: 12px;
}

.continue-visual svg { width: 100%; height: auto; }

/* Quick Start */
.section-title {
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 12px;
}

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

.qs-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
  text-align: left;
}
.qs-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border);
  transform: translateY(-2px);
}

.qs-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}

.qs-card.pomodoro .qs-icon { background: rgba(239, 68, 68, 0.14); }
.qs-card.deep .qs-icon { background: rgba(56, 189, 248, 0.14); }
.qs-card.review .qs-icon { background: rgba(251, 191, 36, 0.14); }

.qs-name { font-size: 13.5px; font-weight: 600; }
.qs-time { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.qs-arrow { margin-left: auto; color: var(--text-muted); font-size: 18px; }

/* ===== Right Panel ===== */
.right-panel {
  background: rgba(11, 15, 26, 0.65);
  border-left: 1px solid var(--border-soft);
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-title { font-size: 13.5px; font-weight: 600; }
.panel-link { font-size: 12px; color: var(--primary); }

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

.session-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 13px;
  display: flex;
  gap: 12px;
  transition: all 0.18s;
}
.session-card:hover {
  border-color: var(--border);
  background: var(--bg-card-hover);
}

.session-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 15px;
  flex-shrink: 0;
}
.session-icon.cyan { background: rgba(56, 189, 248, 0.14); }
.session-icon.amber { background: rgba(251, 191, 36, 0.14); }
.session-icon.purple { background: rgba(167, 139, 250, 0.14); }

.session-name { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.session-sub { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }

.session-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tag {
  font-size: 10.5px;
  font-weight: 500;
  padding: 3px 7px;
  border-radius: 5px;
}
.tag.deep { background: rgba(56, 189, 248, 0.12); color: var(--primary); }
.tag.review { background: rgba(251, 191, 36, 0.12); color: var(--accent); }
.tag.practice { background: rgba(167, 139, 250, 0.12); color: var(--purple); }

.time { font-size: 11px; color: var(--text-muted); }

.quote-card {
  margin-top: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 16px;
  position: relative;
}

.quote-mark {
  font-size: 28px;
  color: var(--primary);
  opacity: 0.5;
  line-height: 1;
  margin-bottom: 4px;
}

.quote-card p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  font-style: italic;
}

.quote-card cite {
  display: block;
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-muted);
  font-style: normal;
}

/* ===== Soon badge (nav items without a real destination yet) ===== */
.nav-item.soon { opacity: 0.55; cursor: default; }
.nav-item .soon-tag {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(255,255,255,0.06);
  padding: 2px 6px;
  border-radius: 5px;
}

/* ===== Focus Timer Modal ===== */
.timer-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(5, 8, 14, 0.75);
  backdrop-filter: blur(6px);
  display: none;
  place-items: center;
  padding: 20px;
}
.timer-modal.open { display: grid; }
.timer-card {
  width: min(360px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  text-align: center;
  box-shadow: var(--shadow);
}
.timer-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.timer-name { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.timer-display {
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  margin-bottom: 22px;
}
.timer-display.pomodoro { color: #f87171; }
.timer-display.deep { color: var(--primary); }
.timer-display.review { color: var(--accent); }
.timer-actions { display: flex; gap: 10px; justify-content: center; }
.timer-btn {
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  color: var(--text);
  transition: all 0.18s ease;
}
.timer-btn:hover { background: var(--bg-card-hover); }
.timer-btn.primary { background: linear-gradient(135deg, var(--primary), #0ea5e9); color: #0b0f1a; border: none; }
.timer-note { margin-top: 16px; font-size: 12px; color: var(--text-muted); }

/* ===== Sessions: empty state + add form ===== */
.session-empty {
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
  padding: 18px 10px;
  border: 1px dashed var(--border-soft);
  border-radius: var(--radius-sm);
}
.session-add-btn {
  width: 100%;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  transition: all 0.18s ease;
}
.session-add-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.session-form { display: flex; flex-direction: column; gap: 8px; background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 12px; }
.session-form input, .session-form textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12.5px;
  color: var(--text);
  font-family: inherit;
}
.session-form input:focus, .session-form textarea:focus { outline: none; border-color: var(--primary); }
.session-form-row { display: flex; gap: 8px; }
.session-form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 2px; }
.session-form-actions button {
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
}
.session-form-actions .cancel { color: var(--text-muted); }
.session-form-actions .save { background: var(--primary); color: #0b0f1a; }
.session-delete {
  background: none;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1;
  padding: 2px 4px;
  flex-shrink: 0;
  align-self: flex-start;
  opacity: 0;
  transition: opacity 0.15s;
}
.session-card:hover .session-delete { opacity: 1; }
.session-delete:hover { color: #f87171; }
.session-card { position: relative; }
.session-top-row { display: flex; gap: 12px; }

/* ===== Progress section (real per-course bars) ===== */
.progress-section { margin-bottom: 28px; }
.progress-list { display: flex; flex-direction: column; gap: 10px; }
.progress-item {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.progress-item-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; gap: 12px; }
.progress-item-title { font-size: 13.5px; font-weight: 600; }
.progress-item-pct { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.progress-item .progress-bar { height: 5px; }
.progress-empty { font-size: 13px; color: var(--text-muted); }

/* ===== Mobile safety (baked in from this session's lessons) ===== */
table { display: block; }
@media (max-width: 768px) {
  table { overflow-x: auto !important; -webkit-overflow-scrolling: touch; white-space: nowrap; }
}

/* ===== Responsive (original) ===== */
@media (max-width: 1200px) {
  .app { grid-template-columns: 220px 1fr; }
  .right-panel { display: none; }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .streak-card { grid-column: 1 / -1; }
  .continue-card { grid-template-columns: 1fr; }
  .continue-visual { height: 120px; }
  .quick-grid { grid-template-columns: 1fr; }
}
