/* ===============================
   VARIABLES GLOBALES
================================= */
:root {
  --sidebar-width: 240px;
  --sidebar-collapsed: 60px;
}

/* ===============================
   RESETEO BÁSICO Y ESTRUCTURA GLOBAL
================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  overflow: hidden; /* importante para layout fijo */
}

/* ===============================
   PRELOADER (pantalla de carga)
================================= */
#preloader {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: white;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.spinner {
  border: 6px solid #f3f3f3;
  border-top: 6px solid #4caf50;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===============================
   LAYOUT WRAPPER
================================= */
.wrapper {
  overflow: hidden;
}

/* ===============================
   SIDEBAR
================================= */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1000;
  width: var(--sidebar-width);
  background: #2E7D32;
  color: white;
  transition: width 0.3s ease;
  display: flex;
  flex-direction: column;
}

#sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

/* Marca y navegación del sidebar */
#sidebar .brand {
  font-size: 1.5rem;
  font-weight: bold;
  padding: 1rem;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.2);
}

#sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: right;
  flex-grow: 1;
}

#sidebar ul li {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
}

#sidebar ul li i {
  margin-right: 1rem;
  width: 20px;
}

#sidebar ul li:hover {
  background: #43a047;
  transform: scale(1.03);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

#sidebar ul li:active {
  background: #1B5E20;
  transform: scale(0.98);
}

#sidebar.collapsed ul li span {
  display: none;
}

/* ===============================
   TOGGLE BUTTON
================================= */
#toggle-btn {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1100;
  background: #c8e6c9;
  border: none;
  border-radius: 6px;
  color: #2e7d32;
  font-size: 1.5rem;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

#toggle-btn:hover {
  background: #a5d6a7;
}

/* ===============================
   NAVBAR (FIJA)
================================= */
.navbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  z-index: 999;
  height: 56px;
}

/* ===============================
   CONTENIDO PRINCIPAL (MAIN)
================================= */
.main {
  margin-left: var(--sidebar-width);
  margin-top: 56px;
  height: calc(100vh - 56px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s ease;
}

#sidebar.collapsed + .main {
  margin-left: var(--sidebar-collapsed);
}

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

/* ===============================
   FOOTER
================================= */
footer {
  background: #e0e0e0;
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
  color: #555;
}

/* ===============================
   SECCIONES / PANELES
================================= */
.section {
  display: none;
}

.section.active {
  display: block;
}

/* ===============================
   NOTIFICACIONES (dropdowns)
================================= */
.notification-dropdown {
  min-width: 250px;
}

.notification-item {
  padding: 10px 15px;
  border-bottom: 1px solid #eee;
}

.notification-item:last-child {
  border-bottom: none;
}

/* ===============================
   LOGIN
================================= */
body.login-page {
  background: linear-gradient(135deg, #4caf50 0%, #81c784 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-container {
  background: rgba(255, 255, 255, 0.95);
  padding: 30px 35px;
  border-radius: 12px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  text-align: center;
}

.login-container h2 {
  margin-bottom: 24px;
  color: #2e7d32;
  font-weight: 700;
  font-size: 1.8rem;
}

form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

input[type="password"] {
  padding: 14px 18px;
  font-size: 1rem;
  border: 2px solid #a5d6a7;
  border-radius: 8px;
  transition: border-color 0.3s ease;
}

input[type="password"]:focus {
  outline: none;
  border-color: #388e3c;
  box-shadow: 0 0 8px #66bb6a;
}

button {
  padding: 14px 18px;
  font-size: 1.1rem;
  font-weight: 600;
  color: white;
  background: #388e3c;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
  box-shadow: 0 6px 12px rgba(56, 142, 60, 0.5);
}

button:hover,
button:focus {
  background: #2e7d32;
  box-shadow: 0 8px 16px rgba(46, 125, 50, 0.7);
  outline: none;
}

.error {
  color: #d32f2f;
  font-weight: 600;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

/* ===============================
   RESPONSIVE LOGIN
================================= */
@media (max-width: 480px) {
  .login-container {
    padding: 25px 20px;
    max-width: 320px;
  }

  input[type="password"],
  button {
    font-size: 1rem;
    padding: 12px 14px;
  }

  .login-container h2 {
    font-size: 1.5rem;
  }
}

/* ===============================
   CARD SLOT (MARKETING)
================================= */
.card-slot-link {
  text-decoration: none;
  color: inherit;
  display: inline-block;
  max-width: 280px;
  margin: 1rem 1rem 2rem;
}

.card-slot {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.card-slot:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.18);
}

.card-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

.card-content {
  padding: 1rem;
}

.card-title {
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.card-text {
  font-size: 0.95rem;
  color: #555;
  margin: 0;
}

/* ===============================
   MARKETING - GRID ARCHIVOS
================================= */



