/* ═══════════════════════════════════════════════════
   PlanTrack System — styles.css  (Complete Fixed)
═══════════════════════════════════════════════════ */

:root {
  --bg: #0c0e14;
  --surface: #13161f;
  --surface2: #1a1e2b;
  --surface3: #21273a;
  --border: #252b3d;
  --border2: #2f3650;
  --accent: #f0c040;
  --accent-dark: #c9a030;
  --accent2: #e07b3a;
  --blue: #4a90e2;
  --green: #27ae60;
  --red: #e74c3c;
  --purple: #9b59b6;
  --text: #e2e6f0;
  --text2: #8892aa;
  --text3: #555e78;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 8px 40px rgba(0,0,0,0.5);
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.3);
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; -webkit-text-size-adjust:100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width:6px; height:6px; }
::-webkit-scrollbar-track { background:var(--surface); }
::-webkit-scrollbar-thumb { background:var(--border2); border-radius:99px; }
::-webkit-scrollbar-thumb:hover { background:var(--text3); }

/* ════════════ AUTH ════════════ */
#auth-screen {
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
  overflow:hidden;
  padding:20px;
}

.auth-bg { position:fixed; inset:0; pointer-events:none; z-index:0; }

.blob {
  position:absolute; border-radius:50%;
  filter:blur(80px); opacity:0.12;
  animation:blobMove 8s ease-in-out infinite alternate;
}
.b1 { width:500px; height:500px; background:var(--accent); top:-100px; left:-100px; }
.b2 { width:400px; height:400px; background:var(--accent2); bottom:-100px; right:-80px; animation-delay:-3s; }
.b3 { width:300px; height:300px; background:var(--blue); top:50%; left:50%; transform:translate(-50%,-50%); animation-delay:-6s; }
@keyframes blobMove { from{transform:scale(1) rotate(0)} to{transform:scale(1.15) rotate(20deg)} }

.auth-box {
  position:relative; z-index:1;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:44px 40px;
  width:100%; max-width:430px;
  box-shadow:var(--shadow);
  animation:fadeUp 0.5s ease;
}
@keyframes fadeUp { from{opacity:0;transform:translateY(30px)} to{opacity:1;transform:translateY(0)} }

.auth-logo {
  font-family:'Playfair Display',serif;
  font-size:2.2rem; font-weight:900;
  color:var(--accent); text-align:center; letter-spacing:3px;
  display:flex; align-items:center; justify-content:center; gap:12px;
}
.logo-img {
  width:44px; height:44px; border-radius:10px;
  box-shadow:0 0 15px rgba(240,192,64,0.3);
  object-fit:cover;
}
.auth-brand-line {
  text-align:center; font-size:.7rem; font-weight:600;
  letter-spacing:5px; color:var(--text3);
  margin-top:4px; margin-bottom:28px;
}
.auth-welcome { text-align:center; color:var(--text2); font-size:.88rem; margin-bottom:22px; }

.auth-tabs {
  display:flex; gap:6px;
  background:var(--surface2); border-radius:10px;
  padding:4px; margin-bottom:24px;
}
.auth-tab {
  flex:1; padding:9px; border:none; border-radius:7px;
  background:transparent; color:var(--text2);
  font-family:'DM Sans',sans-serif; font-weight:600;
  font-size:.85rem; cursor:pointer; transition:all .2s;
}
.auth-tab.active { background:var(--accent); color:#000; }

.fg { margin-bottom:16px; }
.fg label {
  display:block; font-size:.78rem; font-weight:600;
  color:var(--text2); text-transform:uppercase;
  letter-spacing:.6px; margin-bottom:7px;
}
.fg input, .fg select, .fg textarea {
  width:100%; background:var(--surface2);
  border:1px solid var(--border); border-radius:var(--radius);
  padding:11px 14px; color:var(--text);
  font-family:'DM Sans',sans-serif; font-size:.93rem;
  outline:none; transition:border-color .2s, box-shadow .2s;
  -webkit-appearance:none; appearance:none;
}
.fg input:focus, .fg select:focus, .fg textarea:focus {
  border-color:var(--accent); box-shadow:0 0 0 3px rgba(240,192,64,0.12);
}
.fg select option { background:var(--surface2); }
.fg textarea { resize:vertical; min-height:80px; }

.pw-wrap { position:relative; }
.pw-wrap input { padding-right:44px; }
.eye-btn {
  position:absolute; right:12px; top:50%;
  transform:translateY(-50%);
  background:none; border:none; color:var(--text3);
  cursor:pointer; font-size:.9rem; transition:color .2s;
  padding:4px;
}
.eye-btn:hover { color:var(--accent); }

.auth-btn {
  width:100%; padding:13px;
  background:var(--accent); color:#000; border:none;
  border-radius:var(--radius); font-family:'DM Sans',sans-serif;
  font-size:.95rem; font-weight:700; cursor:pointer;
  transition:all .2s; letter-spacing:.3px;
}
.auth-btn:hover { background:var(--accent-dark); transform:translateY(-1px); box-shadow:0 4px 16px rgba(240,192,64,0.3); }
.auth-btn:active { transform:translateY(0); }

/* ── Auth Divider ── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}
.auth-divider span {
  font-size: 0.78rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
}

/* ── Google Sign-In Button ── */
.google-sign-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.2px;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.google-sign-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  transition: left 0.5s;
}
.google-sign-btn:hover::before { left: 100%; }
.google-sign-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(66,133,244,0.15), 0 0 0 1px rgba(66,133,244,0.1);
}
.google-sign-btn:active { transform: translateY(0); }
.google-icon-wrapper {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.google-icon { width: 22px; height: 22px; }

.auth-link-row { text-align:center; margin-top:14px; }
.txt-btn {
  background:none; border:none; color:var(--text2);
  font-family:'DM Sans',sans-serif; font-size:.83rem;
  cursor:pointer; text-decoration:underline; transition:color .2s;
  padding:4px;
}
.txt-btn:hover { color:var(--accent); }
.forgot-hint { color:var(--text2); font-size:.86rem; margin-bottom:18px; line-height:1.6; }

#auth-msg {
  margin-top:14px; font-size:.83rem; padding:10px 14px;
  border-radius:8px; text-align:center; display:none;
}
#auth-msg.error   { background:rgba(231,76,60,.15); color:var(--red); border:1px solid rgba(231,76,60,.3); }
#auth-msg.success { background:rgba(39,174,96,.15); color:var(--green); border:1px solid rgba(39,174,96,.3); }
#auth-msg.info    { background:rgba(74,144,226,.15); color:var(--blue); border:1px solid rgba(74,144,226,.3); }

/* ════════════ APP SHELL ════════════ */
.topbar {
  height:60px; background:var(--surface);
  border-bottom:1px solid var(--border);
  display:flex; align-items:center;
  justify-content:space-between;
  padding:0 16px; position:sticky; top:0; z-index:200;
}
.tb-left  { display:flex; align-items:center; gap:12px; }
.tb-right { display:flex; align-items:center; gap:8px; }

.hamburger {
  background:none; border:none; color:var(--text2);
  font-size:1.1rem; cursor:pointer; padding:8px;
  border-radius:8px; transition:all .2s; flex-shrink:0;
}
.hamburger:hover { background:var(--surface2); color:var(--accent); }

.tb-logo {
  font-family:'Playfair Display',serif; font-size:1.2rem;
  font-weight:900; color:var(--accent); letter-spacing:2px;
  white-space:nowrap; display:flex; align-items:center; gap:8px;
}
.tb-logo-img {
  width:28px; height:28px; border-radius:6px;
  object-fit:cover;
}

.profile-btn {
  display:flex; align-items:center; gap:7px;
  background:var(--surface2); border:1px solid var(--border);
  border-radius:99px; padding:6px 14px;
  color:var(--text2); cursor:pointer;
  font-family:'DM Sans',sans-serif; font-size:.83rem;
  font-weight:600; transition:all .2s;
  max-width:160px; overflow:hidden;
}
.profile-btn:hover { border-color:var(--accent); color:var(--accent); }
.profile-btn:hover .tb-avatar { border-color:var(--accent); box-shadow:0 0 8px rgba(240,192,64,0.4); }
.profile-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* Topbar avatar mini-circle */
.tb-avatar {
  width:30px; height:30px; border-radius:50%; flex-shrink:0;
  background:linear-gradient(135deg,var(--accent),var(--accent2));
  border:2px solid var(--border2);
  display:flex; align-items:center; justify-content:center;
  font-family:'Playfair Display',serif;
  font-size:.95rem; font-weight:900; color:#000;
  overflow:hidden; transition:border-color .2s, box-shadow .2s;
}

.logout-btn {
  display:flex; align-items:center; gap:6px;
  background:var(--surface2); border:1px solid var(--border);
  border-radius:var(--radius); color:var(--text2);
  font-family:'DM Sans',sans-serif; font-size:.83rem;
  font-weight:600; padding:7px 14px; cursor:pointer; transition:all .2s;
}
.logout-btn:hover { border-color:var(--red); color:var(--red); }

/* ─── SIDEBAR OVERLAY (mobile) ─── */
.sidebar-overlay {
  display:none; position:fixed; inset:0;
  background:rgba(0,0,0,0.5); z-index:99;
}
.sidebar-overlay.show { display:block; }

/* ─── SIDEBAR ─── */
.app-layout { display:flex; height:calc(100vh - 60px); overflow:hidden; }

.sidebar {
  width:220px; min-width:220px;
  background:var(--surface); border-right:1px solid var(--border);
  display:flex; flex-direction:column;
  padding:20px 12px; gap:4px;
  overflow-y:auto; transition:transform .3s ease, width .3s ease;
  position:relative; z-index:100;
}
.sidebar.collapsed { transform:translateX(-100%); width:0; min-width:0; padding:0; overflow:hidden; }

