/* =========================================================
   BLOG & PUBLICACIONES — Estilos del Sistema de Blog
   ========================================================= */

/* ---- Hero de Publicaciones ---- */
.blog-hero {
  position: relative;
  overflow: hidden;
  background-color: var(--accent-dark);
  background-size: cover;
  background-position: center;
  color: var(--text-white);
  padding: 96px 0 72px;
}
.blog-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 14, 69, 0.88) 0%, rgba(12, 58, 133, 0.78) 100%);
  z-index: 1;
}
.blog-hero .container {
  position: relative;
  z-index: 2;
}
.blog-hero .hero-eyebrow { color: #93c5fd; }
.blog-hero h1 { color: var(--text-white); max-width: 720px; }
.blog-hero .hero-lead {
  color: #cbd5e1;
  max-width: 620px;
  margin-top: 16px;
  font-size: 1.1rem;
  line-height: 1.6;
}
.blog-hero .blog-counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  font-family: var(--font-head);
  font-size: 0.88rem;
  font-weight: 600;
  color: #93c5fd;
  background: rgba(255,255,255,0.06);
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,0.12);
}
.blog-hero .blog-counter strong {
  font-size: 1.1rem;
  color: #fff;
}

/* ---- Filtros de Categoría ---- */
.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}
.blog-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-muted);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}
.blog-filter-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: var(--primary-light);
}
.blog-filter-btn.active {
  background: var(--primary-color);
  color: var(--text-white);
  border-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(28, 74, 150, 0.25);
}

/* ---- Grid de Publicaciones ---- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
@media (max-width: 980px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .blog-grid { grid-template-columns: 1fr; } }

/* ---- Featured Post (most recent) ---- */
.blog-featured {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 40px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.blog-featured:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
}
.blog-featured > div:first-child {
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-light), var(--bg-light));
}
.blog-featured > div:first-child img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.blog-featured:hover > div:first-child img {
  transform: scale(1.05);
}
@media (max-width: 860px) {
  .blog-featured {
    grid-template-columns: 1fr;
  }
  .blog-featured > div:first-child img {
    min-height: 220px;
  }
}

/* ---- Tarjeta de Blog ---- */
.blog-card {
  background: var(--bg-card);
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.blog-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-5px);
}
.blog-card-thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-light), var(--bg-light));
  position: relative;
}
.blog-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.blog-card:hover .blog-card-thumb img {
  transform: scale(1.06);
}
.blog-card-no-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: var(--primary-color);
}
.blog-card-no-img svg {
  width: 48px;
  height: 48px;
  opacity: 0.4;
}
.blog-card-body {
  padding: 28px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.blog-card-tag {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary-color);
  background: var(--primary-light);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
}
.blog-card-date {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 10px;
}
.blog-card-body h3 {
  font-size: 1.12rem;
  line-height: 1.4;
  margin-bottom: 12px;
  color: var(--accent-dark);
}
.blog-card-summary {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
}
.blog-card-readmore {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary-color);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-body);
}
.blog-card-readmore svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}
.blog-card-readmore:hover svg {
  transform: translateX(4px);
}

/* ---- Estado Vacío ---- */
.blog-empty {
  text-align: center;
  padding: 80px 24px;
  grid-column: 1 / -1;
}
.blog-empty svg {
  width: 64px;
  height: 64px;
  color: var(--text-light);
  opacity: 0.4;
  margin-bottom: 20px;
}
.blog-empty h3 {
  font-size: 1.3rem;
  color: var(--text-dark);
  margin-bottom: 8px;
}
.blog-empty p {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* ---- Skeleton Loader ---- */
.blog-skeleton {
  background: var(--bg-card);
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.skeleton-img {
  aspect-ratio: 16 / 10;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
}
.skeleton-body { padding: 28px 24px; }
.skeleton-tag {
  width: 80px;
  height: 20px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  margin-bottom: 14px;
}
.skeleton-line {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  margin-bottom: 10px;
}
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w40 { width: 40%; }
.skeleton-line.h20 { height: 20px; width: 70%; }

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---- Modal de Artículo ---- */
.blog-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(6px);
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.blog-modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.blog-modal {
  position: fixed;
  top: 0;
  right: 0;
  width: min(720px, 100%);
  height: 100%;
  background: var(--bg-card);
  z-index: 510;
  box-shadow: var(--shadow-xl);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}
.blog-modal.is-open {
  transform: translateX(0);
}
.blog-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 32px 32px 24px;
  border-bottom: 1px solid var(--border-light);
  gap: 16px;
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 5;
}
.blog-modal-header-text { flex: 1; }
.blog-modal-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary-color);
  background: var(--primary-light);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 12px;
}
.blog-modal-header h2 {
  font-size: 1.5rem;
  line-height: 1.3;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-modal-date {
  font-size: 0.85rem;
  color: var(--text-light);
}
.blog-modal-close {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.04);
  color: var(--text-light);
  font-size: 1.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.blog-modal-close:hover {
  background: rgba(15, 23, 42, 0.1);
  color: var(--text-dark);
}
.blog-modal-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
}
.blog-modal-content {
  padding: 32px;
  flex: 1;
}
.blog-modal-external {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  background: var(--primary-color);
  color: var(--text-white);
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  margin-top: 24px;
  transition: all 0.25s ease;
}
.blog-modal-external:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}
.blog-modal-external svg {
  width: 18px;
  height: 18px;
}

