/* =====================================================
   Evoque Tickets — style.css
   Paleta e-voque (misma del LMS): azul #2b50c8, UI clara
   y aireada, pills blancos, Montserrat + Open Sans.
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&family=Open+Sans:wght@400;500;600&display=swap');

:root {
    --ev-blue:       #2b50c8;
    --ev-blue-dark:  #1e3ca6;
    --ev-blue-soft:  #eef3fc;
    --ev-blue-line:  #dbe4f4;
    --ev-green:      #5f9c4f;
    --ev-green-dark: #4c8140;
    --ev-green-soft: #ecf5e8;
    --ev-rose-soft:  #fcf1f2;
    --ev-rose:       #b34a5c;
    --ev-amber:      #b98a2c;
    --ev-amber-soft: #fdf6e3;
    --dark:          #1C1C28;
    --bg:            #f6f8fb;
    --text:          #2C2C3A;
    --text-muted:    #6b7280;
    --border:        #e3e9f4;
    --white:         #ffffff;
    --shadow-sm:     0 2px 8px rgba(30,60,120,.06);
    --shadow-md:     0 2px 10px rgba(30,60,120,.08);
    --shadow-lg:     0 8px 26px rgba(30,60,120,.14);
    --radius:        10px;
    --radius-lg:     14px;
    --transition:    .2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
    font-family: 'Open Sans', sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.65;
    min-height: 100vh;
}

h1, h2, h3, h4 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    line-height: 1.3;
    color: var(--dark);
}

a { color: var(--ev-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* =====================================================
   NAVBAR — estilo pill e-voque
   ===================================================== */
.navbar {
    background: var(--bg);
    border-bottom: 1px solid #e7ecf5;
    padding: .7rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: .38rem .95rem .38rem .45rem;
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--transition), transform var(--transition);
    text-decoration: none;
}
.navbar-brand:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); text-decoration: none; }

.navbar-brand .brand-icon {
    width: 32px; height: 32px;
    background: var(--ev-blue);
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    color: #fff;
    font-size: .95rem;
    flex-shrink: 0;
}
.navbar-brand .brand-text {
    color: var(--ev-blue-dark);
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -.01em;
}
.navbar-brand .brand-text span { color: var(--ev-blue); font-weight: 600; }

.navbar-user { display: flex; align-items: center; gap: .7rem; }
.navbar-user .user-name { color: var(--text); font-size: .9rem; font-weight: 600; }
.navbar-user .user-avatar {
    width: 32px; height: 32px;
    background: var(--ev-blue);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: .8rem;
    font-family: 'Montserrat', sans-serif;
}

/* =====================================================
   BOTONES
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .55rem 1.25rem;
    border-radius: 100px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: .88rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background var(--transition), color var(--transition), border-color var(--transition), transform .18s ease, box-shadow .18s ease;
    text-decoration: none;
    line-height: 1.4;
}
.btn:hover { text-decoration: none; }
.btn:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(30,60,166,.16); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary { background: var(--ev-blue); border-color: var(--ev-blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--ev-blue-dark); border-color: var(--ev-blue-dark); color: #fff; }

.btn-ghost {
    background: var(--white);
    color: var(--ev-blue-dark);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.btn-ghost:hover:not(:disabled) { background: var(--ev-blue-soft); border-color: var(--ev-blue); color: var(--ev-blue-dark); }

.btn-success { background: var(--ev-green); border-color: var(--ev-green); color: #fff; }
.btn-success:hover:not(:disabled) { background: var(--ev-green-dark); border-color: var(--ev-green-dark); color: #fff; }

.btn-danger { background: #fff; border-color: #e3a7a7; color: #a03d3d; }
.btn-danger:hover:not(:disabled) { background: #fdf1f1; border-color: #a03d3d; color: #a03d3d; }

.btn-sm { padding: .35rem .9rem; font-size: .8rem; }
.btn-block { width: 100%; justify-content: center; }

/* =====================================================
   LOGIN
   ===================================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #f2f6fd 0%, #eef7f0 100%);
}
.login-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    padding: 2.4rem 2.2rem;
    width: 100%;
    max-width: 420px;
    animation: evFadeUp .5s cubic-bezier(.22,.9,.35,1) both;
}
.login-logo { text-align: center; margin-bottom: 1.6rem; }
.login-logo .logo-icon {
    width: 52px; height: 52px;
    background: var(--ev-blue);
    border-radius: 14px;
    margin: 0 auto .85rem;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800; font-size: 1.4rem; color: #fff;
    box-shadow: 0 3px 10px rgba(43,80,200,.25);
}
.login-logo h1 { font-size: 1.35rem; margin-bottom: .2rem; }
.login-logo p { color: var(--text-muted); font-size: .88rem; }
.login-hint { text-align: center; margin-top: 1.2rem; }

/* =====================================================
   FORMULARIOS
   ===================================================== */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: .84rem;
    margin-bottom: .35rem;
    color: var(--dark);
}
.form-control {
    width: 100%;
    padding: .6rem .85rem;
    border: 1px solid #c6d2e6;
    border-radius: var(--radius);
    font-family: 'Open Sans', sans-serif;
    font-size: .92rem;
    color: var(--text);
    background: #fff;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: var(--ev-blue);
    box-shadow: 0 0 0 3px var(--ev-blue-soft);
}
textarea.form-control { resize: vertical; min-height: 130px; }
select.form-control { appearance: auto; }
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: .3rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* =====================================================
   ALERTAS
   ===================================================== */
.alert {
    padding: .7rem 1rem;
    border-radius: var(--radius);
    font-size: .88rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}
