/* ========================================
   TribuOS - Design System
   ======================================== */

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

:root {
  --bg: #0f0f13;
  --bg-surface: #1a1a24;
  --bg-card: #22222e;
  --bg-hover: #2a2a38;
  --border: rgba(255,255,255,0.06);
  --border-light: rgba(255,255,255,0.1);
  --text: #e8e8ed;
  --text-secondary: #8b8b9e;
  --text-muted: #5a5a6e;
  --accent-eco: #34d399;
  --accent-emo: #fb7185;
  --accent-com: #60a5fa;
  --accent-work: #fbbf24;
  --accent-game: #a78bfa;
  --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --gradient-hero: linear-gradient(135deg, #0f0f13 0%, #1a1a2e 50%, #16213e 100%);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-full: 9999px;
  --shadow-card: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-glow: 0 0 40px rgba(102, 126, 234, 0.15);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ========================================
   LOGIN PAGE
   ======================================== */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(102,126,234,0.1) 0%, transparent 70%);
  top: -200px;
  right: -200px;
  animation: float 8s ease-in-out infinite;
}

.login-page::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(118,75,162,0.08) 0%, transparent 70%);
  bottom: -100px;
  left: -100px;
  animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(30px, -30px); }
}

.login-container {
  width: 100%;
  max-width: 420px;
  padding: 1.5rem;
  position: relative;
  z-index: 10;
}

.login-card {
  background: rgba(26, 26, 36, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo .logo-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

.login-logo h1 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-logo p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.3rem;
}

.login-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.login-tab {
  flex: 1;
  padding: 0.6rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  transition: var(--transition);
  font-family: inherit;
}

.login-tab.active {
  background: var(--bg-card);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-group input {
  width: 100%;
  padding: 0.7rem 1rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

.form-group input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.btn-primary {
  width: 100%;
  padding: 0.8rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--gradient-1);
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 25px rgba(102,126,234,0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.login-error {
  background: rgba(251,113,133,0.1);
  border: 1px solid rgba(251,113,133,0.2);
  color: #fb7185;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  margin-bottom: 1rem;
  display: none;
}

.login-error.show { display: block; }

/* ========================================
   APP LAYOUT
   ======================================== */

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

/* Sidebar */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  transition: var(--transition);
}

.sidebar-header {
  padding: 1.5rem 1.2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.sidebar-header .logo-text h1 {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-header .logo-text p {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.sidebar-nav {
  flex: 1;
  padding: 0.5rem 0;
  overflow-y: auto;
}

.nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 1.2rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  font-family: inherit;
  border-left: 3px solid transparent;
}

.nav-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.nav-btn.active {
  background: rgba(102,126,234,0.08);
  color: var(--text);
  font-weight: 600;
  border-left-color: #667eea;
}

.nav-btn .nav-icon { font-size: 1.15rem; }

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

.sidebar-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.green { background: var(--accent-eco); box-shadow: 0 0 6px var(--accent-eco); }
.status-dot.blue { background: var(--accent-com); }
.status-dot.gray { background: var(--text-muted); }

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

.app-header {
  padding: 1rem 1.5rem;
  background: rgba(15,15,19,0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  z-index: 20;
}

.app-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-icon {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border-light);
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.btn-icon:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border-color: rgba(255,255,255,0.15);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-1);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}

.user-avatar:hover { box-shadow: 0 0 0 3px rgba(102,126,234,0.3); }

.content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.content-inner {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

/* ========================================
   CARDS & COMPONENTS
   ======================================== */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: var(--transition);
}

.card:hover { border-color: var(--border-light); }

.card-accent {
  border-left: 3px solid;
}

.card-accent.eco { border-left-color: var(--accent-eco); }
.card-accent.emo { border-left-color: var(--accent-emo); }
.card-accent.com { border-left-color: var(--accent-com); }
.card-accent.work { border-left-color: var(--accent-work); }
.card-accent.game { border-left-color: var(--accent-game); }

.card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card .card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.kpi-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.kpi-card .kpi-icon { font-size: 1.5rem; margin-bottom: 0.6rem; }
.kpi-card .kpi-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}
.kpi-card .kpi-value {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0.2rem 0;
}
.kpi-card .kpi-sub {
  font-size: 0.7rem;
  font-weight: 500;
}
.kpi-sub.positive { color: var(--accent-eco); }
.kpi-sub.neutral { color: var(--accent-com); }
.kpi-sub.highlight { color: var(--accent-work); }

/* Charts */
.chart-container {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  height: 280px;
}

/* Grid Layout */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.space-y { display: flex; flex-direction: column; gap: 1rem; }

/* Section visibility */
.section-hidden { display: none !important; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { background: rgba(255,255,255,0.03); }
.data-table th {
  padding: 0.7rem 1rem;
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
}
.badge-eco { background: rgba(52,211,153,0.1); color: var(--accent-eco); }
.badge-emo { background: rgba(251,113,133,0.1); color: var(--accent-emo); }
.badge-neg { background: rgba(251,113,133,0.1); color: var(--accent-emo); }
.badge-pos { background: rgba(52,211,153,0.1); color: var(--accent-eco); }
.badge-neutral { background: rgba(255,255,255,0.06); color: var(--text-secondary); }

/* Timeline */
.timeline {
  position: relative;
  padding-left: 1.5rem;
  border-left: 2px solid var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
  padding-left: 1rem;
}

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 0.2rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}
.timeline-dot.family { background: var(--accent-emo); }
.timeline-dot.work { background: var(--accent-work); }
.timeline-dot.finance { background: var(--accent-eco); }
.timeline-dot.general { background: var(--accent-com); }

.timeline-item h4 { font-size: 0.9rem; font-weight: 600; }
.timeline-item time {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.timeline-item p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.03);
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-sm);
  margin-top: 0.4rem;
  border: 1px solid var(--border);
}

/* Memory Cards */
.memory-card {
  border-radius: var(--radius);
  padding: 1rem;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.memory-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }

.memory-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}
.memory-sender {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.memory-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
}
.memory-sender span { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); }
.memory-date { font-size: 0.65rem; color: var(--text-muted); }
.memory-content { margin-bottom: 0.6rem; }
.memory-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.memory-emoji { font-size: 1.2rem; }
.memory-source {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
}

