/* Fase 1/admin/css/admin.css
 *
 * Componentes del Admin Dashboard: páginas de autenticación, shell
 * (sidebar + header), botones, campos de formulario, tarjetas de métricas
 * y estados vacíos. Usa exclusivamente las variables de tokens.css.
 */

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

/* El atributo hidden siempre debe ganar, sin importar qué otra regla de
   esta hoja fije `display` en el mismo elemento (p. ej. .field-error,
   .auth-alert). Evita el bug de que un mensaje de error quede visible
   después de ocultarlo por JS solo porque una clase con igual
   especificidad que [hidden] se aplicó después en la cascada. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; color: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible {
  outline: 2px solid var(--accent-secondary);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius-s);
  font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background-color .15s var(--ease), border-color .15s var(--ease);
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent-primary); color: var(--text-on-magenta); }
.btn-primary:hover:not(:disabled) { background: var(--accent-primary-press); }
.btn-secondary { background: var(--bg-surface); color: var(--text-primary); border-color: var(--border-subtle); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-app); }

/* ---------- Páginas de autenticación (login / change-password) ---------- */
.auth-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--bg-app);
}
.auth-card {
  width: 100%; max-width: 400px; background: var(--bg-surface);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-l);
  padding: 36px 32px; box-shadow: var(--shadow-m);
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
/* .auth-brand-mark: todavía la usa change-password.html (texto "Teatro en
   15") — esa pantalla no se tocó en este cambio, así que la regla se
   conserva para no romperla. */
.auth-brand-mark { font-weight: 700; font-size: 16px; }
/* Logo oficial (mismo archivo que el sitio público, 270x140 px reales),
   usado en login.html — altura fija, ancho automático: nunca se deforma. */
.auth-brand-logo { height: 32px; width: auto; display: block; }
.auth-brand-sub { font-size: 13px; color: var(--text-muted); }
.auth-title { margin: 0 0 4px; font-size: 22px; font-weight: 700; }
.auth-subtitle { margin: 0 0 24px; color: var(--text-muted); font-size: 14px; }

.auth-alert {
  padding: 10px 14px; border-radius: var(--radius-s); font-size: 13.5px;
  margin-bottom: 16px; line-height: 1.4;
}
.auth-alert--danger { background: var(--danger-tint); color: var(--danger); }
.auth-alert--success { background: var(--success-tint); color: var(--success); }

.field { display: block; margin-bottom: 18px; }
.field-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input[type="email"], .field input[type="password"], .field input[type="text"] {
  width: 100%; height: 42px; padding: 0 14px; border-radius: var(--radius-s);
  border: 1px solid var(--border-subtle); background: var(--bg-surface);
}
.field input:focus { border-color: var(--accent-primary); }
.field-with-action { position: relative; }
.field-with-action input { padding-right: 76px; }
.field-action {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  height: 30px; padding: 0 10px; border: 0; background: transparent;
  color: var(--accent-secondary); font-weight: 600; font-size: 12.5px; cursor: pointer; border-radius: 6px;
}
.field-action:hover { background: var(--accent-secondary-tint); }
.field-hint { display: block; font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.field-error { display: block; font-size: 12.5px; color: var(--danger); margin-top: 6px; }

/* ---------- Shell del dashboard ---------- */
.dash-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle); display: flex; flex-direction: column;
  padding: 20px 0;
}
.sidebar-brand { padding: 0 20px 20px; font-weight: 700; font-size: 15px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 20px; overflow-y: auto; }
.sidebar-group { display: flex; flex-direction: column; }
.sidebar-group-label {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted); padding: 0 20px 8px;
}
.sidebar-link {
  display: block; padding: 9px 20px; color: var(--text-primary); text-decoration: none;
  font-size: 14px; font-weight: 500; border-left: 3px solid transparent;
}
.sidebar-link:hover { background: var(--bg-app); }
.sidebar-link--active {
  background: var(--accent-primary-tint); border-left-color: var(--accent-primary);
  color: var(--accent-primary); font-weight: 600;
}

.sidebar-toggle {
  display: none; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 1px solid var(--border-subtle); border-radius: var(--radius-s);
  background: var(--bg-surface); cursor: pointer; margin-right: 4px;
}

