/**
 * Admin Panel Styles
 * Interfaz profesional de administración
 */

.admin-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #f9fafb;
  overflow: hidden;
}

/* ============= HEADER ============= */

.admin-header {
  padding: 24px;
  background: linear-gradient(135deg, #184A3A 0%, #0f766e 100%);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.admin-header h1 {
  margin: 0 0 4px 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.admin-header p {
  margin: 0;
  opacity: 0.9;
  font-size: 0.9rem;
}

.admin-role {
  background: rgba(255,255,255,0.2);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ============= TABS ============= */

.admin-tabs {
  display: flex;
  gap: 4px;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  padding: 0 16px;
  overflow-x: auto;
  flex-shrink: 0;
}

.admin-tab {
  padding: 12px 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 150ms ease;
  white-space: nowrap;
}

.admin-tab:hover {
  color: var(--brand);
}

.admin-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* ============= CONTENT ============= */

.admin-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.admin-section {
  display: none;
  animation: fadeIn 300ms ease;
}

.admin-section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ============= SECTION HEADER ============= */

.admin-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.admin-section-header h2 {
  margin: 0;
  font-size: 1.3rem;
  color: var(--text-primary);
  flex: 1;
}

.section-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ============= SEARCH & FILTER ============= */

.admin-search {
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  min-width: 200px;
  transition: all 150ms ease;
}

.admin-search:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(24,74,58,0.1);
}

.admin-filter {
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  background: white;
  cursor: pointer;
  transition: all 150ms ease;
}

.admin-filter:focus {
  outline: none;
  border-color: var(--brand);
}

/* ============= BUTTONS ============= */

.admin-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 150ms ease;
  white-space: nowrap;
}

.admin-btn.primary {
  background: var(--brand);
  color: white;
}

.admin-btn.primary:hover {
  background: #0f766e;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(24,74,58,0.2);
}

.admin-btn.small {
  padding: 8px 12px;
  font-size: 0.85rem;
  background: #e5e7eb;
  color: var(--text-primary);
}

.admin-btn.small:hover {
  background: #d1d5db;
}

.admin-btn.danger {
  background: #fee;
  color: #c33;
}

.admin-btn.danger:hover {
  background: #fdd;
}

/* ============= STATS GRID ============= */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.stat-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  display: flex;
  gap: 16px;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: all 150ms ease;
}

.stat-card:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 12px rgba(24,74,58,0.1);
}

.stat-icon {
  font-size: 2rem;
}

.stat-info {
  flex: 1;
}

.stat-label {
  margin: 0 0 4px 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
}

.stat-value {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.8rem;
  font-weight: 700;
}

/* ============= LIST ============= */

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-item {
  background: white;
  padding: 16px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: all 150ms ease;
}

.admin-item:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 12px rgba(24,74,58,0.1);
}

.item-info {
  flex: 1;
  min-width: 0;
}

.item-title {
  margin: 0 0 4px 0;
  font-weight: 600;
  color: var(--text-primary);
  word-wrap: break-word;
}

.item-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.item-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ============= EMPTY & LOADING ============= */

.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.error {
  text-align: center;
  padding: 40px 20px;
  color: #c33;
  background: #fee;
  border-radius: 8px;
}

/* ============= RESPONSIVE ============= */

@media (max-width: 1024px) {
  .admin-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-controls {
    width: 100%;
  }

  .admin-search {
    width: 100%;
  }

  .admin-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .item-actions {
    width: 100%;
  }

  .item-actions button {
    flex: 1;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .admin-header {
    padding: 16px;
  }

  .admin-header h1 {
    font-size: 1.2rem;
  }

  .admin-header p {
    display: none;
  }

  .admin-tabs {
    padding: 0 8px;
  }

  .admin-tab {
    padding: 10px 12px;
    font-size: 0.8rem;
  }

  .admin-content {
    padding: 16px;
  }

  .admin-section-header h2 {
    font-size: 1.1rem;
  }

  .admin-section-header {
    margin-bottom: 16px;
  }

  .section-controls {
    gap: 8px;
  }

  .admin-search {
    min-width: 150px;
    font-size: 0.85rem;
  }

  .admin-item {
    padding: 12px;
  }

  .item-title {
    font-size: 0.95rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-icon {
    font-size: 1.5rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .admin-header {
    padding: 12px;
  }

  .admin-header h1 {
    font-size: 1rem;
  }

  .admin-tabs {
    gap: 2px;
  }

  .admin-tab {
    padding: 8px 10px;
    font-size: 0.7rem;
  }

  .admin-content {
    padding: 12px;
  }

  .admin-section-header h2 {
    font-size: 1rem;
  }

  .section-controls {
    gap: 4px;
    width: 100%;
  }

  .admin-search {
    min-width: 100px;
    font-size: 0.8rem;
    padding: 8px 10px;
  }

  .admin-filter {
    font-size: 0.8rem;
    padding: 8px 10px;
  }

  .admin-btn.primary {
    font-size: 0.8rem;
    padding: 8px 12px;
  }

  .admin-btn.small {
    font-size: 0.75rem;
    padding: 6px 10px;
  }

  .admin-item {
    padding: 10px;
    gap: 10px;
  }

  .item-title {
    font-size: 0.9rem;
  }

  .item-meta {
    font-size: 0.8rem;
  }

  .item-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .item-actions button {
    flex: 1;
    min-width: 60px;
  }

  .stat-card {
    padding: 12px;
    gap: 12px;
  }

  .stat-icon {
    font-size: 1.3rem;
  }

  .stat-label {
    font-size: 0.8rem;
  }

  .stat-value {
    font-size: 1.3rem;
  }
}

/* ============= SCROLLBAR ============= */

.admin-tabs::-webkit-scrollbar,
.admin-content::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

.admin-tabs::-webkit-scrollbar-track,
.admin-content::-webkit-scrollbar-track {
  background: transparent;
}

.admin-tabs::-webkit-scrollbar-thumb,
.admin-content::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

.admin-tabs::-webkit-scrollbar-thumb:hover,
.admin-content::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}