/* Image placeholder */
.img-placeholder {
  width: 100%;
  height: 100px;
  background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.08));
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  opacity: 0.4;
  margin-bottom: 0.4rem;
}

/* Audio player */
.audio-player {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.04);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.audio-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(96,165,250,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--accent-com);
  flex-shrink: 0;
}
.audio-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}
.audio-bar-fill { width: 33%; height: 100%; background: var(--accent-com); }
.audio-time { font-size: 0.7rem; color: var(--text-muted); }

/* ========================================
   MINI-GAMES
   ======================================== */

.game-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.game-card:hover {
  border-color: var(--accent-game);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(167,139,250,0.15);
}

.game-card .game-icon { font-size: 2.5rem; margin-bottom: 0.8rem; }
.game-card h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.3rem; }
.game-card p { font-size: 0.75rem; color: var(--text-secondary); }

.game-area {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  min-height: 350px;
  display: none;
}

.game-area.active { display: block; }

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

.game-score {
  font-size: 0.8rem;
  color: var(--accent-game);
  font-weight: 600;
}

.btn-game {
  padding: 0.5rem 1rem;
  border: 1px solid var(--accent-game);
  background: rgba(167,139,250,0.1);
  color: var(--accent-game);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.btn-game:hover {
  background: rgba(167,139,250,0.2);
}

.btn-back {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.btn-back:hover { background: var(--bg-hover); color: var(--text); }

/* Trivia */
.trivia-question {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
  line-height: 1.5;
}

.trivia-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.trivia-option {
  padding: 0.8rem 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--text);
  text-align: left;
}

.trivia-option:hover { background: rgba(167,139,250,0.08); border-color: var(--accent-game); }
.trivia-option.correct { background: rgba(52,211,153,0.15); border-color: var(--accent-eco); color: var(--accent-eco); }
.trivia-option.wrong { background: rgba(251,113,133,0.15); border-color: var(--accent-emo); color: var(--accent-emo); }

/* Memory Game (card matching) */
.memory-game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  max-width: 500px;
  margin: 0 auto;
}