.dash-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.dash-header {
  height: var(--header-h); flex-shrink: 0; display: flex; align-items: center; gap: 16px;
  padding: 0 24px; background: var(--bg-surface); border-bottom: 1px solid var(--border-subtle);
}
.search-field {
  flex: 1; max-width: 420px; display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 12px; border-radius: var(--radius-s);
  background: var(--bg-app); color: var(--text-muted);
}
.search-field input {
  border: 0; background: transparent; width: 100%; font-size: 14px; color: var(--text-primary);
}
.search-field input::placeholder { color: var(--text-muted); }

.header-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }

.account-menu { position: relative; }
.account-trigger {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  background: transparent; border: 0; cursor: pointer; padding: 4px 8px; border-radius: var(--radius-s);
}
.account-trigger:hover { background: var(--bg-app); }
.account-name { font-size: 13.5px; font-weight: 600; }
.account-role { font-size: 11.5px; color: var(--text-muted); }
.account-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 160px;
  background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-s);
  box-shadow: var(--shadow-s); overflow: hidden; z-index: 20;
}
.account-dropdown-item {
  display: block; width: 100%; text-align: left; padding: 10px 14px; border: 0;
  background: transparent; cursor: pointer; font-size: 13.5px;
}
.account-dropdown-item:hover { background: var(--bg-app); }

.dash-content { flex: 1; padding: 28px 32px; overflow-y: auto; }

.view-header { margin-bottom: 20px; }
.view-title { margin: 0; font-size: 20px; font-weight: 700; }
.section-subtitle { font-size: 14px; font-weight: 700; margin: 0 0 12px; }

.metric-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px;
}
.metric-card {
  background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-m);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow-xs);
}
.metric-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.metric-value { font-size: 28px; font-weight: 700; }
.metric-value--loading { font-size: 14px; font-weight: 500; color: var(--text-muted); }
.metric-value--error { color: var(--danger); }

.quick-actions-grid { display: flex; flex-wrap: wrap; gap: 10px; }

.empty-state {
  background: var(--bg-surface); border: 1px dashed var(--border-subtle); border-radius: var(--radius-m);
  padding: 48px 24px; text-align: center;
}
.empty-state-title { font-weight: 700; margin: 0 0 6px; }
.empty-state-body { color: var(--text-muted); margin: 0; font-size: 14px; }

.sidebar-scrim {
  position: fixed; inset: 0; background: rgba(41,43,53,.35); z-index: 15;
}

/* ---------- Etapa B: listados, formularios, modal, toasts ---------- */

.view-header--with-action { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.view-header-actions { display: flex; gap: 10px; }

.btn-link {
  background: none; border: 0; color: var(--accent-secondary); font-weight: 600;
  font-size: 13.5px; cursor: pointer; padding: 4px 6px; border-radius: 6px;
}
.btn-link:hover { background: var(--accent-secondary-tint); }
.btn-link--danger { color: var(--danger); }
.btn-link--danger:hover { background: var(--danger-tint); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 85%, #000); }

.select {
  height: 38px; padding: 0 12px; border-radius: var(--radius-s);
  border: 1px solid var(--border-subtle); background: var(--bg-surface); font-size: 14px;
}

/* Toolbar: búsqueda + filtros */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.search-field--toolbar { flex: 1; min-width: 220px; max-width: 360px; height: 38px; background: var(--bg-surface); border: 1px solid var(--border-subtle); }
.search-field--toolbar input { color: var(--text-primary); }

/* Tabla de datos */
.table-state { padding: 40px 0; text-align: center; color: var(--text-muted); }
.table-state--error { color: var(--danger); display: flex; flex-direction: column; align-items: center; gap: 10px; }

.data-table {
  width: 100%; border-collapse: collapse; background: var(--bg-surface);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-m); overflow: hidden;
}
.data-table th, .data-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border-subtle); font-size: 13.5px; }
.data-table th { font-weight: 600; color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: var(--bg-app); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--bg-app); }
.data-table-title { font-weight: 600; }
.data-table-thumb-col { width: 56px; }
.data-table-actions-col { white-space: nowrap; text-align: right; }

.table-thumb { width: 40px; height: 56px; object-fit: cover; border-radius: 6px; display: block; }
.table-thumb--empty { background: var(--bg-app); border: 1px dashed var(--border-subtle); }
.table-thumb--round { width: 40px; height: 40px; border-radius: 50%; }

