/* ==============================================
   PUNTOBASE - MAQUETA FRONTEND
   Estilos globales - CSS único
   ============================================== */

/* ========== VARIABLES Y RESET ========== */
:root {
  /* Colores principales */
  --primary-blue: #00A8E8;
  --primary-blue-dark: #0091CC;
  --cyan: #00D4FF;
  
  /* Fondos */
  --bg-main: #F5F7FA;
  --bg-white: #FFFFFF;
  --bg-light: #F8FBFD;
  
  /* Textos */
  --text-dark: #2C3E50;
  --text-gray: #7A8FA0;
  --text-light: #B0BEC5;
  
  /* Estados */
  --success: #4CAF50;
  --warning: #FF9800;
  --danger: #F44336;
  --info: #2196F3;
  --pending: #FFC107;
  
  /* Bordes */
  --border-color: #E0E0E0;
  --border-light: #F0F0F0;
  
  /* Sombras */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.16);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-dark);
  line-height: 1.6;
}

/* ========== LAYOUT PRINCIPAL ========== */
.container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* TOPBAR */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 0 0 auto;
}

.topbar-center {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  justify-content: right;
  margin-right: 10px;
}

.topbar-label {
  font-size: 13px;
  color: var(--text-gray);
  font-weight: 500;
  white-space: nowrap;
}

.topbar-select {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: var(--bg-white);
  color: var(--text-dark);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 200px;
  background-color: #F5F7FA;
}

.topbar-select:hover {
  border-color: var(--primary-blue);
}

.topbar-select:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(0, 168, 232, 0.1);
}

.topbar-logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  max-width: 150px;
  height: 45px;
}

.topbar-logo img {
  max-height: 40px;
  width: auto;
  object-fit: contain;
}

.topbar-logo:hover img {
  opacity: 0.8;
}

.topbar-company {
  color: var(--text-gray);
  font-size: 13px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 0 0 auto;
}

.topbar-notifications {
  position: relative;
  cursor: pointer;
  font-size: 20px;
  transition: all 0.3s ease;
  background-color: #F5F7FA;
}

.topbar-notifications:hover {
  opacity: 0.7;
}

.topbar-notifications .badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: var(--primary-blue);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.topbar-user-btn {
  background-color: #F5F7FA;
  border: none;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 5px;
}

.topbar-user-btn:hover {
  opacity: 0.7;
}

/* SIDEBAR */
.sidebar {
  position: fixed;
  left: 0;
  top: 60px;
  width: 220px;
  height: calc(100vh - 60px);
  background-color: var(--bg-white);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  padding: 20px 0;
  z-index: 999;
  background-color: #F5F7FA;
}

.sidebar-section {
  padding: 0;
  margin-bottom: 10px;
}

.sidebar-title {
  padding: 10px 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-light);
  letter-spacing: 0.5px;
}

.sidebar-menu {
  list-style: none;
}

.sidebar-item {
  margin: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--text-gray);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
  position: relative;
}

.sidebar-link:hover {
  color: var(--primary-blue);
  background-color: var(--bg-light);
}

.sidebar-link.active {
  color: var(--primary-blue);
  background-color: #ffffff;
  border-left-color: var(--primary-blue);
  font-weight: 600;
}

.sidebar-icon {
  font-size: 18px;
  min-width: 20px;
}

.sidebar-icon-img {
  height: 30px;
  width: 30px;
  min-width: 30px;
  object-fit: contain;
}

.sidebar-badge {
  margin-left: auto;
  background-color: var(--primary-blue);
  color: white;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
}

/* SIDEBAR TOGGLE BUTTON */
.sidebar-toggle {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-gray);
  cursor: pointer;
  padding: 5px 10px;
  margin-right: 10px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-toggle:hover {
  color: var(--primary-blue);
}

/* MINIMIZED SIDEBAR STATES */
.sidebar.minimized {
  width: 70px;
}

.sidebar.minimized .sidebar-section {
  padding: 0;
}

.sidebar.minimized .sidebar-title {
  display: none;
}

.sidebar.minimized .sidebar-link {
  padding: 12px 10px;
  justify-content: center;
  gap: 0;
}

.sidebar.minimized .sidebar-link span:not(.sidebar-icon) {
  display: none;
}

.sidebar.minimized .sidebar-badge {
  display: none;
}

.main-content.minimized {
  margin-left: 70px;
}

/* MAIN CONTENT */
.main-content {
  margin-left: 220px;
  margin-top: 60px;
  flex: 1;
  overflow-y: auto;
  background-color: var(--bg-main);
}

.content-wrapper {
  padding: 30px;
  max-width: 1400px;
  margin: 0 auto;
}

/* ========== CABECERA DE PÁGINA ========== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 20px;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-dark);
}

.page-description {
  font-size: 14px;
  color: var(--text-gray);
  margin-top: 5px;
}

.page-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ========== BOTONES ========== */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary-blue);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-blue-dark);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: transparent;
  color: var(--primary-blue);
  border: 1.5px solid var(--primary-blue);
}

.btn-secondary:hover {
  background-color: var(--bg-light);
}

.btn-success {
  background-color: var(--success);
  color: white;
}