.nav-label {
  font-size:.65rem; font-weight:700; color:var(--text3);
  letter-spacing:1.5px; text-transform:uppercase;
  padding:0 8px; margin-bottom:6px;
}
.nav-btn {
  display:flex; align-items:center; gap:12px;
  width:100%; padding:11px 14px;
  border:none; border-radius:10px;
  background:transparent; color:var(--text2);
  font-family:'DM Sans',sans-serif; font-size:.88rem;
  font-weight:500; cursor:pointer; transition:all .2s; text-align:left;
}
.nav-btn i { width:18px; text-align:center; font-size:.9rem; flex-shrink:0; }
.nav-btn:hover { background:var(--surface2); color:var(--text); }
.nav-btn.active { background:rgba(240,192,64,0.12); color:var(--accent); border-left:3px solid var(--accent); }
.sidebar-footer { margin-top:auto; padding:12px 8px 0; font-size:.7rem; color:var(--text3); letter-spacing:1px; }

/* ─── CONTENT ─── */
.content-area { flex:1; overflow-y:auto; padding:24px; background:var(--bg); }

.sec { display:none; animation:fadeIn .3s ease; }
.sec.active { display:block; }
@keyframes fadeIn { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:translateY(0)} }

.sec-header {
  display:flex; align-items:flex-start;
  justify-content:space-between; margin-bottom:24px;
  gap:12px; flex-wrap:wrap;
}
.sec-header-btns { display:flex; gap:8px; flex-wrap:wrap; }
.sec-title-block h1 {
  font-family:'Playfair Display',serif; font-size:1.6rem;
  font-weight:700; color:var(--text);
  display:flex; align-items:center; gap:10px;
}
.sec-title-block h1 i { color:var(--accent); font-size:1.2rem; }
.sec-title-block p { color:var(--text2); font-size:.85rem; margin-top:4px; }

.fab-btn {
  display:flex; align-items:center; gap:8px;
  padding:10px 18px; background:var(--accent); color:#000;
  border:none; border-radius:var(--radius);
  font-family:'DM Sans',sans-serif; font-size:.88rem;
  font-weight:700; cursor:pointer; transition:all .2s; white-space:nowrap;
}
.fab-btn:hover { background:var(--accent-dark); transform:translateY(-2px); box-shadow:0 6px 20px rgba(240,192,64,0.3); }
.upload-label { cursor:pointer; }

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

.empty-state { text-align:center; padding:60px 20px; color:var(--text3); }
.empty-state i { font-size:3rem; margin-bottom:16px; display:block; opacity:.5; }
.empty-state p { font-size:.9rem; }
.empty-state strong { color:var(--text2); }

/* ════════════ ALARM CARDS ════════════ */
.alarm-card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); padding:18px;
  position:relative; transition:all .2s; overflow:hidden;
}
.alarm-card:hover { border-color:var(--border2); transform:translateY(-2px); box-shadow:var(--shadow-sm); }

/* ── Alarm Status Bar (ON/OFF indicator) ── */
.alarm-status-bar {
  display:flex; align-items:center; gap:6px;
  font-size:.72rem; font-weight:700;
  padding:4px 10px; border-radius:99px;
  margin-bottom:12px; width:fit-content;
}
.alarm-status-bar.status-on {
  background:rgba(39,174,96,.15); color:var(--green); border:1px solid rgba(39,174,96,.3);
}
.alarm-status-bar.status-off {
  background:rgba(85,94,120,.15); color:var(--text3); border:1px solid rgba(85,94,120,.2);
}
.status-dot {
  width:7px; height:7px; border-radius:50%; flex-shrink:0;
}
.status-on .status-dot  { background:var(--green); box-shadow:0 0 6px var(--green); animation:pulse-dot 2s infinite; }
.status-off .status-dot { background:var(--text3); }
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:.4} }

.alarm-card.off { opacity:.75; }
.alarm-card.off .alarm-time { color:var(--text3); }

.alarm-time {
  font-family:'Playfair Display',serif; font-size:1.9rem;
  font-weight:700; color:var(--accent); line-height:1;
}
.alarm-label { font-weight:600; color:var(--text); margin:6px 0 2px; font-size:.92rem; }
/* ── Live Countdown Bar ── */
.alarm-countdown-bar {
  display:none; /* shown by JS */
  align-items:center; gap:7px;
  margin:6px 0 2px;
  padding:6px 12px;
  border-radius:10px;
  font-size:.82rem; font-weight:700; font-family:'DM Sans',sans-serif;
  background:rgba(74,144,226,.1); border:1px solid rgba(74,144,226,.2);
  color:var(--blue);
  transition:background .4s, border-color .4s, color .4s;
  animation:fadeUp .3s ease;
}
/* < 30 min — amber */
.alarm-countdown-bar.countdown-soon {
  background:rgba(240,192,64,.1); border-color:rgba(240,192,64,.3);
  color:var(--accent);
}
/* < 5 min — red pulsing */
.alarm-countdown-bar.countdown-urgent {
  background:rgba(231,76,60,.12); border-color:rgba(231,76,60,.4);
  color:var(--red);
  animation:countdownPulse 1s ease-in-out infinite;
}
/* Ringing now */
.alarm-countdown-bar.countdown-due {
  background:rgba(231,76,60,.2); border-color:var(--red);
  color:var(--red); font-size:.88rem;
}
@keyframes countdownPulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:.75; transform:scale(1.01); }
}
.countdown-icon {
  font-size:.8rem; flex-shrink:0;
  animation:hourglassTilt 2s ease-in-out infinite;
}
@keyframes hourglassTilt {
  0%,100% { transform:rotate(0deg); }
  50%      { transform:rotate(180deg); }
}
.countdown-icon-ring {
  animation:bellRing .4s ease-in-out infinite alternate !important;
}
@keyframes bellRing {
  from { transform:rotate(-15deg); }
  to   { transform:rotate(15deg); }
}
.countdown-text { letter-spacing:.3px; }
.alarm-meta  { font-size:.78rem; color:var(--text2); display:flex; gap:10px; flex-wrap:wrap; margin-top:4px; }
.alarm-meta span { display:flex; align-items:center; gap:4px; }
.alarm-sound-tag {
  display:inline-flex; align-items:center; gap:5px;
  background:var(--surface2); border:1px solid var(--border);
  border-radius:99px; padding:3px 10px;
  font-size:.73rem; color:var(--text2); margin-top:8px;
}
.alarm-actions { display:flex; gap:8px; margin-top:14px; align-items:center; flex-wrap:wrap; }

/* Toggle with ON/OFF label */
.toggle-wrap {
  display:flex; align-items:center; gap:6px;
  cursor:pointer; user-select:none;
}
.toggle-switch {
  position:relative; width:44px; height:24px;
  background:var(--surface3); border:1px solid var(--border2);
  border-radius:99px; cursor:pointer; transition:background .2s; flex-shrink:0;
}
.toggle-switch.on { background:var(--accent); border-color:var(--accent); }
.toggle-switch::after {
  content:''; position:absolute;
  width:18px; height:18px; background:#fff;
  border-radius:50%; top:2px; left:2px;
  transition:left .2s; box-shadow:0 1px 4px rgba(0,0,0,0.3);
}
.toggle-switch.on::after { left:22px; }
.toggle-label { font-size:.75rem; font-weight:700; color:var(--text3); }
.toggle-switch.on + .toggle-label { color:var(--accent); }

.icon-btn {
  background:var(--surface2); border:1px solid var(--border);
  border-radius:8px; padding:7px 10px;
  color:var(--text2); cursor:pointer; font-size:.85rem; transition:all .2s;
}
.icon-btn:hover { border-color:var(--accent); color:var(--accent); }
.icon-btn.del:hover { border-color:var(--red); color:var(--red); }

/* ════════════ SOUND GRID ════════════ */
.sound-grid {
  display:flex; flex-direction:column; gap:6px;
  max-height:300px; overflow-y:auto; padding:4px 2px;
}
.sound-section-label {
  font-size:.7rem; font-weight:700; color:var(--text3);
  text-transform:uppercase; letter-spacing:1px; padding:4px 2px; margin-top:4px;
}
.sound-item {
  background:var(--surface2); border:1.5px solid var(--border);
  border-radius:10px; padding:9px 12px; cursor:pointer;
  transition:all .2s; display:flex; align-items:center;
  gap:10px; font-size:.85rem; color:var(--text2); width:100%;
}
.sound-item:hover  { border-color:var(--accent); color:var(--text); }
.sound-item.selected { border-color:var(--accent); background:rgba(240,192,64,0.08); color:var(--accent); font-weight:600; }
.sound-emoji { font-size:1rem; flex-shrink:0; }
.sound-name  { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sound-preview-btn {
  background:var(--surface3); border:1px solid var(--border2);
  border-radius:6px; color:var(--text2); cursor:pointer;
  padding:4px 8px; font-size:.75rem; transition:all .2s; flex-shrink:0;
}
.sound-preview-btn:hover { border-color:var(--accent); color:var(--accent); }
.sound-del-btn {
  background:none; border:1px solid var(--border);
  border-radius:6px; color:var(--text3); cursor:pointer;
  padding:4px 8px; font-size:.75rem; transition:all .2s; flex-shrink:0;
}
.sound-del-btn:hover { border-color:var(--red); color:var(--red); }
.sound-empty-msg { font-size:.8rem; color:var(--text3); padding:10px 12px; text-align:center; font-style:italic; }
.sound-upload-btn {
  display:flex; align-items:center; justify-content:center; gap:8px;
  margin-top:8px; padding:11px 16px;
  background:var(--surface2); border:1.5px dashed var(--border2);
  border-radius:10px; color:var(--text2);
  font-family:'DM Sans',sans-serif; font-size:.85rem;
  font-weight:600; cursor:pointer; transition:all .2s; width:100%;
}
.sound-upload-btn:hover { border-color:var(--accent); color:var(--accent); background:rgba(240,192,64,0.05); }
.sound-upload-btn i { color:var(--accent); }

/* ════════════ TIMETABLE ════════════ */
.tt-card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); padding:20px;
  transition:all .2s; position:relative; overflow:hidden;
}
.tt-card::before {
  content:''; position:absolute; top:0; left:0; right:0; height:3px;
  background:linear-gradient(90deg,var(--blue),var(--purple));
}
.tt-card:hover { border-color:var(--border2); transform:translateY(-2px); box-shadow:var(--shadow-sm); }
.tt-card-title { font-family:'Playfair Display',serif; font-size:1.1rem; font-weight:700; color:var(--text); margin-bottom:4px; }
.tt-type-pill {
  display:inline-block; background:rgba(74,144,226,0.12); color:var(--blue);
  border:1px solid rgba(74,144,226,0.25); border-radius:99px;
  padding:3px 12px; font-size:.73rem; font-weight:600; margin-bottom:10px;
}
.tt-card-meta   { font-size:.78rem; color:var(--text2); margin-bottom:12px; }
.tt-card-actions { display:flex; gap:8px; flex-wrap:wrap; }
.tt-table-wrap { overflow-x:auto; margin-top:14px; }
.tt-table { width:100%; border-collapse:collapse; font-size:.88rem; min-width:400px; }
.tt-table th {
  background:var(--surface3); color:var(--accent); font-weight:600;
  padding:10px 14px; text-align:left; border:1px solid var(--border); white-space:nowrap;
}
.tt-table td { padding:9px 14px; border:1px solid var(--border); color:var(--text2); vertical-align:top; }
.tt-table td input {
  background:transparent; border:none; color:var(--text);
  font-family:'DM Sans',sans-serif; font-size:.88rem; width:100%; outline:none; padding:2px 0;
}
.tt-table td input:focus { border-bottom:1px solid var(--accent); }
.tt-table tr:nth-child(even) td { background:rgba(255,255,255,0.02); }
.tt-row-del {
  background:none; border:none; color:var(--text3); cursor:pointer;
  font-size:.8rem; padding:4px 6px; border-radius:6px; transition:all .2s;
}
.tt-row-del:hover { color:var(--red); background:rgba(231,76,60,0.1); }
.tt-type-badge {
  background:rgba(74,144,226,0.1); border:1px solid rgba(74,144,226,0.2);
  border-radius:var(--radius); padding:10px 16px; margin-bottom:16px;
  font-size:.85rem; color:var(--blue);
}
.tt-type-badge strong { font-size:1.05rem; color:var(--text); }
.tt-columns-row { display:flex; gap:10px; align-items:flex-end; flex-wrap:wrap; }
.tt-columns-row .fg { flex:1; min-width:200px; }