/* ---- Markdown Rendered Content ---- */
.markdown-body {
  font-size: 1.02rem;
  line-height: 1.8;
  color: var(--text-muted);
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  color: var(--accent-dark);
  margin-top: 28px;
  margin-bottom: 14px;
  font-family: var(--font-head);
  line-height: 1.3;
}
.markdown-body h1 { font-size: 1.8rem; }
.markdown-body h2 { font-size: 1.5rem; }
.markdown-body h3 { font-size: 1.25rem; }
.markdown-body h4 { font-size: 1.1rem; }
.markdown-body p { margin-bottom: 16px; color: var(--text-muted); }
.markdown-body strong { color: var(--text-dark); font-weight: 700; }
.markdown-body em { font-style: italic; }
.markdown-body ul, .markdown-body ol {
  margin: 12px 0 16px 24px;
}
.markdown-body li {
  margin-bottom: 6px;
  line-height: 1.7;
}
.markdown-body blockquote {
  border-left: 4px solid var(--primary-color);
  padding: 12px 20px;
  margin: 16px 0;
  background: var(--primary-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text-muted);
}
.markdown-body hr {
  border: none;
  height: 1px;
  background: var(--border-light);
  margin: 28px 0;
}
.markdown-body code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.9em;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--primary-color);
  word-break: break-word;
}
.markdown-body pre {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.markdown-body pre code {
  white-space: pre;
  word-break: normal;
}
.markdown-body a {
  color: var(--primary-color);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.markdown-body a:hover {
  color: var(--primary-hover);
}

@media (max-width: 600px) {
  .blog-modal { width: 100%; }
  .blog-modal-header { padding: 24px 20px 16px; }
  .blog-modal-content { padding: 24px 20px; }
}

/* =========================================================
   ADMIN PANEL — Estilos del Panel de Administración
   ========================================================= */

/* ---- Login Screen ---- */
.admin-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  padding: 24px;
}
.admin-login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(15, 23, 42, 0.05);
}
.admin-login-card .brand {
  align-items: center;
  text-align: center;
  margin-bottom: 32px;
}
.admin-login-card .brand-logo {
  height: 64px;
  margin-bottom: 12px;
}
.admin-login-card h2 {
  font-size: 1.4rem;
  margin-bottom: 4px;
  text-align: center;
}
.admin-login-card .login-subtitle {
  font-size: 0.9rem;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 28px;
}
.admin-login-card .form-field input {
  width: 100%;
}
.admin-login-error {
  background: #fef2f2;
  color: #dc2626;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: none;
  border: 1px solid #fecaca;
}
.admin-login-error.is-visible {
  display: block;
}

/* ---- Admin Layout ---- */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.admin-sidebar {
  width: 260px;
  background: var(--accent-dark);
  color: var(--text-white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.admin-sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-sidebar-brand img {
  height: 40px;
  width: auto;
}
.admin-sidebar-brand-text {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-white);
  line-height: 1.2;
}
.admin-sidebar-brand-text small {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: #94a3b8;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.admin-sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: #94a3b8;
  transition: all 0.2s ease;
}
.admin-sidebar-nav a:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-white);
}
.admin-sidebar-nav a.active {
  background: var(--primary-color);
  color: var(--text-white);
}
.admin-sidebar-nav a svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.admin-sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.admin-sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 0.85rem;
  color: #94a3b8;
  transition: color 0.2s;
}
.admin-sidebar-footer a:hover { color: var(--text-white); }
.admin-sidebar-footer a svg { width: 18px; height: 18px; }