.btn-success:hover {
  background-color: #45a049;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

/* ========== TARJETAS (CARDS) ========== */
.card {
  background-color: var(--bg-white);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 15px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
}

.card-description {
  font-size: 13px;
  color: var(--text-gray);
  margin-top: 5px;
}

.card-body {
  padding: 20px 0;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 15px;
  border-top: 1px solid var(--border-light);
}

/* ========== GRID DE STATS ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background-color: var(--bg-white);
  border-radius: 8px;
  padding: 20px;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 15px;
}

.stat-icon {
  font-size: 32px;
  min-width: 50px;
  text-align: center;
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
}

.stat-label {
  font-size: 12px;
  color: var(--text-gray);
  margin-top: 5px;
}

/* ========== TABLAS ========== */
.table-container {
  background-color: var(--bg-white);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  margin-bottom: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background-color: var(--bg-light);
  border-bottom: 2px solid var(--border-color);
}

th {
  padding: 15px;
  text-align: left;
  font-weight: 700;
  font-size: 12px;
  color: var(--text-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  padding: 15px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--text-dark);
}

tr:hover {
  background-color: var(--bg-light);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* ========== BADGES Y ETIQUETAS ========== */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success {
  background-color: #E8F5E9;
  color: var(--success);
}

.badge-warning {
  background-color: #FFF3E0;
  color: var(--warning);
}

.badge-danger {
  background-color: #FFEBEE;
  color: var(--danger);
}

.badge-info {
  background-color: #E3F2FD;
  color: var(--info);
}

.badge-pending {
  background-color: #FFF9C4;
  color: #F57F17;
}

/* ========== FORMULARIOS ========== */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-dark);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-dark);
  background-color: var(--bg-white);
  transition: all 0.3s ease;
  font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(0, 168, 232, 0.1);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

/* ========== BÚSQUEDA ========== */
.search-box {
  display: flex;
  align-items: center;
  background-color: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 10px 15px;
  gap: 10px;
  margin-bottom: 20px;
}

.search-box input {
  border: none;
  background: none;
  flex: 1;
  outline: none;
}

.search-box input::placeholder {
  color: var(--text-light);
}

.search-icon {
  font-size: 18px;
  color: var(--text-light);
  cursor: pointer;
}

/* ========== MODAL / OVERLAY ========== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background-color: var(--bg-white);
  border-radius: 8px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 15px;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
}

.modal-close {
  cursor: pointer;
  font-size: 24px;
  color: var(--text-light);
  float: right;
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: var(--text-dark);
}

/* ========== ALERTAS ========== */
.alert {
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.alert-icon {
  font-size: 18px;
  min-width: 20px;
  flex-shrink: 0;
}

.alert-success {
  background-color: #E8F5E9;
  color: var(--success);
}

.alert-warning {
  background-color: #FFF3E0;
  color: var(--warning);
}

.alert-danger {
  background-color: #FFEBEE;
  color: var(--danger);
}

.alert-info {
  background-color: #E3F2FD;
  color: var(--info);
}

/* ========== TABS ========== */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 12px 20px;
  background: none;
  border: none;
  color: var(--text-gray);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
}

.tab-btn.active {
  color: var(--primary-blue);
  border-bottom-color: var(--primary-blue);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ========== GRID DE CARDS ========== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.card-item {
  background-color: var(--bg-white);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: all 0.3s ease;
}

.card-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-item-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: start;
}

.card-item-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.card-item-info {
  flex: 1;
}

.card-item-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-dark);
}

.card-item-subtitle {
  font-size: 12px;
  color: var(--text-gray);
  margin-top: 3px;
}

.card-item-icon {
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.card-item-icon:hover {
  color: var(--primary-blue);
}

.card-item-body {
  padding: 20px;
  font-size: 13px;
  color: var(--text-dark);
  line-height: 1.6;
}

.card-item-tags {
  padding: 0 20px 15px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  background-color: var(--bg-light);
  color: var(--primary-blue);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.card-item-footer {
  padding: 15px 20px;
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--border-light);
}

.card-item-footer .btn {
  flex: 1;
  text-align: center;
}

/* ========== RATING ========== */
.rating {
  display: flex;
  gap: 5px;
  align-items: center;
}

.star {
  font-size: 14px;
}

.rating-value {
  font-size: 12px;
  color: var(--text-gray);
  margin-left: 5px;
}

/* ========== LISTA ========== */
.list {
  list-style: none;
}

.list-item {
  padding: 15px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.3s ease;
}

.list-item:hover {
  background-color: var(--bg-light);
}

.list-item:last-child {
  border-bottom: none;
}

/* ========== PAGINACIÓN ========== */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 30px;
  align-items: center;
}

.pagination-btn {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-white);
  color: var(--text-dark);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.pagination-btn:hover {
  background-color: var(--bg-light);
}

.pagination-btn.active {
  background-color: var(--primary-blue);
  color: white;
  border-color: var(--primary-blue);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .sidebar {
    width: 70px;
  }
  
  .sidebar-link span:not(.sidebar-icon) {
    display: none;
  }
  
  .sidebar-title {
    display: none;
  }
  
  .main-content {
    margin-left: 70px;
  }
  
  .content-wrapper {
    padding: 20px;
  }
  
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .cards-grid {
    grid-template-columns: 1fr;
  }
  
  .topbar {
    flex-direction: column;
    height: auto;
    padding: 10px 15px;
    gap: 10px;
  }
  
  .topbar-left,
  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 480px) {
  .sidebar {
    display: none;
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .content-wrapper {
    padding: 15px;
  }
  
  .page-title {
    font-size: 20px;
  }
  
  table {
    font-size: 11px;
  }
  
  th, td {
    padding: 10px;
  }
}