/* ════════════ FILE MANAGER ════════════ */
.breadcrumb {
  display:flex; align-items:center; gap:8px;
  margin-bottom:20px; font-size:.85rem; color:var(--text2); flex-wrap:wrap;
}
.breadcrumb button {
  background:var(--surface2); border:1px solid var(--border); border-radius:8px;
  padding:6px 12px; color:var(--text2); cursor:pointer;
  font-family:'DM Sans',sans-serif; font-size:.82rem;
  display:flex; align-items:center; gap:6px; transition:all .2s;
}
.breadcrumb button:hover { border-color:var(--accent); color:var(--accent); }
.breadcrumb span { color:var(--text); font-weight:600; }

.folders-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:14px; }
.folder-card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); padding:20px 16px;
  cursor:pointer; transition:all .2s;
  display:flex; flex-direction:column; align-items:center;
  text-align:center; gap:8px; position:relative;
}
.folder-card:hover { border-color:var(--accent); transform:translateY(-3px); box-shadow:var(--shadow-sm); }
.folder-card i { font-size:2.5rem; color:var(--accent); }
.folder-card .fc-name { font-weight:600; color:var(--text); font-size:.88rem; word-break:break-word; }
.folder-card .fc-count { font-size:.75rem; color:var(--text2); }
.folder-card-actions { position:absolute; top:8px; right:8px; display:flex; gap:4px; opacity:0; transition:opacity .2s; }
.folder-card:hover .folder-card-actions { opacity:1; }

.files-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:12px; }
.file-card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius); padding:14px;
  display:flex; flex-direction:column; align-items:center;
  text-align:center; gap:8px; transition:all .2s; overflow:hidden;
}
.file-card:hover { border-color:var(--border2); box-shadow:var(--shadow-sm); }
.file-card .fc-icon { font-size:2rem; }
.file-card .fc-icon.doc { color:var(--blue); }
.file-card .fc-icon.img { color:var(--green); }
.file-card .fc-icon.vid { color:var(--red); }
.file-card .fc-icon.aud { color:var(--purple); }
.file-card .fc-icon.other { color:var(--text3); }
.file-card .fc-name { font-size:.75rem; color:var(--text2); word-break:break-all; line-height:1.4; max-height:3.2em; overflow:hidden; }
.file-card .fc-size { font-size:.7rem; color:var(--text3); }
.file-actions { display:flex; gap:6px; margin-top:4px; }
.file-thumb { width:100%; height:80px; object-fit:cover; border-radius:8px; margin-bottom:4px; }

