:root {
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Premium Human-Crafted Dark Palette */
  --bg-app: #0B0F19;
  --bg-sidebar: #0F172A;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(51, 65, 85, 0.8);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);

  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-sub: #64748B;

  --primary: #6366F1;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --secondary: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* App Layout */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 20px 8px;
  border-bottom: 1px solid var(--border-color);
}

.brand-logo {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.brand-text h2 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand-text h2 span {
  color: var(--primary);
}

.brand-text p {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.fleet-status-pill {
  margin: 16px 8px;
  padding: 8px 14px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #34D399;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #10B981;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  margin-top: 10px;
}

.nav-group-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
  letter-spacing: 1px;
  padding: 12px 12px 6px 12px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  margin-bottom: 4px;
}

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

.nav-item.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.2), rgba(99, 102, 241, 0.05));
  color: #A5B4FC;
  border-left: 3px solid var(--primary);
}

.nav-badge {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
}

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

.admin-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
}

.admin-profile .avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F59E0B, #EF4444);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.admin-info h4 {
  font-size: 13px;
  font-weight: 600;
}

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

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

/* Top Header */
.top-header {
  height: 72px;
  padding: 0 32px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  width: 440px;
}

.header-search input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 14px;
  width: 100%;
}

.header-search input::placeholder {
  color: var(--text-sub);
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, #6366F1, #4F46E5);
  color: white;
  box-shadow: 0 4px 14px var(--primary-glow);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.btn-outline:hover {
  background: rgba(99, 102, 241, 0.1);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: #EF4444;
  color: white;
}

/* Content Body */
.content-body {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}

.view-panel {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}

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

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

.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 20px;
}

.view-title {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.6px;
}

.view-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.tagline-badge {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  color: #C7D2FE;
  font-style: italic;
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

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

.kpi-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.kpi-data {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  margin: 2px 0;
}

.kpi-sub {
  font-size: 12px;
}

.kpi-sub.positive {
  color: #34D399;
}

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

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

.card-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Dashboard Split */
.dashboard-split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.fleet-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fleet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: background 0.2s ease;
}

.fleet-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.fleet-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}

.fleet-avatar {
  font-size: 28px;
}

.fleet-name h4 {
  font-size: 14px;
  font-weight: 600;
}

.fleet-name p {
  font-size: 12px;
  color: var(--text-muted);
}

.fleet-badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
}

.badge-locked {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
}

.badge-break {
  background: rgba(245, 158, 11, 0.15);
  color: #FBBF24;
}

.action-buttons-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateX(4px);
}

.action-btn .icon {
  font-size: 24px;
}

.action-btn .text strong {
  display: block;
  font-size: 14px;
}

.action-btn .text p {
  font-size: 12px;
  color: var(--text-muted);
}

.action-btn .arrow {
  margin-left: auto;
  color: var(--text-sub);
}

.kiosk-status-callout {
  margin-top: 10px;
  padding: 16px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px dashed rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
}

.kiosk-badge {
  font-size: 12px;
  font-weight: 700;
  color: #818CF8;
  margin-bottom: 6px;
}

.kiosk-status-callout p {
  font-size: 12px;
  color: var(--text-muted);
}

/* Filters */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.filter-pill {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.filter-pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.form-select {
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  outline: none;
  font-size: 13px;
}

/* Video Grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.video-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.4);
}

.video-thumb-wrap {
  position: relative;
  height: 180px;
  background: #1E293B;
  overflow: hidden;
}

.video-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-duration {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.8);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.video-body {
  padding: 18px;
}

.video-badges {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.v-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.v-badge.age {
  color: #38BDF8;
}

.v-badge.lang {
  color: #F472B6;
}

.video-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.35;
}

.video-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
  margin-top: 12px;
}

.video-views {
  font-size: 12px;
  color: var(--text-muted);
}

/* Custom Table */
.table-responsive {
  overflow-x: auto;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.custom-table th {
  padding: 14px 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border-color);
}

.custom-table td {
  padding: 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-color);
}

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