/* ---- Main Content Area ---- */
.admin-main {
  flex: 1;
  margin-left: 260px;
  background: var(--bg-light);
  min-height: 100vh;
}

/* ---- Topbar ---- */
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 90;
}
.admin-topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.admin-topbar-left h2 {
  font-size: 1.2rem;
}
.admin-mobile-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--text-dark);
}
.admin-mobile-toggle svg { width: 20px; height: 20px; }

.admin-status-bar {
  display: flex;
  align-items: center;
  gap: 16px;
}
.admin-status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-light);
}
.admin-status-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}
.admin-status-dot.connected::before { background: #10b981; }
.admin-status-dot.disconnected::before { background: #ef4444; }

/* ---- Admin Content ---- */
.admin-content {
  padding: 32px;
}
.admin-page { display: none; }
.admin-page.active { display: block; }

/* ---- Stats Grid ---- */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}
.admin-stat-card {
  background: var(--bg-card);
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.admin-stat-card .stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.admin-stat-card .stat-value {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin-top: 4px;
}

/* ---- Admin Form ---- */
.admin-form-card {
  background: var(--bg-card);
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}
.admin-form-card h3 {
  font-size: 1.15rem;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}
.admin-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 768px) {
  .admin-form-row { grid-template-columns: 1fr; }
}
.admin-form-full {
  grid-column: 1 / -1;
}

/* ---- Markdown Editor ---- */
.md-editor {
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s;
}
.md-editor:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}
.md-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
}
.md-toolbar button {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.15s;
}
.md-toolbar button:hover {
  background: var(--primary-light);
  color: var(--primary-color);
}
.md-toolbar .separator {
  width: 1px;
  height: 20px;
  background: var(--border-light);
  margin: 0 4px;
}
.md-editor textarea {
  width: 100%;
  min-height: 300px;
  padding: 16px;
  border: none;
  resize: vertical;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-dark);
  background: var(--bg-card);
}
.md-editor textarea:focus {
  outline: none;
}

/* ---- Split Preview ---- */
.md-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.md-split .md-editor { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.md-split .md-preview {
  border: 1.5px solid var(--border-light);
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 24px;
  overflow-y: auto;
  max-height: 460px;
  background: var(--bg-card);
}
.md-preview-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}
@media (max-width: 768px) {
  .md-split {
    grid-template-columns: 1fr;
  }
  .md-split .md-editor { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
  .md-split .md-preview {
    border-left: 1.5px solid var(--border-light);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    max-height: 300px;
  }
}

/* ---- Image Upload Zone ---- */
.upload-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-md);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  background: #fafbfc;
  position: relative;
}
.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--primary-color);
  background: var(--primary-light);
}
.upload-zone svg {
  width: 40px;
  height: 40px;
  color: var(--text-light);
  margin-bottom: 12px;
}
.upload-zone p {
  font-size: 0.9rem;
  color: var(--text-light);
}
.upload-zone p strong {
  color: var(--primary-color);
}
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.upload-progress {
  display: none;
  margin-top: 16px;
}
.upload-progress.is-visible { display: block; }
.upload-progress-bar {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.upload-progress-fill {
  height: 100%;
  background: var(--primary-color);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
}
.upload-progress-text {
  font-size: 0.8rem;
  color: var(--text-light);
}
.upload-preview {
  display: none;
  margin-top: 16px;
  position: relative;
}
.upload-preview.is-visible { display: block; }
.upload-preview img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}
.upload-preview-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.6);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: background 0.2s;
}
.upload-preview-remove:hover { background: rgba(220,38,38,0.8); }

/* ---- Admin Table ---- */
.admin-table-card {
  background: var(--bg-card);
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.admin-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
  gap: 12px;
}
.admin-table-header h3 { font-size: 1.1rem; border: none; padding: 0; margin: 0; }
.admin-table-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
}
.admin-table-search svg { width: 16px; height: 16px; color: var(--text-light); flex-shrink: 0; }
.admin-table-search input {
  border: none;
  background: none;
  font-size: 0.88rem;
  color: var(--text-dark);
  outline: none;
  width: 200px;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-light);
  padding: 14px 24px;
  border-bottom: 1px solid var(--border-light);
  background: #f8fafc;
}
.admin-table td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
  color: var(--text-muted);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(15, 23, 42, 0.015); }
