/* ── Sistema de Diseño Global SaaS (Glassmorphism & Clean UI) ── */
:root {
  --primary: #00E676;
  --primary-hover: #00C853;
  --bg-color: #f4f7fa;
  --sidebar-bg: #111827;
  --sidebar-hover: #1f2937;
  --sidebar-text: #9ca3af;
  --sidebar-text-active: #ffffff;
  --card-bg: #ffffff;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --radius: 12px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
}

/* ── Animaciones ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade {
  animation: fadeIn 0.4s ease-out forwards;
}

/* ── Contenedor App (Layout Sidebar) ── */
.app-container {
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-header h2 {
  color: white;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.sidebar-nav {
  padding: 20px 12px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-weight: 500;
  border-radius: 8px;
  margin-bottom: 4px;
  transition: all 0.2s ease;
}

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

.nav-item.active {
  background-color: rgba(0, 230, 118, 0.1);
  color: var(--primary);
}

.nav-item.logout {
  margin-top: auto;
  color: #ef4444;
}
.nav-item.logout:hover {
  background-color: rgba(239, 68, 68, 0.1);
}

/* ── Área Principal ── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-color);
  overflow-y: auto;
}

.topbar {
  background: var(--card-bg);
  height: 70px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar h1 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-main);
}

.page-content {
  padding: 32px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* ── Tarjetas SaaS ── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255,255,255,0.8);
  margin-bottom: 24px;
}

.card h2 {
  margin-bottom: 8px;
  font-size: 18px;
}

.card .desc {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ── Botones y Formularios ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #111;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}
.btn:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary { background: white; border: 1px solid var(--border); color: var(--text-main); }
.btn-secondary:hover { background: #f9fafb; border-color: #d1d5db; }

.btn-fb { background: #1877f2; color: white; }
.btn-fb:hover { background: #166fe5; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: var(--text-main); }

input[type="text"], input[type="email"], input[type="password"], textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  transition: all 0.2s;
  background: #f9fafb;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(0, 230, 118, 0.15);
}

/* ── Tablas Modernas ── */
.table-container {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}
table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  text-align: left;
}
th {
  background: #f9fafb;
  padding: 12px 16px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
td {
  padding: 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fcfcfd; }

/* ── Tags / Badges ── */
.badge {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge.green { background: #dcfce7; color: #166534; }
.badge.gray { background: #f3f4f6; color: #4b5563; }
.badge.blue { background: #dbeafe; color: #1e40af; }
