/* ==========================================================================
   LexAdmin Bolívar - Layout & Shell
   ========================================================================== */

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-obsidian-root);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(245, 158, 11, 0.05) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.04) 0%, transparent 50%);
  background-attachment: fixed;
}

/* --------------------------------------------------------------------------
   App Container & Sidebar
   -------------------------------------------------------------------------- */
#app-container {
  display: flex;
  width: 100vw;
  min-height: 100vh;
}

/* Sidebar Fija */
.sidebar {
  width: 280px;
  background: var(--bg-obsidian-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 50;
}

.sidebar-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--prestige-gold);
  background: var(--prestige-gold-dim);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(245, 158, 11, 0.25);
  margin-bottom: 10px;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--text-sharp);
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-title span.accent {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.74rem;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  margin-top: 4px;
}

/* Perfil del Socio Senior (Culto al Ego) */
.senior-partner-card {
  margin: 16px 14px;
  padding: 12px 14px;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.45), rgba(15, 23, 42, 0.7));
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.senior-partner-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--gold-gradient);
}

.partner-role-tag {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--prestige-gold);
  font-weight: 700;
}

.partner-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-sharp);
  margin: 2px 0 2px;
}

.partner-jurisdiction {
  font-size: 0.7rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.partner-jurisdiction svg {
  color: var(--cunning-emerald);
}

/* Navegación Sidebar */
.sidebar-nav {
  flex: 1;
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  padding: 10px 10px 4px;
  font-weight: 700;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  position: relative;
  cursor: pointer;
}

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

.nav-link.active {
  color: var(--text-sharp);
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.22), rgba(37, 99, 235, 0.05));
  border-left: 3px solid var(--intellect-blue);
  box-shadow: inset 0 0 12px rgba(37, 99, 235, 0.1);
  font-weight: 600;
}

.nav-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.nav-link.active svg {
  color: var(--intellect-blue-light);
  filter: drop-shadow(0 0 6px var(--intellect-blue));
}

.nav-badge {
  margin-left: auto;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-weight: 700;
}

.nav-badge.danger {
  background: var(--term-critical-dim);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.nav-badge.gold {
  background: var(--prestige-gold-dim);
  color: var(--text-gold);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Footer Sidebar */
.sidebar-footer {
  padding: 16px 14px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(8, 12, 20, 0.6);
}

.demo-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cunning-emerald);
  box-shadow: 0 0 8px var(--cunning-emerald);
  display: inline-block;
}

/* --------------------------------------------------------------------------
   Main Content Layout
   -------------------------------------------------------------------------- */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
}

/* Topbar Superior */
.topbar {
  height: 70px;
  background: rgba(12, 16, 26, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
  max-width: 580px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  width: 100%;
  transition: var(--transition-fast);
}

.search-box:focus-within {
  border-color: var(--intellect-blue);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
  background: rgba(15, 23, 42, 0.95);
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-sharp);
  font-size: 0.85rem;
  width: 100%;
  font-family: var(--font-sans);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box svg {
  color: var(--text-muted);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

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

.system-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  border-right: 1px solid var(--border-subtle);
  padding-right: 16px;
}

.clock-time {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-sharp);
  letter-spacing: 0.05em;
}

.clock-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Contenido Principal de Vistas */
.content-area {
  padding: 32px;
  flex: 1;
  max-width: 1540px;
  margin: 0 auto;
  width: 100%;
}

.view-container {
  display: none;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

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