.admin-table .td-title {
  font-weight: 600;
  color: var(--text-dark);
}
.admin-table .td-thumb {
  width: 56px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--primary-light);
}
.admin-table .td-thumb-empty {
  width: 56px;
  height: 40px;
  border-radius: 6px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
}
.admin-table .td-thumb-empty svg { width: 18px; height: 18px; }
.admin-table .td-actions {
  display: flex;
  gap: 8px;
}
.admin-table .td-actions button {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.admin-table .td-actions button:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: var(--primary-light);
}
.admin-table .td-actions button.btn-delete:hover {
  border-color: #dc2626;
  color: #dc2626;
  background: #fef2f2;
}
.admin-table .td-actions button svg { width: 16px; height: 16px; }

/* Table responsive */
@media (max-width: 900px) {
  .admin-table-wrap { overflow-x: auto; }
  .admin-table { min-width: 640px; }
}

/* ---- Modal Confirmación ---- */
.admin-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 600;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.admin-confirm-overlay.is-open {
  display: flex;
}
.admin-confirm-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  text-align: center;
}
.admin-confirm-card svg {
  width: 48px;
  height: 48px;
  color: #ef4444;
  margin-bottom: 16px;
}
.admin-confirm-card h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}
.admin-confirm-card p {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 24px;
}
.admin-confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ---- Admin Toast ---- */
.admin-toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 700;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.admin-toast {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  color: var(--text-white);
  padding: 16px 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--primary-color);
  min-width: 300px;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 16px;
  animation: slideInToast 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.admin-toast.success { border-left-color: #10b981; }
.admin-toast.error { border-left-color: #ef4444; }
.admin-toast svg { width: 22px; height: 22px; flex-shrink: 0; }

/* ---- Admin Responsive ---- */
@media (max-width: 900px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.is-open {
    transform: translateX(0);
  }
  .admin-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 199;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
  }
  .admin-sidebar-backdrop.is-open {
    display: block;
  }
  .admin-main {
    margin-left: 0;
  }
  .admin-mobile-toggle {
    display: flex;
  }
  .admin-topbar { padding: 12px 16px; }
  .admin-topbar-left { gap: 10px; }
  .admin-content { padding: 20px 16px; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .admin-table-search input { width: 140px; font-size: 0.82rem; }
}
@media (max-width: 480px) {
  .admin-stats { grid-template-columns: 1fr; }
  .admin-topbar { flex-wrap: wrap; }
  .admin-table-search { width: 100%; order: 3; }
  .admin-table-search input { width: 100%; }
  .admin-toast { min-width: auto; max-width: calc(100vw - 24px); }
  .admin-settings-card { padding: 20px 16px; }
  .admin-form-row { grid-template-columns: 1fr !important; }
  .admin-login-card { padding: 32px 20px; margin: 16px; }
}

/* ---- Admin Settings ---- */
.admin-settings-card {
  background: var(--bg-card);
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}
.admin-settings-card h3 {
  font-size: 1.1rem;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}
.admin-settings-card .form-field input[type="password"],
.admin-settings-card .form-field input[type="text"] {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
}

/* ---- Admin Post Card (Preview en formulario) ---- */
.admin-preview-panel {
  background: var(--bg-card);
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.admin-preview-panel h3 {
  font-size: 1rem;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-light);
}

/* ---- Badge de Categoría ---- */
.blog-tag-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--primary-light);
  color: var(--primary-color);
}

/* ---- Pagination ---- */
.blog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
}
.blog-pagination button {
  min-width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-muted);
  font-family: var(--font-head);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.blog-pagination button:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}
.blog-pagination button.active {
  background: var(--primary-color);
  color: var(--text-white);
  border-color: var(--primary-color);
}
.blog-pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* =========================================================
   GARANTÍA RESPONSIVE BLOG (Ajustes Adicionales de Seguridad)
   ========================================================= */
@media (max-width: 400px) {
  .blog-hero {
    padding: 60px 0 40px;
  }
  .blog-grid {
    gap: 20px;
  }
  .admin-login-card {
    padding: 32px 24px;
  }
  .md-toolbar {
    flex-wrap: wrap;
  }
  .md-editor textarea {
    min-height: 200px;
  }
}