/* Enlaces externos (Cast & Production) — mismo patrón visual que .paragraph-row */
.link-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.link-row input[type="text"], .link-row input[type="url"] {
  flex: 1; height: 38px; padding: 0 12px; border-radius: var(--radius-s); border: 1px solid var(--border-subtle);
}

/* Badges */
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.badge--status-now { background: var(--accent-primary-tint); color: var(--accent-primary); }
.badge--status-soon { background: var(--accent-secondary-tint); color: color-mix(in srgb, var(--accent-secondary) 60%, #000); }
.badge--status-archived { background: var(--bg-app); color: var(--text-muted); }
.badge--published { background: var(--success-tint); color: var(--success); }
.badge--draft { background: var(--bg-app); color: var(--text-muted); }
.badge--role { background: var(--bg-app); color: var(--text-primary); text-transform: none; font-weight: 600; }

/* Formularios (crear/editar) */
.form-panel {
  background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-m);
  padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--shadow-xs);
}
.form-panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.form-panel-title { font-size: 15px; font-weight: 700; margin: 0 0 16px; }
.form-panel-header .form-panel-title { margin-bottom: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field--checkbox { display: flex; align-items: center; gap: 8px; margin-top: 22px; }
.field--checkbox input { width: 18px; height: 18px; }
.form-actions { display: flex; justify-content: flex-end; margin-bottom: 32px; }

/* Selector de idioma ES/EN */
.lang-switcher { display: inline-flex; background: var(--bg-app); border-radius: 999px; padding: 3px; gap: 2px; }
.lang-pill { border: 0; background: transparent; padding: 6px 16px; border-radius: 999px; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--text-muted); }
.lang-pill--active { background: var(--accent-primary); color: var(--text-on-magenta); }

/* Párrafos de descripción */
.paragraph-row { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.paragraph-row textarea {
  flex: 1; border: 1px solid var(--border-subtle); border-radius: var(--radius-s); padding: 10px 12px;
  font: inherit; resize: vertical;
}
.paragraph-remove {
  width: 32px; height: 32px; border-radius: var(--radius-s); border: 1px solid var(--border-subtle);
  background: var(--bg-surface); cursor: pointer; font-size: 16px; color: var(--text-muted); flex-shrink: 0;
}
.paragraph-remove:disabled { opacity: .4; cursor: not-allowed; }
.paragraph-remove:hover:not(:disabled) { background: var(--danger-tint); color: var(--danger); }

/* Subida de imagen deshabilitada (sin bucket configurado) */
.upload-disabled {
  display: flex; align-items: center; gap: 10px; padding: 14px; margin-top: 10px;
  border: 1px dashed var(--border-subtle); border-radius: var(--radius-s);
  background: var(--bg-app); color: var(--text-muted); font-size: 13px;
}
.upload-disabled input[disabled] { cursor: not-allowed; }

/* Créditos (Cast & Production dentro de Shows) */
.credit-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-subtle);
}
.credit-name { font-weight: 600; flex: 1; }
.credit-row-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border-subtle);
  background: var(--bg-surface); cursor: pointer; color: var(--text-primary);
}
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.icon-btn:hover:not(:disabled) { background: var(--bg-app); }

