:root {
  --bg-main: #0f111a;
  --bg-card: rgba(22, 25, 38, 0.85);
  --bg-card-hover: rgba(30, 35, 52, 0.95);
  --bg-input: #1a1e2d;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: rgba(99, 102, 241, 0.4);
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.15);
  
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --purple: #8b5cf6;
  --pink: #ec4899;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  
  --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* App Shell */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Top Header */
.top-header {
  height: 68px;
  background: rgba(15, 17, 26, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  flex-shrink: 0;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.brand-title {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.3px;
  display: block;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Mode Selector */
.mode-pill-selector {
  display: flex;
  background: #1a1d2c;
  padding: 4px;
  border-radius: 30px;
  border: 1px solid var(--border-color);
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.mode-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ws-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: var(--success);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  padding: 5px 12px 5px 6px;
  border-radius: 30px;
  border: 1px solid var(--border-color);
  cursor: pointer;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.user-name-display {
  font-size: 13px;
  font-weight: 600;
}

/* Layout */
.main-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: rgba(18, 20, 31, 0.9);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 12px;
  flex-shrink: 0;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  position: relative;
}

.nav-item i {
  font-size: 17px;
  width: 20px;
  text-align: center;
}

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

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3.5px;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
}

.badge-count {
  margin-left: auto;
  background: #1e2235;
  color: var(--text-muted);
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 10px;
}

.badge-alert {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  animation: pulse 1.5s infinite;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
}

.family-card-mini {
  background: var(--bg-input);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border-color);
}

.fam-name {
  font-size: 12px;
  font-weight: 700;
  display: block;
}

.fam-code {
  font-size: 10.5px;
  color: var(--text-muted);
}

.btn-logout {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

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

/* Content Area */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.05), transparent 40%),
              radial-gradient(circle at bottom left, rgba(139, 92, 246, 0.04), transparent 40%);
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease forwards;
}

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

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

/* Glassmorphism Cards */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
}

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