/* ════════════ PLANS ════════════ */
.filter-tabs { display:flex; gap:6px; margin-bottom:20px; flex-wrap:wrap; }
.filter-tab {
  padding:7px 16px; background:var(--surface2);
  border:1px solid var(--border); border-radius:99px;
  color:var(--text2); font-family:'DM Sans',sans-serif;
  font-size:.82rem; font-weight:600; cursor:pointer; transition:all .2s;
}
.filter-tab:hover  { border-color:var(--accent); color:var(--accent); }
.filter-tab.active { background:var(--accent); border-color:var(--accent); color:#000; }

.plan-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); margin-bottom:16px; overflow:hidden; transition:all .2s; }
.plan-card:hover { border-color:var(--border2); }
.plan-header { padding:16px 20px; display:flex; align-items:center; justify-content:space-between; gap:12px; cursor:pointer; flex-wrap:wrap; }
.plan-header-left { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.plan-title-text { font-family:'Playfair Display',serif; font-size:1.05rem; font-weight:700; color:var(--text); }
.plan-duration-pill { display:inline-block; padding:3px 12px; border-radius:99px; font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.5px; }
.pill-daily   { background:rgba(74,144,226,.12); color:var(--blue); }
.pill-weekly  { background:rgba(155,89,182,.12); color:var(--purple); }
.pill-monthly { background:rgba(224,123,58,.12);  color:var(--accent2); }
.pill-yearly  { background:rgba(240,192,64,.12);  color:var(--accent); }

.plan-progress-bar-wrap { padding:0 20px 14px; }
.plan-progress-bar { height:8px; background:var(--surface3); border-radius:99px; overflow:hidden; margin-bottom:6px; }
.plan-progress-fill { height:100%; background:linear-gradient(90deg,var(--green),#51e98c); border-radius:99px; transition:width .5s ease; }
.plan-progress-label { font-size:.78rem; color:var(--text2); display:flex; justify-content:space-between; }
.plan-progress-label strong { color:var(--green); }
.plan-body { padding:0 20px 18px; }

.activity-row {
  display:flex; align-items:center; gap:10px;
  padding:9px 12px; background:var(--surface2);
  border:1px solid var(--border); border-radius:10px;
  margin-bottom:8px; transition:all .2s;
}
.activity-row:hover { border-color:var(--border2); }
.activity-text { flex:1; font-size:.88rem; color:var(--text); word-break:break-word; }
.status-btns  { display:flex; gap:6px; flex-shrink:0; }
.status-btn {
  width:30px; height:30px; border:2px solid var(--border2);
  border-radius:50%; background:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  font-size:.85rem; transition:all .2s;
}
.status-btn.green-btn { color:var(--green); }
.status-btn.green-btn.active { background:var(--green); border-color:var(--green); color:#fff; }
.status-btn.red-btn   { color:var(--red); }
.status-btn.red-btn.active   { background:var(--red);   border-color:var(--red);   color:#fff; }

.plan-summary { margin-top:14px; background:var(--surface3); border:1px solid var(--border); border-radius:var(--radius); padding:14px 16px; }
.plan-summary h4 { font-size:.83rem; color:var(--text2); margin-bottom:10px; text-transform:uppercase; letter-spacing:.5px; }
.summary-stat { display:flex; justify-content:space-between; font-size:.85rem; margin-bottom:6px; }
.summary-stat .lbl { color:var(--text2); }
.summary-stat .val { font-weight:700; }
.val-green { color:var(--green); }
.val-red   { color:var(--red); }
.incomplete-list { margin-top:10px; }
.incomplete-item {
  padding:5px 10px; background:rgba(231,76,60,.08);
  border:1px solid rgba(231,76,60,.2); border-radius:8px;
  font-size:.8rem; color:var(--red); margin-bottom:4px;
  display:flex; align-items:center; gap:6px;
}
.plan-card-actions { display:flex; gap:8px; }

.activity-input-row { display:flex; gap:8px; margin-bottom:8px; align-items:center; }
.activity-input-row input {
  flex:1; background:var(--surface2); border:1px solid var(--border);
  border-radius:10px; padding:9px 12px; color:var(--text);
  font-family:'DM Sans',sans-serif; font-size:.88rem; outline:none; transition:border-color .2s;
}
.activity-input-row input:focus { border-color:var(--accent); }
.rm-act-btn {
  background:none; border:1px solid var(--border); border-radius:8px;
  color:var(--text3); cursor:pointer; padding:7px 10px;
  font-size:.8rem; transition:all .2s; flex-shrink:0;
}
.rm-act-btn:hover { border-color:var(--red); color:var(--red); }

/* ════════════ PROFILE ════════════ */
.profile-card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); padding:28px 24px;
  display:flex; align-items:center; gap:20px;
  margin-bottom:20px; flex-wrap:wrap;
}
.profile-avatar {
  width:72px; height:72px; border-radius:50%;
  background:linear-gradient(135deg,var(--accent),var(--accent2));
  display:flex; align-items:center; justify-content:center;
  font-family:'Playfair Display',serif;
  font-size:2rem; font-weight:900; color:#000; flex-shrink:0;
}
.profile-info { flex:1; min-width:0; }
.profile-username { font-family:'Playfair Display',serif; font-size:1.4rem; font-weight:700; color:var(--text); }
.profile-email  { font-size:.85rem; color:var(--text2); margin-top:4px; word-break:break-all; }
.profile-joined { font-size:.78rem; color:var(--text3); margin-top:6px; }

.profile-stats-grid {
  display:grid; grid-template-columns:repeat(auto-fit,minmax(130px,1fr));
  gap:14px; margin-bottom:24px;
}
.profile-avatar-wrap {
  position:relative;
  display:inline-block;
}
.avatar-upload-btn {
  position:absolute; bottom:0; right:0;
  width:26px; height:26px; border-radius:50%;
  background:var(--surface2); border:2px solid var(--surface);
  color:var(--text); display:flex; align-items:center; justify-content:center;
  cursor:pointer; font-size:.8rem; transition:all .2s;
}
.avatar-upload-btn:hover { background:var(--accent); color:#000; box-shadow:0 0 10px rgba(240,192,64,.4); }
.profile-stat-card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); padding:20px 16px;
  text-align:center; transition:all .2s;
}
.profile-stat-card:hover { border-color:var(--border2); transform:translateY(-2px); }
.profile-stat-card i { font-size:1.5rem; margin-bottom:10px; display:block; }
.stat-number { font-family:'Playfair Display',serif; font-size:1.8rem; font-weight:700; color:var(--text); }
.stat-label  { font-size:.78rem; color:var(--text2); margin-top:4px; }

.profile-actions { display:flex; gap:12px; flex-wrap:wrap; }
.profile-action-btn {
  display:flex; align-items:center; gap:8px;
  padding:12px 20px; background:var(--surface2);
  border:1px solid var(--border); border-radius:var(--radius);
  color:var(--text); font-family:'DM Sans',sans-serif;
  font-size:.88rem; font-weight:600; cursor:pointer; transition:all .2s;
}
.profile-action-btn:hover { border-color:var(--accent); color:var(--accent); }
.profile-action-btn.danger:hover { border-color:var(--red); color:var(--red); }

/* ════════════ MODALS ════════════ */
.overlay {
  position:fixed; inset:0; background:rgba(0,0,0,0.72);
  z-index:500; display:flex; align-items:center;
  justify-content:center; padding:16px;
  animation:overlayIn .2s ease; backdrop-filter:blur(4px);
}
@keyframes overlayIn { from{opacity:0} to{opacity:1} }

.modal {
  background:var(--surface); border:1px solid var(--border2);
  border-radius:var(--radius-lg); width:100%; max-width:520px;
  max-height:92vh; overflow-y:auto; box-shadow:var(--shadow);
  animation:modalIn .25s ease;
}
.modal.modal-wide { max-width:760px; }
.modal.modal-sm   { max-width:420px; }
.modal.modal-xs   { max-width:360px; }
@keyframes modalIn { from{opacity:0;transform:scale(.94) translateY(20px)} to{opacity:1;transform:scale(1) translateY(0)} }

.mh {
  display:flex; align-items:center; justify-content:space-between;
  padding:18px 22px; border-bottom:1px solid var(--border); position:sticky; top:0;
  background:var(--surface); z-index:1;
}
.mh h2 {
  font-family:'Playfair Display',serif; font-size:1.05rem;
  font-weight:700; color:var(--text); display:flex; align-items:center; gap:8px;
}
.mh h2 i { color:var(--accent); }
.mclose {
  background:var(--surface2); border:1px solid var(--border);
  border-radius:8px; color:var(--text2); cursor:pointer;
  width:32px; height:32px; display:flex; align-items:center;
  justify-content:center; font-size:.9rem; transition:all .2s; flex-shrink:0;
}
.mclose:hover { background:rgba(231,76,60,.15); border-color:var(--red); color:var(--red); }

.mb { padding:22px; }
.mf {
  display:flex; justify-content:flex-end; gap:10px;
  padding:14px 22px; border-top:1px solid var(--border);
  flex-wrap:wrap;
}

.form-row2 { display:grid; grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); gap:12px; }

.btn-cancel {
  padding:10px 18px; background:var(--surface2);
  border:1px solid var(--border); border-radius:var(--radius);
  color:var(--text2); font-family:'DM Sans',sans-serif;
  font-size:.88rem; font-weight:600; cursor:pointer; transition:all .2s;
}
.btn-cancel:hover { border-color:var(--accent); color:var(--accent); }

.btn-save {
  padding:10px 20px; background:var(--accent); border:none;
  border-radius:var(--radius); color:#000;
  font-family:'DM Sans',sans-serif; font-size:.88rem;
  font-weight:700; cursor:pointer; transition:all .2s;
  display:flex; align-items:center; gap:7px;
}
.btn-save:hover { background:var(--accent-dark); }

.btn-danger {
  padding:10px 20px; background:var(--red); border:none;
  border-radius:var(--radius); color:#fff;
  font-family:'DM Sans',sans-serif; font-size:.88rem;
  font-weight:700; cursor:pointer; transition:all .2s;
  display:flex; align-items:center; gap:7px;
}
.btn-danger:hover { background:#c0392b; }

.btn-outline-sm {
  padding:8px 14px; background:var(--surface2);
  border:1px solid var(--border); border-radius:9px; color:var(--text2);
  font-family:'DM Sans',sans-serif; font-size:.83rem; font-weight:600;
  cursor:pointer; transition:all .2s;
  display:inline-flex; align-items:center; gap:6px; white-space:nowrap;
}
.btn-outline-sm:hover { border-color:var(--accent); color:var(--accent); }

.voice-row { display:flex; gap:8px; align-items:stretch; }
.voice-row input { flex:1; }
.voice-btn {
  background:var(--surface3); border:1px solid var(--border);
  border-radius:var(--radius); color:var(--text2); cursor:pointer;
  padding:0 14px; font-size:.85rem; transition:all .2s;
  display:flex; align-items:center; gap:6px; white-space:nowrap;
}
.voice-btn:hover { border-color:var(--accent); color:var(--accent); }
.voice-btn.listening { border-color:var(--red); color:var(--red); animation:pulse .8s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }
.voice-status { font-size:.75rem; color:var(--text3); margin-top:4px; display:block; min-height:16px; }

.req { color:var(--red); }
.question-text { font-size:1rem; font-weight:600; color:var(--text); margin-bottom:18px; line-height:1.5; }

#password-msg { font-size:.83rem; color:var(--red); margin-top:8px; min-height:20px; }

/* ════════════ ALARM RINGING ════════════ */
#alarm-ring {
  position:fixed; inset:0; background:rgba(0,0,0,0.92);
  z-index:9999; display:flex; align-items:center; justify-content:center; padding:20px;
}
.ring-box {
  text-align:center; padding:40px 32px;
  background:var(--surface); border:2px solid var(--accent);
  border-radius:var(--radius-lg); max-width:340px; width:100%;
  animation:ringPulse 1s ease-in-out infinite;
}
@keyframes ringPulse { 0%,100%{box-shadow:0 0 0 0 rgba(240,192,64,.4)} 50%{box-shadow:0 0 0 24px rgba(240,192,64,0)} }
.ring-anim { font-size:3.5rem; margin-bottom:16px; display:block; animation:ringShake .5s ease-in-out infinite; }
@keyframes ringShake { 0%,100%{transform:rotate(-10deg)} 50%{transform:rotate(10deg)} }
#ring-label { font-family:'Playfair Display',serif; font-size:1.4rem; font-weight:700; color:var(--accent); margin-bottom:8px; }
#ring-time  { color:var(--text2); font-size:.9rem; margin-bottom:24px; }

/* ════════════ TOAST ════════════ */
.toast {
  position:fixed; bottom:24px; right:20px;
  background:var(--surface2); border:1px solid var(--border2);
  border-radius:var(--radius); padding:14px 18px;
  color:var(--text); font-size:.88rem; font-weight:500;
  box-shadow:var(--shadow); z-index:10000; max-width:300px;
  opacity:0; transform:translateY(20px);
  transition:all .3s ease; pointer-events:none;
}
.toast.show { opacity:1; transform:translateY(0); }
.toast.toast-success { border-color:var(--green); }
.toast.toast-error   { border-color:var(--red); }

/* ════════════ ANIMATIONS ════════════ */
@keyframes planPopupIn  { from{opacity:0;transform:translateX(60px)} to{opacity:1;transform:translateX(0)} }
@keyframes planPopupOut { from{opacity:1;transform:translateX(0)} to{opacity:0;transform:translateX(60px)} }

@keyframes tiltMobile { 0%,100%{transform:rotate(0deg)} 25%{transform:rotate(-15deg)} 75%{transform:rotate(15deg)} }

/* ════════════ ORIENTATION OVERLAY ════════════ */
#orientation-overlay {
  display:none; position:fixed; inset:0;
  background:var(--bg); z-index:99999;
  align-items:center; justify-content:center;
  text-align:center; padding:20px;
}
.orientation-box { max-width:80%; }
@media screen and (orientation: landscape) and (max-height: 600px) {
  #app, #auth-screen { display:none !important; }
  #orientation-overlay { display:flex !important; }
}

/* ════════════ RESPONSIVE — MOBILE ════════════ */
@media (max-width: 768px) {
  /* Sidebar slides in from left on mobile */
  .sidebar {
    position:fixed; top:60px; left:0; bottom:0;
    z-index:150; transform:translateX(-100%);
    transition:transform .3s ease;
    width:240px; min-width:240px;
  }
  .sidebar.open { transform:translateX(0); }
  .sidebar.collapsed { transform:translateX(-100%); }

  .content-area { padding:16px; }
  .sec-header { flex-direction:column; align-items:flex-start; }
  .sec-header-btns { width:100%; }
  .fab-btn { width:100%; justify-content:center; }

  .auth-box { padding:28px 20px; }
  .auth-logo { font-size:1.8rem; }

  .cards-grid { grid-template-columns:1fr; }
  .folders-grid { grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); }
  .files-grid   { grid-template-columns:repeat(auto-fill,minmax(120px,1fr)); }

  .profile-btn .profile-name { display:none; }
  .logout-text { display:none; }

  .tb-logo { font-size:1rem; }
  .alarm-time { font-size:1.7rem; }

  .profile-card { flex-direction:column; text-align:center; }
  .profile-stats-grid { grid-template-columns:repeat(2,1fr); }

  .modal { margin:8px; }
  .mb { padding:16px; }
  .mf { padding:12px 16px; }
  .mh { padding:14px 16px; }

  .plan-header { gap:8px; }
  .alarm-actions { flex-wrap:wrap; gap:6px; }

  .tt-columns-row { flex-direction:column; }
  .tt-columns-row .fg { min-width:unset; width:100%; }

  .form-row2 { grid-template-columns:1fr; }
  .filter-tabs { gap:4px; }
  .filter-tab { padding:6px 12px; font-size:.78rem; }
}