.credit-add-row { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.credit-add-row input[type="text"] {
  flex: 1; min-width: 200px; height: 38px; padding: 0 12px; border-radius: var(--radius-s);
  border: 1px solid var(--border-subtle);
}
.person-results {
  margin-top: 8px; border: 1px solid var(--border-subtle); border-radius: var(--radius-s);
  max-height: 180px; overflow-y: auto; background: var(--bg-surface);
}
.person-result {
  display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: transparent;
  cursor: pointer; font-size: 13.5px; border-bottom: 1px solid var(--border-subtle);
}
.person-result:last-child { border-bottom: 0; }
.person-result:hover { background: var(--bg-app); }

/* Modal genérico (confirmación / vista previa) */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(41,43,53,.45); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: var(--bg-surface); border-radius: var(--radius-l); box-shadow: var(--shadow-m);
  max-width: 440px; width: 100%; padding: 24px; position: relative;
}
.modal-title { margin: 0 0 10px; font-size: 17px; font-weight: 700; }
.modal-message { margin: 0 0 20px; color: var(--text-muted); font-size: 14px; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.modal-close {
  position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 8px;
  border: 0; background: var(--bg-app); font-size: 20px; line-height: 1; cursor: pointer; color: var(--text-muted);
}

/* Modal de vista previa */
.modal--preview { max-width: 560px; }
.preview-disclaimer {
  background: var(--accent-secondary-tint); color: color-mix(in srgb, var(--accent-secondary) 55%, #000);
  border-radius: var(--radius-s); padding: 10px 14px; font-size: 12.5px; line-height: 1.5; margin-bottom: 16px;
}
.preview-body { display: flex; gap: 18px; }
.preview-poster { width: 140px; height: 196px; object-fit: cover; border-radius: var(--radius-s); flex-shrink: 0; }
.preview-poster--empty {
  display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 12px;
  background: var(--bg-app); border: 1px dashed var(--border-subtle); text-align: center;
}
.preview-info h2 { margin: 10px 0 4px; font-size: 18px; }
.preview-genre { color: var(--text-muted); font-size: 13px; margin: 0 0 10px; }
.preview-info p { font-size: 13.5px; line-height: 1.6; margin: 0 0 8px; }
.preview-empty-text { color: var(--text-muted); font-style: italic; }

/* Toasts */
.toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 60; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--color-dark); color: #fff; padding: 12px 16px; border-radius: var(--radius-s);
  font-size: 13.5px; box-shadow: var(--shadow-m); max-width: 320px; animation: toast-in .15s var(--ease);
}
.toast--error { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Etapa D: toggle de vista, badges de estado calculado, calendario ---------- */

.view-toggle { display: inline-flex; background: var(--bg-app); border-radius: var(--radius-s); padding: 3px; gap: 2px; margin-bottom: 16px; }
.view-toggle-btn { border: 0; background: transparent; padding: 7px 16px; border-radius: 6px; font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--text-muted); }
.view-toggle-btn--active { background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-xs); }