/* Children Grid */
.children-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.child-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.child-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.child-avatar {
  font-size: 34px;
  background: rgba(255, 255, 255, 0.06);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.child-meta h3 {
  font-size: 17px;
  font-weight: 700;
}

.child-meta p {
  font-size: 12px;
  color: var(--text-muted);
}

.child-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
  border-radius: var(--radius-md);
}

.stat-box {
  display: flex;
  flex-direction: column;
}

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

.stat-box .value {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-main);
}

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

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

.modal-card {
  background: #1E293B;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 540px;
  max-width: 90vw;
  padding: 28px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  animation: modalScale 0.2s ease;
}

@keyframes modalScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
}

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

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group input, .form-group select {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
}

.form-group input:focus, .form-group select:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* API Console */
.api-console-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
}

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

.endpoint-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s ease;
}

.endpoint-item:hover {
  background: rgba(99, 102, 241, 0.15);
}

.endpoint-item .method {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
}

.endpoint-item .method.get {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
}

.endpoint-item .url {
  font-family: monospace;
  font-size: 13px;
}

.json-viewer {
  background: #0B0F19;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: #38BDF8;
  max-height: 480px;
  overflow: auto;
  line-height: 1.6;
}

.status-code {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
}

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

.toast {
  background: #1E293B;
  border-left: 4px solid var(--primary);
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  animation: slideInRight 0.3s ease;
}

.toast.success {
  border-left-color: #10B981;
}

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

/* Charts Bar Mock */
.chart-mock-bar {
  display: flex;
  height: 44px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 16px;
}

.bar-fill {
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 700;
}

.bar-fill.education {
  background: linear-gradient(90deg, #6366F1, #8B5CF6);
  color: white;
}

.bar-fill.entertainment {
  background: linear-gradient(90deg, #F43F5E, #FB7185);
  color: white;
}

.metric-highlight {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
}

.metric-highlight .number {
  font-family: var(--font-heading);
  font-size: 48px;
  font-weight: 800;
  color: #34D399;
}

.metric-highlight .label {
  font-size: 14px;
  color: var(--text-muted);
}

/* SQLite Live Diagnostic Indicator */
.db-live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34D399;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-full);
}

.db-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10B981;
  box-shadow: 0 0 8px #10B981;
}

.metric-skeleton {
  opacity: 0.4;
  animation: pulseOpacity 1.2s infinite ease-in-out;
}

@keyframes pulseOpacity {
  0% { opacity: 0.3; }
  50% { opacity: 0.7; }
  100% { opacity: 0.3; }
}

.loading-state {
  padding: 30px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* Input with inline Action button */
.input-with-action {
  display: flex;
  gap: 10px;
}

.input-with-action input {
  flex: 1;
}

.form-textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  box-sizing: border-box;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Rhymes & Stories Grid */
.rhymes-grid, .stories-grid, .games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 10px;
}

.rhyme-card, .story-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-card);
  transition: all 0.2s ease;
}

.rhyme-card:hover, .story-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
}

.rhyme-card-header, .story-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.rhyme-emoji, .story-emoji {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.rhyme-meta h3, .story-meta h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 2px;
}

.rhyme-meta p, .story-meta p {
  font-size: 13px;
  color: var(--text-muted);
}

.rhyme-lyrics-preview {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
  color: #E2E8F0;
  max-height: 110px;
  overflow-y: auto;
  border-left: 3px solid #6366F1;
}

.story-moral-badge {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #34D399;
}

.story-pages-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.rhyme-card-actions, .story-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

/* Games Store Controller Card */
.game-control-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-card);
}

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

.game-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.game-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: rgba(99, 102, 241, 0.15);
}

.game-info h4 {
  font-size: 16px;
  font-weight: 700;
}

.game-info span {
  font-size: 12px;
  color: var(--text-muted);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

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

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

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

input:checked + .slider-round {
  background-color: #10B981;
}

input:checked + .slider-round:before {
  transform: translateX(22px);
}

.game-limits-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.game-status-label {
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
}

.game-status-label.enabled {
  color: #10B981;
}

.game-status-label.disabled {
  color: #EF4444;
}

/* ========================================================
   PARENT GUIDE BANNER (HOW TO USE)
======================================================== */
.parent-guide-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.12) 100%);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.parent-guide-banner::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
  pointer-events: none;
}

