@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@300;400;500;700&display=swap');

* {
  margin: 0;
  padding: 0;
  font-family: 'Ubuntu', sans-serif;
  box-sizing: border-box;
}

:root {
  --color-primary: #02A5E2;
  --color-primary-dark: #007bbd;
  --white: #fff;
  --grey: #f5f5f5;
  --black1: #222;
  --black2: #999;
  --danger: #ed1a3b;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

.contenedor {
  position: relative;
  width: 100%;
}



/* ---------- Main / topbar ---------- */

.main {
  position: absolute;
  width: calc(100% - 250px);
  left: 250px;
  min-height: 100vh;
  background: var(--white);
  transition: 0.5s;
}

.main.active {
  width: calc(100% - 110px);
  left: 100px;
}

.topbar {
  width: 100%;
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
}

.toggle {
  position: relative;
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2.5em;
  cursor: pointer;
}

/* ---------- Filtros ---------- */

.barra-filtros {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.form-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: start;
}

.filter-input {
  width: 160px;
  border-radius: 40px;
  padding: 5px 20px;
  font-size: 14px;
  outline: none;
  border: 1px solid #ccc;
  transition: border-color 0.3s ease;
}

.filter-input:focus { border-color: var(--color-primary); }

.select-filter {
  position: relative;
  display: inline-block;
}

.select-filter select {
  appearance: none;
  padding: 0.5em 2.5em 0.5em 1em;
  border: 1px solid #ccc;
  border-radius: 40px;
  background-color: #fff;
  font-size: 14px;
  cursor: pointer;
  width: 200px;
}

.select-filter::after {
  content: '\25BC';
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  background: var(--color-primary);
  color: white;
  padding: 0.4em 0.5em;
  border-radius: 40px;
  pointer-events: none;
  transition: all 0.25s ease;
}

.select-filter:hover::after { background: var(--color-primary-dark); }

.button-filter {
  display: inline-block;
  padding: 5px 25px;
  border: 1px solid var(--color-primary);
  color: #fff;
  background: var(--color-primary);
  border-radius: 15px;
  font-weight: 500;
  letter-spacing: 1px;
  transition: 0.7s;
  cursor: pointer;
}

.button-filter:hover { background: var(--color-primary-dark); }

.nuevo-izquierda {
  right: 0;
  margin-right: 10px;
  position: absolute;
}

/* ---------- Tarjetas / contenido ---------- */

.detalles{
    position: relative;
    width: 100%;
    padding: 7px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-gap: 30px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.cardinicio {
  position: relative;
  display: grid;
  min-height: 500px;
  background: var(--white);
  padding: 20px;
  box-shadow: 0 7px 25px rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  margin-left: 22px;
  width: 96%;
}

.cardHeader {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
}

.cardHeader.Home {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  flex-direction: column;
  text-align: center;
}

.cardHeader p { font-size: 1.5rem; width: 80%; }
.cardHeader h1 { font-weight: 600; font-size: 3rem; color: var(--color-primary); }

.btn {
  position: relative;
  padding: 5px 10px;
  background: var(--color-primary);
  text-decoration: none;
  color: var(--white);
  border-radius: 6px;
}

/* ---------- Tablas ---------- */

.detalles table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.detalles table thead td { font-weight: 600; }

.detalles .recientes table tr {
  color: var(--black1);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.detalles .recientes table tr:last-child { border-bottom: none; }

.detalles .recientes table tbody tr:hover {
  background: var(--color-primary);
  color: var(--white);
}

.detalles .recientes table tbody .tr-pagination:hover {
  background: var(--white);
  color: var(--black1);
}

.detalles .recientes table tbody tr:hover td:first-child {
  border-top-left-radius: 20px;
  border-bottom-left-radius: 20px;
}

.detalles .recientes table tbody tr:hover td:last-child {
  border-top-right-radius: 20px;
  border-bottom-right-radius: 20px;
}

.detalles .recientes table tbody tr:hover ion-icon {
  color: var(--white);
  cursor: pointer;
}

.detalles .recientes table tr td {
  padding: 10px;
  text-align: center;
}

.detalles .recientes table tbody tr.detalle-row:hover td:first-child,
.detalles .recientes table tbody tr.detalle-row:hover td:last-child {
  border-radius: 0;
}

.detalles .recientes table tbody tr.detalle-row:hover {
  background: rgb(232, 231, 231);
  color: rgb(0, 0, 0);
}

.estado {
  padding: 2px 4px;
  background: #8de02c;
  color: var(--white);
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
}

/* ---------- Paginación ---------- */

.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.pagination-text {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 90px;
  text-align: center;
  padding: 12px 0;
}

.btn-pagination-modern {
  background-color: white;
  border: 2px solid var(--color-primary);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.btn-pagination-modern ion-icon {
  color: var(--color-primary) !important;
  font-size: 20px;
  transition: transform 0.3s ease, color 0.3s ease;
}

.btn-pagination-modern:hover {
  background-color: var(--color-primary) !important;
  box-shadow: 0 4px 15px rgba(2, 165, 226, 0.3);
}

.btn-pagination-modern.forward:hover ion-icon { color: white !important; transform: translateX(4px); }
.btn-pagination-modern.back:hover ion-icon { color: white !important; transform: translateX(-4px); }

ion-icon { pointer-events: none; }
button { cursor: pointer; }

/* ---------- Responsive ---------- */

@media (max-width: 991px) {
  .navegador { left: -260px; }
  .navegador.active { width: 260px; left: 0; }
  .main { width: 100%; left: 0; }
}

@media (max-width: 768px) {
  .recientes { overflow-x: auto; }
  .estado { white-space: nowrap; }
  .cardinicio { width: 100%; margin: 0; }
}

@media (max-width: 480px) {
  .navegador.active ul li a img { width: 7rem !important; height: 3rem !important; }
  .cardHeader h1 { font-size: 2rem; }
  .cardHeader { font-size: 15px; }

  .navegador { width: 100%; left: -100%; z-index: 1000; }
  .navegador.active { width: 100%; left: 0; }

  .toggle { z-index: 10001; }
  .main.active .toggle { position: fixed; right: 0; left: initial; color: #fff; }

  .cardinicio { width: 100%; margin: 0; }
}

.form-group-button {
  display: flex;
  justify-content: center;
  align-items: center;
}

.form-group-button button {
  margin: 20px;
}

.form-group-button .btn-cancelar:hover {
  background: #ed1a3b;
  box-shadow: 0 4px 10px #ed1a3b;
  transition: box-shadow 0.3s ease;
}

.modal-contenido .form-group select {
    width: 100%;
    min-width: 0;
    padding: 0.8rem 0.9rem;
    border: 1px solid #d9e2ec;
    border-radius: 10px;
    background-color: #fff;
    color: #23374d;
    font-size: 0.95rem;
    background-image: linear-gradient(45deg, transparent 50%, #02A5E2 50%), linear-gradient(135deg, #02A5E2 50%, transparent 50%);
    background-position: calc(100% - 20px) calc(1.2em), calc(100% - 14px) calc(1.2em);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    cursor: pointer;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.03);
}

.main #contenido > .contenedor {
  min-height: calc(100vh - 60px);
}