@media (max-width: 480px) {
  .profile-stats-grid { grid-template-columns:repeat(2,1fr); }
  .sound-grid { max-height:220px; }
  .ring-box { padding:30px 20px; }
  .ring-anim { font-size:3rem; }
  .profile-actions { flex-direction:column; }
  .profile-action-btn { width:100%; justify-content:center; }
}

@media (max-width: 360px) {
  .tb-logo { font-size:.9rem; }
  .auth-logo { font-size:1.5rem; }
  .sec-title-block h1 { font-size:1.3rem; }
}

/* ════════════ UPLOAD PROGRESS STYLES ════════════ */
.up-fill {
  box-shadow: 0 0 15px rgba(240, 192, 64, 0.4);
}
.up-icon i {
  animation: upIconMove 2s infinite ease-in-out;
}
@keyframes upIconMove {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(-10px); opacity: 0.7; }
}

/* ════════════ SHARE CARD STYLES ════════════ */
.share-card {
  width: fit-content;
  min-width: 450px;
  max-width: 95vw;
  min-height: 200px;
  background: var(--bg);
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  box-shadow: var(--shadow);
  height: auto !important;
  max-height: none !important;
}
.sc-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--accent);
}
.sc-logo img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}
#sc-content {
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.sc-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}
.sc-url {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 700;
}
.sc-tagline {
  font-size: 0.75rem;
  color: var(--text3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Special adjustments for sharing */
.share-mode .tt-table th { background: var(--surface2) !important; color: var(--accent) !important; }
.share-mode .plan-card { border: none !important; margin-bottom: 0 !important; }
.share-mode .plan-header { padding: 20px !important; }

/* Files Download Card for Sharing */
.sc-file-card {
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.sc-file-preview {
  width: 100%;
  max-height: none; /* Allow full height */
  overflow: visible;
  border-radius: 12px;
  margin-bottom: 20px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sc-file-preview img {
  width: 100%;
  height: auto;
  object-fit: contain; /* Don't crop */
  border-radius: 12px;
}
.sc-file-info {
  text-align: center;
  margin-bottom: 20px;
}
.sc-file-card .sc-file-icon {
  margin-bottom: 20px;
}
.sc-download-btn {
  margin-top: 5px;
  background: var(--accent);
  color: #000;
  padding: 12px 30px;
  border-radius: 99px;
  font-weight: 800;
  font-size: 0.85rem;
  text-transform: uppercase;
  text-align: center;
  width: 100%;
}

/* BRANDING TOGGLE */
.share-card.no-brand .sc-logo,
.share-card.no-brand .sc-footer {
  display: none !important;
}
.share-card.no-brand {
  padding: 20px;
  border: none;
  box-shadow: none;
  background: transparent;
}
.share-card.no-brand .sc-file-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
}

/* PURE IMAGE MODE */
.share-card.pure-image {
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  width: fit-content;
  max-width: 100vw;
}
.share-card.pure-image .sc-logo,
.share-card.pure-image .sc-footer {
  display: none !important;
}
.share-card.pure-image .sc-file-preview {
  margin-bottom: 0 !important;
  border-radius: 0 !important;
}
.share-card.pure-image .sc-file-preview img {
  border-radius: 0 !important;
}

/* ════════════ SPLASH SCREEN STYLES ════════════ */
#splash-screen {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 11000;
  transition: opacity 0.5s ease;
}
.splash-content { text-align: center; }
.splash-logo img {
  width: 100px; height: 100px;
  border-radius: 25px;
  margin-bottom: 20px;
  animation: splashPulse 2s infinite ease-in-out;
}
@keyframes splashPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(240,192,64,0.4); }
  50% { transform: scale(1.05); box-shadow: 0 0 40px 10px rgba(240,192,64,0.2); }
}
.splash-text {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 24px;
  letter-spacing: 1px;
}
.splash-loader {
  width: 40px; height: 4px;
  background: var(--surface3);
  margin: 0 auto;
  border-radius: 2px;
  position: relative; overflow: hidden;
}
.splash-loader span {
  position: absolute; left: -100%; top: 0; bottom: 0; width: 100%;
  background: var(--accent);
  animation: splashLoad 1.5s infinite linear;
}
@keyframes splashLoad {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* ════════════ FOCUS TIMER ════════════ */
.timer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-top: 20px;
  position: relative;
  overflow: hidden;
}

.timer-display-wrap {
  position: relative;
  width: 280px;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 30px;
}

.timer-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-bg-circle {
  fill: none;
  stroke: var(--surface3);
  stroke-width: 6;
}

.timer-progress-circle {
  fill: none;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 283; /* 2 * PI * R (45) */
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.3s;
  filter: drop-shadow(0 0 8px rgba(240, 192, 64, 0.4));
}

.timer-text {
  position: absolute;
  font-family: 'Playfair Display', serif;
  font-size: 4rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -2px;
}

.timer-controls {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.quick-starts {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.quick-starts button {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
}

.timer-actions {
  display: flex;
  gap: 12px;
}

.timer-actions button {
  flex: 1;
  height: 48px;
}

.focus-stats-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
}

.focus-stat {
  background: var(--surface2);
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: center;
}

.focus-stat .lbl {
  display: block;
  font-size: 0.75rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.focus-stat .val {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

/* Pulse animation when active */
.timer-container.active .timer-progress-circle {
  animation: timerGlow 2s infinite ease-in-out;
}

@keyframes timerGlow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(240, 192, 64, 0.4)); stroke: var(--accent); }
  50% { filter: drop-shadow(0 0 15px rgba(240, 192, 64, 0.8)); stroke: var(--accent-dark); }
}


/* ── PLANS SECTION ─────────────────────────────────────────── */
.filter-tabs { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:20px; }
.filter-tab {
  padding:6px 16px; border-radius:99px;
  border:1px solid var(--border2);
  background:var(--surface2); color:var(--text2);
  font-size:.8rem; font-weight:600; cursor:pointer;
  transition:all .2s; font-family:'DM Sans',sans-serif;
}
.filter-tab.active, .filter-tab:hover {
  background:var(--accent); color:#000; border-color:var(--accent);
}

/* ── FOCUS TIMER: CUSTOM TIME INPUT ────────────────────────── */
.timer-custom-row {
  margin: 16px 0 4px;
  width: 100%;
}
.timer-custom-label {
  display: block;
  font-size: .78rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 8px;
  font-weight: 600;
}
.timer-custom-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.timer-custom-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.timer-custom-field input {
  width: 56px;
  padding: 8px 6px;
  text-align: center;
  background: var(--surface3);
  border: 1px solid var(--border2);
  border-radius: 10px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  -moz-appearance: textfield;
}
.timer-custom-field input::-webkit-outer-spin-button,
.timer-custom-field input::-webkit-inner-spin-button { -webkit-appearance: none; }
.timer-custom-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(240,192,64,.2);
}
.timer-unit-label {
  font-size: .68rem;
  color: var(--text3);
  font-weight: 600;
  text-transform: uppercase;
}
.timer-colon {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text3);
  margin-bottom: 14px;
}

/* ── FOCUS TIMER: SOUND PICKER ─────────────────────────────── */
.timer-sound-row {
  margin: 14px 0;
  width: 100%;
}
.timer-sound-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 160px;
  overflow-y: auto;
  padding: 4px 2px;
}
.timer-sound-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px 5px 8px;
  background: var(--surface3);
  border: 1.5px solid var(--border);
  border-radius: 99px;
  cursor: pointer;
  font-size: .78rem;
  transition: all .18s;
  white-space: nowrap;
}
.timer-sound-item:hover { border-color: var(--border2); background: var(--surface2); }
.timer-sound-item.selected {
  border-color: var(--accent);
  background: rgba(240,192,64,.12);
  color: var(--accent);
}
.timer-sound-name { font-weight: 600; color: inherit; }
.timer-sound-item .sound-preview-btn {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: .7rem;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color .15s;
}
.timer-sound-item.selected .sound-preview-btn { color: var(--accent); }
.timer-sound-item .sound-preview-btn:hover { color: var(--text); }

/* ── FOCUS COMPLETE POPUP ANIMATIONS ───────────────────────── */
@keyframes scaleIn {
  from { opacity:0; transform:scale(.85); }
  to   { opacity:1; transform:scale(1); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
@keyframes fadeIn {
  from { opacity:0; }
  to   { opacity:1; }
}

/* ── TIMER SOUND PICKER: UPLOAD & LABELS ───────────────────── */
.timer-sound-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.timer-sound-row-header .timer-custom-label {
  margin-bottom: 0;
}
.timer-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--surface3);
  border: 1.5px dashed var(--border2);
  border-radius: 99px;
  color: var(--text2);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  font-family: 'DM Sans', sans-serif;
}
.timer-upload-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(240,192,64,.08);
}
.timer-sound-section-label {
  width: 100%;
  font-size: .7rem;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: 4px 2px;
}
.timer-no-music {
  font-size: .8rem;
  color: var(--text3);
  padding: 6px 4px;
  font-style: italic;
}

/* ── CAPGO FORCE UPDATE MODAL STYLES ───────────────────────────── */
.update-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 14, 20, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.4s ease;
}

.update-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 440px;
  text-align: center;
  box-shadow: 0 0 50px rgba(240, 192, 64, 0.1), var(--shadow);
  animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.update-icon-wrapper {
  width: 72px;
  height: 72px;
  background: rgba(240, 192, 64, 0.1);
  border: 1px solid rgba(240, 192, 64, 0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  color: var(--accent);
  font-size: 2.2rem;
  animation: pulse 2s infinite alternate;
}

.update-card h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.update-card p {
  color: var(--text2);
  font-size: 0.93rem;
  line-height: 1.6;
  margin-bottom: 30px;
}

.update-version-badge {
  display: inline-block;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--accent);
  font-family: monospace;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 99px;
  margin-bottom: 24px;
}

.update-btn-action {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #000;
  border: none;
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(240, 192, 64, 0.2);
}

.update-btn-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(240, 192, 64, 0.4);
}

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

.update-progress-container {
  width: 100%;
  display: none;
  margin-top: 10px;
}

.update-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text2);
  margin-bottom: 8px;
  font-weight: 600;
}

.update-progress-bg {
  width: 100%;
  height: 8px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.update-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 99px;
  transition: width 0.1s ease;
}

.update-status-msg {
  font-size: 0.8rem;
  color: var(--text3);
  margin-top: 12px;
  font-style: italic;
}