.memory-game-card {
  aspect-ratio: 1;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.memory-game-card.hidden-card {
  background: linear-gradient(135deg, rgba(167,139,250,0.1), rgba(96,165,250,0.1));
  border-color: rgba(167,139,250,0.3);
}
.memory-game-card.hidden-card::after { content: '❓'; }
.memory-game-card.revealed { animation: flipIn 0.3s ease; }
.memory-game-card.matched { opacity: 0.5; pointer-events: none; border-color: var(--accent-eco); }

@keyframes flipIn {
  0% { transform: rotateY(90deg); }
  100% { transform: rotateY(0deg); }
}

/* ========================================
   MODALS & FORMS
   ======================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

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

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 90%;
  max-width: 450px;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.2s ease;
}

.modal-overlay.show .modal { transform: translateY(0); }

.modal h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.modal .form-group { margin-bottom: 0.8rem; }

.modal .form-group select {
  width: 100%;
  padding: 0.7rem 1rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.btn-secondary {
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

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

.btn-small-primary {
  padding: 0.6rem 1.2rem;
  border: none;
  background: var(--gradient-1);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.btn-small-primary:hover { box-shadow: 0 4px 15px rgba(102,126,234,0.3); }

/* ========================================
   TELEGRAM CONFIG PANEL
   ======================================== */

.telegram-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.telegram-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.telegram-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: rgba(255,255,255,0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  flex-shrink: 0;
}

.telegram-toggle.active { background: var(--accent-eco); }

.telegram-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
}

.telegram-toggle.active::after { left: 23px; }

/* ========================================
   TOAST NOTIFICATION
   ======================================== */

.toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  max-width: 350px;
  box-shadow: var(--shadow-card);
  z-index: 200;
  transform: translateY(-120%);
  opacity: 0;
  transition: var(--transition);
}

.toast.show { transform: translateY(0); opacity: 1; }

.toast-icon { font-size: 1.2rem; flex-shrink: 0; }
.toast-title { font-size: 0.8rem; font-weight: 600; }
.toast-message { font-size: 0.7rem; color: var(--text-secondary); }

/* Delete button */
.btn-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: var(--transition);
}
.btn-delete:hover { color: var(--accent-emo); background: rgba(251,113,133,0.1); }

/* Add button floating */
.btn-add {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 1rem;
  border: 1px dashed var(--border-light);
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.btn-add:hover { border-color: #667eea; color: #667eea; background: rgba(102,126,234,0.05); }

/* ========================================
   USER DROPDOWN
   ======================================== */

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  min-width: 180px;
  box-shadow: var(--shadow-card);
  z-index: 50;
  display: none;
  overflow: hidden;
}
.user-dropdown.show { display: block; }

.user-dropdown-item {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.user-dropdown-item:hover { background: var(--bg-hover); color: var(--text); }
.user-dropdown-item.danger:hover { color: var(--accent-emo); }

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  .app-layout { flex-direction: column; }

  .sidebar {
    width: 100%;
    height: 56px;
    flex-direction: row;
    border-right: none;
    border-top: 1px solid var(--border);
    position: fixed;
    bottom: 0;
    z-index: 50;
    order: 2;
  }

  .sidebar-header, .sidebar-footer { display: none; }

  .sidebar-nav {
    display: flex;
    width: 100%;
    padding: 0;
    overflow-x: auto;
  }

  .nav-btn {
    flex: 1;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.5rem 0.3rem;
    font-size: 0.6rem;
    text-align: center;
    border-left: none;
    border-top: 3px solid transparent;
    justify-content: center;
  }

  .nav-btn.active {
    border-left-color: transparent;
    border-top-color: #667eea;
  }

  .nav-btn .nav-icon { font-size: 1rem; }

  .main-content {
    height: calc(100vh - 56px);
    order: 1;
  }

  .content-scroll { padding: 1rem; padding-bottom: 4rem; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .game-selector { grid-template-columns: 1fr; }
  .memory-game-grid { grid-template-columns: repeat(3, 1fr); }
}
