/* ═══════════════════════════════════════════════
   SPARKY — Kids English Assistant
   Colegio Educación Alive
   Colors: #fdb731 | #0e808a | #16c3ed | #808080
   Fonts: Mali (titles) | Urbanist (body)
═══════════════════════════════════════════════ */

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

/* ─── TOKENS ─── */
:root {
  --yellow:   #fdb731;
  --teal:     #0e808a;
  --blue:     #16c3ed;
  --gray:     #808080;
  --yellow-light: #fff3cc;
  --teal-light:   #e0f4f5;
  --blue-light:   #d6f4fd;
  --white:    #ffffff;
  --dark:     #0a3d41;
  --text:     #2d2d2d;
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 32px;
  --shadow-sm: 0 4px 16px rgba(14,128,138,.12);
  --shadow-md: 0 8px 32px rgba(14,128,138,.18);
  --shadow-lg: 0 16px 56px rgba(14,128,138,.22);
  --transition: .3s cubic-bezier(.4,0,.2,1);
}

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Urbanist', sans-serif;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ═══ ANIMATED BACKGROUND ═══ */
.bg-animated {
  position: fixed; inset: 0; z-index: 0;
  background: linear-gradient(150deg, #0a3d41 0%, #0e808a 40%, #16c3ed 80%, #fdb731 130%);
  overflow: hidden;
}
.bg-animated::before, .bg-animated::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  animation: float 8s ease-in-out infinite;
}
.bg-animated::before {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(253,183,49,.3), transparent 70%);
  top: -150px; right: -150px;
  animation-delay: 0s;
}
.bg-animated::after {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,.08), transparent 70%);
  bottom: -100px; left: -100px;
  animation-delay: -4s;
}
@keyframes float {
  0%, 100% { transform: translate(0,0) scale(1); }
  33%       { transform: translate(20px,-30px) scale(1.05); }
  66%       { transform: translate(-15px,20px) scale(.95); }
}