.guide-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: #F8FAFC;
  margin-bottom: 4px;
}

.guide-header p {
  color: #94A3B8;
  font-size: 14px;
  margin-bottom: 18px;
}

.guide-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.guide-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.guide-card:hover {
  transform: translateY(-3px);
  border-color: rgba(129, 140, 248, 0.5);
  background: rgba(30, 41, 59, 0.75);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.guide-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.25);
  color: #A5B4FC;
  margin-bottom: 10px;
}

.guide-icon {
  font-size: 30px;
  margin-bottom: 8px;
}

.guide-card h4 {
  font-size: 15px;
  font-weight: 700;
  color: #F1F5F9;
  margin-bottom: 6px;
}

.guide-card p {
  font-size: 12px;
  color: #94A3B8;
  line-height: 1.5;
}

/* ========================================================
   VOICE & MASCOT STUDIO
======================================================== */
.voice-studio-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .voice-studio-grid {
    grid-template-columns: 1fr;
  }
}

.mascot-selector-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 8px;
}

.mascot-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mascot-choice:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.4);
}

.mascot-choice.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: #6366F1;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.3);
}

.mascot-choice .m-emoji {
  font-size: 28px;
}

.mascot-choice .m-name {
  font-weight: 700;
  font-size: 14px;
  color: #F8FAFC;
}

.slider-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

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

.slider-header label {
  font-weight: 600;
  font-size: 13px;
  color: #CBD5E1;
}

.slider-val-badge {
  font-size: 12px;
  font-weight: 700;
  color: #818CF8;
  background: rgba(99, 102, 241, 0.15);
  padding: 2px 10px;
  border-radius: 12px;
}

.slider-box input[type="range"] {
  width: 100%;
  accent-color: #6366F1;
  cursor: pointer;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #64748B;
  margin-top: 6px;
}

.voice-test-bar {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.voice-test-bar .btn {
  flex: 1;
}

.btn-block {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  justify-content: center;
  margin-top: 16px;
}

.mt-1 {
  margin-top: 8px;
}

/* ==================== LOGIN OVERLAY & AUTH STYLES ==================== */
.btn-logout {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #F87171;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: auto;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.3);
  transform: scale(1.05);
}

.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 25, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: loginFadeIn 0.3s ease;
}

@keyframes loginFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 40px rgba(99, 102, 241, 0.15);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.login-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-badge-mascot {
  font-size: 48px;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, rgba(255, 214, 102, 0.25), rgba(255, 159, 28, 0.1));
  border: 2px solid rgba(255, 209, 102, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 10px 25px rgba(255, 159, 28, 0.2);
  animation: mascotFloat 3s ease-in-out infinite alternate;
}

@keyframes mascotFloat {
  from { transform: translateY(0); }
  to { transform: translateY(-6px); }
}

.login-header h2 {
  font-size: 24px;
  font-weight: 800;
  color: #F8FAFC;
  letter-spacing: -0.5px;
  margin: 0;
}

.login-header h2 span {
  color: #6366F1;
  background: linear-gradient(135deg, #818CF8, #C084FC);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-header p {
  font-size: 13px;
  color: #94A3B8;
  margin-top: 6px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-error-banner {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #FCA5A5;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  color: #64748B;
  pointer-events: none;
}

.input-with-icon input {
  width: 100%;
  padding: 13px 42px 13px 44px;
  background: rgba(15, 23, 42, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  color: #F8FAFC;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.input-with-icon input:focus {
  outline: none;
  border-color: #6366F1;
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.btn-toggle-pwd {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.btn-toggle-pwd:hover {
  opacity: 1;
}

.login-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  margin-top: 2px;
}

.remember-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #94A3B8;
  cursor: pointer;
}

.remember-label input[type="checkbox"] {
  accent-color: #6366F1;
  cursor: pointer;
}

.login-hint {
  color: #64748B;
  font-size: 11px;
}

.btn-login-submit {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 14px;
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
  transition: all 0.2s ease;
  margin-top: 6px;
}

.btn-login-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(99, 102, 241, 0.5);
}

.spinner-small {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.login-footer {
  text-align: center;
  font-size: 11px;
  color: #64748B;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 14px;
}



