/* ============================================================
   PULSO CRÍTICO — Admin Panel Styles
   Interfaz editorial operativa — separada del sitio público
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:        #c8102e;
  --red-dark:   #a00d24;
  --dark:       #1a1a1a;
  --sidebar-bg: #1e2128;
  --sidebar-w:  220px;
  --header-h:   56px;
  --bg:         #f4f5f7;
  --white:      #ffffff;
  --border:     #e0e3e8;
  --ink:        #2c2f36;
  --ink-soft:   #5a606b;
  --muted:      #9aa0ab;
  --success:    #1a7a3a;
  --warning:    #c07a10;
  --info:       #1a5c96;
  --radius:     6px;
  --shadow:     0 1px 4px rgba(0,0,0,.10);
  --shadow-md:  0 2px 10px rgba(0,0,0,.12);
  --trans:      .15s ease;
}

html { font-size: 14px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a  { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
img { display: block; max-width: 100%; }

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

/* ── Sidebar ──────────────────────────────────────────────── */
.admin-sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-logo-main {
  font-size: 17px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -.01em;
}
.sidebar-logo-main span { color: var(--red); }
.sidebar-logo-sub {
  font-size: 10px;
  color: rgba(255,255,255,.4);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-top: 2px;
}
.sidebar-nav { padding: 10px 0; flex: 1; }
.sidebar-section {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  padding: 14px 20px 6px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  font-size: 13px;
  color: rgba(255,255,255,.65);
  border-left: 3px solid transparent;
  transition: all var(--trans);
}
.sidebar-link:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
}
.sidebar-link.active {
  background: rgba(200,16,46,.15);
  color: #fff;
  border-left-color: var(--red);
}
.sidebar-link .icon { font-size: 15px; width: 18px; text-align: center; }
.sidebar-link--disabled {
  opacity: .4;
  pointer-events: none;
  cursor: default;
}
.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-footer a {
  font-size: 12px;
  color: rgba(255,255,255,.4);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color var(--trans);
}
.sidebar-footer a:hover { color: rgba(255,255,255,.8); }

/* Sidebar markup used by the PHP admin pages */
.admin-sidebar-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.admin-logo {
  font-size: 17px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0;
}
.admin-logo span { color: #ff4f68; }
.admin-sidebar-close {
  color: rgba(255,255,255,.78);
  font-size: 18px;
  line-height: 1;
}
.admin-sidebar-close:hover { color: #fff; }
.admin-nav {
  padding: 10px 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.admin-nav-section {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
  padding: 14px 20px 6px;
}
.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  font-size: 13px;
  color: rgba(255,255,255,.78);
  border-left: 3px solid transparent;
  transition: background var(--trans), color var(--trans), border-color var(--trans);
}
.admin-nav-link:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.admin-nav-link.active {
  background: rgba(200,16,46,.22);
  color: #fff;
  border-left-color: var(--red);
}
.admin-nav-link span {
  width: 18px;
  text-align: center;
  color: inherit;
}
.admin-nav-link.sidebar-link--disabled {
  color: rgba(255,255,255,.42);
  opacity: 1;
}
.admin-nav-link#logout-link,
.admin-nav a[href="logout.php"] {
  color: #ff8585 !important;
}
.admin-nav-link#logout-link:hover,
.admin-nav a[href="logout.php"]:hover {
  color: #fff !important;
}

/* ── Main area ────────────────────────────────────────────── */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Top bar ──────────────────────────────────────────────── */
.admin-topbar {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.topbar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-badge {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 6px;
}
.topbar-badge .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--warning);
}

/* ── Page content ─────────────────────────────────────────── */
.admin-content { padding: 24px; flex: 1; }
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 12px;
  flex-wrap: wrap;
}
.page-header h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--dark);
}

/* ── Stat cards ───────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.stat-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-sub { font-size: 12px; color: var(--ink-soft); }
.stat-card.accent { border-left: 4px solid var(--red); }
.stat-card.green  { border-left: 4px solid var(--success); }
.stat-card.blue   { border-left: 4px solid var(--info); }
.stat-card.orange { border-left: 4px solid var(--warning); }

/* ── Card / Panel ─────────────────────────────────────────── */
.panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}
.panel-header h2 {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
}
.panel-body { padding: 18px; }

