:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --text-primary: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --primary-accent: #6366f1;
  --primary-hover: #4f46e5;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
}

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.brand-badge {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  border-radius: 12px;
  font-size: 1.2rem;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-item:hover, .nav-item.active {
  background-color: rgba(99, 102, 241, 0.15);
  color: #818cf8;
}

.system-status {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.status-indicator {
  width: 10px;
  height: 10px;
  background-color: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
}

.system-status small {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 2.5rem;
  overflow-y: auto;
}

.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.text-muted {
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.btn {
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-primary {
  background-color: var(--primary-accent);
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  font-size: 2rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.75rem;
  border-radius: 10px;
}

.stat-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Section Containers */
.section-container {
  margin-bottom: 2.5rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.link-action {
  color: #818cf8;
  text-decoration: none;
  font-size: 0.9rem;
}

.channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.channel-badge {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  position: relative;
}

.channel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.instagram .channel-dot { background-color: #e1306c; box-shadow: 0 0 6px #e1306c; }
.youtube .channel-dot { background-color: #ff0000; box-shadow: 0 0 6px #ff0000; }
.tiktok .channel-dot { background-color: #00f2fe; box-shadow: 0 0 6px #00f2fe; }
.facebook .channel-dot { background-color: #1877f2; box-shadow: 0 0 6px #1877f2; }

/* Table */
.table-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background-color: rgba(255, 255, 255, 0.02);
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-warning {
  background-color: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.badge-success {
  background-color: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.badge-neutral {
  background-color: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
}

.tag-channel {
  background-color: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

/* ========================================================
   Fase 1: Estilos de Autenticación y Módulos Profe Luisa
   Paleta: Azul Marino #0a192f y Dorado #f59e0b
   ======================================================== */

.badge-gold {
  background-color: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.greeting-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-logout {
  background-color: transparent;
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  text-decoration: none;
  font-size: 0.875rem;
}

.btn-logout:hover {
  background-color: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
}

.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0a192f;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sidebar-footer {
  margin-top: auto;
  margin-bottom: 1rem;
}

.btn-logout-sidebar {
  display: block;
  text-align: center;
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
  text-decoration: none;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-logout-sidebar:hover {
  background-color: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
}

/* Tarjetas de Módulos del Sistema */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.module-card {
  background: linear-gradient(145deg, #112240, #1e293b);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.module-card:hover {
  transform: translateY(-3px);
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.module-icon {
  font-size: 1.75rem;
}

.module-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f8fafc;
}

.module-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.module-footer {
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.module-meta {
  font-size: 0.75rem;
  color: #f59e0b;
  font-weight: 600;
}

/* ========================================================
   Pantalla de Login
   ======================================================== */
.login-body {
  background: radial-gradient(circle at top, #112240 0%, #0a192f 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-container {
  width: 100%;
  max-width: 440px;
}

.login-card {
  background: rgba(17, 34, 64, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(245, 158, 11, 0.05);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-brand-badge {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0a192f;
  font-size: 1.75rem;
  font-weight: 900;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.35);
  margin-bottom: 1rem;
}

.login-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 0.25rem;
}

.login-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.login-badge-secure {
  display: inline-block;
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
}

.login-alert {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #cbd5e1;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1rem;
  font-size: 1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.form-input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.75rem;
  background: #0a192f;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: #f8fafc;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.btn-gold {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0a192f;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.9rem 1.5rem;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-gold:hover {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
}

.btn-block {
  width: 100%;
}

.login-footer {
  margin-top: 2rem;
  text-align: center;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.login-footer-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