.alert-danger  { background: #fdf1f1; color: #a03d3d; border-color: #e3a7a7; }
.alert-success { background: var(--ev-green-soft); color: #2f6023; border-color: #a9cf9c; }
.alert-info    { background: var(--ev-blue-soft); color: var(--ev-blue-dark); border-color: var(--ev-blue-line); }

/* =====================================================
   LAYOUT PRINCIPAL
   ===================================================== */
.container { max-width: 1080px; margin: 0 auto; padding: 1.8rem 1.5rem 3rem; }

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.4rem;
    flex-wrap: wrap;
}
.page-head h1 { font-size: 1.5rem; }
.page-head .sub { color: var(--text-muted); font-size: .9rem; margin-top: .15rem; }

/* Tarjetas de resumen */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: .9rem;
    margin-bottom: 1.6rem;
}
.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: .95rem 1.1rem;
    transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.stat-card .num {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--ev-blue-dark);
}
.stat-card .lbl { font-size: .78rem; color: var(--text-muted); font-weight: 600; }
.stat-card.accent-green  .num { color: var(--ev-green-dark); }
.stat-card.accent-amber  .num { color: var(--ev-amber); }
.stat-card.accent-rose   .num { color: var(--ev-rose); }

/* Filtros */
.filters {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: 1.2rem;
}
.filter-pill {
    padding: .38rem 1rem;
    border-radius: 100px;
    background: var(--white);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: .8rem;
    box-shadow: var(--shadow-sm);
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.filter-pill:hover { background: var(--ev-blue-soft); border-color: var(--ev-blue); text-decoration: none; }
.filter-pill.active { background: var(--ev-blue); border-color: var(--ev-blue); color: #fff; }

/* =====================================================
   LISTA DE TICKETS
   ===================================================== */
.ticket-list { display: flex; flex-direction: column; gap: .75rem; }

.ticket-card {
    display: block;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1rem 1.25rem;
    transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
    color: var(--text);
    animation: evFadeUp .45s cubic-bezier(.22,.9,.35,1) both;
}
.ticket-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--ev-blue-line);
    text-decoration: none;
}
.ticket-card .tk-top {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
}
.ticket-card .tk-id {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: .8rem;
    color: var(--text-muted);
}
.ticket-card .tk-asunto {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--dark);
    flex: 1 1 auto;
}
.ticket-card .tk-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: .35rem;
    font-size: .8rem;
    color: var(--text-muted);
}
.ticket-card .tk-dot { color: #c9d2e4; }
.ticket-card.needs-attention { border-left: 4px solid var(--ev-blue); }

/* Badges de estado */
.badge {
    display: inline-block;
    padding: .18rem .7rem;
    border-radius: 100px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: .72rem;
    white-space: nowrap;
}
.badge-abierto     { background: var(--ev-blue-soft);  color: var(--ev-blue-dark); border: 1px solid var(--ev-blue-line); }
.badge-en_progreso { background: var(--ev-amber-soft); color: var(--ev-amber);     border: 1px solid #ecdcb0; }
.badge-resuelto    { background: var(--ev-green-soft); color: #2f6023;             border: 1px solid #a9cf9c; }
.badge-cerrado     { background: #f1f3f7;              color: #6b7280;             border: 1px solid #dfe4ec; }
.badge-reabierto   { background: var(--ev-rose-soft);  color: var(--ev-rose);      border: 1px solid #e8c3ca; }

.badge-pr-baja    { background: #f1f3f7;              color: #6b7280;         border: 1px solid #dfe4ec; }
.badge-pr-media   { background: var(--ev-blue-soft);  color: var(--ev-blue-dark); border: 1px solid var(--ev-blue-line); }
.badge-pr-alta    { background: var(--ev-amber-soft); color: var(--ev-amber);  border: 1px solid #ecdcb0; }
.badge-pr-urgente { background: #fdf1f1;              color: #a03d3d;          border: 1px solid #e3a7a7; }

/* Estado vacío */
.empty-state {
    text-align: center;
    background: var(--white);
    border: 1px dashed #c9d4e8;
    border-radius: var(--radius-lg);
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}
.empty-state .emoji { font-size: 2rem; margin-bottom: .5rem; }

/* =====================================================
   DETALLE DE TICKET
   ===================================================== */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.4rem 1.5rem;
    margin-bottom: 1.2rem;
    animation: evFadeUp .45s cubic-bezier(.22,.9,.35,1) both;
}
.card h2 { font-size: 1.05rem; margin-bottom: .8rem; }

.ticket-detail-head { display: flex; align-items: flex-start; gap: .8rem; flex-wrap: wrap; }
.ticket-detail-head h1 { font-size: 1.3rem; flex: 1 1 auto; }
.ticket-desc { white-space: pre-wrap; margin-top: .8rem; }

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .8rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eef1f7;
}
.meta-grid .mg-lbl { font-size: .72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.meta-grid .mg-val { font-size: .88rem; font-weight: 600; color: var(--dark); }

/* Hilo de comentarios */
.comment-thread { display: flex; flex-direction: column; gap: .8rem; }

.comment {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: .9rem 1.1rem;
    background: #fbfcff;
    animation: evFadeUp .4s ease both;
}
.comment.role-soporte {
    background: var(--ev-blue-soft);
    border-color: var(--ev-blue-line);
    border-left: 4px solid var(--ev-blue);
}
.comment.role-cliente { border-left: 4px solid #c9d2e4; }
.comment .c-head {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin-bottom: .35rem;
    flex-wrap: wrap;
}
.comment .c-author { font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: .85rem; color: var(--dark); }
.comment .c-role   { font-size: .7rem; font-weight: 600; color: var(--ev-blue-dark); background: #fff; border: 1px solid var(--ev-blue-line); border-radius: 100px; padding: .05rem .55rem; }
.comment.role-cliente .c-role { color: var(--text-muted); border-color: #dfe4ec; }
.comment .c-date { font-size: .75rem; color: var(--text-muted); margin-left: auto; }
.comment .c-body { font-size: .92rem; white-space: pre-wrap; }
.comment .c-status-change {
    margin-top: .5rem;
    font-size: .78rem;
    color: var(--text-muted);
}

/* Cambio de estado como evento del hilo */
.thread-event {
    text-align: center;
    font-size: .78rem;
    color: var(--text-muted);
    padding: .2rem 0;
}
.thread-event .badge { margin: 0 .25rem; }

/* Adjuntos */
.attachment-list { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: .3rem .85rem;
    font-size: .8rem;
    font-weight: 600;
    color: var(--ev-blue-dark);
    box-shadow: var(--shadow-sm);
    transition: background var(--transition), border-color var(--transition);
}
.attachment-chip:hover { background: var(--ev-blue-soft); border-color: var(--ev-blue); text-decoration: none; }

/* Barra de acciones del ticket */
.action-bar { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .5rem; }

/* =====================================================
   TABLAS (usuarios)
   ===================================================== */
.table-wrap { overflow-x: auto; }
table.tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
    background: #fff;
}
table.tbl th {
    background: var(--ev-blue-soft);
    color: var(--ev-blue-dark);
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: .78rem;
    text-align: left;
    padding: .6rem .8rem;
    border-bottom: 1px solid var(--ev-blue-line);
}
table.tbl td { padding: .6rem .8rem; border-bottom: 1px solid #eef1f7; }
table.tbl tbody tr { transition: background .18s ease; }
table.tbl tbody tr:hover { background: var(--ev-blue-soft); }

/* =====================================================
   ANIMACIONES / RESPONSIVE
   ===================================================== */
@keyframes evFadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

@media (max-width: 640px) {
    .navbar { padding: .6rem 1rem; }
    .navbar-user .user-name { display: none; }
    .container { padding: 1.2rem 1rem 2.5rem; }
    .form-row { grid-template-columns: 1fr; }
    .comment .c-date { margin-left: 0; width: 100%; }
}

/* =====================================================
   FORMULARIO RICO — tarjetas de opción, segmentado y dropzone
   ===================================================== */

/* Etiqueta de sección dentro de un formulario */
.field-label {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: .84rem;
    color: var(--dark);
    margin-bottom: .5rem;
}
.field-label .hint { font-weight: 400; font-size: .76rem; color: var(--text-muted); }

/* Tarjetas seleccionables (categoría) */
.opt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: .6rem;
}
.opt-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: var(--radius);
    padding: .7rem .8rem;
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition), transform var(--transition);
}
.opt-card:hover { border-color: var(--ev-blue-line); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.opt-card input { position: absolute; opacity: 0; pointer-events: none; }
.opt-card .ic { font-size: 1.05rem; line-height: 1.25; flex-shrink: 0; }
.opt-card > span:last-child { display: block; min-width: 0; }
.opt-card .tx { display: block; font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: .84rem; color: var(--dark); line-height: 1.35; }
.opt-card .ds { display: block; font-size: .74rem; color: var(--text-muted); line-height: 1.4; margin-top: .12rem; }
.opt-card:has(input:checked) {
    border-color: var(--ev-blue);
    background: var(--ev-blue-soft);
    box-shadow: 0 0 0 3px rgba(43,80,200,.10);
}
.opt-card input:focus-visible + .ic { outline: 2px solid var(--ev-blue); border-radius: 4px; }

/* Control segmentado (prioridad) */
.seg { display: inline-flex; background: #eef1f7; border-radius: 100px; padding: .22rem; gap: .15rem; flex-wrap: wrap; }
.seg label {
    position: relative;
    padding: .34rem 1rem;
    border-radius: 100px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: .8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.seg label:hover { color: var(--ev-blue-dark); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--white); color: var(--ev-blue-dark); box-shadow: var(--shadow-sm); }
.seg label.pr-alta:has(input:checked)    { color: var(--ev-amber); }
.seg label.pr-urgente:has(input:checked) { color: #a03d3d; }

/* Zona de arrastrar y soltar */
.dropzone {
    border: 2px dashed #c9d4e8;
    border-radius: var(--radius-lg);
    background: #fbfcfe;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), transform var(--transition);
}
.dropzone:hover { border-color: var(--ev-blue); background: var(--ev-blue-soft); }
.dropzone.is-over {
    border-color: var(--ev-blue);
    background: var(--ev-blue-soft);
    transform: scale(1.01);
    box-shadow: 0 0 0 4px rgba(43,80,200,.10);
}
.dropzone .dz-ic { font-size: 1.7rem; line-height: 1; margin-bottom: .35rem; }
.dropzone .dz-t  { font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: .88rem; color: var(--dark); }
.dropzone .dz-t u { color: var(--ev-blue); text-underline-offset: 2px; }
.dropzone .dz-s  { font-size: .76rem; color: var(--text-muted); margin-top: .2rem; }
.dropzone input[type=file] { display: none; }

/* Lista de archivos elegidos */
.file-list { display: flex; flex-direction: column; gap: .4rem; margin-top: .7rem; }
.file-chip {
    display: flex;
    align-items: center;
    gap: .6rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .45rem .7rem;
    font-size: .82rem;
    animation: evFadeUp .3s cubic-bezier(.22,.9,.35,1) both;
}
.file-chip .fc-ic   { font-size: 1rem; flex-shrink: 0; }
.file-chip .fc-name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.file-chip .fc-size { color: var(--text-muted); font-size: .75rem; flex-shrink: 0; }
.file-chip .fc-del  {
    border: none; background: transparent; cursor: pointer;
    color: #b0b8c8; font-size: 1.05rem; line-height: 1; padding: 0 .15rem; flex-shrink: 0;
    transition: color var(--transition);
}
.file-chip .fc-del:hover { color: #a03d3d; }
.file-chip.too-big { border-color: #e3a7a7; background: #fdf1f1; }
.file-chip.too-big .fc-size { color: #a03d3d; font-weight: 600; }

@media (max-width: 640px) {
    .opt-grid { grid-template-columns: 1fr 1fr; }
    .seg { width: 100%; justify-content: space-between; }
}

/* Respaldo por JS para navegadores sin :has() */
.opt-card.is-sel { border-color: var(--ev-blue); background: var(--ev-blue-soft); box-shadow: 0 0 0 3px rgba(43,80,200,.10); }
.seg label.is-sel { background: var(--white); color: var(--ev-blue-dark); box-shadow: var(--shadow-sm); }
.seg label.pr-alta.is-sel    { color: var(--ev-amber); }
.seg label.pr-urgente.is-sel { color: #a03d3d; }

/* =====================================================
   BARRAS DE MÉTRICAS (compartidas: marketing.php y meta.php)
   ===================================================== */
.barrow {
    display: grid;
    grid-template-columns: 92px 1fr 78px;
    align-items: center;
    gap: .6rem;
    margin: .3rem 0;
    font-size: .84rem;
}
.barlab { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bartrack { background: var(--ev-blue-soft); border-radius: 6px; height: 20px; overflow: hidden; }
.barfill {
    height: 100%;
    border-radius: 6px;
    background: var(--ev-blue);
    transition: width .35s cubic-bezier(.22,.9,.35,1);
}
.barfill.warn { background: var(--ev-amber); }
.barfill.mut  { background: #aab4c8; }
.barval { text-align: right; color: var(--text-muted); font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
    .barrow { grid-template-columns: 74px 1fr 62px; font-size: .78rem; }
}

/* =====================================================
   APP SHELL — barra lateral + barra superior
   ===================================================== */
:root { --side-w: 236px; }

.sidebar {
    position: fixed; inset: 0 auto 0 0;
    width: var(--side-w);
    background: var(--white);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    z-index: 120;
    overflow-y: auto;
}
.side-brand {
    display: flex; align-items: center; gap: .6rem;
    padding: 1.1rem 1.1rem .9rem;
    text-decoration: none; flex-shrink: 0;
}
.side-brand:hover { text-decoration: none; }
.side-brand .brand-icon {
    width: 34px; height: 34px; background: var(--ev-blue); border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Montserrat', sans-serif; font-weight: 800; color: #fff; font-size: 1rem;
}
.side-brand .brand-text {
    font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 1.02rem;
    color: var(--dark); letter-spacing: -.01em;
}
.side-brand .brand-text span { color: var(--ev-blue); font-weight: 600; }

.side-nav { padding: .3rem .6rem 1rem; flex: 1 1 auto; }
.nav-group {
    font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: #9aa4b8; padding: .95rem .6rem .35rem;
}
.nav-item {
    display: flex; align-items: center; gap: .6rem;
    padding: .55rem .65rem; border-radius: 9px;
    color: var(--text); font-size: .875rem; font-weight: 500;
    text-decoration: none; margin-bottom: .12rem;
    transition: background var(--transition), color var(--transition);
}
.nav-item:hover { background: var(--ev-blue-soft); color: var(--ev-blue-dark); text-decoration: none; }
.nav-item.is-on {
    background: var(--ev-blue-soft); color: var(--ev-blue-dark); font-weight: 700;
    box-shadow: inset 3px 0 0 var(--ev-blue);
}
.nav-ic { font-size: 1rem; width: 1.3rem; text-align: center; flex-shrink: 0; }

.side-foot { padding: .8rem; flex-shrink: 0; }
.side-help {
    background: var(--ev-blue-soft); border: 1px solid var(--ev-blue-line);
    border-radius: var(--radius); padding: .7rem .8rem;
}
.side-help .sh-t { font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: .8rem; color: var(--ev-blue-dark); }
.side-help .sh-s { font-size: .74rem; color: var(--text-muted); margin-top: .1rem; }

.topbar {
    position: sticky; top: 0; z-index: 110;
    margin-left: var(--side-w);
    height: 58px; padding: 0 1.5rem;
    background: rgba(246,248,251,.92); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.topbar-right { display: flex; align-items: center; gap: .7rem; margin-left: auto; }
.topbar .user-name { font-size: .88rem; font-weight: 600; color: var(--text); }
.topbar .user-avatar {
    width: 32px; height: 32px; background: var(--ev-blue); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: .78rem; font-family: 'Montserrat', sans-serif;
}
.side-toggle {
    display: inline-flex; background: none; border: 1px solid var(--border);
    border-radius: 8px; padding: .25rem .55rem; font-size: 1.05rem; cursor: pointer; color: var(--text);
    transition: background var(--transition), border-color var(--transition);
}
.side-toggle:hover { background: var(--ev-blue-soft); border-color: var(--ev-blue); color: var(--ev-blue-dark); }

/* ── Barra lateral plegada: queda una franja con los iconos ──
   Todo el ancho sale de --side-w, así que basta con redefinirla en el body
   para que la barra, la cabecera y el contenido se muevan a la vez. */
body.side-min { --side-w: 58px; }
body.side-min .side-brand .brand-text,
body.side-min .nav-item .nav-tx,
body.side-min .side-help { display: none; }
body.side-min .side-brand { justify-content: center; padding: 1.1rem .4rem .9rem; }
body.side-min .side-nav   { padding: .3rem .35rem 1rem; }
body.side-min .nav-item   { justify-content: center; padding: .55rem 0; }
body.side-min .nav-ic     { width: auto; }
body.side-min .side-foot  { padding: 0; }
/* El título del grupo se convierte en un separador fino. */
body.side-min .nav-group {
    height: 1px; padding: 0; margin: .55rem .5rem; overflow: hidden;
    background: var(--border); color: transparent;
}
.sidebar, .topbar, body > .container { transition: width .18s ease, margin-left .18s ease; }

/* ── Aviso de pauta: banda fija, visible en cualquier página ── */
.pauta-banda {
    position: fixed; top: 0; left: 0; right: 0; z-index: 300;
    display: flex; gap: .55rem; align-items: center; justify-content: center;
    padding: .5rem 1rem; font-size: .84rem; line-height: 1.35;
    background: #fdf2dc; color: #7a5310; border-bottom: 1px solid #f0d9a8;
}
.pauta-banda.grave { background: #fdecec; color: #8f2f2f; border-bottom-color: #f3c2c2; }
.pauta-banda a { color: inherit; font-weight: 700; text-decoration: underline; }
.pauta-banda[hidden] { display: none; }
/* Cuando la banda está, todo baja para no quedar tapado. */
body.con-pauta .sidebar { top: 34px; }
body.con-pauta .topbar  { top: 34px; }
body.con-pauta .tb-panel { top: 88px; }

/* ── Barra superior: conectados, mensajes y avisos ── */
.tb-btn {
    position: relative; display: inline-flex; align-items: center; gap: .3rem;
    background: none; border: 1px solid var(--border); border-radius: 8px;
    padding: .22rem .5rem; font-size: .82rem; cursor: pointer; color: var(--text);
    text-decoration: none; font-weight: 600; font-family: 'Montserrat', sans-serif;
    transition: background var(--transition), border-color var(--transition);
}
.tb-btn:hover { background: var(--ev-blue-soft); border-color: var(--ev-blue); text-decoration: none; }
.tb-dot { width: 8px; height: 8px; border-radius: 50%; background: #2ec27e; }
.tb-badge {
    position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px;
    padding: 0 .25rem; border-radius: 20px; background: var(--ev-rose, #d94f7a); color: #fff;
    font-size: .62rem; font-weight: 700; line-height: 16px; text-align: center;
}
.tb-panel {
    position: fixed; top: 54px; right: 1.2rem; z-index: 200; width: 330px;
    max-height: 70vh; overflow-y: auto; background: var(--white);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.tb-panel-cab {
    display: flex; justify-content: space-between; align-items: center; gap: .5rem;
    padding: .7rem .9rem; border-bottom: 1px solid var(--border);
    font-family: 'Montserrat', sans-serif; font-size: .9rem;
}
.tb-link { background: none; border: none; color: var(--ev-blue); font-size: .74rem;
           cursor: pointer; font-weight: 600; }
.tb-vacio { padding: 1.6rem .9rem; text-align: center; color: var(--text-muted); font-size: .84rem; }
.tb-grupo { padding: .55rem .9rem .2rem; font-size: .68rem; font-weight: 700;
            letter-spacing: .05em; text-transform: uppercase; color: #9aa4b8; }
.tb-aviso, .tb-persona {
    display: flex; gap: .55rem; align-items: flex-start;
    padding: .6rem .9rem; border-bottom: 1px solid #f1f4f9; text-decoration: none; color: var(--text);
}
.tb-aviso:hover { background: var(--ev-blue-soft); text-decoration: none; }
.tb-aviso.nuevo { background: #f5f8ff; }
.tb-aviso.nuevo .tb-tx b::after {
    content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
    background: var(--ev-blue); margin-left: .35rem; vertical-align: middle;
}
.tb-ic { font-size: 1rem; flex-shrink: 0; }
.tb-tx { display: flex; flex-direction: column; min-width: 0; }
.tb-tx b { font-size: .82rem; font-weight: 700; font-family: 'Montserrat', sans-serif; }
.tb-tx span { font-size: .78rem; color: var(--text-muted); margin-top: .1rem;
              overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
              -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tb-tx em { font-size: .68rem; color: #9aa4b8; font-style: normal; margin-top: .2rem; }
.tb-luz { width: 9px; height: 9px; border-radius: 50%; background: #c9d0dd; margin-top: .35rem; flex-shrink: 0; }
.tb-luz.linea { background: #2ec27e; }
.tb-luz.ausente { background: #e8a33d; }

/* El contenido se corre a la derecha de la barra lateral. */
body > .container { margin-left: var(--side-w); max-width: none; padding: 1.6rem 2rem 3rem; }
body > .container > * { max-width: 1180px; }

@media (max-width: 900px) {
    /* En móvil la barra es un cajón que entra y sale: el plegado no aplica. */
    body.side-min { --side-w: 236px; }
    body.side-min .side-brand .brand-text,
    body.side-min .nav-item .nav-tx,
    body.side-min .side-help { display: revert; }
    body.side-min .nav-item, body.side-min .side-brand { justify-content: flex-start; }
    body.side-min .nav-group { height: auto; padding: .95rem .6rem .35rem; margin: 0;
                               background: none; color: #9aa4b8; }
    .sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
    .sidebar.open { transform: none; }
    .topbar, body > .container { margin-left: 0; }
    body > .container { padding: 1.2rem 1rem 2.5rem; }
}

/* =====================================================
   DASHBOARD — KPIs, gráficos y tarjetas de apoyo
   ===================================================== */
.kpi-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: .9rem; margin-bottom: 1.1rem;
}
.kpi-card { padding: 1rem 1.1rem; margin-bottom: 0; }
.kpi-top { display: flex; align-items: center; gap: .7rem; }
.kpi-ic {
    width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 1.05rem;
}
.kpi-ic.v1 { background: #efeafd; } .kpi-ic.v2 { background: #e6f0ff; }
.kpi-ic.v3 { background: #fdeaf3; } .kpi-ic.v4 { background: #e3f7f2; }
.kpi-ic.v5 { background: #fdf0e3; }
.kpi-card .kpi-n {
    font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 1.55rem;
    color: var(--dark); line-height: 1.1;
}
.kpi-card .kpi-l { font-size: .78rem; color: var(--text-muted); margin-top: .1rem; line-height: 1.3; }
/* Sin esto el bloque de texto no puede encogerse — es un item flex y su
   min-width:auto vale lo que mida el número — así que cifras como
   "$413.13" se salían por la derecha de la tarjeta en pantallas angostas. */
.kpi-top { min-width: 0; }
.kpi-top > div { min-width: 0; }
/* El numero nunca se parte a media cifra (partia "$0.86" en "$0.8 / 6").
   En vez de eso escala con el ancho de SU PROPIA tarjeta: 11cqi la hace
   caber siempre, y el clamp evita que se vuelva ilegible o gigante. */
.kpi-card { container-type: inline-size; }
.kpi-card .kpi-n { white-space: nowrap; letter-spacing: -.02em;
                   font-size: clamp(1.05rem, 11cqi, 1.55rem); }
/* En pantallas angostas la cifra cabía por un pelo (1px): el icono se
   achica y el número baja un punto para que respire. */
@media (max-width: 560px) {
    .kpi-ic { width: 34px; height: 34px; border-radius: 9px; font-size: .95rem; }
    .kpi-top { gap: .55rem; }
    .kpi-card { padding: .85rem .9rem; }
}
.kpi-d { font-size: .74rem; font-weight: 700; margin-top: .7rem; }
.kpi-d.up   { color: var(--ev-green-dark); }
.kpi-d.down { color: var(--ev-rose); }
.kpi-d span { font-weight: 400; color: var(--text-muted); }

.dash-2col { display: grid; grid-template-columns: 1.9fr 1fr; gap: 1.1rem; align-items: start; }
.dash-3col { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.1rem; align-items: start; }

.chart { width: 100%; height: auto; display: block; }
.chart .ax  { font-size: 9px; fill: #97a1b5; font-family: 'Open Sans', sans-serif; }
.chart .axv { font-size: 9px; fill: var(--text-muted); font-weight: 600; font-family: 'Open Sans', sans-serif; }

.donut-wrap { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.donut { width: 132px; height: 132px; flex-shrink: 0; }
.donut .dn-n { font-size: 17px; font-weight: 800; fill: var(--dark); font-family: 'Montserrat', sans-serif; }
.donut .ax   { font-size: 9px; fill: #97a1b5; }
.donut-leg { flex: 1 1 auto; min-width: 120px; font-size: .84rem; }
.donut-leg > div { display: flex; align-items: center; gap: .45rem; padding: .35rem 0; flex-wrap: wrap; }
.donut-leg b { margin-left: auto; font-family: 'Montserrat', sans-serif; }
.donut-leg small { width: 100%; color: var(--text-muted); font-size: .74rem; padding-left: 1.1rem; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex-shrink: 0; }

.mini-row { display: grid; grid-template-columns: 96px 1fr 62px; align-items: center; gap: .5rem; margin: .45rem 0; font-size: .82rem; }
.mini-l { color: var(--text); }
.mini-track { background: #eef1f7; border-radius: 6px; height: 8px; overflow: hidden; }
.mini-fill { height: 100%; border-radius: 6px; transition: width .35s ease; }
.mini-v { text-align: right; font-weight: 700; font-family: 'Montserrat', sans-serif; font-size: .8rem; }
.mini-tot {
    display: flex; justify-content: space-between; align-items: center;
    border-top: 1px solid var(--border); margin-top: .8rem; padding-top: .65rem;
    font-size: .82rem; color: var(--text-muted);
}
.mini-tot b { font-family: 'Montserrat', sans-serif; color: var(--dark); font-size: .95rem; }

.res-row {
    display: flex; justify-content: space-between; align-items: center; gap: .6rem;
    padding: .45rem 0; border-bottom: 1px dashed var(--border); font-size: .82rem; color: var(--text-muted);
}
.res-row:last-child { border-bottom: none; }
.res-row b { color: var(--dark); font-family: 'Montserrat', sans-serif; font-size: .82rem; text-align: right; }

@media (max-width: 900px) { .dash-2col { grid-template-columns: 1fr; } }

/* =====================================================
   TABLA DE CANALES · FEED DE ACTIVIDAD · SPARKLINE
   ===================================================== */
.spark { width: 100%; height: 42px; display: block; margin-top: .7rem; opacity: .9; }

.can-head {
    display: grid; grid-template-columns: 1.5fr 2fr 60px 56px;
    gap: .7rem; align-items: center;
    font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    color: #9aa4b8; padding: 0 0 .5rem; border-bottom: 1px solid var(--border);
}
.can-head span:nth-child(3), .can-head span:nth-child(4) { text-align: right; }
.can-row {
    display: grid; grid-template-columns: 1.5fr 2fr 60px 56px;
    gap: .7rem; align-items: center;
    padding: .5rem 0; border-bottom: 1px solid #f1f4f9; font-size: .84rem;
}
.can-row:last-child { border-bottom: none; }
.can-name { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.can-name > *:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.can-ic {
    width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: .78rem; font-weight: 700;
}
.can-n { text-align: right; font-weight: 700; font-family: 'Montserrat', sans-serif; }
.can-p { text-align: right; color: var(--text-muted); font-size: .8rem; }

.feed-row {
    display: flex; align-items: center; gap: .6rem;
    padding: .45rem 0; border-bottom: 1px solid #f1f4f9; font-size: .82rem;
}
.feed-row:last-child { border-bottom: none; }
.feed-t { flex: 1 1 auto; color: var(--text); min-width: 0; }
.feed-h { color: var(--text-muted); font-size: .74rem; white-space: nowrap; }

@media (max-width: 640px) {
    .can-head, .can-row { grid-template-columns: 1.3fr 1fr 52px 48px; gap: .4rem; font-size: .78rem; }
}

/* Pie de totales bajo un gráfico */
.chart-foot {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: .8rem; margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--border);
}
.chart-foot > div { display: flex; flex-direction: column; }
.chart-foot span { font-size: .72rem; color: var(--text-muted); }
.chart-foot b { font-family: 'Montserrat', sans-serif; font-size: 1.1rem; color: var(--dark); line-height: 1.25; }
.chart-foot small { font-size: .68rem; color: #9aa4b8; }

/* Numeración del ranking en las tarjetas de video */
.tt-rank {
    position: absolute; left: .4rem; top: .4rem; z-index: 2;
    width: 22px; height: 22px; border-radius: 50%;
    background: rgba(17,24,39,.78); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: .72rem; font-weight: 700; font-family: 'Montserrat', sans-serif;
}

/* Tarjetas de red en el resumen general */
.net-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.1rem; margin-bottom: 1.1rem; }
.net-card { position: relative; overflow: hidden; padding-bottom: 1.1rem; margin-bottom: 0; }
.net-card::after { content:''; position:absolute; left:0; right:0; bottom:0; height:4px; }
.net-card.tt::after { background: linear-gradient(90deg,#111827,#25f4ee 50%,#fe2c55); }
.net-card.fb::after { background: #1877f2; }
.net-card.ig::after { background: linear-gradient(90deg,#f9ce34,#ee2a7b 50%,#6228d7); }
.net-head { display: flex; align-items: center; gap: .7rem; margin-bottom: .9rem; }
.net-ic { width: 42px; height: 42px; border-radius: 12px; display:flex; align-items:center; justify-content:center;
          font-size: 1.15rem; color:#fff; flex-shrink:0; }
.net-ic.tt { background:#111827; } .net-ic.fb { background:#1877f2; }
.net-ic.ig { background: linear-gradient(135deg,#f9ce34,#ee2a7b 50%,#6228d7); }
.net-name { font-family:'Montserrat',sans-serif; font-weight:700; font-size:1.02rem; color: var(--dark); }
.net-user { font-size:.78rem; color: var(--text-muted); }
.net-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: .5rem; text-align: center; }
.net-stats b { display:block; font-family:'Montserrat',sans-serif; font-weight:800; font-size:1.2rem; color: var(--dark); }
.net-stats span { font-size:.72rem; color: var(--text-muted); }
.chart-legend { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: .3rem; }
.lg-item { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; color: var(--text-muted); }
.kpi-multi { display:flex; gap:.7rem; flex-wrap:wrap; margin-top:.7rem; font-size:.74rem; font-weight:700; }
.best { display:flex; gap:.6rem; align-items:center; text-decoration:none; color:inherit;
        border:1px solid var(--border); border-radius:var(--radius); padding:.5rem; transition:box-shadow var(--transition); }
.best:hover { box-shadow: var(--shadow-md); text-decoration:none; }
.best img, .best-noimg { width:62px; height:62px; border-radius:8px; object-fit:cover; flex-shrink:0; background:#eef1f7; }
.best-noimg { display:flex; align-items:center; justify-content:center; color:#aab4c8; }
.best-tx { min-width:0; }
.best-t { font-size:.8rem; line-height:1.35; color:var(--dark);
          display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.best-m { font-size:.74rem; color:var(--text-muted); margin-top:.25rem; }
.best-m b { color:var(--dark); font-family:'Montserrat',sans-serif; }

/* =====================================================
   MENSAJES DIRECTOS
   ===================================================== */
.dm-wrap { display: grid; grid-template-columns: 320px 1fr; gap: 1rem; margin-top: .9rem; align-items: start; }
.dm-col { max-height: 520px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.dm-item { display: flex; align-items: center; gap: .6rem; padding: .6rem .7rem;
           border-bottom: 1px solid #f1f4f9; cursor: pointer; transition: background var(--transition); }
.dm-item:last-child { border-bottom: none; }
.dm-item:hover { background: var(--ev-blue-soft); }
.dm-item.is-on { background: var(--ev-blue-soft); box-shadow: inset 3px 0 0 var(--ev-blue); }
.dm-av { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; color: #fff;
         display: flex; align-items: center; justify-content: center; font-size: .82rem; font-weight: 700; }
.dm-av.fb { background: #1877f2; }
.dm-av.ig { background: linear-gradient(135deg,#f9ce34,#ee2a7b 50%,#6228d7); }
.dm-tx { flex: 1 1 auto; min-width: 0; }
.dm-top { display: flex; justify-content: space-between; gap: .4rem; font-size: .82rem; }
.dm-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-h { color: var(--text-muted); font-size: .7rem; white-space: nowrap; }
.dm-prev { font-size: .76rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-you { color: var(--ev-blue); font-weight: 600; }
.dm-badge { background: var(--ev-blue); color: #fff; border-radius: 20px; font-size: .68rem;
            padding: .05rem .4rem; font-weight: 700; flex-shrink: 0; }

.dm-chat { display: flex; flex-direction: column; border: 1px solid var(--border);
           border-radius: var(--radius); height: 520px; }
.dm-chat-head { padding: .7rem .9rem; border-bottom: 1px solid var(--border); font-size: .9rem; }
.dm-msgs { flex: 1 1 auto; overflow-y: auto; padding: .9rem; background: #fbfcfe; }
.dm-msg { margin-bottom: .7rem; max-width: 78%; }
.dm-msg.mio { margin-left: auto; text-align: right; }
.dm-burb { display: inline-block; padding: .5rem .75rem; border-radius: 12px;
           background: #fff; border: 1px solid var(--border); font-size: .85rem;
           line-height: 1.5; text-align: left; white-space: pre-wrap; }
.dm-msg.mio .dm-burb { background: var(--ev-blue); border-color: var(--ev-blue); color: #fff; }
.dm-fecha { font-size: .68rem; color: var(--text-muted); margin-top: .2rem; }
.dm-send { display: flex; gap: .5rem; padding: .7rem; border-top: 1px solid var(--border); }
.dm-send input { flex: 1 1 auto; }

@media (max-width: 900px) { .dm-wrap { grid-template-columns: 1fr; } .dm-chat { height: 420px; } }

/* =====================================================
   COMPOSITOR — pasos y vista previa
   ===================================================== */
.compo-2col { display: grid; grid-template-columns: 1.15fr 1fr; gap: 1.1rem; align-items: start; }
.paso { display: flex; align-items: center; gap: .7rem; margin-bottom: 1rem; }
.paso-n { width: 26px; height: 26px; border-radius: 50%; background: var(--ev-blue); color: #fff;
          display: flex; align-items: center; justify-content: center; flex-shrink: 0;
          font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: .82rem; }

.pv-tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.pv-tab { background: none; border: none; padding: .5rem .8rem; cursor: pointer;
          font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: .82rem;
          color: var(--text-muted); border-bottom: 2px solid transparent; }
.pv-tab:hover { color: var(--ev-blue-dark); }
.pv-tab.is-on { color: var(--ev-blue); border-bottom-color: var(--ev-blue); }

.pv-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #fff; }
.pv-head { display: flex; align-items: center; gap: .6rem; padding: .7rem .8rem; }
.pv-av { width: 36px; height: 36px; border-radius: 50%; color: #fff; flex-shrink: 0;
         display: flex; align-items: center; justify-content: center; font-weight: 800;
         font-family: 'Montserrat', sans-serif; }
.pv-av.fb { background: #1877f2; }
.pv-av.ig { background: linear-gradient(135deg,#f9ce34,#ee2a7b 50%,#6228d7); }
.pv-name { font-weight: 700; font-size: .85rem; color: var(--dark); font-family: 'Montserrat', sans-serif; }
.pv-sub  { font-size: .72rem; color: var(--text-muted); }
.pv-txt  { padding: 0 .8rem .7rem; font-size: .85rem; line-height: 1.55; color: var(--text); word-break: break-word; }
.pv-vacio { color: #b3bccd; font-style: italic; }
.pv-media { position: relative; background: #eef1f7; }
.pv-img { width: 100%; display: block; object-fit: cover; max-height: 320px; }
.pv-img.cuad { aspect-ratio: 1/1; max-height: none; }
.pv-img.vert { aspect-ratio: 9/16; max-height: 380px; }
.pv-ph { display: flex; align-items: center; justify-content: center; min-height: 150px;
         color: #9aa4b8; font-size: .82rem; background: #eef1f7; }
.pv-ph.cuad { aspect-ratio: 1/1; } .pv-ph.vert { aspect-ratio: 9/16; }
.pv-count { position: absolute; top: .5rem; right: .5rem; background: rgba(0,0,0,.6); color: #fff;
            border-radius: 20px; font-size: .7rem; padding: .1rem .5rem; }
.pv-acts { display: flex; justify-content: space-around; padding: .55rem; border-top: 1px solid var(--border);
           font-size: .78rem; color: var(--text-muted); }
.pv-acts.ig { justify-content: flex-start; gap: 1rem; padding-left: .8rem; font-size: 1rem; }
.pv-card.tt { background: #111827; border-color: #111827; }
.pv-card.tt .pv-txt, .pv-card.tt .pv-name { color: #fff; }
.pv-tt-info { padding: .7rem .8rem; }

@media (max-width: 1000px) { .compo-2col { grid-template-columns: 1fr; } }

/* =====================================================
   MODAL COMPARTIDO (meta.php, rrhh.php)
   ===================================================== */
.modal { position: fixed; inset: 0; background: rgba(20,30,60,.45);
         display: flex; align-items: center; justify-content: center; z-index: 200; padding: 1rem; }
.modal[hidden] { display: none; }
.modal-box { background: #fff; border-radius: var(--radius-lg); padding: 1.5rem;
             max-width: 460px; width: 100%; box-shadow: var(--shadow-lg); }
.pgbtn { border: 1px solid var(--border); background: #fff; border-radius: 6px;
         padding: .3rem .6rem; cursor: pointer; font-size: .82rem; }
.pgbtn:disabled { opacity: .45; cursor: default; }
/* Tarjeta de sincronización de RRHH */
.sync-card { border-left: 4px solid var(--ev-blue); }
.sy-tit { font-size:.76rem; font-weight:700; color:var(--text-muted); margin:.9rem 0 .3rem;
          text-transform:uppercase; letter-spacing:.03em; }
.sy-lista { max-height:190px; overflow-y:auto; border:1px solid var(--border);
            border-radius:var(--radius); background:#fbfcfe; }
.sy-lista > div { display:flex; align-items:baseline; gap:.5rem; padding:.35rem .6rem;
                  border-bottom:1px solid #f1f4f9; font-size:.8rem; }
.sy-lista > div:last-child { border-bottom:none; }
.sy-lista span { color:var(--text-muted); font-size:.72rem; flex-shrink:0; width:80px; }
.sy-lista small { margin-left:auto; color:var(--text-muted); font-size:.72rem; }
.sy-lista.om small { color:var(--ev-amber); font-weight:600; }
.sy-nota { font-size:.78rem; color:var(--text-muted); background:var(--ev-amber-soft);
           border:1px solid #f0e0b0; border-radius:var(--radius); padding:.5rem .7rem; margin-bottom:.4rem; }
.sy-obs { font-size:.68rem; color:#9aa4b8; font-style:normal; background:#eef1f7;
          border-radius:20px; padding:.05rem .4rem; margin-left:.3rem; }

/* ====================================================
   SUB-PESTAÑAS Y AYUDAS PLEGABLES (Anuncios, Postulaciones)
   ===================================================== */
.subtabs { position:sticky; top:var(--nav-h, 58px); z-index:20; display:flex; gap:.3rem;
           flex-wrap:wrap; margin:0 0 1rem; padding:.55rem 0;
           background:var(--bg); border-bottom:1px solid var(--border); }
.subtab { border:1px solid transparent; background:none; padding:.45rem .9rem; border-radius:100px;
          cursor:pointer; font:inherit; font-size:.86rem; font-weight:700; color:var(--text-muted);
          transition:background .15s, color .15s; }
.subtab:hover { background:#fff; border-color:var(--border); color:var(--ev-blue-dark); }
.subtab.is-on { background:var(--ev-blue); color:#fff; box-shadow:0 2px 8px rgba(43,80,200,.25); }
div[data-sub][hidden] { display:none; }
[data-sub] > .card { margin-bottom:1rem; }
.ayuda { margin:0 0 .8rem; font-size:.84rem; color:var(--text-muted); line-height:1.5; }
.ayuda summary { cursor:pointer; color:var(--ev-blue); font-size:.8rem; font-weight:600;
                 list-style:none; display:inline-block; }
.ayuda summary::-webkit-details-marker { display:none; }
.ayuda summary::before { content:"\24d8  "; }
.ayuda[open] summary { margin-bottom:.35rem; }
.ayuda[open] summary::before { content:"\25be  "; }
.kpi-d.flat { color:var(--text-muted); }
