:root {
  --bg-base:        #F8F7FF;
  --bg-card:        #FFFFFF;
  --bg-soft:        #F3F0FA;
  --border:         #E4DFF2;
  --border-subtle:  #EEE9F8;
  --purple-400:     #8B5CF6;
  --purple-500:     #7C3AED;
  --grad-start:     #40c9ff;
  --grad-mid:       #7228cd;
  --grad-end:       #e81cff;
  --gradient:       linear-gradient(135deg, #40c9ff 0%, #7228cd 52%, #e81cff 100%);
  --text-primary:   #1A1035;
  --text-secondary: #6B5F8A;
  --text-muted:     #9E94B8;
  --font-ui:        'Outfit', sans-serif;
  --font-label:     'Lexend Exa', sans-serif;
  --header-h:       56px;
  --max-w:          900px;
  --radius:         12px;
  --radius-lg:      16px;
  --radius-pill:    999px;
}

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

html, body {
  height: 100%;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#root { min-height: 100vh; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(114,40,205,0.2); border-radius: 4px; }

/* ── HEADER — stays dark for contrast ── */
.tps-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(16, 8, 32, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
}

.tps-logo {
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  user-select: none;
}

/* Nav pills live inside the dark header — keep dark styles */
.nav-pills {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  max-width: calc(100vw - 140px);
}
.nav-pills::-webkit-scrollbar { display: none; }

.nav-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.45);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-pill:hover { color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.06); }
.nav-pill.active {
  background: rgba(124,58,237,0.22);
  color: #c4b5fd;
}

.avatar-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
}
.avatar-pill:hover { background: rgba(255,255,255,0.1); }

.avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.avatar-name { font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.85); }

/* ── MAIN CONTENT — light ── */
.tps-main { padding-top: var(--header-h); min-height: 100vh; }
.tps-container { max-width: var(--max-w); margin: 0 auto; padding: 24px 16px; }

/* ── CARDS ── */
.tps-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 1px 3px rgba(114,40,205,0.06), 0 1px 2px rgba(0,0,0,0.04);
  transition: all 0.2s ease;
}
.tps-card:hover {
  border-color: rgba(114,40,205,0.25);
  box-shadow: 0 4px 14px rgba(114,40,205,0.1);
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  border: none;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--gradient); color: white; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(114,40,205,0.3); }
.btn-secondary { background: #FFFFFF; border: 1px solid var(--border); color: var(--text-primary); }
.btn-secondary:hover { background: var(--bg-soft); border-color: rgba(114,40,205,0.2); }

/* ── INPUTS ── */
.tps-input {
  background: #FFFFFF;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 15px;
  outline: none;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.tps-input:focus {
  border-color: rgba(114,40,205,0.5);
  box-shadow: 0 0 0 3px rgba(114,40,205,0.08);
}
.tps-input::placeholder { color: var(--text-muted); }

/* ── ANIMATIONS ── */
@keyframes tps-fadein-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fadein-up { animation: tps-fadein-up 0.25s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── LOADING ── */
.tps-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 16px;
  background: var(--bg-base);
}
.tps-loading-logo {
  font-family: var(--font-label);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.tps-spinner {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(114,40,205,0.15);
  border-top-color: var(--purple-400);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── SCREEN PLACEHOLDER ── */
.screen-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--header-h));
  gap: 12px;
}
.screen-placeholder h2 { font-size: 24px; font-weight: 600; color: var(--text-primary); }
.screen-placeholder p  { font-size: 15px; color: var(--text-secondary); }

/* ── SUB-NAV (light surface) ── */
.sub-nav {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-wrap: nowrap !important;
  scrollbar-width: none;
}
.sub-nav::-webkit-scrollbar { display: none; }

/* ── MOBILE ── */
@media (max-width: 768px) {
  .tps-container { padding: 14px !important; }
  .tps-card { padding: 14px !important; }
  .tps-input { font-size: 16px !important; }
  .tps-main { padding-bottom: 60px !important; }
  .nav-pill { font-size: 10px !important; padding: 5px 9px !important; }
  .mobile-tab-bar { display: flex !important; }
}
@media (min-width: 769px) {
  .mobile-tab-bar { display: none !important; }
}

/* ── MOBILE TAB BAR ── */
.mobile-tab-bar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: rgba(16,8,32,0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,0.08);
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  padding: 0 4px;
}

