/* ─── Mission Control — Dark Premium Theme ────────────────────── */
/* Inspired by Linear / Vercel / Raycast                      */
/* Accent: #4ADE80 (green)                                     */

:root {
  /* Dark palette */
  --bg: #0A0A0B;
  --surface: #111113;
  --surface-hover: #1A1A1E;
  --border: #2A2A2F;
  --border-bright: #3A3A42;

  /* Text */
  --text: #F0F0F0;
  --text-secondary: #8B8B99;
  --text-muted: #5A5A65;

  /* Accents */
  --accent: #4ADE80;
  --accent-dim: #22C55E;
  --blue: #60A5FA;
  --amber: #F59E0B;
  --red: #F87171;

  /* Sizing */
  --sidebar-width: 260px;
  --content-padding: clamp(20px, 4%, 48px);
  --card-radius: 8px;

  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ─── Reset ──────────────────────────────────────────────── */

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }

/* ─── Layout ─────────────────────────────────────────────── */

.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar (desktop) */
.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 10;
}

.sidebar-header {
  padding: clamp(24px, 4%, 40px);
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.sidebar-logo span {
  font-size: clamp(13px, 2vw, 16px);
  font-weight: 500;
  color: var(--text);
}

.sidebar-subtitle {
  color: var(--text-muted);
  font-size: clamp(11px, 1.5vw, 13px);
  letter-spacing: 0.02em;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: clamp(16px, 3%, 24px) clamp(12px, 2%, 16px);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: clamp(13px, 1.5vw, 15px);
  transition: all 0.15s ease;
  border-left: 2px solid transparent;
  margin-bottom: 2px;
  cursor: pointer;
}

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

.nav-item.active {
  color: var(--accent);
  background: rgba(74, 222, 128, 0.08);
  border-left-color: var(--accent);
  font-weight: 500;
}

.nav-item .icon {
  font-size: clamp(18px, 2.5vw, 20px);
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}

.sidebar-footer {
  padding: clamp(16px, 3%, 24px);
  border-top: 1px solid var(--border);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-name {
  font-size: clamp(13px, 1.5vw, 15px);
  color: var(--text);
  font-weight: 500;
}

.user-role {
  font-size: clamp(11px, 1.2vw, 13px);
  color: var(--text-muted);
}

/* Main content */
.main {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 0;
}

.page-header {
  padding: clamp(24px, 4%, 48px);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: clamp(16px, 4%, 32px);
  flex-wrap: wrap;
}

.page-title {
  font-size: clamp(24px, 5vw, 40px);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: clamp(11px, 1.5vw, 13px);
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.greeting {
  font-size: clamp(24px, 5vw, 40px);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

/* ─── Mobile Bottom Nav ─────────────────────────────────── */

.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 50;
  justify-content: space-around;
  align-items: center;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  height: 100%;
  color: var(--text-secondary);
  font-size: 10px;
  transition: color 0.15s ease;
  cursor: pointer;
  min-height: 44px;
}

.mobile-nav-item .icon {
  font-size: 20px;
}

.mobile-nav-item.active {
  color: var(--accent);
}

/* ─── Cards ──────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: clamp(20px, 4%, 32px);
  transition: all 0.15s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  border-color: var(--border-bright);
}

.card-title {
  font-size: clamp(11px, 1.5vw, 13px);
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: clamp(16px, 3%, 24px);
}

/* ─── Focus Block ────────────────────────────────────────── */

.focus-block {
  margin-bottom: clamp(32px, 5%, 48px);
  padding: clamp(24px, 4%, 48px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--card-radius);
}

.focus-label {
  font-size: clamp(11px, 1.5vw, 13px);
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: clamp(12px, 2%, 16px);
}

.focus-text {
  font-size: clamp(18px, 3vw, 32px);
  color: var(--text);
  cursor: pointer;
  line-height: 1.4;
  font-weight: 500;
}

/* ─── Grid ───────────────────────────────────────────────── */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(280px, 100%, 400px), 1fr));
  gap: clamp(16px, 3%, 32px);
  margin-bottom: clamp(32px, 5%, 48px);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(300px, 100%, 600px), 1fr));
  gap: clamp(16px, 3%, 32px);
}

/* ─── Buttons ────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 2%, 14px) clamp(20px, 3%, 32px);
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  font-family: inherit;
  min-height: 44px;
  min-width: 44px;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

.btn-ghost {
  background: none;
  color: var(--text-secondary);
  padding: 8px 12px;
}

.btn-ghost:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}

.btn-danger {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 18px;
  transition: color 0.15s ease;
  min-height: 44px;
  min-width: 44px;
}

.btn-danger:hover { color: var(--red); }

/* ─── Inputs ─────────────────────────────────────────────── */

.input {
  width: 100%;
  padding: clamp(10px, 2%, 16px);
  font-size: clamp(13px, 1.8vw, 15px);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: var(--bg);
  font-family: inherit;
  transition: all 0.15s ease;
  caret-color: var(--accent);
  min-height: 44px;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.2);
}