/* ── Toolbar (filters + search) ───────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.toolbar-search {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
}
.toolbar-search input {
  border: none;
  outline: none;
  padding: 7px 10px;
  font-size: 13px;
  width: 180px;
  background: transparent;
}
.toolbar-search button {
  padding: 7px 10px;
  color: var(--muted);
  background: transparent;
  border-left: 1px solid var(--border);
}
.toolbar-select {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--ink);
  background: var(--white);
  outline: none;
  cursor: pointer;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--trans);
}
.btn-primary { background: var(--red); color: #fff; border-color: var(--red); }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn-secondary { background: var(--white); color: var(--ink); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #156030; }
.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-danger  { background: #c8102e; color: #fff; border-color: #c8102e; }
.btn-danger:hover  { background: var(--red-dark); }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: transparent; }
.btn-ghost:hover { background: var(--bg); color: var(--ink); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 6px; border-radius: 4px; }
.btn-primary,
.btn-outline,
.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
  text-align: center;
  transition: background var(--trans), border-color var(--trans), color var(--trans), box-shadow var(--trans);
}
.btn-primary,
.btn-submit {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.btn-primary:hover,
.btn-submit:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
  color: #fff;
}
.btn-outline {
  background: #fff;
  border-color: var(--border);
  color: var(--ink);
}
.btn-outline:hover {
  background: var(--bg);
  border-color: var(--muted);
  color: var(--dark);
}
.btn-primary.btn-sm,
.btn-outline.btn-sm,
.btn-submit.btn-sm {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
}

/* ── Table ────────────────────────────────────────────────── */
.news-table { width: 100%; border-collapse: collapse; }
.news-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.news-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}
.news-table tr:last-child td { border-bottom: none; }
.news-table tr:hover td { background: #fafbfc; }
.news-table .col-title { max-width: 280px; }
.news-table .col-title a { font-weight: 600; color: var(--dark); }
.news-table .col-title a:hover { color: var(--red); text-decoration: underline; }
.news-table .col-img img {
  width: 56px; height: 40px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid var(--border);
}
.news-table .col-actions { white-space: nowrap; }
.news-table .col-actions .action-btns { display: flex; gap: 4px; }
.col-check input[type=checkbox] { width: 15px; height: 15px; cursor: pointer; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
}
.badge-publicada { background: #e6f4ea; color: #1a7a3a; }
.badge-borrador  { background: #fff3e0; color: #c07a10; }
.badge-uh { background: #fdecea; color: #c8102e; }
.badge-tendencia { background: #fff8e1; color: #c07a10; }
.badge-cat { background: var(--bg); color: var(--ink-soft); }

/* ── Empty table ──────────────────────────────────────────── */
.table-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}
.table-empty h3 { font-size: 15px; margin-bottom: 6px; color: var(--ink-soft); }

/* ── Pagination ───────────────────────────────────────────── */
.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}
.admin-pagination .pag-btns { display: flex; gap: 4px; }
.pag-btn {
  width: 30px; height: 30px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft);
  transition: all var(--trans);
}
.pag-btn:hover, .pag-btn.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* ── Form ─────────────────────────────────────────────────── */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.form-label .req { color: var(--red); margin-left: 2px; }
.form-input, .form-select, .form-textarea {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  color: var(--ink);
  background: var(--white);
  outline: none;
  transition: border-color var(--trans), box-shadow var(--trans);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(200,16,46,.08);
}
.form-input.error { border-color: var(--red); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-hint { font-size: 11px; color: var(--muted); }
.form-error { font-size: 11px; color: var(--red); display: none; }
.form-error.show { display: block; }

/* Checkboxes row */
.checkbox-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}
.checkbox-item input { width: 15px; height: 15px; cursor: pointer; }
.checkbox-item span { font-size: 13px; font-weight: 600; }

/* Image preview */
.img-preview-wrap {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  transition: border-color var(--trans);
}
.img-preview-wrap:hover { border-color: var(--red); }
.img-preview {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 10px;
  display: none;
}
.img-preview.show { display: block; }
.img-placeholder { color: var(--muted); font-size: 13px; padding: 20px 0; }
.img-placeholder span { font-size: 32px; display: block; margin-bottom: 6px; }

/* Editor toolbar */
.editor-toolbar {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  background: var(--bg);
}
.editor-toolbar button {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--white);
  transition: all var(--trans);
}
.editor-toolbar button:hover { background: var(--red); color: #fff; border-color: var(--red); }
.editor-import {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.editor-import strong {
  display: block;
  color: var(--dark);
  font-size: 13px;
  margin-bottom: 2px;
}
.editor-import span {
  color: var(--ink-soft);
  font-size: 12px;
}
.editor-textarea {
  border-radius: 0 0 4px 4px !important;
  min-height: 200px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
}
.editor-preview {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px 16px;
  min-height: 200px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink);
  background: #fafbfc;
}
.editor-preview h2 { font-size: 17px; font-weight: 700; margin: 18px 0 8px; }
.editor-preview h3 { font-size: 15px; font-weight: 700; margin: 14px 0 6px; }
.editor-preview p  { margin-bottom: 12px; }
.editor-preview ul, .editor-preview ol { margin: 0 0 12px 20px; }
.editor-preview blockquote { border-left: 4px solid var(--red); padding: 6px 12px; background: var(--bg); margin: 12px 0; font-style: italic; }
.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}
.editor-main,
.editor-sidebar {
  min-width: 0;
}
.editor-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.editor-widget {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}
.editor-widget h3 {
  font-size: 15px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 12px;
}
.editor-sidebar .editor-widget:first-child {
  border-top: 3px solid var(--red);
}
.editor-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 14px;
}
.editor-actions .btn-submit,
.editor-actions #btn-publicar {
  min-height: 42px;
  width: 100%;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(200,16,46,.22);
}
.editor-actions .btn-outline,
.editor-actions #btn-borrador {
  width: 100%;
}
.editor-flags {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
}
.form-check input {
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* Tabs */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 20px; gap: 0; }
.tab-btn {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all var(--trans);
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--red); border-bottom-color: var(--red); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* Sticky save bar */
.save-bar {
  position: sticky;
  bottom: 0;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 -2px 8px rgba(0,0,0,.08);
  z-index: 50;
  gap: 10px;
  flex-wrap: wrap;
}
.save-bar-left { display: flex; align-items: center; gap: 8px; }
.save-bar-right { display: flex; align-items: center; gap: 8px; }
.save-status {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.save-status.saved { color: var(--success); }
.save-status.error { color: var(--red); }

/* Alert / toast */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.alert-success { background: #e6f4ea; color: #1a7a3a; border: 1px solid #b2dfcb; }
.alert-error   { background: #fdecea; color: #c8102e; border: 1px solid #f5b8c0; }
.alert-info    { background: #e3f0fa; color: #1a5c96; border: 1px solid #adc8e8; }
.alert-warn    { background: #fff8e1; color: #c07a10; border: 1px solid #f5d78c; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: var(--radius);
  max-width: 420px;
  width: 90%;
  padding: 24px;
  box-shadow: var(--shadow-md);
}
.modal h2 { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.modal p  { font-size: 13px; color: var(--ink-soft); margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* Preview mode */
.preview-frame {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  padding: 24px;
  max-height: 500px;
  overflow-y: auto;
  font-size: 15px;
  line-height: 1.7;
}
.preview-frame h1 { font-size: 22px; font-weight: 900; margin-bottom: 8px; line-height: 1.2; }
.preview-frame .pv-cat { display: inline-block; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 2px; margin-bottom: 10px; }
.preview-frame .pv-bajada { font-style: italic; color: var(--ink-soft); border-left: 4px solid var(--red); padding-left: 12px; margin-bottom: 14px; font-size: 14px; }
.preview-frame .pv-meta { font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.preview-frame img { width: 100%; max-height: 250px; object-fit: cover; border-radius: 4px; margin-bottom: 14px; }
.preview-frame .pv-body h2 { font-size: 17px; font-weight: 700; margin: 16px 0 8px; }
.preview-frame .pv-body p  { margin-bottom: 12px; }

/* Security banner */
.security-banner {
  background: #fff8e1;
  border: 1px solid #f5d78c;
  border-left: 4px solid var(--warning);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 12px;
  color: #7a5000;
  margin-bottom: 20px;
}
.security-banner strong { color: var(--warning); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .admin-sidebar { transform: translateX(-100%); transition: transform var(--trans); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr; }
  .editor-layout { grid-template-columns: 1fr; }
  .editor-sidebar .editor-widget:first-child { position: static; }
  .editor-actions { grid-template-columns: 1fr; }
}
@media (min-width: 901px) and (max-width: 1180px) {
  .editor-layout { grid-template-columns: 1fr; }
  .editor-sidebar .editor-widget:first-child { position: static; }
  .editor-actions { grid-template-columns: minmax(160px, 1fr) minmax(180px, 1fr); }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
  .admin-content { padding: 14px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .editor-import { align-items: stretch; flex-direction: column; }
}

/* ── Login page ───────────────────────────────────────────── */
.admin-login-body { background: var(--bg); display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-wrap { width: 100%; max-width: 400px; padding: 20px; }
.login-card { background: var(--white); border-radius: 10px; padding: 36px 32px; box-shadow: var(--shadow-md); }
.login-logo { display: block; text-align: center; font-size: 22px; font-weight: 900; color: var(--dark); text-decoration: none; letter-spacing: 1px; margin-bottom: 6px; }
.login-logo span { color: var(--red); }
.login-title { text-align: center; font-size: 14px; color: var(--ink-soft); font-weight: 400; margin-bottom: 24px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.input-pw-wrap { position: relative; }
.input-pw-wrap .form-input { padding-right: 40px; }
.toggle-pw { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 16px; padding: 0; line-height: 1; }
/* Save status */
.save-status { font-size: 12px; margin-top: 8px; min-height: 20px; }
.save-status--ok    { color: var(--success); }
.save-status--error { color: var(--red); }
/* img preview */
.img-preview { width: 100%; max-height: 160px; object-fit: cover; border-radius: var(--radius); display: block; }