/* ══════════════════════════════════════════════
   TPS 3.0 · NUEVO LAYOUT DE NAVEGACIÓN
   Sidebar (desktop) + Pill nav flotante (mobile)
   ══════════════════════════════════════════════ */

/* ── ALMA ORB ── */
.tps-alma-orb {
  border-radius: 50%;
  background: linear-gradient(135deg, #40c9ff 0%, #7228cd 52%, #e81cff 100%);
  display: flex; align-items: center; justify-content: center;
  animation: tps-orb 4s ease-in-out infinite;
  flex-shrink: 0;
  box-shadow: 0 6px 20px rgba(232,28,255,0.35);
}
@keyframes tps-orb {
  0%,100% { transform: scale(1); filter: hue-rotate(0deg); }
  50%      { transform: scale(1.06); filter: hue-rotate(20deg); }
}

/* ── SIDEBAR (desktop) ── */
.tps-sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: 260px;
  background: #ffffff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  z-index: 100;
}
.tps-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  cursor: pointer;
  padding: 0 6px;
}
.tps-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.tps-sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  width: 100%;
}
.tps-sidebar-item:hover { background: var(--bg-soft); }
.tps-sidebar-item.active {
  background: linear-gradient(135deg, #40c9ff 0%, #7228cd 52%, #e81cff 100%);
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(114,40,205,0.28);
}
.tps-sidebar-item .nav-letter {
  font-size: 16px;
  font-weight: 800;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
}
.tps-sidebar-alma {
  margin-top: 16px;
  padding: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── TOPBAR (desktop) ── */
.tps-topbar {
  position: fixed;
  top: 0; right: 0;
  left: 260px;
  height: 64px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 28px;
  z-index: 90;
}
.tps-topbar-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-soft);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 9px 18px;
  transition: border-color 0.2s;
}
.tps-topbar-search:focus-within {
  border-color: rgba(114,40,205,0.4);
  background: #fff;
}
.tps-topbar-search input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text-primary);
  background: transparent;
}
.tps-topbar-search input::placeholder { color: var(--text-muted); }

/* ── MOBILE TOPBAR ── */
.tps-mobile-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
}

/* ── FLOATING PILL NAV (mobile) ── */
.tps-pill-nav {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 420px;
  background: rgba(255,255,255,0.97);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 8px 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  box-shadow: 0 8px 32px rgba(114,40,205,0.18);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.tps-pill-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 12px;
  transition: all 0.15s;
}
.tps-pill-nav-orb-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: -28px;
  cursor: pointer;
}
.tps-pill-nav-orb {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #40c9ff 0%, #7228cd 52%, #e81cff 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(232,28,255,0.5);
  border: 3px solid #fff;
  animation: tps-orb 4s ease-in-out infinite;
  transition: transform 0.15s;
}
.tps-pill-nav-orb:active { transform: scale(0.95); }
.tps-pill-nav-orb-label {
  font-size: 9px;
  font-weight: 600;
  font-family: var(--font-label);
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, #7228cd, #e81cff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-top: 2px;
}

/* ── LAYOUT RESPONSIVE ── */
@media (min-width: 769px) {
  .tps-header       { display: none !important; }
  .mobile-tab-bar   { display: none !important; }
  .tps-mobile-topbar{ display: none !important; }
  .tps-pill-nav     { display: none !important; }
  .tps-main {
    padding-top: 64px !important;
    margin-left: 260px !important;
    padding-bottom: 0 !important;
  }
}
@media (max-width: 768px) {
  .tps-sidebar  { display: none !important; }
  .tps-topbar   { display: none !important; }
  .tps-main {
    padding-top: 56px !important;
    padding-bottom: 96px !important;
    margin-left: 0 !important;
  }
}