.badge--pstatus-upcoming { background: var(--accent-secondary-tint); color: color-mix(in srgb, var(--accent-secondary) 55%, #000); }
.badge--pstatus-live { background: var(--success-tint); color: var(--success); }
.badge--pstatus-completed { background: var(--bg-app); color: var(--text-muted); }
.badge--pstatus-cancelled { background: var(--danger-tint); color: var(--danger); }

.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.calendar-nav { display: flex; align-items: center; gap: 12px; }
.calendar-label { font-weight: 700; font-size: 15px; text-transform: capitalize; min-width: 160px; text-align: center; }

.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px;
  background: var(--border-subtle); border: 1px solid var(--border-subtle); border-radius: var(--radius-m); overflow: hidden;
}
.calendar-weekday {
  background: var(--bg-app); padding: 8px; text-align: center; font-size: 11.5px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
}
.calendar-day {
  background: var(--bg-surface); border: 0; min-height: 72px; padding: 8px; display: flex; flex-direction: column;
  align-items: flex-start; gap: 6px; cursor: pointer; font: inherit; color: var(--text-primary);
}
.calendar-grid--week .calendar-day { min-height: 110px; }
.calendar-day:hover { background: var(--bg-app); }
.calendar-day--muted { color: var(--text-muted); background: color-mix(in srgb, var(--bg-app) 60%, #fff); }
.calendar-day--today .calendar-day-number {
  background: var(--accent-primary); color: #fff; border-radius: 50%; width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
}
.calendar-day--selected { outline: 2px solid var(--accent-secondary); outline-offset: -2px; }
.calendar-day-number { font-size: 13px; font-weight: 600; }
.calendar-day-dots { display: flex; gap: 4px; flex-wrap: wrap; }
.calendar-dot { width: 7px; height: 7px; border-radius: 50%; }
.calendar-dot--upcoming { background: var(--accent-secondary); }
.calendar-dot--live { background: var(--success); }
.calendar-dot--completed { background: var(--text-muted); }
.calendar-dot--cancelled { background: var(--danger); }

/* ---------- Etapa E: editor de texto enriquecido ---------- */

.rte-toolbar {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border: 1px solid var(--border-subtle);
  border-bottom: 0; border-radius: var(--radius-s) var(--radius-s) 0 0; background: var(--bg-app);
}
.rte-btn {
  height: 32px; padding: 0 10px; border-radius: 6px; border: 1px solid transparent; background: transparent;
  font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text-primary);
}
.rte-btn:hover { background: var(--bg-surface); border-color: var(--border-subtle); }
.rte-btn--bold { font-weight: 800; }
.rte-btn--italic { font-style: italic; }

.rte-editable {
  min-height: 220px; padding: 14px 16px; border: 1px solid var(--border-subtle); border-radius: 0 0 var(--radius-s) var(--radius-s);
  background: var(--bg-surface); font-size: 14.5px; line-height: 1.6;
}
.rte-editable:focus { outline: none; border-color: var(--accent-primary); }

.rte-editable h2, .rte-content h2 { font-size: 19px; margin: 0 0 10px; font-weight: 700; }
.rte-editable h3, .rte-content h3 { font-size: 16px; margin: 0 0 8px; font-weight: 700; }
.rte-editable p, .rte-content p { margin: 0 0 10px; }
.rte-editable ul, .rte-editable ol, .rte-content ul, .rte-content ol { margin: 0 0 10px; padding-left: 22px; }
.rte-editable a, .rte-content a { color: var(--accent-secondary); text-decoration: underline; }

.news-preview-body h2 { margin: 10px 0 14px; font-size: 19px; }

/* ---------- Etapa G: portada real (News) ---------- */
.cover-preview { display: flex; gap: 16px; align-items: flex-start; }
.cover-preview-img { width: 140px; height: 140px; object-fit: cover; border-radius: var(--radius-s); flex-shrink: 0; }
.cover-preview-img--empty {
  display: flex; align-items: center; justify-content: center; text-align: center; font-size: 12px;
  color: var(--text-muted); background: var(--bg-app); border: 1px dashed var(--border-subtle); padding: 10px;
}

/* ---------- Etapa F: galería de Media Library ---------- */

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.media-card {
  background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-m);
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-xs);
}
.media-card-thumb {
  height: 120px; background: var(--bg-app); display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--border-subtle);
}
.media-card-mime { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); letter-spacing: .04em; }
.media-card-img { width: 100%; height: 100%; object-fit: cover; }
.media-card-body { padding: 12px 14px; flex: 1; }
.media-card-path { font-size: 12.5px; font-weight: 600; margin: 0 0 4px; word-break: break-all; }
.media-card-meta { font-size: 11.5px; color: var(--text-muted); margin: 0 0 2px; }
.media-card-alt { font-size: 11.5px; color: var(--text-muted); margin: 4px 0 0; font-style: italic; }
.media-card .badge { margin-top: 8px; }
.media-card-delete { width: 100%; text-align: center; border-top: 1px solid var(--border-subtle); border-radius: 0; padding: 8px; }

/* ---------- Responsive ---------- */

/* Tablet: 768px–1023px — sidebar colapsa a overlay expandible por tap/teclado,
   nunca solo por :hover. */
@media (max-width: 1023px) {
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 20; transform: translateX(-100%);
    transition: transform .2s var(--ease); box-shadow: var(--shadow-m);
  }
  .sidebar.sidebar--expanded { transform: translateX(0); }
  .sidebar-toggle { display: inline-flex; }
  .sidebar-scrim { display: block; }
}
@media (min-width: 1024px) {
  .sidebar-scrim { display: none !important; }
}

/* Mobile: < 768px */
@media (max-width: 767px) {
  .dash-header { padding: 0 16px; gap: 10px; }
  .search-field { display: none; }
  .dash-content { padding: 20px 16px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .account-name, .account-role { display: none; }
  .account-trigger::after { content: "⋮"; font-size: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .preview-body { flex-direction: column; }
  .preview-poster { width: 100%; height: 220px; }
  .data-table { display: block; overflow-x: auto; white-space: nowrap; }
  .calendar-day { min-height: 52px; padding: 5px; }
  .calendar-grid--week .calendar-day { min-height: 80px; }
  .calendar-label { min-width: 0; font-size: 13px; }
  .link-row { flex-wrap: wrap; }
  .link-row input[type="text"] { flex-basis: 100%; }
  .link-row input[type="url"] { flex: 1 1 auto; min-width: 0; }
}
@media (max-width: 480px) {
  .metric-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
}