/* ════════════ TIMER PRESET CHIPS ════════════ */
.timer-chip {
  flex: 1;
  min-width: 48px;
  padding: 10px 6px;
  border-radius: 12px;
  border: 1.5px solid var(--border2);
  background: var(--surface3);
  color: var(--text2);
  font-family: 'DM Sans', sans-serif;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  letter-spacing: .3px;
}
.timer-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(240,192,64,.08);
  transform: translateY(-2px);
}
.timer-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  box-shadow: 0 4px 18px rgba(240,192,64,.35);
  transform: translateY(-2px);
}

/* ════════════ TIMER SOUND TRIGGER ROW ════════════ */
.timer-sound-trigger-row { width: 100%; margin: 4px 0; }
#current-sound-label { font-weight: 700; color: var(--text2); }

/* ════════════ SOUND BOTTOM SHEET ════════════ */
.bottom-sheet-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 8000;
  display: flex; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(4px);
  animation: overlayIn .2s ease;
}
.bottom-sheet-panel {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 24px 24px 0 0;
  width: 100%; max-width: 560px; max-height: 70vh;
  display: flex; flex-direction: column;
  animation: sheetUp .3s cubic-bezier(0.34,1.56,0.64,1);
  overflow: hidden;
}
@keyframes sheetUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.bottom-sheet-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0; gap: 12px;
  flex-wrap: wrap;
}
.bottom-sheet-handle {
  width: 40px; height: 4px;
  background: var(--border2); border-radius: 99px;
  margin: 0 auto 12px; flex-shrink: 0;
  width: 100%;
}
.bottom-sheet-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem; font-weight: 700; color: var(--text);
  flex: 1; display: flex; align-items: center; gap: 8px;
}
.bottom-sheet-body {
  overflow-y: auto; padding: 16px 20px 24px;
  display: flex; flex-direction: column; gap: 6px;
}
.bs-sound-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: 12px; cursor: pointer; transition: all .18s; font-size: .88rem;
}
.bs-sound-item:hover { border-color: var(--border2); background: var(--surface3); }
.bs-sound-item.selected { border-color: var(--accent); background: rgba(240,192,64,.1); color: var(--accent); }
.bs-sound-item .bs-emoji { font-size: 1.1rem; flex-shrink: 0; }
.bs-sound-item .bs-name { flex: 1; font-weight: 600; color: inherit; }
.bs-play-btn {
  background: var(--surface3); border: 1px solid var(--border2);
  border-radius: 8px; color: var(--text3);
  padding: 5px 9px; font-size: .75rem;
  cursor: pointer; transition: all .2s; flex-shrink: 0;
}
.bs-play-btn:hover { border-color: var(--accent); color: var(--accent); }
.bs-sound-item.selected .bs-play-btn { color: var(--accent); }
.bs-del-btn {
  background: none; border: 1px solid var(--border);
  border-radius: 8px; color: var(--text3);
  padding: 5px 9px; font-size: .75rem;
  cursor: pointer; transition: all .2s; flex-shrink: 0;
}
.bs-del-btn:hover { border-color: var(--red); color: var(--red); }

/* ════════════ 3-COL FOCUS STATS ════════════ */
.focus-stats-mini {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px; margin-top: 20px;
}
@media (max-width: 480px) {
  .focus-stats-mini { grid-template-columns: 1fr 1fr; }
  .focus-stats-mini .focus-stat:last-child { grid-column: 1 / -1; }
}

/* ════════════ SOCIAL ACCOUNTABILITY CARD ════════════ */
.social-accountability-card {
  margin-top: 20px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.social-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface2);
}
.social-live-badge {
  display: flex; align-items: center; gap: 8px;
  font-size: .82rem; font-weight: 600; color: var(--green);
}
.live-pulse-dot {
  width: 8px; height: 8px;
  background: var(--green); border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(39,174,96,.5);
  animation: livePulse 1.8s infinite; flex-shrink: 0;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(39,174,96,.5); }
  70%  { box-shadow: 0 0 0 8px rgba(39,174,96,0); }
  100% { box-shadow: 0 0 0 0 rgba(39,174,96,0); }
}
.social-body { padding: 16px 18px 20px; }
.social-title {
  font-family: 'DM Sans', sans-serif;
  font-size: .82rem; font-weight: 700; color: var(--text2);
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px; text-transform: uppercase; letter-spacing: .6px;
}
.social-title i { color: var(--accent); }
.friends-list { display: flex; flex-direction: column; gap: 10px; }
.friend-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 12px; transition: border-color .2s;
}
.friend-item:hover { border-color: var(--border2); }
.friend-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: .95rem; font-weight: 900; color: #fff; flex-shrink: 0;
}
.friend-info { flex: 1; min-width: 0; }
.friend-name { font-weight: 700; font-size: .88rem; color: var(--text); }
.friend-status { font-size: .73rem; color: var(--text3); margin-top: 2px; display: flex; align-items: center; gap: 5px; }
.friend-status .sdot { width: 6px; height: 6px; border-radius: 50%; background: var(--text3); flex-shrink: 0; }
.friend-status.focusing { color: var(--green); }
.friend-status.focusing .sdot { background: var(--green); animation: livePulse 1.8s infinite; }
.friend-actions { display: flex; gap: 6px; }
.friend-action-btn {
  background: var(--surface3); border: 1px solid var(--border2);
  border-radius: 8px; padding: 5px 10px;
  font-size: .75rem; font-weight: 700;
  cursor: pointer; transition: all .2s; white-space: nowrap;
  font-family: 'DM Sans', sans-serif; color: var(--text2);
}
.friend-action-btn:hover { border-color: var(--accent); color: var(--accent); }
.friend-action-btn.nudge:hover { border-color: var(--accent2); color: var(--accent2); }
.friend-action-btn.hifi:hover { border-color: var(--green); color: var(--green); }

/* ════════════ DAILY STREAK SPLASH ════════════ */
#streak-splash {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(8px);
  z-index: 10500;
  display: flex; align-items: center; justify-content: center;
  animation: overlayIn .3s ease;
}
.streak-splash-content {
  text-align: center; padding: 40px 28px;
  background: var(--surface);
  border: 2px solid rgba(240,192,64,.3);
  border-radius: 24px;
  max-width: 320px; width: 90%;
  box-shadow: 0 0 60px rgba(240,192,64,.15), var(--shadow);
  animation: modalIn .35s cubic-bezier(0.34,1.56,0.64,1);
}
.streak-flame-wrap { position: relative; display: inline-block; margin-bottom: 20px; }
.streak-flame {
  font-size: 5rem; display: block; line-height: 1;
  animation: flameFlicker 1.5s ease-in-out infinite alternate;
}
@keyframes flameFlicker {
  0%   { transform: scale(1)   rotate(-3deg); filter: drop-shadow(0 0 10px rgba(240,150,40,.7)); }
  100% { transform: scale(1.1) rotate(3deg);  filter: drop-shadow(0 0 22px rgba(240,192,64,.9)); }
}
.streak-streak-num {
  position: absolute; bottom: -8px; right: -12px;
  background: var(--accent); color: #000;
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem; font-weight: 900;
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 3px solid var(--surface);
  box-shadow: 0 4px 16px rgba(240,192,64,.4);
}
.streak-splash-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem; font-weight: 900; color: var(--accent); margin-bottom: 8px;
}
.streak-splash-sub { color: var(--text2); font-size: .88rem; line-height: 1.6; }

/* ════════════ BREATHING TIMER GLOW (ACTIVE) ════════════ */
.timer-container.active .timer-progress-circle {
  animation: timerBreath 3s ease-in-out infinite !important;
}
@keyframes timerBreath {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(240,192,64,.4));  stroke-width: 6; }
  50%       { filter: drop-shadow(0 0 22px rgba(240,192,64,.9)); stroke-width: 7.5; }
}

/* ════════════ ADMIN PANEL & NEW FEATURES ════════════ */

/* Streak display on profile card */
.profile-streak-badge {
  display: inline-block;
  background: rgba(240,192,64,0.15);
  color: var(--accent);
  border: 1px solid rgba(240,192,64,0.3);
  padding: 6px 14px;
  border-radius: 20px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  margin-top: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Admin summary grid */
.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.admin-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.admin-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(240,192,64,0.15);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 12px;
}
.admin-stat-val {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1.2;
}
.admin-stat-lbl {
  font-size: 0.75rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* Admin Search and Table */
.admin-search-row {
  margin-bottom: 16px;
  display: flex;
}
.admin-search-row input {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
}
.admin-search-row input:focus {
  border-color: var(--accent);
  outline: none;
}
.admin-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow-x: auto;
  margin-bottom: 30px;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}
.admin-table th, .admin-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table th {
  background: var(--surface2);
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}
.admin-table tr:last-child td {
  border-bottom: none;
}
.admin-table tbody tr {
  transition: background 0.15s;
}
.admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}
.admin-table .user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-table .avatar-cell {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}
.admin-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text);
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.admin-section-title i {
  color: var(--accent);
}

/* Feedback Item Card */
.feedback-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.feedback-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.feedback-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.feedback-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
}
.feedback-username {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text);
}
.feedback-date {
  font-size: 0.72rem;
  color: var(--text3);
}
.feedback-rating-stars {
  color: var(--accent);
  font-size: 0.8rem;
}
.feedback-comment-text {
  color: var(--text2);
  font-size: 0.82rem;
  line-height: 1.4;
  margin-top: 6px;
}

/* Star ratings row in modal */
.star-rating-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  font-size: 2.2rem;
}
.star-rating-row .star {
  cursor: pointer;
  color: var(--border2);
  transition: color 0.15s, transform 0.1s;
}
.star-rating-row .star:hover {
  transform: scale(1.15);
}
.star-rating-row .star.selected {
  color: var(--accent);
  filter: drop-shadow(0 0 4px rgba(240,192,64,0.3));
}

/* Friend search result items */
.fs-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.2s;
}
.fs-result-item:hover {
  border-color: var(--border2);
}
.fs-user-details {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex: 1;
}
.fs-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}
.fs-name {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text);
}

