@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap');

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

body {
  font-family: 'Inter', sans-serif;
  background-color: #f4f4f4;
  color: #222;
  display: flex;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

/* === Sidebar === */
.sidebar {
  position: fixed;
  top: 0px;
  left: -240px;
  width: 240px;
  height: 100%;
  background-color: #fff;
  border-right: 1px solid #ddd;
  padding: 15px;
  /*overflow-y: auto;*/
  overflow: hidden;
  transition: left 0.3s;
  z-index: 1000;
}

.sidebar.active {
  left: 0;
}

.sidebar h2 {
  font-size: 1.3rem;
  margin-bottom: 20px;
}

.sidebar ul {
  list-style: none;
}

.sidebar ul li {
  margin: 15px 0;
}

.sidebar ul li a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #333;
  padding: 10px;
  border-radius: 6px;
  transition: background 0.2s;
}

.sidebar ul li a:hover {
  background-color: #eee;
}

    .menu-item {
      padding: 0.5rem;
      cursor: pointer;
      display: flex;
      align-items: center;
      border-top: 1px solid #ddd;
      transition: background 0.2s;
    }

    .menu-item:hover {
      background: var(--hover);
    }

    .menu-item i {
      margin-right: 10px;
      min-width: 20px;
      text-align: center;
    }

    .submenu {
      background: var(--hover);
      max-height: 0;
      overflow: hidden;
      transition: max-height 0.3s ease;
      display: flex;
      flex-direction: column;
    }

    .submenu a {
      padding: 0.5rem 2.5rem;
      text-decoration: none;
      color: inherit;
    }

    .menu-item.active + .submenu {
      max-height: 500px;
    }

    .content {
      margin-left: 250px;
      padding: 2rem;
      transition: margin-left 0.3s;
      flex: 1;
    }

/* === Topbar === */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  height: 60px;
  width: 100%;
  background-color: #fff;
  border-bottom: 1px solid #ddd;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 999;
}

.toggle-btn {
  font-size: 1.5rem;
  cursor: pointer;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-info img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

/* === Main content === */
.main-content {
  margin-left: 0;
  padding: 0px 5px 0px 0px;
  width: 100%;
  transition: margin-left 0.3s;
}

.main {
  margin-left: 0;
  /*arriba - derecha - abajo - izquierda*/
  padding: 70px 10px 10px 10px;
  width: 100%;
  transition: margin-left 0.3s;
}

.sidebar.active ~ .main {
  margin-left: 240px;
}

h1, h2 {
  margin-bottom: 16px;
}

/* === Table === */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

th, td {
  padding: 12px;
  border: 1px solid #ccc;
  text-align: left;
}

th {
  background-color: #f0f0f0;
  font-weight: 600;
}

/* === Form and Inputs === */
input, select, textarea {
  width: 100%;
  padding: 5px;
  margin-top: 5px;
  margin-bottom: 5px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fff;  
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0,123,255,0.2);
}

/* === Buttons Normal === */
.btn {
  padding: 7px;
  margin-top: 5px;
  margin-bottom: 5px;

  background-color: #007bff;
  color: white;
  border: none;
  font-size: 1em;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s;
}

.btn:hover {
  background-color: #0056b3;
}

/* === Buttons Special=== */
.btn-icono {
  display: inline-flex;       /* Necesario si usas íconos o contenido adicional */
  align-items: center;        /* Centrado vertical */
  justify-content: center;    /* Centrado horizontal */
  gap: 6px;
  /*padding: 10px 18px;*/

  padding: 7px;
  margin-top: 5px;
  margin-bottom: 5px;

  border: none;
  background-color: #007bff;
  color: white;
  font-size: 1em;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-icono i {
  font-size: 18px;
}

.btn-icono:hover {
  background-color: #0056b3;
}

/* === Cards === */
.card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  margin-bottom: 20px;
}

.card-title {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  margin-bottom: 20px;
  background-color:#d6eafa; 
  font-size:1.5em
}

/* === Cards 2 === */
.card-2 {
  background: white;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  margin-bottom: 10px;
}

.card-2-title {
  background: white;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  margin-bottom: 10px;
  background-color:#d6eafa; 
  font-size:1.5em
}

/* === Responsive === */
@media (max-width: 768px) {
  .sidebar {
    width: 200px;
    left: -200px;
  }

  .sidebar.active {
    left: 0;
  }

  .sidebar.active ~ .main {
    margin-left: 200px;
  }
}

.centrado {
  display: flex;
  justify-content: center; /* Centra horizontalmente */
  align-items: center;     /* Centra verticalmente */
  border: 1px solid #ccc;
}

/* === Dark Mode === */
body.dark {
  background-color: #1e1e1e;
  color: #e0e0e0;
}

body.dark .sidebar {
  background-color: #2a2a2a;
  border-right-color: #444;
}

body.dark .sidebar ul li a {
  color: #e0e0e0;
}

body.dark .sidebar ul li a:hover {
  background-color: #3a3a3a;
}

body.dark .topbar {
  background-color: #2a2a2a;
  border-bottom-color: #444;
}

body.dark table th {
  background-color: #333;
  color: #fff;
}

body.dark table td {
  background-color: #2a2a2a;
  color: #ddd;
}

body.dark .card {
  background-color: #2a2a2a;
}

body.dark .card-title {
  background-color: #2a2a2a;
}

body.dark .card-2 {
  background-color: #2a2a2a;
}

body.dark .card-2-title {
  background-color: #2a2a2a;
}

body.dark input,
body.dark select,
body.dark textarea {
  background-color: #333;
  border-color: #555;
  color: #fff;
}
