/* =====================================================================
   Pautaly — sistema visual
   Precisa, tranquila y confiable. Sin degradados ni efectos llamativos.
   Los colores de redes sociales solo se usan en sus íconos.
   ===================================================================== */

@font-face { font-family: "Plus Jakarta Sans"; font-weight: 400; font-display: swap; src: url("../vendor/fonts/plus-jakarta-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 500; font-display: swap; src: url("../vendor/fonts/plus-jakarta-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 600; font-display: swap; src: url("../vendor/fonts/plus-jakarta-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 700; font-display: swap; src: url("../vendor/fonts/plus-jakarta-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 800; font-display: swap; src: url("../vendor/fonts/plus-jakarta-sans-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../vendor/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("../vendor/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../vendor/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("../vendor/fonts/inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url("../vendor/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url("../vendor/fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --p-primary: #0F766E;
  --p-primary-hover: #115E59;
  --p-primary-soft: #E6F2F1;
  --p-accent: #F59E0B;
  --p-accent-soft: #FEF3C7;
  --p-bg: #F7F7F5;
  --p-surface: #FFFFFF;
  --p-surface-2: #FAFAF9;
  --p-sidebar: #111827;
  --p-sidebar-text: #CBD5E1;
  --p-sidebar-muted: #64748B;
  --p-sidebar-active: #1F2937;
  --p-text: #1F2937;
  --p-text-2: #6B7280;
  --p-border: #E5E7EB;
  --p-success: #16A34A;
  --p-warning: #D97706;
  --p-danger: #DC2626;
  --p-info: #2563EB;
  --p-draft: #9CA3AF;
  --p-sandbox: #7C3AED;
  --p-radius: 12px;
  --p-radius-sm: 8px;
  --p-shadow: 0 1px 2px rgba(17, 24, 39, .05);
  --p-shadow-lg: 0 10px 30px rgba(17, 24, 39, .12);
  --p-font: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --p-font-ui: "Inter", "Segoe UI", system-ui, sans-serif;
  --p-mono: "JetBrains Mono", Consolas, monospace;
  --p-sidebar-w: 248px;
  --p-topbar-h: 64px;

  --bs-primary: var(--p-primary);
  --bs-primary-rgb: 15, 118, 110;
  --bs-body-font-family: var(--p-font-ui);
  --bs-body-color: var(--p-text);
  --bs-body-bg: var(--p-bg);
  --bs-border-color: var(--p-border);
  --bs-link-color: var(--p-primary);
  --bs-link-color-rgb: 15, 118, 110;
  --bs-link-hover-color: var(--p-primary-hover);
  --bs-border-radius: var(--p-radius-sm);
  --bs-secondary-color: var(--p-text-2);
}

[data-theme="dark"] {
  --p-primary: #14B8A6;
  --p-primary-hover: #2DD4BF;
  --p-primary-soft: #0F2E2B;
  --p-accent-soft: #3A2A07;
  --p-bg: #0B1120;
  --p-surface: #111827;
  --p-surface-2: #0F172A;
  --p-sidebar: #030712;
  --p-sidebar-active: #111827;
  --p-text: #E5E7EB;
  --p-text-2: #9CA3AF;
  --p-border: #1F2937;
  --bs-body-color: var(--p-text);
  --bs-body-bg: var(--p-bg);
  --bs-border-color: var(--p-border);
  --bs-secondary-color: var(--p-text-2);
  --bs-tertiary-bg: #1F2937;
  --bs-emphasis-color: #F9FAFB;
  color-scheme: dark;
}

html { font-size: 15px; }
body { background: var(--p-bg); color: var(--p-text); font-family: var(--p-font-ui); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5, .brand-font { font-family: var(--p-font); letter-spacing: -.01em; color: var(--p-text); }
.font-mono, code, kbd { font-family: var(--p-mono); }
a { text-decoration: none; }
.text-secondary { color: var(--p-text-2) !important; }
:focus-visible { outline: 2px solid var(--p-accent); outline-offset: 2px; }

/* ---------- Botones ---------- */
.btn { font-weight: 600; border-radius: 10px; padding: .5rem 1rem; }
.btn-sm { border-radius: 8px; padding: .3rem .7rem; }
.btn-primary { --bs-btn-bg: var(--p-primary); --bs-btn-border-color: var(--p-primary); --bs-btn-hover-bg: var(--p-primary-hover); --bs-btn-hover-border-color: var(--p-primary-hover); --bs-btn-active-bg: var(--p-primary-hover); --bs-btn-disabled-bg: var(--p-primary); --bs-btn-disabled-border-color: var(--p-primary); }
.btn-accent { background: var(--p-accent); color: #111827; border-color: var(--p-accent); }
.btn-accent:hover { background: #D97706; color: #111827; }
.btn-outline-primary { --bs-btn-color: var(--p-primary); --bs-btn-border-color: var(--p-primary); --bs-btn-hover-bg: var(--p-primary); --bs-btn-hover-border-color: var(--p-primary); }
.btn-light { background: var(--p-surface); border: 1px solid var(--p-border); color: var(--p-text); }
.btn-light:hover { background: var(--p-surface-2); border-color: #D1D5DB; color: var(--p-text); }
.btn-ghost { background: transparent; border: 0; color: var(--p-text-2); }
.btn-ghost:hover { color: var(--p-text); background: var(--p-surface-2); }
.btn-icon { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; }

/* ---------- Layout de la app ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--p-sidebar-w); background: var(--p-sidebar); color: var(--p-sidebar-text); position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 1030; transition: transform .2s ease; }
.sidebar-brand { height: var(--p-topbar-h); display: flex; align-items: center; gap: .6rem; padding: 0 1.25rem; color: #fff; font-family: var(--p-font); font-weight: 800; font-size: 1.35rem; letter-spacing: -.02em; }
.sidebar-brand:hover { color: #fff; }
.sidebar-brand .brand-y { position: relative; }
.sidebar-brand .brand-y::after { content: ""; position: absolute; left: 60%; bottom: -3px; width: 32px; height: 3px; border-radius: 2px; background: var(--p-accent); }
.sidebar-nav { padding: .5rem .75rem 1rem; overflow-y: auto; flex: 1; }
.nav-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--p-sidebar-muted); padding: 1rem .75rem .35rem; font-weight: 600; }
.sidebar-nav a { display: flex; align-items: center; gap: .75rem; padding: .55rem .75rem; border-radius: 10px; color: var(--p-sidebar-text); font-weight: 500; font-size: .93rem; }
.sidebar-nav a i { width: 18px; text-align: center; color: var(--p-sidebar-muted); }
.sidebar-nav a:hover { background: var(--p-sidebar-active); color: #fff; }
.sidebar-nav a.active { background: var(--p-sidebar-active); color: #fff; box-shadow: inset 3px 0 0 var(--p-accent); }
.sidebar-nav a.active i { color: var(--p-accent); }
.sidebar-nav .badge-count { margin-left: auto; background: var(--p-accent); color: #111827; font-size: .7rem; font-weight: 700; border-radius: 999px; padding: .1rem .45rem; }
.sidebar-foot { padding: .9rem 1.25rem; border-top: 1px solid #1F2937; font-size: .78rem; color: var(--p-sidebar-muted); display: flex; align-items: center; gap: .5rem; }
.worker-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--p-draft); }
.worker-dot.ok { background: var(--p-success); }
.worker-dot.bad { background: var(--p-danger); }

.main { margin-left: var(--p-sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: var(--p-topbar-h); background: var(--p-surface); border-bottom: 1px solid var(--p-border); display: flex; align-items: center; gap: .75rem; padding: 0 1.5rem; position: sticky; top: 0; z-index: 1020; }
.topbar .search { flex: 1; max-width: 420px; position: relative; }
.topbar .search input { padding-left: 2.2rem; background: var(--p-surface-2); border-color: var(--p-border); border-radius: 10px; }
.topbar .search i { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--p-text-2); }
.org-switch { border: 1px solid var(--p-border); border-radius: 10px; padding: .35rem .7rem; background: var(--p-surface); display: flex; align-items: center; gap: .5rem; font-weight: 600; color: var(--p-text); max-width: 240px; }
.org-switch .org-avatar { width: 24px; height: 24px; border-radius: 6px; background: var(--p-primary); color: #fff; font-size: .75rem; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.org-switch span.name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 34px; height: 34px; border-radius: 50%; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; background: var(--p-primary); flex-shrink: 0; }
.avatar-sm { width: 26px; height: 26px; font-size: .7rem; }
.bell { position: relative; }
.bell .dot { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--p-danger); color: #fff; font-size: .62rem; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 3px; }
.content { padding: 1.75rem 1.5rem 3rem; max-width: 1440px; width: 100%; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-head h1 { font-size: 1.6rem; font-weight: 800; margin: 0; }
.page-head .sub { color: var(--p-text-2); margin: .25rem 0 0; }
.sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--p-shadow-lg); }
  .app.sidebar-open .sidebar { transform: none; }
  .app.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 1025; }
  .main { margin-left: 0; }
  .topbar { padding: 0 .75rem; }
  .topbar .search { display: none; }
  .content { padding: 1.25rem .9rem 3rem; }
  .page-head h1 { font-size: 1.35rem; }
}

/* ---------- Tarjetas ---------- */
.card { background: var(--p-surface); border: 1px solid var(--p-border); border-radius: var(--p-radius); box-shadow: var(--p-shadow); color: var(--p-text); }
.card-header { background: transparent; border-bottom: 1px solid var(--p-border); padding: .9rem 1.15rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.card-header h2, .card-header h3 { font-size: 1rem; font-weight: 700; margin: 0; }
.card-body { padding: 1.15rem; }
.card-status { border-left: 4px solid var(--p-border); }
.card-status.s-published { border-left-color: var(--p-success); }
.card-status.s-scheduled { border-left-color: var(--p-info); }
.card-status.s-failed, .card-status.s-critical { border-left-color: var(--p-danger); }
.card-status.s-pending_approval, .card-status.s-warning { border-left-color: var(--p-warning); }
.card-status.s-draft { border-left-color: var(--p-draft); }

.kpi { padding: 1rem 1.15rem; display: flex; flex-direction: row; gap: .9rem; align-items: center; }
.kpi .kpi-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.kpi .kpi-value { font-family: var(--p-font); font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.kpi .kpi-label { color: var(--p-text-2); font-size: .82rem; font-weight: 500; }
.kpi-info .kpi-icon { background: #DBEAFE; color: var(--p-info); }
.kpi-success .kpi-icon { background: #DCFCE7; color: var(--p-success); }
.kpi-danger .kpi-icon { background: #FEE2E2; color: var(--p-danger); }
.kpi-warning .kpi-icon { background: var(--p-accent-soft); color: var(--p-warning); }
.kpi-primary .kpi-icon { background: var(--p-primary-soft); color: var(--p-primary); }
[data-theme="dark"] .kpi .kpi-icon { background: var(--p-surface-2); }

/* ---------- Píldoras de estado ---------- */
.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .18rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; background: #F3F4F6; color: #374151; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-draft { background: #F3F4F6; color: #6B7280; }
.pill-pending_approval, .pill-pending, .pill-warning, .pill-expired, .pill-queued { background: #FEF3C7; color: #B45309; }
.pill-scheduled, .pill-info, .pill-processing, .pill-locked { background: #DBEAFE; color: #1D4ED8; }
.pill-published, .pill-connected, .pill-ok, .pill-approved, .pill-done, .pill-success, .pill-active { background: #DCFCE7; color: #15803D; }
.pill-failed, .pill-error, .pill-critical, .pill-rejected, .pill-danger { background: #FEE2E2; color: #B91C1C; }
.pill-partial, .pill-draft_sent { background: #FFEDD5; color: #C2410C; }
.pill-cancelled, .pill-disconnected, .pill-disabled, .pill-unknown { background: #F3F4F6; color: #4B5563; }
.pill-sandbox, .pill-simulated { background: #EDE9FE; color: var(--p-sandbox); }
[data-theme="dark"] .pill { filter: saturate(.9) brightness(.95); }

/* ---------- Chips de red / cuentas ---------- */
.chip { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--p-border); border-radius: 999px; padding: .2rem .65rem .2rem .3rem; font-size: .82rem; background: var(--p-surface); color: var(--p-text); }
.chip .chip-ic { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--p-surface-2); font-size: .8rem; }
.account-pick { display: flex; align-items: center; gap: .65rem; padding: .55rem .7rem; border: 1px solid var(--p-border); border-radius: 10px; cursor: pointer; background: var(--p-surface); transition: border-color .15s, background .15s; user-select: none; }
.account-pick:hover { border-color: #CBD5E1; }
.account-pick.selected { border-color: var(--p-primary); background: var(--p-primary-soft); }
.account-pick.disabled { opacity: .5; cursor: not-allowed; }
.account-pick .acc-ic { position: relative; }
.account-pick .acc-ic i { position: absolute; right: -4px; bottom: -4px; background: var(--p-surface); border-radius: 50%; font-size: .75rem; padding: 1px; }
.health-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--p-draft); }
.health-dot.ok { background: var(--p-success); }
.health-dot.warning { background: var(--p-warning); }
.health-dot.critical { background: var(--p-danger); }
.sandbox-badge { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--p-sandbox); background: #EDE9FE; border-radius: 6px; padding: .1rem .4rem; }

/* ---------- Tablas ---------- */
.table { --bs-table-bg: transparent; --bs-table-color: var(--p-text); margin: 0; }
.table > thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--p-text-2); font-weight: 600; background: var(--p-surface-2); border-bottom: 1px solid var(--p-border); position: sticky; top: 0; z-index: 1; padding: .7rem .9rem; white-space: nowrap; }
.table > tbody td { padding: .7rem .9rem; vertical-align: middle; border-color: var(--p-border); height: 48px; }
.table-hover > tbody > tr:hover > * { --bs-table-hover-bg: var(--p-surface-2); --bs-table-hover-color: var(--p-text); }
.table-wrap { overflow-x: auto; }
.cell-title { font-weight: 600; color: var(--p-text); }
.cell-sub { font-size: .8rem; color: var(--p-text-2); }

/* ---------- Formularios ---------- */
.form-label { font-weight: 600; font-size: .86rem; margin-bottom: .35rem; color: var(--p-text); }
.form-text { color: var(--p-text-2); font-size: .8rem; }
.form-control, .form-select { border-radius: 10px; border-color: var(--p-border); background-color: var(--p-surface); color: var(--p-text); padding: .55rem .8rem; }
.form-control:focus, .form-select:focus { border-color: var(--p-primary); box-shadow: 0 0 0 3px rgba(15, 118, 110, .15); background-color: var(--p-surface); color: var(--p-text); }
.form-check-input:checked { background-color: var(--p-primary); border-color: var(--p-primary); }
.invalid-feedback { font-size: .8rem; }
.char-counter { font-family: var(--p-mono); font-size: .78rem; color: var(--p-text-2); }
.char-counter.over { color: var(--p-danger); font-weight: 600; }

/* ---------- Estados vacíos y carga ---------- */
.empty { text-align: center; padding: 3rem 1rem; color: var(--p-text-2); }
.empty .empty-ic { width: 64px; height: 64px; border-radius: 18px; background: var(--p-primary-soft); color: var(--p-primary); display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 1rem; }
.empty h3 { font-size: 1.05rem; font-weight: 700; color: var(--p-text); }
.skeleton { background: linear-gradient(90deg, var(--p-surface-2), var(--p-border), var(--p-surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; min-height: 14px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.top-loader { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--p-accent); z-index: 2000; transition: width .3s ease, opacity .3s; opacity: 0; }
.top-loader.on { opacity: 1; width: 70%; }

/* ---------- Toasts propios ---------- */
.toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 2000; display: flex; flex-direction: column; gap: .5rem; max-width: min(380px, calc(100vw - 2rem)); }
.p-toast { background: var(--p-sidebar); color: #F9FAFB; border-radius: 12px; padding: .75rem 1rem; display: flex; gap: .7rem; align-items: flex-start; box-shadow: var(--p-shadow-lg); font-size: .9rem; animation: tin .2s ease; border-left: 4px solid var(--p-primary); }
.p-toast.success { border-left-color: var(--p-success); }
.p-toast.error { border-left-color: var(--p-danger); }
.p-toast.warning { border-left-color: var(--p-accent); }
.p-toast i { margin-top: .15rem; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Banda de avisos (Centinela) ---------- */
.notice { border-radius: 10px; padding: .7rem .9rem; display: flex; gap: .7rem; align-items: flex-start; font-size: .9rem; border: 1px solid; }
.notice-warning { background: #FFFBEB; border-color: #FDE68A; color: #92400E; }
.notice-danger { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }
.notice-info { background: #EFF6FF; border-color: #BFDBFE; color: #1E40AF; }
.notice-success { background: #F0FDF4; border-color: #BBF7D0; color: #166534; }
.notice-sandbox { background: #F5F3FF; border-color: #DDD6FE; color: #5B21B6; }
[data-theme="dark"] .notice { background: var(--p-surface-2); }

/* ---------- Autenticación ---------- */
.auth-body { background: var(--p-bg); }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-side { background: var(--p-sidebar); color: #E5E7EB; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side .pauta { position: absolute; right: -40px; top: 28%; opacity: .07; width: 420px; }
.auth-side h2 { color: #fff; font-size: 2rem; font-weight: 800; max-width: 420px; line-height: 1.2; }
.auth-side ul { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.auth-side li { display: flex; gap: .7rem; margin-bottom: .8rem; color: #CBD5E1; }
.auth-side li i { color: var(--p-accent); margin-top: .2rem; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 1.6rem; font-weight: 800; }
.error-code { font-family: var(--p-font); font-size: 4rem; font-weight: 800; color: var(--p-primary); line-height: 1; margin-bottom: .5rem; }
.auth-wrap > .auth-card { margin: auto; grid-column: 1 / -1; background: var(--p-surface); border: 1px solid var(--p-border); border-radius: var(--p-radius); padding: 2rem; }
@media (max-width: 991.98px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* ---------- Composer ---------- */
.composer-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 1.25rem; align-items: start; }
@media (max-width: 1199.98px) { .composer-grid { grid-template-columns: 1fr; } }
.variant-tabs .nav-link { color: var(--p-text-2); font-weight: 600; border-radius: 10px; display: flex; align-items: center; gap: .4rem; }
.variant-tabs .nav-link.active { background: var(--p-primary-soft); color: var(--p-primary); }
.variant-tabs .nav-link .warn { color: var(--p-warning); }
.variant-tabs .nav-link .err { color: var(--p-danger); }
.media-strip { display: flex; flex-wrap: wrap; gap: .5rem; }
.media-thumb { width: 92px; height: 92px; border-radius: 10px; overflow: hidden; position: relative; border: 1px solid var(--p-border); background: var(--p-surface-2); }
.media-thumb img, .media-thumb video { width: 100%; height: 100%; object-fit: cover; }
.media-thumb .rm { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(17,24,39,.75); color: #fff; font-size: .7rem; }
.media-thumb .kind { position: absolute; left: 4px; bottom: 4px; background: rgba(17,24,39,.75); color: #fff; font-size: .65rem; border-radius: 4px; padding: 0 .3rem; }
.preview-card { border: 1px solid var(--p-border); border-radius: 12px; background: var(--p-surface); overflow: hidden; }
.preview-head { display: flex; align-items: center; gap: .6rem; padding: .7rem .8rem; }
.preview-body { padding: 0 .8rem .8rem; white-space: pre-wrap; word-break: break-word; font-size: .9rem; }
.preview-media { background: var(--p-surface-2); aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.preview-media img, .preview-media video { width: 100%; height: 100%; object-fit: cover; }
.preview-note { font-size: .72rem; color: var(--p-text-2); padding: .4rem .8rem; border-top: 1px dashed var(--p-border); }
.emoji-panel { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 220px; overflow-y: auto; padding: .4rem; width: 300px; }
.emoji-panel button { border: 0; background: transparent; font-size: 1.25rem; border-radius: 6px; padding: .15rem; }
.emoji-panel button:hover { background: var(--p-surface-2); }

/* ---------- Biblioteca ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .9rem; }
.media-card { border: 1px solid var(--p-border); border-radius: 12px; overflow: hidden; background: var(--p-surface); cursor: pointer; transition: border-color .15s, box-shadow .15s; position: relative; }
.media-card:hover { border-color: #CBD5E1; box-shadow: var(--p-shadow-lg); }
.media-card.selected { border-color: var(--p-primary); box-shadow: 0 0 0 2px var(--p-primary); }
.media-card .thumb { aspect-ratio: 4 / 3; background: var(--p-surface-2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.media-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-card .thumb .fa-film { font-size: 2rem; color: var(--p-text-2); }
.media-card .meta { padding: .5rem .65rem; font-size: .78rem; }
.media-card .meta .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--p-text); }
.dropzone { border: 2px dashed var(--p-border); border-radius: 12px; padding: 1.75rem; text-align: center; color: var(--p-text-2); background: var(--p-surface); transition: border-color .15s, background .15s; cursor: pointer; }
.dropzone.drag { border-color: var(--p-primary); background: var(--p-primary-soft); }
.compat-list { display: flex; flex-wrap: wrap; gap: .35rem; }
.compat-list .ok { color: var(--p-success); }
.compat-list .no { color: var(--p-danger); }
.folder-list a { display: flex; align-items: center; gap: .5rem; padding: .4rem .6rem; border-radius: 8px; color: var(--p-text); font-size: .9rem; }
.folder-list a.active, .folder-list a:hover { background: var(--p-primary-soft); color: var(--p-primary); }

/* ---------- Calendario ---------- */
.fc { --fc-border-color: var(--p-border); --fc-today-bg-color: var(--p-primary-soft); --fc-page-bg-color: var(--p-surface); --fc-neutral-bg-color: var(--p-surface-2); --fc-list-event-hover-bg-color: var(--p-surface-2); font-size: .85rem; }
.fc .fc-toolbar-title { font-family: var(--p-font); font-size: 1.15rem; font-weight: 700; text-transform: capitalize; }
.fc .fc-button-primary { background: var(--p-surface); border-color: var(--p-border); color: var(--p-text); font-weight: 600; text-transform: capitalize; }
.fc .fc-button-primary:not(:disabled).fc-button-active, .fc .fc-button-primary:not(:disabled):active { background: var(--p-primary); border-color: var(--p-primary); color: #fff; }
.fc .fc-button-primary:hover { background: var(--p-surface-2); color: var(--p-text); border-color: #CBD5E1; }
.fc-event.pe { border: 0; border-left: 3px solid var(--ev-color, var(--p-info)); background: var(--p-surface-2); color: var(--p-text); padding: 1px 4px; border-radius: 6px; cursor: pointer; }
.fc-event.pe .fc-event-main { color: var(--p-text); }
.fc-event.pe.st-published { --ev-color: var(--p-success); }
.fc-event.pe.st-failed, .fc-event.pe.st-partial { --ev-color: var(--p-danger); }
.fc-event.pe.st-pending_approval { --ev-color: var(--p-warning); }
.fc-event.pe.st-draft, .fc-event.pe.st-cancelled { --ev-color: var(--p-draft); }
.fc-event.pe.st-processing { --ev-color: var(--p-primary); }
.fc-event.pe.st-simulated { --ev-color: var(--p-sandbox); }
.ev-line { display: flex; align-items: center; gap: .3rem; overflow: hidden; white-space: nowrap; font-size: .78rem; }
.ev-line .risk { color: var(--p-warning); }
.ev-line .risk.critical { color: var(--p-danger); }
.filters-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.filters-bar .form-select, .filters-bar .form-control { width: auto; min-width: 150px; }

/* ---------- Varios ---------- */
.list-clean { list-style: none; padding: 0; margin: 0; }
.list-row { display: flex; align-items: center; gap: .75rem; padding: .7rem 1.15rem; border-bottom: 1px solid var(--p-border); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 1rem 1.4rem; font-size: .88rem; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--p-primary); }
.timeline li::after { content: ""; position: absolute; left: 8.5px; top: 16px; bottom: 0; width: 1px; background: var(--p-border); }
.timeline li:last-child::after { display: none; }
.perm-matrix th, .perm-matrix td { text-align: center; }
.perm-matrix td:first-child, .perm-matrix th:first-child { text-align: left; }
.dropdown-menu { border-radius: 12px; border-color: var(--p-border); box-shadow: var(--p-shadow-lg); background: var(--p-surface); --bs-dropdown-link-color: var(--p-text); --bs-dropdown-link-hover-bg: var(--p-surface-2); }
.dropdown-item { border-radius: 8px; font-size: .9rem; }
.dropdown-menu { padding: .35rem; }
.notif-menu { width: 360px; max-width: calc(100vw - 1.5rem); padding: 0; }
.notif-item { display: flex; gap: .65rem; padding: .7rem .9rem; border-bottom: 1px solid var(--p-border); color: var(--p-text); font-size: .86rem; }
.notif-item.unread { background: var(--p-primary-soft); }
.notif-item .ni-ic { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--p-surface-2); }
.modal-content { border-radius: 14px; border-color: var(--p-border); background: var(--p-surface); color: var(--p-text); }
.swal2-popup { border-radius: 14px !important; font-family: var(--p-font-ui) !important; }
.swal2-styled.swal2-confirm { background: var(--p-primary) !important; border-radius: 10px !important; }
.swal2-styled.swal2-cancel { border-radius: 10px !important; }
.nav-pills .nav-link.active { background: var(--p-primary); }
.progress { height: 8px; border-radius: 4px; }
.progress-bar { background: var(--p-primary); }
.bg-primary-soft { background: var(--p-primary-soft); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.metric-na { color: var(--p-text-2); font-style: italic; font-size: .85rem; }

/* ---------- Ajustes responsive (verificados con Playwright a 375/768 px) ---------- */
.min-w-0 { min-width: 0; }
.kpi { overflow: hidden; min-width: 0; }
.kpi .kpi-label, .kpi .cell-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#calendar { max-width: 100%; overflow-x: auto; }
@media (max-width: 575.98px) {
  .kpi { padding: .8rem; gap: .6rem; }
  .kpi .kpi-icon { width: 36px; height: 36px; font-size: .95rem; }
  .kpi .kpi-value { font-size: 1.3rem; }
  .card-body { padding: .9rem; }
  .fc .fc-toolbar { flex-wrap: wrap; gap: .5rem; }
  .fc .fc-toolbar-title { font-size: 1rem; }
}
