@import url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css');

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* Elimina el highlight gris al tocar en iOS/Android */
a, button { -webkit-tap-highlight-color: transparent; }

/* ── Variables ──────────────────────────────────────────── */
:root {
  --primary: #10CFC9;
  --primary-strong: #00AFAA;
  --bg: #FFFFFE;
  --fg: #383A41;
  --muted: #E5E1E6;
  --secondary: #54565A;
  --accent: #655DC6;
  --border: #D4D6D7;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 1px 4px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
  --shadow-focus: 0 0 0 3px rgba(16,207,201,.25);
}

/* ── Base ───────────────────────────────────────────────── */
body {
  font-family: 'Open Sans', sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1,h2,h3,h4,h5,h6 { font-family: 'Montserrat', sans-serif; }
button { font-family: inherit; }

/* ── Layout ─────────────────────────────────────────────── */
/* 100vh fallback → 100dvh excluye la barra del browser en iOS/Android */
.layout { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100vh; height: 100dvh; overflow: hidden; }

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: 256px; flex-shrink: 0; background: var(--fg);
  display: flex; flex-direction: column; height: 100vh; height: 100dvh; position: sticky; top: 0;
}
.sidebar-logo {
  height: 64px; display: flex; align-items: center; padding: 0 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-logo a { display: flex; align-items: center; gap: 8px; }
.logo-dot { width: 10px; height: 10px; background: var(--primary); border-radius: 50%; flex-shrink: 0; }
.logo-text { font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 1.125rem; color: #fff; letter-spacing: -.01em; }
.sidebar-logo-img { height: 32px; width: auto; object-fit: contain; filter: brightness(0) invert(1); }

.sidebar-nav { flex: 1; padding: 12px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px;
  font-size: .875rem; font-weight: 500; color: rgba(255,255,255,.6);
  cursor: pointer; transition: color .15s, background .15s;
  text-decoration: none; width: 100%; border: none; background: transparent;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-item.active { color: var(--primary); background: rgba(16,207,201,.15); }
.nav-divider { margin: 12px; height: 1px; background: rgba(255,255,255,.1); }
.nav-section-label {
  font-size: .6875rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255,255,255,.3); padding: 0 12px; margin-bottom: 4px;
}

.sidebar-user { border-top: 1px solid rgba(255,255,255,.1); padding: 8px; }
.user-profile-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px;
  cursor: pointer; transition: background .15s; text-decoration: none; width: 100%;
}
.user-profile-link:hover, .user-profile-link.active { background: rgba(255,255,255,.08); }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: .75rem; flex-shrink: 0;
}
.user-avatar-img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.2); flex-shrink: 0; }
.user-info { flex: 1; min-width: 0; }
.user-display { font-size: .75rem; font-weight: 600; color: rgba(255,255,255,.8); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-username { font-size: .6875rem; color: rgba(255,255,255,.4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.logout-btn {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px;
  font-size: .875rem; color: rgba(255,255,255,.5); cursor: pointer;
  transition: color .15s, background .15s; border: none; background: transparent;
  width: 100%; margin-bottom: 4px;
}
.logout-btn:hover { color: rgba(255,255,255,.8); background: rgba(255,255,255,.08); }

/* ── Page header ────────────────────────────────────────── */
.page-header {
  height: 64px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; background: #fff; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30; flex-shrink: 0;
}
.page-title { font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 1.0625rem; color: var(--fg); }
.page-actions { display: flex; align-items: center; gap: 8px; }

/* ── Main content ───────────────────────────────────────── */
.page-body { flex: 1; padding: 24px; overflow-y: auto; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
  border-radius: 8px; font-size: .875rem; font-weight: 600;
  border: none; cursor: pointer; transition: background .15s, opacity .15s;
  text-decoration: none; white-space: nowrap;
}
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-strong); }
.btn-secondary { background: #fff; color: var(--fg); border: 1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--muted); }
.btn-danger { background: #fee2e2; color: #dc2626; }
.btn-danger:hover:not(:disabled) { background: #fecaca; }
.btn-sm { padding: 6px 12px; font-size: .8125rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-ghost { background: transparent; color: var(--secondary); border: 1px solid transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--muted); color: var(--fg); }

/* ── Form fields ────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: .8125rem; font-weight: 600; color: var(--fg); font-family: 'Montserrat', sans-serif; }
.field-hint { font-size: .75rem; color: var(--secondary); }
.input, .textarea, .select {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--border);
  border-radius: 8px; font-size: .875rem; font-family: inherit;
  color: var(--fg); background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--primary); box-shadow: var(--shadow-focus); }
.textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2354565A' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: .875rem; color: var(--fg); font-weight: 500; }
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; border-radius: 4px; accent-color: var(--primary); cursor: pointer; }

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 100px;
  font-size: .6875rem; font-weight: 700; font-family: 'Montserrat', sans-serif;
  letter-spacing: .02em; white-space: nowrap;
}
.badge-published { background: #d1fae5; color: #065f46; }
.badge-draft { background: #fef3c7; color: #92400e; }
.badge-archived { background: var(--muted); color: var(--secondary); }
.badge-admin { background: rgba(101,93,198,.12); color: var(--accent); }
.badge-colaborador { background: rgba(16,207,201,.12); color: var(--primary-strong); }
.badge-active { background: #d1fae5; color: #065f46; }
.badge-inactive { background: #fee2e2; color: #dc2626; }

/* ── Alerts ─────────────────────────────────────────────── */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: 8px; font-size: .875rem; line-height: 1.5; margin-bottom: 16px; }
.alert.hidden { display: none; }
.alert-error { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-info { background: rgba(16,207,201,.08); color: var(--primary-strong); border: 1px solid rgba(16,207,201,.3); display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* Category tag pills */
.cat-tags-area { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.cat-tag-pill { position: relative; display: inline-flex; align-items: center; background: rgba(101,93,198,.1); color: var(--accent); padding: 5px 12px; border-radius: 100px; font-size: .75rem; font-weight: 600; }
.cat-tag-remove { position: absolute; top: -6px; right: -6px; width: 17px; height: 17px; background: var(--accent); color: #fff; border-radius: 50%; border: none; cursor: pointer; font-size: 11px; display: flex; align-items: center; justify-content: center; padding: 0; line-height: 1; transition: background .15s; }
.cat-tag-remove:hover { background: #4a3fa0; }

/* Draft auto-save indicator */
.draft-saved { font-size: .75rem; color: var(--secondary); display: flex; align-items: center; gap: 5px; }
.draft-saved::before { content: ''; width: 6px; height: 6px; background: var(--primary); border-radius: 50%; flex-shrink: 0; }

/* ── Cards ──────────────────────────────────────────────── */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title-sm { font-family: 'Montserrat', sans-serif; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--secondary); }
.card-body { padding: 20px; }
.card-body.space-y > * + * { margin-top: 16px; }

/* ── Table ──────────────────────────────────────────────── */
.table-wrap { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; overflow-x: auto; max-width: 1100px; margin: 0 auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead tr { background: rgba(229,225,230,.3); border-bottom: 1px solid var(--border); }
th { text-align: left; padding: 12px 20px; font-family: 'Montserrat', sans-serif; font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--secondary); }
td { padding: 14px 20px; vertical-align: middle; }
tbody tr:not(:last-child) { border-bottom: 1px solid rgba(212,214,215,.6); }
tbody tr:hover { background: rgba(229,225,230,.2); transition: background .1s; }
.td-title { font-weight: 500; color: var(--fg); }
.td-sub { font-size: .75rem; color: var(--secondary); margin-top: 2px; font-family: monospace; }
.td-secondary { color: var(--secondary); font-size: .75rem; }
.td-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }

.action-btn {
  font-size: .75rem; font-weight: 600; color: var(--secondary); padding: 4px 8px;
  border-radius: 6px; cursor: pointer; transition: color .15s, background .15s;
  border: none; background: transparent;
}
.action-btn:hover { color: var(--primary-strong); background: var(--muted); }
.action-btn.danger:hover { color: #dc2626; background: #fee2e2; }

.icon-btn {
  padding: 6px; border-radius: 6px; cursor: pointer; color: var(--secondary);
  transition: color .15s, background .15s; border: none; background: transparent;
  display: flex; align-items: center;
}
.icon-btn:hover { color: var(--primary-strong); background: var(--muted); }
.icon-btn.disabled { color: var(--border); cursor: not-allowed; pointer-events: none; }

/* ── Modal ──────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.15);
  width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
  transform: translateY(8px); transition: transform .2s;
}
.modal-backdrop.open .modal { transform: translateY(0); }
.modal-header { padding: 20px 24px 0; display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-family: 'Montserrat', sans-serif; font-size: 1rem; font-weight: 600; color: var(--fg); }
.modal-close { background: transparent; border: none; cursor: pointer; color: var(--secondary); padding: 4px; border-radius: 6px; display: flex; align-items: center; transition: color .15s; }
.modal-close:hover { color: var(--fg); }
.modal-body { padding: 20px 24px 24px; }
.modal-body .space-y > * + * { margin-top: 16px; }
.modal-body .form-footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }

/* ── Spinner ────────────────────────────────────────────── */
.spinner { width: 32px; height: 32px; border: 3px solid var(--muted); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-page { display: flex; align-items: center; justify-content: center; height: 200px; }
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }

/* ── Empty state ────────────────────────────────────────── */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; text-align: center; gap: .75rem; }
.empty-state .empty-icon { width: 56px; height: 56px; opacity: .35; }
.empty-state h2 { font-size: 1.1rem; font-weight: 600; margin: 0; }
.empty-state p { color: var(--secondary); font-size: .875rem; margin: 0; }

/* ── Stats ──────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-label { font-family: 'Montserrat', sans-serif; font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--secondary); margin-bottom: 8px; }
.stat-value { font-family: 'Montserrat', sans-serif; font-size: 1.875rem; font-weight: 700; color: var(--fg); }
.stat-card.published .stat-value { color: #059669; }
.stat-card.draft .stat-value { color: #d97706; }
.stat-card.archived .stat-value { color: var(--secondary); }

/* ── Filter bar (non-scrolling area above table) ─────────── */
.filter-bar { flex-shrink: 0; padding: 12px 24px 0; background: var(--bg); border-bottom: 1px solid var(--border); }
.filter-bar .filter-tabs { margin-bottom: 12px; }

/* ── Filter tabs ────────────────────────────────────────── */
.filter-tabs { display: flex; align-items: center; gap: 2px; background: rgba(229,225,230,.5); border: 1px solid var(--border); border-radius: 10px; padding: 4px; width: fit-content; margin-bottom: 20px; }
.filter-tab { padding: 6px 12px; border-radius: 7px; font-size: .75rem; font-weight: 600; font-family: 'Montserrat', sans-serif; cursor: pointer; border: none; background: transparent; color: var(--secondary); transition: color .15s, background .15s; }
.filter-tab:hover { color: var(--fg); }
.filter-tab.active { background: #fff; color: var(--fg); box-shadow: 0 1px 3px rgba(0,0,0,.08); border: 1px solid rgba(212,214,215,.5); }
.filter-tab .count { margin-left: 4px; opacity: .6; font-size: .6875rem; }

/* ── Quick actions ──────────────────────────────────────── */
.quick-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.quick-action { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; cursor: pointer; transition: border-color .15s, box-shadow .15s; text-decoration: none; display: block; }
.quick-action:hover { border-color: rgba(16,207,201,.4); box-shadow: 0 4px 20px rgba(16,207,201,.12), 0 2px 8px rgba(0,0,0,.06); }
.quick-action-icon { font-size: 1.5rem; margin-bottom: 12px; }
.quick-action-label { font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: .875rem; color: var(--fg); margin-bottom: 4px; }
.quick-action-desc { font-size: .75rem; color: var(--secondary); }

/* ── Post editor ────────────────────────────────────────── */
.editor-grid { display: grid; grid-template-columns: 1fr 280px; gap: 24px; max-width: 1024px; margin: 0 auto; }
@media (max-width: 768px) { .editor-grid { grid-template-columns: 1fr; } }
.editor-main { display: flex; flex-direction: column; gap: 20px; }
.editor-sidebar { display: flex; flex-direction: column; gap: 16px; }

.tiptap-toolbar {
  display: flex; align-items: center; gap: 2px; padding: 8px 12px;
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
  /* Sigue al usuario mientras desplaza el editor, para no tener que volver arriba */
  position: sticky; top: 0; z-index: 5;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .03);
}
.toolbar-btn { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 6px; border: none; background: transparent; cursor: pointer; color: var(--secondary); font-size: .875rem; font-family: 'Montserrat', sans-serif; font-weight: 600; transition: color .15s, background .15s; }
.toolbar-btn:hover { color: var(--fg); background: var(--muted); }
.toolbar-btn.is-active { color: var(--primary-strong); background: rgba(16,207,201,.12); }
.toolbar-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; flex-shrink: 0; }

.tiptap-editor { min-height: 300px; cursor: text; }
.tiptap-editor .ProseMirror { min-height: 300px; padding: 16px 20px; outline: none; font-size: .9375rem; line-height: 1.7; color: var(--fg); }
.tiptap-editor .ProseMirror > * + * { margin-top: .75rem; }
.tiptap-editor .ProseMirror h1 { font-family: 'Montserrat', sans-serif; font-size: 1.5rem; font-weight: 700; line-height: 1.3; }
.tiptap-editor .ProseMirror h2 { font-family: 'Montserrat', sans-serif; font-size: 1.25rem; font-weight: 700; line-height: 1.3; }
.tiptap-editor .ProseMirror h3 { font-family: 'Montserrat', sans-serif; font-size: 1.0625rem; font-weight: 600; }
.tiptap-editor .ProseMirror ul { list-style: disc; padding-left: 24px; }
.tiptap-editor .ProseMirror ol { list-style: decimal; padding-left: 24px; }
.tiptap-editor .ProseMirror li + li { margin-top: 4px; }
.tiptap-editor .ProseMirror blockquote { border-left: 4px solid var(--primary); padding-left: 16px; font-style: italic; color: var(--secondary); }
.tiptap-editor .ProseMirror code { background: var(--muted); padding: 2px 6px; border-radius: 4px; font-size: .875rem; font-family: monospace; }
.tiptap-editor .ProseMirror pre { background: var(--fg); color: var(--bg); padding: 16px; border-radius: 8px; overflow-x: auto; }
.tiptap-editor .ProseMirror pre code { background: transparent; color: inherit; padding: 0; }
.tiptap-editor .ProseMirror a { color: var(--primary-strong); text-decoration: underline; cursor: pointer; }
.tiptap-editor .ProseMirror img { max-width: 100%; border-radius: 8px; }
.tiptap-editor .ProseMirror strong { font-weight: 600; }
.tiptap-editor .ProseMirror hr { border: none; border-top: 1px solid var(--border); margin: 8px 0; }
.tiptap-editor .ProseMirror p.is-editor-empty:first-child::before { content: attr(data-placeholder); color: rgba(84,86,90,.45); float: left; height: 0; pointer-events: none; }
.ProseMirror-selectednode { outline: 2px solid var(--primary); }

/* ── Status cards ───────────────────────────────────────────────── */
.status-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.status-card { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 12px 6px; border-radius: 10px; border: 1.5px solid var(--border); cursor: pointer; transition: all .15s; font-size: .7rem; font-weight: 600; color: var(--secondary); text-align: center; background: #fff; user-select: none; }
.status-card:hover { border-color: var(--primary); color: var(--primary-strong); background: rgba(16,207,201,.05); }
.status-card i { font-size: 1.25rem; }
.status-card[data-value="draft"].active { border-color: #f59e0b; background: rgba(245,158,11,.08); color: #d97706; }
.status-card[data-value="published"].active { border-color: #22c55e; background: rgba(34,197,94,.08); color: #16a34a; }
.status-card[data-value="archived"].active { border-color: var(--secondary); background: rgba(84,86,90,.08); color: var(--secondary); }

/* ── Profile ────────────────────────────────────────────── */
.profile-card { display: flex; align-items: center; gap: 20px; padding: 24px; background: #fff; border: 1px solid var(--border); border-radius: 16px; margin-bottom: 24px; }
.profile-avatar { width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); display: flex; align-items: center; justify-content: center; color: #fff; font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 1.25rem; flex-shrink: 0; }

/* ── Avatar picker ──────────────────────────────────────────────── */
.avatar-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.avatar-preset { width: 44px; height: 44px; border-radius: 50%; border: 2.5px solid var(--border); cursor: pointer; overflow: hidden; transition: border-color .15s; flex-shrink: 0; background: var(--muted); display: flex; align-items: center; justify-content: center; }
.avatar-preset img { width: 100%; height: 100%; object-fit: cover; }
.avatar-preset:hover { border-color: var(--primary); }
.avatar-preset.selected { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(16,207,201,.3); }
.avatar-preset-placeholder { font-size: .75rem; color: var(--secondary); display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }

/* ── Post thumbnail in table ────────────────────────────────── */
.post-thumb { width: 42px; height: 42px; border-radius: 6px; object-fit: cover; flex-shrink: 0; background: var(--muted); }
.post-thumb-placeholder { width: 42px; height: 42px; border-radius: 6px; background: var(--muted); flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--secondary); }
.post-title-cell { display: flex; align-items: center; gap: 10px; }

/* ── Login ──────────────────────────────────────────────── */
.login-layout { display: flex; min-height: 100vh; }
.login-form-area { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(24px,5vw,64px); max-width: 480px; }
.login-decoration { display: none; }
@media (min-width: 1024px) {
  .login-decoration { display: flex; flex: 1; background: var(--fg); align-items: center; justify-content: center; position: relative; overflow: hidden; }
}

/* ── Hamburger / Mobile drawer ──────────────────────────── */
.hamburger-btn {
  display: none; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px;
  border: none; background: transparent; color: var(--fg);
  cursor: pointer; font-size: 1.375rem; flex-shrink: 0;
  transition: background .15s;
}
.hamburger-btn:hover { background: var(--muted); }

.sidebar-close-btn {
  display: none; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 6px; margin-left: auto;
  border: none; background: rgba(255,255,255,.1); color: rgba(255,255,255,.65);
  cursor: pointer; font-size: .9rem; flex-shrink: 0; transition: background .15s;
}
.sidebar-close-btn:hover { background: rgba(255,255,255,.2); color: #fff; }

.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 99;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.sidebar-overlay.open { opacity: 1; pointer-events: auto; }

/* ── Utility ────────────────────────────────────────────── */
.hidden { display: none !important; }
.space-y > * + * { margin-top: 16px; }
.space-y-sm > * + * { margin-top: 12px; }
.section-divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── Cover image preview ────────────────────────────────── */
/* El posicionamiento real (absolute, fill) se aplica inline en el editor dentro
   de .cover-dropzone. Aquí solo aseguramos que no herede márgenes/bordes que la
   desalineen. */
#cover-preview { display: block; margin: 0; border: none; }

/* ── Responsive ─────────────────────────────────────────── */

/* Pantallas medianas: sidebar más compacta */
@media (max-width: 1024px) {
  .sidebar { width: 220px; }
  .page-body { padding: 20px; }
}

/* Tablet / mobile */
@media (max-width: 768px) {
  .hide-md { display: none; }

  /* Sidebar → drawer deslizable desde la izquierda */
  .hamburger-btn { display: flex; }
  .sidebar-close-btn { display: flex; }
  .sidebar-overlay { display: block; }

  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 272px; z-index: 100;
    height: 100vh; height: 100dvh; /* dvh excluye la chrome bar en iOS/Android */
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    box-shadow: none;
    overscroll-behavior: contain; /* evita que el scroll del drawer mueva el body en iOS */
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 6px 0 32px rgba(0,0,0,.28);
  }
  /* Safe area para el notch/home-bar de iPhone X+ */
  .sidebar-user { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }

  .main-area { height: 100vh; height: 100dvh; }

  /* Inputs: iOS Safari hace zoom si font-size < 16px al enfocar */
  .input, .textarea, .select { font-size: 1rem; }

  /* Header */
  .page-header { padding: 0 16px; height: 56px; gap: 8px; }
  .page-title { font-size: .9375rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Contenido */
  .page-body { padding: 16px; }

  /* Stats — 2 columnas en tablet */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }

  /* Filter bar scroll horizontal */
  .filter-bar { padding: 10px 16px 0; }
  .filter-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .filter-tab { white-space: nowrap; flex-shrink: 0; }

  /* Tabla — padding reducido */
  th { padding: 10px 14px; font-size: .625rem; }
  td { padding: 12px 14px; }

  /* Modal — bottom sheet en móvil */
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { max-width: 100%; border-radius: 20px 20px 0 0; max-height: 85vh; }
  .modal-header { padding: 16px 20px 0; }
  .modal-body { padding: 16px 20px 28px; }

  /* Profile card — apilada */
  .profile-card { flex-direction: column; align-items: flex-start; gap: 16px; padding: 20px 16px; }

  /* Editor — columna única */
  .editor-grid { grid-template-columns: 1fr; }
}

/* Móvil pequeño */
@media (max-width: 540px) {
  .hide-sm { display: none; }

  /* Stats — 1 columna */
  .stats-grid { grid-template-columns: 1fr; }

  /* Quick actions — 1 columna */
  .quick-actions { grid-template-columns: 1fr; }

  /* Botones del page-header: ocultar texto, dejar solo icono */
  .page-actions .btn-text { display: none; }

  /* Tabla: padding mínimo */
  th { padding: 8px 10px; }
  td { padding: 10px 10px; }
  .td-actions { gap: 2px; }

  /* Card bodies más ajustados */
  .card-body { padding: 14px; }
  .card-header { padding: 12px 14px; }

  /* Stat card */
  .stat-value { font-size: 1.5rem; }
}
