/* ==========================================================================
   MOREARTTI — PANEL DE ADMINISTRACIÓN WEB INDEPENDIENTE (CMS)
   Estilos del Gestor de Contenidos Institucional
   ========================================================================== */

.admin-body {
  background-color: #f1f5f9;
  min-height: 100vh;
  display: flex;
}

/* Login Admin */
.admin-login-wrapper {
  min-height: 100vh;
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--moreartti-gray-50, #f8fafc);
  padding: 1.5rem;
}

.admin-login-card {
  background: #ffffff;
  border-radius: var(--radius-md, 6px);
  padding: 2.5rem;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 4px 16px rgba(13, 45, 94, 0.08);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-top: 4px solid var(--gold-primary, #b89047);
}

.admin-login-logo {
  height: 52px;
  margin: 0 auto 1.5rem auto;
  display: block;
}

/* Layout Principal CMS */
.admin-sidebar {
  width: 260px;
  background-color: var(--blue-deep);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-sidebar-logo {
  height: 38px;
  background: #ffffff;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.admin-sidebar-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.admin-nav {
  padding: 1rem 0.5rem;
  list-style: none;
  flex-grow: 1;
  overflow-y: auto;
}

.admin-nav-item {
  margin-bottom: 0.25rem;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.admin-nav-link:hover, .admin-nav-link.active {
  background-color: rgba(184, 144, 71, 0.15);
  color: var(--gold-border);
}

.admin-nav-link.active {
  border-left: 3px solid var(--gold-primary);
}

.admin-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
}

.admin-topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-page-content {
  padding: 2rem;
  flex-grow: 1;
}

/* Métricas del Dashboard */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.metric-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--blue-primary);
  line-height: 1;
  margin-bottom: 0.35rem;
}

.metric-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.metric-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--blue-subtle);
  color: var(--blue-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* Tablas Administrativas */
.admin-table-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
  overflow: hidden;
  margin-bottom: 2rem;
}

.admin-table-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  text-align: left;
}

.admin-table th {
  background: #f8fafc;
  color: var(--text-secondary);
  font-weight: 700;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background-color: #f8fafc;
}

.status-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-publicado {
  background-color: var(--status-success-bg);
  color: var(--status-success);
  border: 1px solid var(--status-success-border);
}

.status-borrador {
  background-color: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

.status-programado {
  background-color: var(--status-info-bg);
  color: var(--status-info);
  border: 1px solid var(--status-info-border);
}

.status-archivado {
  background-color: var(--status-warning-bg);
  color: var(--status-warning);
  border: 1px solid var(--status-warning-border);
}

/* Botones de acción en tabla */
.table-actions {
  display: flex;
  gap: 0.4rem;
}

.btn-action-icon {
  background: transparent;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-action-icon:hover {
  background: var(--blue-subtle);
  color: var(--blue-primary);
  border-color: var(--blue-primary);
}

.btn-action-icon.btn-delete:hover {
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border-color: var(--status-danger);
}

/* ==========================================================================
   ESTILOS AVANZADOS DEL CMS INSTITUCIONAL
   ========================================================================== */

/* Estados de Citas */
.status-solicitada {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.status-confirmada {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.status-reprogramada {
  background-color: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.status-atendida {
  background-color: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.status-cancelada {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Editor Visual de Contenidos */
.editor-container {
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: var(--radius-sm, 4px);
  background: #ffffff;
  overflow: hidden;
}

.editor-toolbar {
  background: #f8fafc;
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
  padding: 0.5rem 0.75rem;
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  align-items: center;
}

.editor-btn {
  background: #ffffff;
  border: 1px solid var(--border-medium, #cbd5e1);
  border-radius: 3px;
  padding: 0.3rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--moreartti-blue, #0d2d5e);
  cursor: pointer;
  transition: all 0.15s ease;
}

.editor-btn:hover {
  background: #f1f5f9;
  border-color: var(--moreartti-blue, #0d2d5e);
}

.editor-area {
  min-height: 180px;
  padding: 1rem;
  outline: none;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #1e293b;
}

/* Galería / Biblioteca de Imágenes */
.images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.image-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: var(--radius-sm, 4px);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.image-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(13, 45, 94, 0.08);
}

.image-thumb-box {
  width: 100%;
  height: 120px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
}

.image-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-info {
  padding: 0.65rem 0.75rem;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex-grow: 1;
}

/* Calendario Interno Administrativo */
.admin-calendar-wrapper {
  background: #ffffff;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: var(--radius-md, 6px);
  padding: 1.5rem;
}

.admin-calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.admin-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: #e2e8f0;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.cal-head-cell {
  background: #f8fafc;
  padding: 0.65rem 0.5rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--moreartti-blue, #0d2d5e);
  text-transform: uppercase;
}

.cal-day-cell {
  background: #ffffff;
  min-height: 90px;
  padding: 0.4rem;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cal-day-number {
  font-weight: 700;
  color: #475569;
  align-self: flex-end;
  margin-bottom: 0.2rem;
}

.cal-event-pill {
  font-size: 0.68rem;
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  line-height: 1.2;
}

/* Google Calendar y Meet Notice */
.btn-google-calendar {
  background-color: #ffffff;
  color: #1a73e8;
  border: 1px solid #dadce0;
  border-radius: 4px;
  padding: 0.4rem 0.8rem;
  font-size: 0.8125rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  transition: background-color 0.15s;
}

.btn-google-calendar:hover {
  background-color: #f8fafd;
  border-color: #1a73e8;
}

.google-meet-notice {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 4px;
  padding: 0.85rem;
  font-size: 0.825rem;
  color: #475569;
  line-height: 1.5;
  margin-top: 0.75rem;
}

/* Conmutador Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 22px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .switch-slider {
  background-color: var(--moreartti-blue, #0d2d5e);
}

input:checked + .switch-slider:before {
  transform: translateX(22px);
}