/* User profile details in modal */
.up-profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.up-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 900;
}
.up-username {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text);
}
.up-joined {
  font-size: 0.75rem;
  color: var(--text3);
  margin-top: 2px;
}
.up-streak {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 4px;
}
.up-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}
.up-stat {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}
.up-stat-val {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--text);
  display: block;
}
.up-stat-lbl {
  font-size: 0.72rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
  display: block;
}


/* ════════════════════════════════════════════════════════════
   CHAT FEATURE STYLES
════════════════════════════════════════════════════════════ */

/* Nav badge */
.nav-btn { position: relative; }
.chat-unread-badge {
  position: absolute;
  top: 6px; right: 8px;
  background: var(--red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  min-width: 18px; height: 18px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  animation: badgePop 0.3s ease;
}
@keyframes badgePop {
  0% { transform: scale(0); }
  70% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ════════════════════════════════════════════════
   NEXUS CHAT — Premium Redesign
   WhatsApp × X/Twitter × Snapchat × PlanTrack
   ════════════════════════════════════════════════ */

/* Chat Section Layout */
.chat-section { padding: 0 !important; height: calc(100vh - 60px); overflow: hidden; }
.chat-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  height: 100%;
  overflow: hidden;
}

/* ── SIDEBAR ── */
.chat-sidebar {
  background: linear-gradient(180deg, rgba(20,20,24,0.98) 0%, rgba(15,15,18,0.98) 100%);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.chat-sidebar-header {
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
  background: rgba(255,255,255,0.02);
}
.chat-sidebar-header h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text1);
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
  letter-spacing: -0.3px;
}
.chat-sidebar-header h2 i { color: var(--accent); }

/* Search bar */
.chat-search-wrap { position: relative; }
.chat-search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-size: 0.78rem;
}
.chat-search-wrap input {
  width: 100%;
  padding: 9px 14px 9px 34px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px;
  color: var(--text1);
  font-size: 0.85rem;
  transition: border-color 0.2s, background 0.2s;
}
.chat-search-wrap input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(240,192,64,0.04);
  box-shadow: 0 0 0 3px rgba(240,192,64,0.08);
}

/* Online Vibe Row */
.chat-vibe-row {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  overflow-x: auto;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
  scrollbar-width: none;
}
.chat-vibe-row::-webkit-scrollbar { display: none; }
.vibe-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  flex-shrink: 0;
}
.vibe-avatar-ring {
  width: 52px; height: 52px;
  border-radius: 50%;
  padding: 2.5px;
  background: linear-gradient(135deg, var(--accent), #ff6b6b, #a855f7);
  animation: ringPulse 3s ease-in-out infinite;
  position: relative;
}
.vibe-avatar-ring.offline {
  background: rgba(255,255,255,0.1);
  animation: none;
}
.vibe-avatar-inner {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border: 2px solid var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1rem; color: #000;
  overflow: hidden;
}
.vibe-avatar-inner img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.vibe-name {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text2);
  max-width: 52px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes ringPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(240,192,64,0.4); }
  50% { box-shadow: 0 0 0 4px rgba(240,192,64,0.1); }
}

/* Conversation List */
.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.chat-list-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 200px;
  color: var(--text3);
  font-size: 0.85rem;
  text-align: center;
  gap: 12px;
  padding: 20px;
}
.chat-list-empty i { font-size: 2.5rem; color: rgba(255,255,255,0.08); }
.chat-list-empty p { line-height: 1.7; }

/* Conversation item */
.chat-convo-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  position: relative;
}
.chat-convo-item:hover { background: rgba(255,255,255,0.04); }
.chat-convo-item.active {
  background: rgba(240,192,64,0.06);
  border-left: 3px solid var(--accent);
  padding-left: 13px;
}

.chat-convo-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem; color: #000;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.chat-convo-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.chat-online-dot {
  position: absolute;
  bottom: 2px; right: 2px;
  width: 12px; height: 12px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid #101014;
  box-shadow: 0 0 6px rgba(34,197,94,0.6);
}

.chat-convo-body { flex: 1; min-width: 0; }
.chat-convo-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: -0.2px;
}
.chat-convo-preview {
  font-size: 0.77rem;
  color: var(--text3);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-weight: 400;
}
.chat-convo-preview.unread-preview { color: var(--text2); font-weight: 600; }
.chat-convo-meta {
  display: flex; flex-direction: column;
  align-items: flex-end; gap: 5px;
  flex-shrink: 0;
}
.chat-convo-time { font-size: 0.68rem; color: var(--text3); font-weight: 500; }
.chat-convo-badge {
  background: var(--accent);
  color: #000;
  font-size: 0.6rem;
  font-weight: 900;
  min-width: 19px; height: 19px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
  box-shadow: 0 2px 8px rgba(240,192,64,0.4);
}
.chat-focus-badge {
  font-size: 0.6rem;
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* ── CHAT WINDOW ── */
.chat-window {
  display: flex;
  flex-direction: column;
  background: #0d0d10;
  overflow: hidden;
  position: relative;
}

.chat-window-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 100%;
  color: var(--text3);
  text-align: center;
  gap: 16px;
}
.chat-empty-icon {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240,192,64,0.12) 0%, transparent 70%);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem;
  color: var(--accent);
  border: 1px solid rgba(240,192,64,0.15);
  box-shadow: 0 0 40px rgba(240,192,64,0.08);
}
.chat-window-empty h3 { color: var(--text2); font-size: 1.1rem; font-weight: 700; }
.chat-window-empty p { font-size: 0.83rem; max-width: 200px; line-height: 1.6; }

/* Active Chat */
.chat-active {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* ── CHAT HEADER ── */
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: rgba(15,15,18,0.9);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.chat-back-btn {
  display: none;
  background: none; border: none;
  color: var(--text2); font-size: 1.1rem;
  cursor: pointer; padding: 4px 8px;
  transition: color 0.2s;
}
.chat-back-btn:hover { color: var(--accent); }

.chat-header-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1rem; color: #000;
  overflow: hidden; flex-shrink: 0;
  border: 2px solid rgba(240,192,64,0.3);
  box-shadow: 0 0 12px rgba(240,192,64,0.15);
}
.chat-header-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.chat-header-info { flex: 1; }
.chat-header-name {
  font-weight: 800;
  font-size: 0.97rem;
  color: var(--text1);
  letter-spacing: -0.2px;
}
.chat-header-status {
  font-size: 0.73rem;
  color: #22c55e;
  font-weight: 600;
  display: flex; align-items: center; gap: 5px;
}
.focus-pulse-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #ef4444;
  animation: focusPulse 1.2s ease-in-out infinite;
  display: inline-block;
}
@keyframes focusPulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(239,68,68,0.5); }
  50% { opacity: 0.8; transform: scale(0.85); box-shadow: 0 0 0 4px rgba(239,68,68,0); }
}

.chat-header-actions { display: flex; gap: 8px; align-items: center; }
.chat-action-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text2);
  font-size: 0.92rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.chat-action-btn:hover {
  background: rgba(240,192,64,0.12);
  border-color: rgba(240,192,64,0.3);
  color: var(--accent);
  box-shadow: 0 0 12px rgba(240,192,64,0.15);
}

/* ── MESSAGES AREA ── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.06) transparent;
  /* Subtle geometric dot wallpaper */
  background-color: #0d0d10;
  background-image:
    radial-gradient(rgba(255,255,255,0.025) 1px, transparent 0),
    radial-gradient(rgba(255,255,255,0.025) 1px, transparent 0);
  background-size: 28px 28px;
  background-position: 0 0, 14px 14px;
}

/* Date Divider Pill */
.chat-date-sep {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0 6px;
}
.chat-date-sep span {
  font-size: 0.68rem;
  color: var(--text3);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 3px 12px;
  border-radius: 20px;
  font-weight: 600;
  letter-spacing: 0.4px;
  backdrop-filter: blur(8px);
}

/* ── MESSAGE BUBBLES ── */
.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  animation: msgSlideIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin-bottom: 1px;
}
.msg-row.grouped { margin-bottom: 0; }
@keyframes msgSlideIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.msg-row.sent { flex-direction: row-reverse; }

.msg-avatar-sm {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 800; color: #000;
  flex-shrink: 0; overflow: hidden;
  border: 1.5px solid rgba(240,192,64,0.2);
}
.msg-avatar-sm img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.msg-avatar-placeholder { width: 30px; flex-shrink: 0; } /* Keeps alignment when no avatar */

.msg-content-wrapper {
  max-width: 72%;
  display: flex;
  flex-direction: column;
  position: relative;
  gap: 2px;
}
.msg-row.sent .msg-content-wrapper { align-items: flex-end; }
.msg-row.received .msg-content-wrapper { align-items: flex-start; }

/* Bubble base */
.msg-bubble {
  padding: 10px 15px;
  border-radius: 20px;
  font-size: 0.875rem;
  line-height: 1.55;
  word-wrap: break-word;
  overflow-wrap: break-word;
  position: relative;
  max-width: 100%;
}