/* ─── BUBBLES ─── */
.bubbles { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.bubble {
  position: absolute; bottom: -60px;
  border-radius: 50%; opacity: .18;
  animation: rise linear infinite;
}
@keyframes rise {
  0%   { transform: translateY(0) rotate(0deg); opacity: .18; }
  100% { transform: translateY(-110vh) rotate(720deg); opacity: 0; }
}

/* ─── PAGE WRAPPER ─── */
.page { position: relative; z-index: 1; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }

/* ─── CARD ─── */
.card {
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1.5px solid rgba(255,255,255,.9);
  padding: 40px 36px;
  width: 100%; max-width: 440px;
  animation: slideUp .6s cubic-bezier(.4,0,.2,1) both;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── LOGO / HEADER ─── */
.sparky-logo {
  text-align: center; margin-bottom: 28px;
}
.sparky-avatar {
  width: 90px; height: 90px;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 42px; margin: 0 auto 14px;
  box-shadow: 0 8px 28px rgba(14,128,138,.35);
  animation: sparkPulse 3s ease-in-out infinite;
}
@keyframes sparkPulse {
  0%, 100% { box-shadow: 0 8px 28px rgba(14,128,138,.35); transform: scale(1); }
  50%       { box-shadow: 0 12px 40px rgba(22,195,237,.5); transform: scale(1.05); }
}
.sparky-name {
  font-family: 'Mali', cursive;
  font-size: 2rem; font-weight: 700;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sparky-tagline {
  font-size: .9rem; color: var(--gray);
  margin-top: 4px; font-weight: 500;
}
.school-label {
  display: inline-block; margin-top: 8px;
  background: var(--yellow-light);
  color: #7a5800; border-radius: 20px;
  padding: 3px 14px; font-size: .78rem; font-weight: 600;
}

/* ─── PIN LABEL ─── */
.pin-label {
  font-family: 'Mali', cursive;
  font-size: 1.05rem; font-weight: 600;
  color: var(--teal); text-align: center;
  margin-bottom: 18px;
}

/* ─── PIN DOTS ─── */
.pin-dots {
  display: flex; justify-content: center; gap: 14px;
  margin-bottom: 28px;
}
.pin-dot {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid #ccc;
  background: transparent;
  transition: var(--transition);
}
.pin-dot.filled {
  background: linear-gradient(135deg, var(--teal), var(--blue));
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(14,128,138,.4);
  transform: scale(1.15);
}

/* ─── NUMPAD ─── */
.numpad {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.numpad-btn {
  background: var(--white);
  border: 2px solid rgba(14,128,138,.15);
  border-radius: var(--radius-md);
  padding: 16px 8px;
  font-family: 'Urbanist', sans-serif;
  font-size: 1.35rem; font-weight: 700;
  color: var(--dark);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.numpad-btn:hover { background: var(--teal-light); border-color: var(--teal); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(14,128,138,.2); }
.numpad-btn:active { transform: scale(.93); }
.numpad-btn.zero { grid-column: 2; }
.numpad-btn.del {
  background: #fff0f0;
  border-color: rgba(220,53,69,.2);
  color: #dc3545; font-size: 1.2rem;
}
.numpad-btn.del:hover { background: #ffe0e0; border-color: #dc3545; }

/* ─── ERROR SHAKE ─── */
.shake { animation: shake .5s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shake {
  10%, 90% { transform: translateX(-4px); }
  20%, 80% { transform: translateX(6px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
}
.error-msg {
  text-align: center; color: #dc3545;
  font-size: .85rem; font-weight: 600;
  margin-top: 14px; min-height: 20px;
  animation: fadeIn .3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* ─── LOADING SPINNER ─── */
.spinner-wrap { display: none; text-align: center; margin-top: 20px; }
.spinner-wrap.active { display: block; }
.spinner {
  width: 36px; height: 36px; margin: 0 auto 8px;
  border: 3px solid var(--teal-light);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ CHAT PAGE ═══ */
.chat-page {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  height: 100dvh; max-width: 700px;
  margin: 0 auto; padding: 0;
}

/* ═══ CHAT HEADER ═══ */
.chat-header {
  background: linear-gradient(135deg, #0a3d41 0%, var(--teal) 60%, #16a3b8 100%);
  padding: 14px 20px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 4px 24px rgba(10,61,65,.5);
  flex-shrink: 0;
  position: relative; overflow: hidden;
}
.chat-header::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.04) 50%, transparent 100%);
  animation: shimmer 3s ease-in-out infinite;
}
@keyframes shimmer {
  0%, 100% { opacity: 0; transform: translateX(-100%); }
  50% { opacity: 1; transform: translateX(100%); }
}
.chat-header-avatar {
  width: 54px; height: 54px;
  background: linear-gradient(135deg, var(--yellow), #f5a800);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; flex-shrink: 0;
  border: 2.5px solid rgba(255,255,255,.5);
  box-shadow: 0 4px 16px rgba(253,183,49,.5);
  animation: sparkPulse 3s ease-in-out infinite;
  position: relative; z-index: 1;
}
.chat-header-info { flex: 1; position: relative; z-index: 1; }
.chat-header-title {
  font-family: 'Mali', cursive;
  font-size: 1.15rem; font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.chat-header-sub {
  font-size: .75rem; color: rgba(255,255,255,.8);
  font-weight: 600; margin-top: 2px;
  background: rgba(255,255,255,.1);
  border-radius: 10px; padding: 2px 8px;
  display: inline-block;
}
.chat-header-actions { display: flex; gap: 8px; position: relative; z-index: 1; }
.header-btn {
  width: 40px; height: 40px;
  background: rgba(255,255,255,.15);
  border: 1.5px solid rgba(255,255,255,.3);
  border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: #fff;
  transition: var(--transition);
  backdrop-filter: blur(4px);
}
.header-btn:hover { background: rgba(255,255,255,.3); transform: scale(1.12); }

/* ═══ STARS BAR ═══ */
.stars-bar {
  background: linear-gradient(90deg, var(--yellow) 0%, #f5c842 100%);
  padding: 8px 20px;
  display: flex; align-items: center; gap: 10px;
  font-size: .82rem; font-weight: 700;
  color: #5c3d00; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(253,183,49,.4);
  position: relative;
}
.stars-visual { display: flex; gap: 4px; margin-left: auto; }
.stars-visual span { font-size: 1rem; opacity: .3; transition: opacity .3s, transform .3s; }
.stars-visual span.lit { opacity: 1; transform: scale(1.2); }
.star-icon { font-size: 1rem; }
.stars-count { font-size: 1rem; font-family: 'Mali', cursive; }

/* ═══ MESSAGES AREA ═══ */
.chat-messages {
  flex: 1; overflow-y: auto;
  padding: 20px 16px;
  display: flex; flex-direction: column; gap: 12px;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); border-radius: 4px; }

/* ═══ MESSAGE BUBBLES ═══ */
.message { display: flex; gap: 10px; align-items: flex-end; animation: msgIn .35s cubic-bezier(.4,0,.2,1) both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.message.user { flex-direction: row-reverse; }
.msg-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
.message.bot .msg-avatar  { background: linear-gradient(135deg, #fff3cc, var(--yellow)); }
.message.user .msg-avatar { background: linear-gradient(135deg, rgba(255,255,255,.25), rgba(255,255,255,.1)); border: 1.5px solid rgba(255,255,255,.3); }
.msg-bubble {
  max-width: 78%;
  padding: 12px 18px;
  border-radius: 22px;
  font-size: .95rem; line-height: 1.6;
  font-weight: 500;
}
.message.bot .msg-bubble {
  background: rgba(255,255,255,.95);
  color: var(--text);
  border-bottom-left-radius: 6px;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
  border: 1px solid rgba(255,255,255,.8);
}
.message.user .msg-bubble {
  background: linear-gradient(135deg, var(--yellow), #f5a800);
  color: #3d2000;
  border-bottom-right-radius: 6px;
  box-shadow: 0 4px 16px rgba(253,183,49,.5);
  font-weight: 600;
}

/* ─── TYPING INDICATOR ─── */
.typing { display: flex; gap: 10px; align-items: flex-end; }
.typing-dots {
  background: var(--white);
  border-radius: 20px; border-bottom-left-radius: 6px;
  padding: 14px 18px;
  display: flex; gap: 5px; align-items: center;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.typing-dots span {
  width: 7px; height: 7px; background: var(--teal);
  border-radius: 50%;
  animation: bounce .9s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-8px); } }

/* ═══ QUICK REPLIES ═══ */
.quick-replies-wrap { padding: 0 16px 8px; flex-shrink: 0; }
.quick-replies { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.quick-replies::-webkit-scrollbar { display: none; }
.qr-btn {
  flex-shrink: 0;
  background: rgba(255,255,255,.18);
  border: 1.5px solid rgba(255,255,255,.4);
  border-radius: 20px;
  padding: 8px 16px;
  font-family: 'Urbanist', sans-serif;
  font-size: .82rem; font-weight: 700;
  color: #fff; cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  backdrop-filter: blur(4px);
}
.qr-btn:hover {
  background: rgba(255,255,255,.3);
  border-color: var(--yellow);
  color: var(--yellow);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}

/* ═══ INPUT BAR ═══ */
.input-bar {
  padding: 12px 16px 16px;
  background: rgba(10,61,65,.7);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex; gap: 10px; align-items: flex-end;
  flex-shrink: 0;
}
.input-bar textarea {
  flex: 1;
  background: rgba(255,255,255,.15);
  border: 1.5px solid rgba(255,255,255,.25);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-family: 'Urbanist', sans-serif;
  font-size: .95rem; font-weight: 500;
  color: #fff; resize: none;
  max-height: 120px; min-height: 46px;
  outline: none; transition: var(--transition);
}
.input-bar textarea:focus { border-color: var(--yellow); background: rgba(255,255,255,.2); box-shadow: 0 0 0 3px rgba(253,183,49,.2); }
.input-bar textarea::placeholder { color: rgba(255,255,255,.5); }
.send-btn {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--yellow), #f5a800);
  border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.send-btn:hover { transform: scale(1.12); box-shadow: 0 6px 22px rgba(14,128,138,.5); }
.send-btn:active { transform: scale(.95); }

/* ─── STAR CELEBRATION ─── */
.star-pop {
  position: fixed; inset: 0; z-index: 999;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.star-pop-inner {
  background: var(--yellow);
  border-radius: var(--radius-lg);
  padding: 28px 40px;
  text-align: center;
  animation: starPop .6s cubic-bezier(.4,0,.2,1) both;
  box-shadow: var(--shadow-lg);
}
@keyframes starPop {
  0%   { opacity: 0; transform: scale(.6) rotate(-5deg); }
  60%  { transform: scale(1.1) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
.star-pop-emoji { font-size: 3.5rem; display: block; margin-bottom: 8px; }
.star-pop-text { font-family: 'Mali', cursive; font-size: 1.4rem; font-weight: 700; color: #7a5800; }

/* ─── ADMIN PAGE ─── */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100dvh;
}
.admin-sidebar {
  background: linear-gradient(180deg, var(--teal) 0%, var(--dark) 100%);
  padding: 28px 0;
  display: flex; flex-direction: column;
}
.admin-logo-wrap { padding: 0 24px 28px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 20px; }
.admin-logo-name { font-family: 'Mali', cursive; font-size: 1.3rem; color: #fff; font-weight: 700; }
.admin-logo-sub { font-size: .75rem; color: rgba(255,255,255,.6); margin-top: 2px; }
.admin-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 24px; cursor: pointer;
  font-size: .9rem; font-weight: 600;
  color: rgba(255,255,255,.7);
  transition: var(--transition);
  border-left: 3px solid transparent;
}
.admin-nav-item:hover, .admin-nav-item.active {
  background: rgba(255,255,255,.1);
  color: #fff;
  border-left-color: var(--yellow);
}
.admin-main { background: #f4f9fa; padding: 32px; overflow-y: auto; }
.admin-header { margin-bottom: 28px; }
.admin-title { font-family: 'Mali', cursive; font-size: 1.6rem; color: var(--dark); font-weight: 700; }
.admin-sub { color: var(--gray); font-size: .9rem; margin-top: 4px; }

/* ─── STATS GRID ─── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--white); border-radius: var(--radius-md);
  padding: 20px; box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--teal);
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--teal); font-family: 'Mali', cursive; }
.stat-label { font-size: .82rem; color: var(--gray); font-weight: 600; margin-top: 4px; }

/* ─── DATA TABLE ─── */
.data-card { background: var(--white); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); overflow: hidden; }
.data-card-header { padding: 18px 24px; border-bottom: 1px solid rgba(14,128,138,.1); display: flex; align-items: center; justify-content: space-between; }
.data-card-title { font-family: 'Mali', cursive; font-size: 1.05rem; color: var(--dark); font-weight: 700; }
.btn-primary {
  background: linear-gradient(135deg, var(--teal), var(--blue));
  color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 9px 18px; font-family: 'Urbanist', sans-serif;
  font-size: .85rem; font-weight: 700; cursor: pointer;
  transition: var(--transition); box-shadow: 0 3px 12px rgba(14,128,138,.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(14,128,138,.4); }
.btn-danger { background: linear-gradient(135deg, #e74c3c, #c0392b); box-shadow: 0 3px 12px rgba(231,76,60,.3); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { background: var(--teal-light); padding: 12px 16px; text-align: left; font-size: .8rem; font-weight: 700; color: var(--teal); text-transform: uppercase; letter-spacing: .5px; }
.data-table td { padding: 14px 16px; border-bottom: 1px solid rgba(14,128,138,.07); font-size: .88rem; color: var(--text); font-weight: 500; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(14,128,138,.03); }

/* ─── BADGES ─── */
.badge {
  display: inline-block; padding: 3px 10px;
  border-radius: 20px; font-size: .72rem; font-weight: 700;
}
.badge-kinder  { background: #e8f5e9; color: #2e7d32; }
.badge-1       { background: #e3f2fd; color: #1565c0; }
.badge-2       { background: #fce4ec; color: #b71c1c; }
.badge-3       { background: #fff3e0; color: #e65100; }
.badge-4       { background: #f3e5f5; color: #6a1b9a; }
.badge-5       { background: #e0f2f1; color: #004d40; }
.badge-6       { background: #fbe9e7; color: #bf360c; }

/* ─── MODAL ─── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(10,61,65,.5);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 36px; width: 100%; max-width: 480px;
  box-shadow: var(--shadow-lg);
  transform: scale(.9);
  transition: var(--transition);
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-title { font-family: 'Mali', cursive; font-size: 1.3rem; color: var(--dark); margin-bottom: 22px; font-weight: 700; }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: .85rem; font-weight: 700; color: var(--teal); margin-bottom: 6px; }
.form-input, .form-select {
  width: 100%; padding: 12px 14px;
  border: 2px solid rgba(14,128,138,.2);
  border-radius: var(--radius-sm);
  font-family: 'Urbanist', sans-serif;
  font-size: .92rem; color: var(--dark);
  outline: none; transition: var(--transition);
  background: var(--white);
}
.form-input:focus, .form-select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14,128,138,.1); }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }
.btn-cancel { background: #f4f4f4; color: var(--gray); border: none; border-radius: var(--radius-sm); padding: 9px 18px; font-family: 'Urbanist', sans-serif; font-size: .85rem; font-weight: 600; cursor: pointer; transition: var(--transition); }
.btn-cancel:hover { background: #e0e0e0; }

/* ─── ADMIN LOGIN SCREEN ─── */
.admin-login { min-height: 100dvh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--teal), var(--dark)); padding: 24px; }
.admin-login .card { max-width: 380px; }

/* ═══ CHAT DESKTOP 2-COLUMN LAYOUT ═══ */
.chat-app-wrapper {
  position: relative; z-index: 1;
  display: flex;
  height: 100dvh;
  max-width: 1180px;
  margin: 0 auto;
}

/* ─── Desktop Sidebar ─── */
.chat-sidebar {
  display: none; /* hidden on mobile */
}

@media (min-width: 900px) {
  .chat-app-wrapper {
    gap: 0;
    align-items: stretch;
    padding: 24px 24px 24px 24px;
  }

  .chat-sidebar {
    display: flex;
    flex-direction: column;
    width: 260px;
    flex-shrink: 0;
    background: rgba(255,255,255,.1);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    border: 1px solid rgba(255,255,255,.2);
    border-right: none;
    padding: 32px 24px;
    gap: 20px;
    overflow-y: auto;
  }

  .chat-page {
    flex: 1;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,.35);
    height: 100%;
    max-width: none;
    margin: 0;
  }

  /* Hide stars bar on desktop (sidebar shows stars instead) */
  .stars-bar { display: none; }
}

/* ─── Sidebar Components ─── */
.sidebar-brand { text-align: center; }
.sidebar-avatar {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--yellow), #f5a800);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; margin: 0 auto 12px;
  box-shadow: 0 8px 28px rgba(253,183,49,.45);
  animation: sparkPulse 3s ease-in-out infinite;
}
.sidebar-name {
  font-family: 'Mali', cursive;
  font-size: 1.8rem; font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.sidebar-tagline {
  font-size: .82rem; color: rgba(255,255,255,.75);
  font-weight: 600; margin-top: 4px;
}
.sidebar-school {
  display: inline-block; margin-top: 10px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  color: rgba(255,255,255,.9);
  border-radius: 20px; padding: 4px 12px;
  font-size: .75rem; font-weight: 600;
}

.sidebar-student-card, .sidebar-stars-card, .sidebar-tips {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.ssc-label {
  font-size: .7rem; font-weight: 700;
  color: rgba(255,255,255,.6);
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 6px;
}
.ssc-name {
  font-family: 'Mali', cursive;
  font-size: 1.1rem; font-weight: 700; color: #fff;
}
.ssc-grade {
  font-size: .8rem; color: rgba(255,255,255,.7);
  font-weight: 600; margin-top: 2px;
}

.sidebar-stars-row { display: flex; gap: 6px; margin-top: 4px; }
.sidebar-stars-row span { font-size: 1.3rem; opacity: .25; transition: opacity .3s, transform .3s; }
.sidebar-stars-row span.lit { opacity: 1; transform: scale(1.25); }

.tips-list {
  list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 4px;
}
.tips-list li { font-size: .78rem; color: rgba(255,255,255,.8); font-weight: 500; }

.sidebar-logout {
  margin-top: auto;
  background: rgba(255,255,255,.1);
  border: 1.5px solid rgba(255,255,255,.25);
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.8);
  font-family: 'Urbanist', sans-serif;
  font-size: .85rem; font-weight: 700;
  padding: 10px 16px; cursor: pointer;
  transition: var(--transition);
  width: 100%;
}
.sidebar-logout:hover {
  background: rgba(220,53,69,.3);
  border-color: rgba(220,53,69,.5);
  color: #fff;
}

/* ═══ ADMIN MOBILE BAR ═══ */
.admin-mobile-bar {
  display: none; /* shown only on mobile via media query */
  position: sticky; top: 0; z-index: 100;
  background: linear-gradient(135deg, #0a3d41, var(--teal));
  padding: 12px 16px;
  align-items: center; justify-content: space-between;
  gap: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.admin-mobile-logo {
  font-family: 'Mali', cursive;
  font-size: 1.05rem; font-weight: 700; color: #fff;
  white-space: nowrap;
}
.admin-mobile-actions { display: flex; gap: 8px; }
.admin-mobile-btn {
  background: rgba(255,255,255,.15);
  border: 1.5px solid rgba(255,255,255,.3);
  border-radius: 20px;
  color: #fff; font-family: 'Urbanist', sans-serif;
  font-size: .78rem; font-weight: 700;
  padding: 6px 12px; cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.admin-mobile-btn:hover, .admin-mobile-btn.active {
  background: rgba(255,255,255,.3);
  border-color: var(--yellow);
  color: var(--yellow);
}
.admin-mobile-btn.danger { border-color: rgba(220,53,69,.5); }
.admin-mobile-btn.danger:hover { background: rgba(220,53,69,.35); border-color: #dc3545; color: #ff8888; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 899px) {
  .chat-page { border-radius: 0; height: 100dvh; }
  .chat-app-wrapper { padding: 0; }
  .admin-mobile-bar { display: flex; }
  .admin-main { padding-top: 16px; }
}

@media (max-width: 640px) {
  .card { padding: 28px 20px; }
  .numpad-btn { padding: 14px 6px; font-size: 1.2rem; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .admin-main { padding: 16px; }
  .msg-bubble { max-width: 85%; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── UTILITIES ─── */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.gap-8 { gap: 8px; }

