/* ========================================
   Patrimonium · Estilos globales
   ======================================== */

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

:root {
  --bg: #0a0a0f;
  --bg-2: #12121a;
  --bg-3: #1a1a24;
  --glass: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-border-hover: rgba(255, 255, 255, 0.12);
  --text: #fafafa;
  --text-2: #a1a1aa;
  --text-3: #71717a;
  --accent: #00d9a3;
  --accent-2: #06b6d4;
  --accent-glow: rgba(0, 217, 163, 0.15);
  --violet: #a78bfa;
  --danger: #f87171;
  --blur: saturate(180%) blur(20px);
}

html, body {
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  letter-spacing: -0.01em;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(at 0% 0%, rgba(0, 217, 163, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(167, 139, 250, 0.06) 0px, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ========================================
   Pantalla de login (NO autenticado)
   ======================================== */

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.login-screen.hidden {
  display: none;
}

.login-card {
  max-width: 440px;
  width: 100%;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 48px 40px;
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  text-align: center;
}

.login-card h1 {
  font-size: 48px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--text-2);
  font-size: 14px;
  margin-bottom: 32px;
  line-height: 1.5;
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(0, 217, 163, 0.1);
  border: 1px solid rgba(0, 217, 163, 0.3);
  border-radius: 100px;
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 32px;
  font-family: 'Geist Mono', 'Monaco', monospace;
}

.login-button {
  width: 100%;
  padding: 14px 24px;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: inherit;
  transition: all 0.2s;
}

.login-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.login-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.google-icon {
  width: 18px;
  height: 18px;
}

.status {
  margin-top: 24px;
  font-size: 11px;
  color: var(--text-3);
  font-family: 'Geist Mono', 'Monaco', monospace;
}

.status.error {
  color: var(--danger);
}

/* ========================================
   App principal (SÍ autenticado)
   ======================================== */

.app-screen {
  display: none;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.app-screen.visible {
  display: flex;
}

/* ========================================
   Sidebar
   ======================================== */

.sidebar {
  width: 260px;
  background: var(--bg-2);
  border-right: 1px solid var(--glass-border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  flex-shrink: 0;
}

.sidebar-logo {
  padding: 0 12px 24px;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 24px;
}

.sidebar-logo-text {
  font-size: 22px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  line-height: 1;
}

.sidebar-logo-tag {
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 6px;
  font-family: 'Geist Mono', 'Monaco', monospace;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 8px 12px;
  margin-top: 12px;
  font-weight: 500;
}

.nav-section-label:first-child {
  margin-top: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-2);
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  transition: all 0.2s;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  letter-spacing: -0.01em;
}

.nav-item:hover {
  background: var(--glass);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 500;
}

.nav-icon {
  width: 16px;
  height: 16px;
  opacity: 0.85;
  flex-shrink: 0;
}

/* ========================================
   User card en sidebar
   ======================================== */

.sidebar-user {
  border-top: 1px solid var(--glass-border);
  padding-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-email {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: 'Geist Mono', 'Monaco', monospace;
}

.sidebar-logout {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-2);
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.sidebar-logout:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* ========================================
   Main content
   ======================================== */

.main {
  flex: 1;
  padding: 40px 56px;
  overflow-y: auto;
  min-width: 0;
}

.view {
  display: none;
  animation: fadeIn 0.3s ease;
}

.view.active {
  display: block;
}

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

.view-header {
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--glass-border);
}

.view-title {
  font-size: 36px;
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 8px;
}

.view-title .em {
  font-style: italic;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.view-subtitle {
  color: var(--text-2);
  font-size: 14px;
  letter-spacing: 0;
}

/* ========================================
   Welcome card
   ======================================== */

.welcome-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 40px;
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.welcome-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--accent-glow), transparent 60%);
  pointer-events: none;
}

.welcome-greeting {
  font-size: 28px;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
  position: relative;
}

.welcome-greeting .em {
  font-style: italic;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-text {
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.6;
  max-width: 600px;
  position: relative;
}

/* ========================================
   Empty state (vistas en construcción)
   ======================================== */

.empty-state {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 64px 40px;
  backdrop-filter: var(--blur);
  text-align: center;
}

.empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  background: var(--accent-glow);
  border: 1px solid rgba(0, 217, 163, 0.2);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.empty-title {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.empty-description {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.6;
  max-width: 420px;
  margin: 0 auto;
}

.empty-tag {
  display: inline-block;
  margin-top: 20px;
  padding: 4px 12px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: 'Geist Mono', 'Monaco', monospace;
}

/* ========================================
   Mobile menu toggle
   ======================================== */

.menu-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 50;
  background: var(--bg-2);
  border: 1px solid var(--glass-border);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 900px) {
  .menu-toggle {
    display: flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    padding: 80px 24px 40px;
    width: 100%;
  }

  .view-title {
    font-size: 28px;
  }
}

/* ========================================
   Scrollbar
   ======================================== */

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-3);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-3);
}