.panel-header h3, .panel-header h4 {
  font-size: 15.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Buttons & Inputs */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.btn-outline:hover { background: rgba(255, 255, 255, 0.05); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-xs { padding: 4px 8px; font-size: 11px; border-radius: 6px; }
.btn-text { background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 11px; }
.btn-text:hover { color: var(--text-main); }
.btn-icon { background: transparent; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; }
.btn-icon:hover { color: var(--text-main); }
.btn-danger-outline {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.w-100 { width: 100%; }

/* TAB 1: RADAR & MAP */
.pane-grid-split {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 18px;
  height: calc(100vh - 110px);
}

.map-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.map-view {
  flex: 1;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  min-height: 400px;
}

.map-status-bar {
  display: flex;
  justify-content: space-between;
  padding-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.family-sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}

.member-cards-list, .alerts-feed-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.member-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s;
  cursor: pointer;
}

.member-card:hover {
  border-color: var(--border-active);
  background: var(--bg-card-hover);
}

.member-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.member-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 14px;
}

.member-name {
  font-size: 13.5px;
  font-weight: 700;
}

.member-status {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.member-battery {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.alert-item {
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 12px;
  font-size: 12px;
}

.alert-item.alert-warn {
  border-left-color: var(--warning);
}

.alert-header {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  margin-bottom: 2px;
}

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

/* TAB 2: AI SMART NOTES */
.notes-workspace-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 18px;
  height: calc(100vh - 110px);
}

.notes-library-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.recorder-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rec-timer {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 16px;
  color: var(--danger);
}

.waveform-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 38px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 0 10px;
}

.wave-bar {
  width: 4px;
  height: 8px;
  background: var(--primary);
  border-radius: 2px;
  animation: waveAnim 1s ease-in-out infinite alternate;
}

@keyframes waveAnim {
  0% { height: 6px; }
  100% { height: 26px; }
}

.recorder-controls {
  display: flex;
  gap: 10px;
}

.btn-rec {
  flex: 1;
  background: #dc2626;
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.live-bookmarks-bar {
  background: var(--bg-input);
  padding: 10px;
  border-radius: var(--radius-sm);
}

.bar-title {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.bookmark-tags {
  display: flex;
  gap: 6px;
}

.tag-btn {
  flex: 1;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  padding: 6px 4px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.tag-important:hover { background: rgba(245, 158, 11, 0.2); border-color: var(--warning); }
.tag-ask:hover { background: rgba(99, 102, 241, 0.2); border-color: var(--primary); }
.tag-exam:hover { background: rgba(236, 72, 153, 0.2); border-color: var(--pink); }

.manual-input-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.manual-input-box input, .manual-input-box textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-main);
  font-size: 12.5px;
}

.notes-vault-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.search-mini {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--text-main);
  width: 130px;
}

.notes-list-items {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.note-item-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.note-item-card:hover, .note-item-card.active {
  border-color: var(--primary);
  background: var(--bg-card-hover);
}

.note-title-line {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 3px;
}

.note-meta-line {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

.notes-viewer-column {
  overflow-y: auto;
}

.note-detail-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.summary-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.sum-tab-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.sum-tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.summary-content-view {
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Flashcards Deck */
.flashcards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.flashcard {
  perspective: 1000px;
  height: 160px;
  cursor: pointer;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.flashcard.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
}

.card-front {
  background: linear-gradient(135deg, #1e2235, #272d45);
  color: var(--text-main);
}

.card-back {
  background: linear-gradient(135deg, #312e81, #4338ca);
  color: #fff;
  transform: rotateY(180deg);
}

/* Quiz Card */
.quiz-box {
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 18px;
  border: 1px solid var(--border-color);
}

.quiz-question {
  font-size: 14.5px;
  font-weight: 700;
  margin-bottom: 12px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-opt-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}

.quiz-opt-btn:hover { background: rgba(99, 102, 241, 0.15); border-color: var(--primary); }
.quiz-opt-btn.correct { background: rgba(16, 185, 129, 0.2); border-color: var(--success); color: var(--success); font-weight: 700; }
.quiz-opt-btn.wrong { background: rgba(239, 68, 68, 0.2); border-color: var(--danger); color: var(--danger); }

/* TAB 3: DIGITAL PARENTING */
.parental-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.child-selector-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.child-pills {
  display: flex;
  gap: 10px;
}

.child-pill-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.child-pill-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.parental-subgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.progress-bar-large {
  height: 14px;
  background: var(--bg-input);
  border-radius: 10px;
  overflow: hidden;
  margin: 12px 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #ec4899);
  border-radius: 10px;
  transition: width 0.4s ease;
}

.app-usage-categories {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.cat-badge {
  flex: 1;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 8px;
  text-align: center;
}

.cat-badge-val {
  font-size: 14px;
  font-weight: 700;
  display: block;
}

.cat-badge-lbl {
  font-size: 10.5px;
  color: var(--text-muted);
}

.section-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.app-usage-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.app-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-input);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}

/* Schedule Rules */
.age-preset-buttons {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  margin-bottom: 14px;
}

.preset-btn {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.preset-btn.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.schedule-block {
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
}

.block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.block-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.block-title span {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}

.time-inputs-row {
  display: flex;
  gap: 14px;
}

.time-inputs-row input[type="time"] {
  background: #121524;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 6px 10px;
  font-size: 12.5px;
}

.time-lbl {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

/* Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #334155;
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(20px); }

/* TAB 5: AI ASSISTANT */
.assistant-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 110px);
}

.chat-messages-area {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 12px 0;
}

.chat-bubble {
  display: flex;
  gap: 10px;
  max-width: 75%;
}

.chat-bubble.ai { align-self: flex-start; }
.chat-bubble.user { align-self: flex-end; flex-direction: row-reverse; }

.bubble-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}

.chat-bubble.user .bubble-avatar {
  background: var(--pink);
}

.bubble-content {
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13.5px;
  line-height: 1.5;
  border: 1px solid var(--border-color);
}

.chat-bubble.user .bubble-content {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.quick-suggestion-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0;
}

.chip-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.chip-btn:hover { background: var(--primary-light); border-color: var(--primary); }

.chat-input-bar {
  display: flex;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.chat-input-bar input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-main);
  font-size: 13.5px;
}

.btn-send {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: var(--primary);
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-backdrop.active { display: flex; }

.modal-box {
  width: 90%;
  max-width: 480px;
}

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

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-group label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input, .form-group select {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text-main);
  font-size: 13px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* Child Mode Lock Overlay */
.child-lock-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 17, 26, 0.96);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lock-modal-card {
  max-width: 420px;
  width: 100%;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}

.lock-icon { font-size: 48px; margin-bottom: 12px; }
.countdown-clock {
  font-family: 'JetBrains Mono', monospace;
  font-size: 36px;
  font-weight: 800;
  color: var(--primary);
  margin: 16px 0;
}

.allowed-apps-box {
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin: 16px 0;
  text-align: left;
}

.allowed-apps-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.allowed-apps-icons span {
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11.5px;
}

.btn-more-time {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  width: 100%;
  cursor: pointer;
  margin-bottom: 10px;
}

.btn-close-lock {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  width: 100%;
  cursor: pointer;
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 3000;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Mobile Nav */
.mobile-bottom-nav {
  display: none;
}

/* Responsive */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .pane-grid-split, .notes-workspace-grid, .parental-subgrid {
    grid-template-columns: 1fr;
    height: auto;
  }
  .mobile-bottom-nav {
    height: 60px;
    background: #141724;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: sticky;
    bottom: 0;
    z-index: 100;
  }
  .bottom-nav-item {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }
  .bottom-nav-item.active { color: var(--primary); }
}

/* Google Sign-In & Auth Modal Styling */
.btn-google-header {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-google-header:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.auth-modal-box {
  max-width: 440px;
}

.auth-sub-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
  text-align: center;
}

.btn-google-large {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #ffffff;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.btn-google-large:hover {
  background: #f9fafb;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0 16px 0;
  color: var(--text-dim);
}

.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
  padding: 0 12px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.auth-form-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-btn-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

/* User Profile Wrapper & Dropdown */
.user-profile-wrapper {
  position: relative;
}

.profile-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 290px;
  background: #181b2a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
  padding: 16px;
  display: none;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
  animation: fadeIn 0.2s ease forwards;
}

.profile-dropdown-menu.active {
  display: flex;
}

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

.avatar-lg {
  width: 42px;
  height: 42px;
  font-size: 16px;
  font-weight: 700;
}

.dropdown-user-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.dropdown-user-details strong {
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-email {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 6px;
  border-radius: 4px;
  align-self: flex-start;
  margin-top: 2px;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

.dropdown-item-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.2s;
}

.dropdown-item-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.dropdown-item-btn.google-item {
  background: #ffffff;
  color: #1f2937;
  border-color: #e5e7eb;
}

.dropdown-item-btn.google-item:hover {
  background: #f3f4f6;
}

.dropdown-section-title {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-top: 4px;
}

.quick-switch-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.switch-member-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.switch-member-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.dot-role {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