.input-large {
  font-size: clamp(16px, 2.5vw, 24px);
  font-weight: 500;
}

.textarea {
  width: 100%;
  padding: clamp(12px, 2%, 20px);
  font-size: clamp(14px, 1.8vw, 16px);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: var(--bg);
  font-family: inherit;
  line-height: 1.7;
  transition: all 0.15s ease;
  caret-color: var(--accent);
  resize: vertical;
  min-height: 44px;
}

.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.2);
}

/* ─── Checkbox ───────────────────────────────────────────── */

.checkbox-custom {
  width: 20px;
  height: 20px;
  margin-top: 4px;
  cursor: pointer;
  accent-color: var(--accent);
  flex-shrink: 0;
  border-radius: 4px;
}

/* ─── Badges ─────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: clamp(11px, 1.5vw, 13px);
  font-weight: 500;
}

.badge-green {
  color: var(--accent);
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.badge-amber {
  color: var(--amber);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-red {
  color: var(--red);
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.badge-gray {
  color: var(--text-secondary);
  background: rgba(139, 139, 153, 0.1);
  border: 1px solid rgba(139, 139, 153, 0.3);
}

/* ─── Progress Bar ───────────────────────────────────────── */

.progress-bar {
  height: 6px;
  background: var(--surface-hover);
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-dim));
  border-radius: 8px;
  transition: width 0.3s ease;
}

/* ─── Item Row ───────────────────────────────────────────── */

.item-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: all 0.15s ease;
}

.item-text {
  font-size: clamp(13px, 1.8vw, 15px);
  color: var(--text);
  cursor: pointer;
  flex: 1;
  line-height: 1.5;
}

.item-text.done {
  text-decoration: line-through;
  opacity: 0.5;
}

.item-meta {
  font-size: clamp(11px, 1.5vw, 12px);
  color: var(--text-muted);
  margin-top: 2px;
}

.add-btn {
  text-align: left;
  padding: 8px 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: clamp(13px, 1.8vw, 15px);
  font-family: inherit;
  transition: all 0.15s ease;
}

/* ─── Mirror / Päevik ────────────────────────────────────── */

.mirror-container {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--content-padding);
}

.mirror-streak {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: clamp(12px, 1.5vw, 14px);
  flex-shrink: 0;
}

.mirror-streak.filled {
  background: rgba(74, 222, 128, 0.08);
  border-color: rgba(74, 222, 128, 0.2);
  color: var(--accent);
}

.day-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: clamp(24px, 4%, 32px);
}

.day-tab {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: all 0.15s ease;
}

.day-tab:hover {
  border-color: var(--border-bright);
  color: var(--text);
}

.day-tab.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.prompt-card {
  margin-bottom: clamp(16px, 3%, 24px);
}

.prompt-label {
  font-size: clamp(12px, 1.5vw, 14px);
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 8px;
}

.prompt-question {
  color: var(--text-secondary);
  font-size: clamp(13px, 1.8vw, 15px);
  margin-bottom: 12px;
}

/* ─── Bottom Bar ─────────────────────────────────────────── */

.bottom-bar {
  padding: clamp(16px, 3%, 24px) var(--content-padding);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: clamp(12px, 3%, 24px);
  flex-wrap: wrap;
  font-size: clamp(12px, 1.5vw, 14px);
}

/* ─── Scrollbar ──────────────────────────────────────────── */

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--border-bright); }

/* ─── Animations ─────────────────────────────────────────── */

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px rgba(74, 222, 128, 0.3); }
  50% { box-shadow: 0 0 10px rgba(74, 222, 128, 0.5); }
}

.glow {
  animation: glow 2s ease-in-out infinite;
}

/* ─── Responsive ─────────────────────────────────────────── */

@media (max-width: 768px) {
  .sidebar { display: none; }
  .mobile-nav { display: flex; }
  .main { padding-bottom: 70px; }

  :root {
    --content-padding: 16px;
    --card-radius: 6px;
  }

  input, textarea, select {
    font-size: 16px;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) and (max-width: 1023px) {
  :root { --sidebar-width: 220px; }
}

@media (min-width: 1024px) and (max-width: 1439px) {
  :root { --sidebar-width: 260px; --content-padding: 40px; }
}

@media (min-width: 1440px) and (max-width: 1919px) {
  :root { --sidebar-width: 280px; --content-padding: 48px; }
}

@media (min-width: 1920px) {
  :root { --sidebar-width: 300px; --content-padding: 64px; }
}

/* ─── Misc ───────────────────────────────────────────────── */

.loading {
  color: var(--text-secondary);
  text-align: center;
  padding: 48px;
}

.text-error { color: var(--red); }
.text-warning { color: var(--amber); }
.text-success { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.min-w-0 { min-width: 0; }
.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