/* SENT: Premium gold gradient + glow */
.msg-row.sent .msg-bubble {
  background: linear-gradient(135deg, #f0c040 0%, #e8a800 50%, #d4950f 100%);
  color: #0a0a00;
  font-weight: 500;
  border-bottom-right-radius: 5px;
  box-shadow: 0 2px 12px rgba(240,192,64,0.25), inset 0 1px 0 rgba(255,255,255,0.2);
}
/* First in group: full rounded */
.msg-row.sent.group-first .msg-bubble { border-bottom-right-radius: 20px; border-top-right-radius: 20px; }
/* Middle in group */
.msg-row.sent.group-mid .msg-bubble { border-bottom-right-radius: 5px; border-top-right-radius: 5px; }

/* RECEIVED: Glassmorphism frosted bubble */
.msg-row.received .msg-bubble {
  background: rgba(255,255,255,0.06);
  color: var(--text1);
  border-bottom-left-radius: 5px;
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.msg-row.received.group-first .msg-bubble { border-bottom-left-radius: 20px; border-top-left-radius: 20px; }
.msg-row.received.group-mid .msg-bubble { border-bottom-left-radius: 5px; border-top-left-radius: 5px; }

/* Hover glow on bubble */
.msg-bubble:hover { filter: brightness(1.06); cursor: default; }

/* Message Status (click to reveal) */
.msg-status-text {
  font-size: 10.5px;
  color: var(--text3);
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 0;
  text-align: right;
  padding: 0 4px;
  user-select: none;
  pointer-events: none;
  font-weight: 500;
}
.msg-row.received .msg-status-text { text-align: left; }
.msg-row.show-status .msg-status-text {
  opacity: 0.75;
  max-height: 24px;
  margin-top: 3px;
}

/* ── REACTIONS & HOVER ACTIONS ── */
.msg-bubble-row {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}
.msg-row.sent .msg-bubble-row { flex-direction: row-reverse; }

.msg-actions-bar {
  position: absolute;
  top: -34px;
  background: rgba(18, 18, 22, 0.96);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 99px;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 20;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s, visibility 0.18s, transform 0.18s;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.msg-row.sent .msg-actions-bar { right: 0; transform: translateY(5px); }
.msg-row.received .msg-actions-bar { left: 0; transform: translateY(5px); }
.msg-row:hover .msg-actions-bar {
  opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0);
}

.quick-emojis { display: flex; align-items: center; gap: 2px; }
.quick-emoji-btn {
  background: transparent; border: none;
  font-size: 1.05rem; padding: 3px 4px;
  cursor: pointer; transition: transform 0.15s;
  user-select: none; border-radius: 6px;
}
.quick-emoji-btn:hover { transform: scale(1.35); background: rgba(255,255,255,0.06); }

.actions-separator { width: 1px; height: 14px; background: rgba(255,255,255,0.12); margin: 0 3px; }

.action-btn-wrap { position: relative; }
.action-bar-btn {
  background: transparent; border: none;
  color: rgba(255,255,255,0.6);
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s; font-size: 0.8rem; padding: 0;
}
.action-bar-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.action-bar-btn.emoji-trigger { background: rgba(255,255,255,0.06); border-radius: 6px; color: #fff; }
.action-bar-btn.emoji-trigger:hover { background: rgba(255,255,255,0.12); }

.action-tooltip {
  position: absolute; bottom: 100%; left: 50%;
  transform: translate(-50%, 4px);
  background: #18181b; color: #fff;
  padding: 3px 8px; border-radius: 4px;
  font-size: 0.65rem; font-weight: 600;
  white-space: nowrap; pointer-events: none;
  opacity: 0; visibility: hidden;
  transition: all 0.15s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.07); z-index: 100;
}
.action-tooltip::after {
  content: ''; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%); border-width: 3px; border-style: solid;
  border-color: #18181b transparent transparent transparent;
}
.action-btn-wrap:hover .action-tooltip { opacity: 1; visibility: visible; transform: translate(-50%, -6px); }

/* More menu */
.msg-more-menu {
  position: absolute; bottom: calc(100% + 10px);
  background: rgba(18,18,22,0.98);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px; padding: 5px;
  display: flex; flex-direction: column;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5); z-index: 50;
  min-width: 140px;
  animation: popIn 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.msg-row.sent .msg-more-menu { right: 0; }
.msg-row.received .msg-more-menu { left: 0; }
.msg-more-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 12px; font-size: 0.8rem;
  color: rgba(255,255,255,0.8); cursor: pointer;
  border-radius: 7px;
  transition: background 0.15s, color 0.15s;
}
.msg-more-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.msg-more-item .text-danger { color: #ef4444; }
.msg-more-item:hover .text-danger { color: #f87171; }

/* Reaction picker */
.msg-reaction-picker {
  position: absolute; bottom: calc(100% + 10px);
  background: rgba(18,18,22,0.96);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 30px; padding: 7px 12px;
  display: flex; gap: 7px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5); z-index: 50;
  animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  white-space: nowrap; backdrop-filter: blur(16px);
}
.msg-row.sent .msg-reaction-picker { right: 0; }
.msg-row.received .msg-reaction-picker { left: 0; }

@keyframes popIn {
  from { opacity: 0; transform: scale(0.65) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.reaction-emoji {
  cursor: pointer; font-size: 1.3rem;
  transition: transform 0.15s; user-select: none;
  padding: 2px; border-radius: 8px;
}
.reaction-emoji:hover { transform: scale(1.4); background: rgba(255,255,255,0.07); }

.msg-reactions-list {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px;
}
.msg-row.sent .msg-reactions-list { justify-content: flex-end; }
.msg-row.received .msg-reactions-list { justify-content: flex-start; }
.reaction-badge {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px; padding: 2px 7px;
  font-size: 0.75rem;
  display: inline-flex; align-items: center; gap: 3px;
  cursor: pointer; user-select: none;
  transition: all 0.2s; backdrop-filter: blur(6px);
}
.reaction-badge:hover { background: rgba(240,192,64,0.1); border-color: var(--accent); }
.reaction-badge.reacted-by-me { background: rgba(240,192,64,0.15); border-color: var(--accent); }

/* Typing Indicator */
.typing-indicator-bubble {
  display: flex; align-items: center; gap: 5px;
  padding: 12px 16px; border-radius: 20px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.09);
  width: fit-content;
  margin-left: 38px; margin-bottom: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  animation: msgSlideIn 0.22s ease;
  backdrop-filter: blur(8px);
}
.typing-dot {
  width: 7px; height: 7px;
  background: var(--text3);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.3); opacity: 0.4; }
  40% { transform: scale(1.15); opacity: 1; }
}

/* Shared Cards */
.shared-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px; overflow: hidden;
  max-width: 280px; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  backdrop-filter: blur(8px);
}
.shared-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.35); }
.shared-card-header { display: flex; align-items: center; gap: 10px; padding: 11px 13px; }
.shared-card-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.shared-card-icon.timetable { background: rgba(74,144,226,0.15); color: var(--blue); }
.shared-card-icon.file { background: rgba(240,192,64,0.15); color: var(--accent); }
.shared-card-icon.plan { background: rgba(39,174,96,0.15); color: var(--green); }
.shared-card-title {
  font-size: 0.83rem; font-weight: 600; color: var(--text1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 185px;
}
.shared-card-meta { font-size: 0.72rem; color: var(--text3); margin-top: 1px; }
.shared-card-footer {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 9px 13px;
  display: flex; align-items: center; justify-content: space-between;
}
.shared-card-type-tag { font-size: 0.67rem; color: var(--text3); text-transform: uppercase; letter-spacing: 0.6px; }
.shared-card-action {
  font-size: 0.76rem; font-weight: 700; color: var(--accent);
  background: none; border: none; cursor: pointer; padding: 0;
}
.shared-card-action:hover { text-decoration: underline; }

/* ── SHARE BAR ── */
.chat-share-bar {
  background: rgba(15,15,18,0.95);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 12px 16px;
  max-height: 220px; overflow-y: auto;
  position: relative; backdrop-filter: blur(12px);
}
.share-bar-title {
  font-size: 0.72rem; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.6px;
  margin-bottom: 10px; font-weight: 700;
}
.share-bar-items { display: flex; flex-direction: column; gap: 6px; }
.share-bar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 12px; cursor: pointer;
  border: 1px solid rgba(255,255,255,0.07);
  transition: all 0.15s;
}
.share-bar-item:hover { background: rgba(240,192,64,0.07); border-color: rgba(240,192,64,0.25); }
.share-bar-item-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; flex-shrink: 0;
}
.share-bar-item-name { font-size: 0.83rem; font-weight: 500; color: var(--text1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.share-bar-item-meta { font-size: 0.72rem; color: var(--text3); }
.share-bar-close {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none; color: var(--text3); font-size: 0.9rem;
  cursor: pointer; padding: 4px;
}
.share-bar-close:hover { color: var(--text1); }

/* ── INPUT AREA ── */
.chat-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: rgba(12,12,15,0.97);
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  backdrop-filter: blur(20px);
}
.chat-attach-btns { display: flex; gap: 4px; }
.chat-attach-btn {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 50%;
  color: var(--text3);
  font-size: 0.83rem;
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.chat-attach-btn:hover {
  background: rgba(240,192,64,0.1);
  border-color: rgba(240,192,64,0.3);
  color: var(--accent);
  box-shadow: 0 0 10px rgba(240,192,64,0.1);
}

.chat-input-wrap { flex: 1; position: relative; }
.chat-input-wrap input {
  width: 100%;
  padding: 11px 18px;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  color: var(--text1);
  font-size: 0.88rem;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
  line-height: 1.4;
}
.chat-input-wrap input::placeholder { color: var(--text3); }
.chat-input-wrap input:focus {
  border-color: var(--accent);
  background: rgba(240,192,64,0.04);
  box-shadow: 0 0 0 3px rgba(240,192,64,0.1), 0 0 20px rgba(240,192,64,0.06);
  outline: none;
}

/* Morphing Send/Mic Button */
.chat-send-btn {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--accent), #d4950f);
  border: none; border-radius: 50%;
  color: #000; font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(240,192,64,0.35);
}
.chat-send-btn:hover {
  transform: scale(1.12);
  box-shadow: 0 6px 20px rgba(240,192,64,0.55);
}
.chat-send-btn:active { transform: scale(0.93); }
.chat-send-btn .send-icon, .chat-send-btn .mic-icon { transition: all 0.2s; }

/* Empty / loading */
.chat-msgs-loading {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; color: var(--text3); font-size: 0.85rem;
  padding: 40px; flex: 1;
}

/* Call Animations */
@keyframes callPulse {
  0% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.18); opacity: 0.15; }
  100% { transform: scale(1.35); opacity: 0; }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.call-control-btn:hover { transform: scale(1.1); background: rgba(255,255,255,0.18) !important; }
.call-control-btn.hangup:hover { transform: scale(1.1); background: #dc2626 !important; box-shadow: 0 6px 24px rgba(239,68,68,0.65) !important; }

@keyframes statusFadeIn {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 0.75; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 700px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-window { display: none; }
  .chat-window.mobile-open { display: flex; position: fixed; inset: 60px 0 0 0; z-index: 200; }
  .chat-back-btn { display: flex; }
}

/* Alarm Warning Banner */
.alarm-warning-banner {
  background: rgba(231, 76, 60, 0.12);
  border: 1px solid rgba(231, 76, 60, 0.4);
  color: #f5b0b0;
  border-radius: 12px;
  padding: 12px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  font-family: 'DM Sans', sans-serif;
  line-height: 1.4;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.alarm-warning-banner i {
  color: #e74c3c;
  font-size: 1.2rem;
  flex-shrink: 0;
}