/* ============================================================
   ADMIN CSS - Portal CPL
   Unificado: estilos base + dashboard
   ============================================================ */

:root {
    --admin-red: #ed1925;
    --admin-red-hover: #c91520;
    --admin-black: #121212;
    --admin-black-soft: #1b1b1f;
    --admin-black-light: #242429;
    --admin-white: #ffffff;
    --admin-text-soft: #b7b7bd;
    --admin-border: #2d2d33;
    --admin-bg: #f4f4f6;
    --admin-card: #ffffff;
    --admin-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --topbar-height: 84px;
    --sidebar-width: 250px;
    --sidebar-width-collapsed: 84px;

    /* Rojo institucional del Colegio de Periodistas de Lambayeque (logo
       assets/img/logo-cpl.png ≈ #BA0001), ya usado como color primario
       de las acciones principales en todo el panel ("Nueva oferta",
       "Nuevo Curso/Evento", los botones rojos de cada mantenimiento).
       ESTE es el único valor que hay que tocar si algún día cambia el
       color institucional: todo lo demás (hover de "Limpiar", opción
       seleccionada del combo box, etc.) lee de acá abajo, nunca del
       color fijo. */
    --color-institucional: #C90000;

    /* Alias semántico: hover del botón "Limpiar filtros", igual en
       mantenimientos.css, agenda.css y bolsa_laboral.css. */
    --btn-limpiar-hover: var(--color-institucional);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-primary, "Inter", "Roboto", Arial, sans-serif);
    background: var(--admin-bg);
    color: #111111;
}

.p {
    font-size: 14px;
    color: #6b7280;

}

/* =========================
   TOPBAR
========================= */
.admin-topbar {
    width: 100%;
    height: var(--topbar-height);
    background: linear-gradient(90deg, #1b1b1d 0%, #2c2c2f 50%, #1f1f21 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 16px;
    position: relative;
    z-index: 1050;
    overflow: visible;
}

.admin-topbar__brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 320px;
    flex-shrink: 0;
}

.intranet-topbar__logo {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    flex-shrink: 0;
}

.admin-topbar__logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.admin-topbar__brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-width: 0;
}

.admin-topbar__brand-text p {
    margin: 0;
    color: #ffffff;
    font-size: 13px;
    line-height: 1.15;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 500;
    white-space: nowrap;
}

.admin-topbar__search {
    flex: 1;
    max-width: 430px;
    height: 48px;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin-left: auto;
}

.admin-topbar__search input {
    flex: 1;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: #ffffff;
    font-size: 14px;
    padding: 0 16px;
}

.admin-topbar__search input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.admin-topbar__search button {
    width: 48px;
    height: 100%;
    border: none;
    background: transparent;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    transition: background 0.2s ease;
}

.admin-topbar__search button:hover {
    background: rgba(255, 255, 255, 0.08);
}

.admin-topbar__actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.admin-topbar__notif {
    position: relative;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
}

.admin-topbar__notif-icon {
    width: 22px;
    height: 22px;
    display: block;
    filter: brightness(0) invert(1);
}

.admin-topbar__notif[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    top: calc(100% + 10px);
    transform: translateX(-50%) translateY(-4px);
    background: rgba(17, 24, 39, 0.96);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    padding: 7px 10px;
    border-radius: 10px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 20;
}

.admin-topbar__notif[data-tooltip]::before {
    content: "";
    position: absolute;
    left: 50%;
    top: calc(100% + 4px);
    transform: translateX(-50%) translateY(-4px);
    border: 6px solid transparent;
    border-bottom-color: rgba(17, 24, 39, 0.96);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 20;
}

.admin-topbar__notif:hover {
    background: rgba(255, 255, 255, 0.12);
}

.admin-topbar__notif:hover::after,
.admin-topbar__notif:hover::before,
.admin-topbar__notif:focus-visible::after,
.admin-topbar__notif:focus-visible::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.admin-topbar__badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ed1925;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-topbar__user {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    border-radius: 18px;
    background: #c90000;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(215, 15, 24, 0.25);
}

.admin-topbar__user-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: left;
    padding: 0;
}

.admin-topbar__user-chevron {
    font-size: 0.85rem;
    transition: transform 0.2s ease;
}

.admin-topbar__user.open .admin-topbar__user-chevron {
    transform: rotate(180deg);
}

.admin-topbar__user-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: #ffffff;
    color: #111827;
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
    z-index: 1100;
    padding: 10px 0;
}

.admin-topbar__user.open .admin-topbar__user-menu {
    display: block;
}

.admin-topbar__logout-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: auto;
    padding: 8px 12px;
    color: #111827;
    text-decoration: none;
    background: rgba(249, 250, 251, 0.95);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s ease;
}

.admin-topbar__logout-menu-item:hover {
    background: #f1f5f9;
}

/* =========================
   LAYOUT
========================= */
.admin-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: calc(100vh - var(--topbar-height));
    transition: none;
}

.admin-layout.sidebar-collapsed {
    grid-template-columns: var(--sidebar-width-collapsed) 1fr;
}

/* =========================
   SIDEBAR
========================= */
.admin-sidebar {
    background: linear-gradient(180deg, #18181c 0%, #111113 100%);
    color: var(--admin-white);
    min-height: calc(100vh - var(--topbar-height));
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: background-color 0.2s ease,
    color 0.2s ease;
}

.admin-sidebar__header {
    margin-bottom: 12px;
}

.admin-sidebar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
}

.admin-sidebar__brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: transparent;
    color: var(--admin-red);
    font-size: 18px;
    flex-shrink: 0;
}

.admin-sidebar__brand-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--admin-white);
    white-space: nowrap;
    flex: 1;
    display: inline-flex;
    text-align: center;
    line-height: 1;
    padding-top: 2px;

}


.admin-sidebar__collapse-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: var(--admin-white);
    border-radius: 8px;
    cursor: pointer;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.admin-sidebar__collapse-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.admin-sidebar__body {
    flex: 1;
    min-height: 0;

    overflow-y: auto;
    overflow-x: hidden;

    scrollbar-gutter: stable;

    padding-right: 2px;

    display: flex;
    flex-direction: column;
}

.admin-sidebar__body::-webkit-scrollbar {
    width: 6px;
}

.admin-sidebar__body::-webkit-scrollbar-thumb {
    background: #3a3a40;
    border-radius: 999px;
}

.admin-sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.admin-sidebar__group {
    display: flex;
    flex-direction: column;
}

.admin-sidebar__link,
.admin-sidebar__sublink {
    width: 100%;
    border: none;
    text-decoration: none;
    background: transparent;
    color: var(--admin-white);
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 12px;
    padding: 12px 12px;
    font-size: 13px;
    font-weight: 600;
    transition: background-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.admin-sidebar__link {
    justify-content: space-between;
    cursor: pointer;
}

.admin-sidebar__link:hover,
.admin-sidebar__sublink:hover {
    background: rgba(255, 255, 255, 0.06);
}

.admin-sidebar__link-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.admin-sidebar__link-main i,
.admin-sidebar__sublink i {
    width: 18px;
    min-width: 18px;
    text-align: center;
    color: var(--admin-white);
    font-size: 14px;
}

.admin-sidebar__link-text {
    white-space: nowrap;
}

.admin-sidebar__link.is-active,
.admin-sidebar__sublink.is-active {
    background: var(--admin-red);
    color: var(--admin-white);
}

.admin-sidebar__link.is-active i,
.admin-sidebar__sublink.is-active i {
    color: var(--admin-white);
}

.admin-sidebar__submenu {
    display: none;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
    margin-left: 8px;
    padding-left: 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.admin-sidebar__group.is-open > .admin-sidebar__submenu {
    display: flex;
}

.admin-sidebar__sublink {
    font-size: 12.5px;
    padding: 10px 10px;
    border-radius: 10px;
}

/* Subgrupo dentro de un submenú de 3 niveles (colegiado/Colegiatura,
   ver admin_menu.php: "Administrar", "Información del colegiado",
   etc.) — es un acordeón anidado más (mismo .admin-sidebar__group que
   el nivel de arriba), con su propio botón que se abre/cierra. */
.admin-sidebar__group--sub {
    margin-top: 2px;
}

.admin-sidebar__sublink--toggle {
    justify-content: space-between;
    cursor: pointer;
}

.admin-sidebar__chevron--sub {
    font-size: 10px;
}

/* Ítem "Próximamente": el docente pidió ver la estructura completa del
   menú (ver Reoordenar Intranet.docx) aunque la página todavía no exista
   — se muestra en el sidebar pero sin enlace ni posibilidad de click. */
.admin-sidebar__sublink--disabled {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: not-allowed;
    color: rgba(255, 255, 255, 0.35);
}

.admin-sidebar__sublink--disabled i {
    color: rgba(255, 255, 255, 0.35);
}

.admin-sidebar__sublink--disabled:hover {
    background: transparent;
}

.admin-sidebar__soon-badge {
    margin-left: auto;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.admin-sidebar__chevron {
    color: var(--admin-white);
    font-size: 11px;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

/* Con nesting (subgrupos dentro de subgrupos), un descendiente ".is-open
   .admin-sidebar__chevron" rotaría también los chevrons de los
   subgrupos hijos aunque estén cerrados — se limita a ">[data-toggle-menu]"
   (hijo directo del grupo) para que cada grupo solo rote su propio ícono. */
.admin-sidebar__group.is-open > [data-toggle-menu] .admin-sidebar__chevron {
    transform: rotate(180deg);
}

.admin-sidebar__footer {
    margin-top: auto;
    padding-top: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

/* =========================
   AVATARES
========================= */
.admin-avatar {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #0088ff;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.admin-avatar.admin-avatar--sm,
.admin-avatar--sm {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.admin-sidebar__user-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    color: var(--admin-white);
}

.admin-sidebar__user-email {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

/* =========================
   COLLAPSED SIDEBAR
========================= */
.admin-sidebar.is-collapsed .admin-sidebar__brand-text,
.admin-sidebar.is-collapsed .admin-sidebar__brand-icon,
.admin-sidebar.is-collapsed .admin-sidebar__submenu,
.admin-sidebar.is-collapsed .admin-sidebar__link-text,
.admin-sidebar.is-collapsed .admin-sidebar__chevron,
.admin-sidebar.is-collapsed .admin-sidebar__footer .admin-sidebar__user,
.admin-sidebar.is-collapsed .admin-sidebar__submenu {
    display: none;
}

.admin-sidebar.is-collapsed .admin-sidebar__brand {
    justify-content: center;
}

.admin-sidebar.is-collapsed .admin-sidebar__link,
.admin-sidebar.is-collapsed .admin-sidebar__sublink {
    justify-content: center;
    padding: 12px 0;
}

.admin-sidebar.is-collapsed .admin-sidebar__link-main {
    justify-content: center;
    gap: 0;
}

.admin-sidebar.is-collapsed .admin-sidebar__collapse-btn {
    margin: 0 auto;
}

/* =========================
   CONTENT
========================= */
.admin-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--admin-bg);
    overflow: hidden;
}

/* =========================
   PAGE
========================= */
.admin-page {
    padding: 12px 16px;
}

.admin-page__header {
    margin-bottom: 24px;
}

.admin-page__header h1 {
    display: flex;
    align-items: center;
    gap: 10px;

    margin: 0 0 8px;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
}

.admin-page__header h1 i {
    color: #c90000;
    font-size: 0.8em;
}

.admin-page__header p {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

/* =========================
   METRIC CARDS
========================= */
.admin-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.metric-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    border-width: 1px;
    border-style: solid;
    box-sizing: border-box;
}

.metric-card__icon {
    font-size: 54px;
    line-height: 1;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.metric-card__data {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.metric-card__value {
    font-size: 20px;
    font-weight: 700;
    line-height: 25px;
}

.metric-card__label {
    font-size: 14px;
    font-weight: 500;
    line-height: 25px;
}

/* =========================
   DASHBOARD GRID
========================= */
.admin-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.admin-dashboard-main-side {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 24px;
    align-items: start;
    margin-bottom: 24px;
}

.admin-dashboard-side {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* =========================
   Secciones de las pantallas de "Reportes" (ver
   portal-intranet/partials/admin_reporte.php) -- varias tablas
   .maintenance-list-card apiladas necesitan separación entre sí,
   igual que hacían "margin-bottom:18px" inline antes de extraerlo aquí.
========================= */
.admin-report-section + .admin-report-section {
    margin-top: 18px;
}

/* =========================
   PANEL (base card)
========================= */
.admin-panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.admin-panel__title {
    font-size: 16px;
    font-weight: 600;
    color: #000000;
    margin: 0 0 4px;
}

.admin-panel__subtitle {
    font-size: 12px;
    font-weight: 400;
    color: #686868;
    margin: 0 0 16px;
}

/* =========================
   RECENT PUBLICATIONS
========================= */
.recent-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: calc(7 * 90px + 6 * 1px);
    overflow-y: auto;
}

.recent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 90px;
    padding: 8px 0;
    background: transparent;
    border-radius: 0;
}

.recent-item + .recent-item {
    border-top: 1px solid #BFB8B8;
}

.recent-item__left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.recent-item__action-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #686868;
    flex-shrink: 0;
}

.recent-item__action-icon i {
    font-size: 18px;
}

.recent-item__content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.recent-item__title {
    font-size: 14px;
    font-weight: 500;
    color: #000000;
    margin: 0;
}

.recent-item__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 400;
    color: #686868;
    margin: 0;
}

.recent-item__date {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #686868;
}

.recent-item__date i {
    font-size: 11px;
}

/* =========================
   STATUS CHIPS
========================= */
.status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 30px;
    min-width: 120px;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 400;
    flex-shrink: 0;
}

.status-chip--publicado {
    background: rgba(34, 197, 94, 0.3);
    color: #22C55E;
}

.status-chip--borrador {
    background: rgba(0, 0, 0, 0.3);
    color: #000000;
}

.status-chip--programado {
    background: rgba(249, 115, 22, 0.3);
    color: #F97316;
}

/* =========================
   QUICK ACTIONS
========================= */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.quick-action {
    min-height: 84px;
    border: 1px solid #d9d9d9;
    border-radius: 12px;
    text-decoration: none;
    color: #111;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    font-size: 14px;
    font-weight: 400;
    transition: background 0.15s, border-color 0.15s;
    background: #ffffff;
}

.quick-action:hover {
    background: #f3f4f6;
    color: #111;
}

.quick-action i {
    font-size: 30px;
    color: #111;
}

/* =========================
   SCHEDULED CONTENT
========================= */
.scheduled-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: calc(5 * 90px);
    overflow-y: auto;
}

.scheduled-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
    padding: 5px 0;
}

.scheduled-item + .scheduled-item {
    border-top: 1px solid #BFB8B8;
}

.scheduled-item__left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scheduled-item__icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #686868;
    flex-shrink: 0;
}

.scheduled-item__icon i {
    font-size: 18px;
}

.scheduled-item__content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.scheduled-item__title {
    font-size: 14px;
    font-weight: 500;
    color: #000000;
    margin: 0;
}

.scheduled-item__type {
    font-size: 12px;
    color: #686868;
    margin: 0;
}

.scheduled-item__date {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #686868;
}

.scheduled-item__date i {
    font-size: 11px;
}

.btn-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 34px;
    padding: 7px 14px;
    background: #8E8E93;
    color: #ffffff;
    border: none;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-edit:hover {
    background: #565659;
    color: #ffffff;
}

.btn-edit i {
    font-size: 13px;
}

/* =========================
   VIEW STATS
========================= */
.view-stats-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.view-stat-item {
    display: flex;
    align-items: center;
    gap: 16px;
}

.view-stat-item__main {
    flex: 1;
    min-width: 0;
}

.view-stat-item__title {
    font-size: 14px;
    font-weight: 500;
    color: #000000;
    margin: 0 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.view-stat-item__bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-bar {
    flex: 1;
    height: 30px;
    background: #E5E5E5;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar__fill {
    height: 100%;
    background: #34C759;
    border-radius: 3px;
    transition: width 0.3s ease-in-out;
}

.view-stat-item__views {
    font-size: 12px;
    color: #686868;
    white-space: nowrap;
}

/* =========================
   TYPE CHIPS
========================= */
.type-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    min-width: 100px;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    flex-shrink: 0;
}

.type-chip--noticia {
    background: rgba(29, 78, 216, 0.3);
    color: #1D4ED8;
}

.type-chip--documento {
    background: rgba(139, 94, 60, 0.3);
    color: #8B5E3C;
}

.type-chip--evento {
    background: rgba(124, 58, 237, 0.3);
    color: #7C3AED;
}

.type-chip--comunicado {
    background: rgba(5, 150, 105, 0.3);
    color: #059669;
}

.type-chip--galeria {
    background: rgba(236, 72, 153, 0.3);
    color: #EC4899;
}

.type-chip--boletin {
    background: rgba(245, 158, 11, 0.3);
    color: #F59E0B;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 1200px) {
    .admin-topbar__brand {
        min-width: auto;
    }

    .admin-topbar__brand-text p {
        font-size: 12px;
    }

    .admin-metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-dashboard-main-side {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .admin-topbar {
        gap: 14px;
        padding: 0 16px;
    }

    .admin-topbar__brand-text {
        display: none;
    }

    .admin-topbar__search {
        max-width: 100%;
    }
}

@media (max-width: 900px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        min-height: auto;
    }

    .admin-metrics {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-topbar {
        padding: 0 14px;
    }

    .admin-topbar__search {
        max-width: none;
    }

    .admin-topbar__user span {
        display: none;
    }
}

/* Card 1 - Gris */
.admin-metrics .metric-card--gray {
    background: #E5E7EB;
    border-color: #64748B;
    color: #64748B;
}

/* Card 2 - Verde */
.admin-metrics .metric-card--green {
    background: #DCFCE7;
    border-color: #22C55E;
    color: #22C55E;
}

/* Card 3 - Amarillo */
.admin-metrics .metric-card--yellow {
    background: #FEF3C7;
    border-color: #FBBF24;
    color: #F59E0B;
}

/* Card 4 - Celeste */
.admin-metrics .metric-card--cyan {
    background: #E0F2FE;
    border-color: #38BDF8;
    color: #0284C7;
}

.admin-metrics .metric-card i,
.admin-metrics .metric-card__icon {
    width: 38px;
    height: 38px;
    min-width: 38px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 999px;
    font-size: 18px;
}

.admin-metrics .metric-card--green i,
.admin-metrics .metric-card--green .metric-card__icon {
    background: #22C55E;
    color: #FFFFFF;
}

.admin-metrics .metric-card--yellow i,
.admin-metrics .metric-card--yellow .metric-card__icon {
    background: #FBBF24;
    color: #FFFFFF;
}

.admin-metrics .metric-card--cyan i,
.admin-metrics .metric-card--cyan .metric-card__icon {
    background: #38BDF8;
    color: #FFFFFF;
}

/* Card 5 - Rojo */
.admin-metrics .metric-card--red {
    background: #FEE2E2;
    border-color: #EF4444;
    color: #DC2626;
}

/* Card 6 - Naranja */
.admin-metrics .metric-card--orange {
    background: #FFF7ED;
    border-color: #F97316;
    color: #C2410C;
}

/* Card 7 - Morado */
.admin-metrics .metric-card--purple {
    background: #F5F3FF;
    border-color: #7C3AED;
    color: #7C3AED;
}

/* Card 8 - Azul */
.admin-metrics .metric-card--blue {
    background: #EFF6FF;
    border-color: #2563EB;
    color: #2563EB;
}

.admin-metrics .metric-card--red i,
.admin-metrics .metric-card--red .metric-card__icon {
    background: #EF4444;
    color: #FFFFFF;
}

.admin-metrics .metric-card--orange i,
.admin-metrics .metric-card--orange .metric-card__icon {
    background: #F97316;
    color: #FFFFFF;
}

.admin-metrics .metric-card--purple i,
.admin-metrics .metric-card--purple .metric-card__icon {
    background: #7C3AED;
    color: #FFFFFF;
}

.admin-metrics .metric-card--blue i,
.admin-metrics .metric-card--blue .metric-card__icon {
    background: #2563EB;
    color: #FFFFFF;
}

/* Variante clickeable: tarjetas que además de mostrar un total, filtran
   la tabla al hacer clic (Agenda, Mesa de partes, Tickets, Trámites).
   El resto de usos de .metric-card (paneles de solo lectura) no llevan
   este modificador y se quedan sin cursor/hover/estado activo. */
.metric-card--clickable {
    cursor: pointer;
    text-align: left;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.metric-card--clickable:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.metric-card--clickable.is-active {
    box-shadow: inset 0 0 0 2px #C90000;
}

/* ============================================================
   FIX FINAL: TOPBAR + SIDEBAR FIJOS SIN ROMPER EL CONTENIDO
   ============================================================ */

:root {
    --admin-topbar-height: 83px;
    --admin-sidebar-width: 231px;
    --admin-sidebar-collapsed-width: 84px;
}

html,
body {
    margin: 0 !important;
    width: 100% !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    background: #F5F6FA !important;
}

/* El documento (html/body) es quien scrollea verticalmente. Sin esto,
   el ancho real del contenido cambia ~15-17px (el ancho de la barra de
   scroll nativa) según si la página actual tiene más o menos alto que
   el viewport: páginas "cortas" (p. ej. bolsa_laboral con pocas ofertas)
   no muestran scrollbar y quedan más anchas, mientras que páginas
   "altas" (agenda, listados largos) sí la muestran y quedan más
   angostas. Al navegar entre una y otra el layout se corre esos px de
   golpe, sensación de "salto" reportada entre Agenda/Bolsa
   Laboral/Comisiones.
   `overflow-y: scroll` obliga a que la barra de scroll (o su espacio
   reservado, en sistemas con scrollbar superpuesta) esté SIEMPRE
   presente, haya o no contenido para scrollear, así el ancho es
   idéntico en cualquier página del panel de forma determinística en
   cualquier navegador. Se deja también `scrollbar-gutter: stable` como
   refuerzo para navegadores que lo soportan (en pruebas, por sí solo
   resultó inconsistente según el alto del contenido de cada página). */
html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

/* TOPBAR FIJO */
header.admin-topbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: var(--admin-topbar-height) !important;
    z-index: 1200 !important;
    background: #111217 !important;
}

/* LAYOUT GENERAL */
.admin-layout {
    display: block !important;
    width: 100% !important;
    min-height: 100vh !important;
    padding-top: var(--admin-topbar-height) !important;
    background: #F5F6FA !important;
}

/* SIDEBAR FIJO */
.admin-sidebar {
    position: fixed !important;
    top: var(--admin-topbar-height) !important;
    left: 0 !important;
    bottom: 0 !important;
    width: var(--admin-sidebar-width) !important;
    min-width: var(--admin-sidebar-width) !important;
    max-width: var(--admin-sidebar-width) !important;
    height: calc(100vh - var(--admin-topbar-height)) !important;
    background: #111217 !important;
    z-index: 1100 !important;
    overflow-y: hidden !important;
    overflow-x: hidden !important;
}

/* CONTENIDO */
.admin-content {
    display: block !important;
    margin-left: var(--admin-sidebar-width) !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: calc(100vh - var(--admin-topbar-height)) !important;
    background: #F5F6FA !important;
    overflow: visible !important;
}

/* PÁGINA INTERNA */
.admin-page,
.bolsa-page,
.agenda-page {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

/* Evita que títulos, filtros y cards se compriman */
.page__header,
.bolsa-stats,
.bolsa-filters,
.bolsa-list,
.oferta-card,
.agenda-toolbar,
.agenda-calendar,
.agenda-list,
.agenda-stats {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
}

/* ============================================================
   SIDEBAR COLAPSADO - COMO LA SEGUNDA IMAGEN
   ============================================================ */

body.sidebar-collapsed .admin-sidebar,
.admin-sidebar.is-collapsed,
.admin-layout.sidebar-collapsed .admin-sidebar {
    width: var(--admin-sidebar-collapsed-width) !important;
    min-width: var(--admin-sidebar-collapsed-width) !important;
    max-width: var(--admin-sidebar-collapsed-width) !important;
}

/* El contenido se acomoda al ancho colapsado */
body.sidebar-collapsed .admin-content,
.admin-layout.sidebar-collapsed .admin-content {
    margin-left: var(--admin-sidebar-collapsed-width) !important;
}

/* Ocultar textos, flechas y logo interno */
body.sidebar-collapsed .admin-sidebar__brand-text,
body.sidebar-collapsed .admin-sidebar__link-text,
body.sidebar-collapsed .admin-sidebar__chevron,
body.sidebar-collapsed .admin-sidebar__brand-icon,
.admin-sidebar.is-collapsed .admin-sidebar__brand-text,
.admin-sidebar.is-collapsed .admin-sidebar__link-text,
.admin-sidebar.is-collapsed .admin-sidebar__chevron,
.admin-sidebar.is-collapsed .admin-sidebar__brand-icon,
.admin-layout.sidebar-collapsed .admin-sidebar__brand-text,
.admin-layout.sidebar-collapsed .admin-sidebar__link-text,
.admin-layout.sidebar-collapsed .admin-sidebar__chevron,
.admin-layout.sidebar-collapsed .admin-sidebar__brand-icon {
    display: none !important;
}

/* Header del sidebar colapsado */
body.sidebar-collapsed .admin-sidebar__header,
.admin-sidebar.is-collapsed .admin-sidebar__header,
.admin-layout.sidebar-collapsed .admin-sidebar__header {
    padding: 24px 0 18px !important;
}

/* Centrar botón hamburguesa */
body.sidebar-collapsed .admin-sidebar__brand,
.admin-sidebar.is-collapsed .admin-sidebar__brand,
.admin-layout.sidebar-collapsed .admin-sidebar__brand {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 0 !important;
}

body.sidebar-collapsed .admin-sidebar__collapse-btn,
.admin-sidebar.is-collapsed .admin-sidebar__collapse-btn,
.admin-layout.sidebar-collapsed .admin-sidebar__collapse-btn {
    position: static !important;
    width: 44px !important;
    height: 44px !important;
    margin: 0 auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Cuerpo del sidebar colapsado */
body.sidebar-collapsed .admin-sidebar__body,
.admin-sidebar.is-collapsed .admin-sidebar__body,
.admin-layout.sidebar-collapsed .admin-sidebar__body {
    padding: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Navegación centrada */
body.sidebar-collapsed .admin-sidebar__nav,
.admin-sidebar.is-collapsed .admin-sidebar__nav,
.admin-layout.sidebar-collapsed .admin-sidebar__nav {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 0 !important;
}

/* Grupos sin ancho extra */
body.sidebar-collapsed .admin-sidebar__group,
.admin-sidebar.is-collapsed .admin-sidebar__group,
.admin-layout.sidebar-collapsed .admin-sidebar__group {
    width: 100% !important;
    margin: 0 !important;
}

/* Links principales colapsados */
body.sidebar-collapsed .admin-sidebar__link,
.admin-sidebar.is-collapsed .admin-sidebar__link,
.admin-layout.sidebar-collapsed .admin-sidebar__link {
    width: 58px !important;
    height: 42px !important;
    padding: 0 !important;
    margin: 0 auto 6px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    border-radius: 12px !important;
}

/* Íconos centrados */
body.sidebar-collapsed .admin-sidebar__link-main,
.admin-sidebar.is-collapsed .admin-sidebar__link-main,
.admin-layout.sidebar-collapsed .admin-sidebar__link-main {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

body.sidebar-collapsed .admin-sidebar__link i,
.admin-sidebar.is-collapsed .admin-sidebar__link i,
.admin-layout.sidebar-collapsed .admin-sidebar__link i {
    margin: 0 !important;
    font-size: 15px !important;
}

/* NO mostrar submenús cuando el sidebar está colapsado */
body.sidebar-collapsed .admin-sidebar__submenu,
.admin-sidebar.is-collapsed .admin-sidebar__submenu,
.admin-layout.sidebar-collapsed .admin-sidebar__submenu {
    display: none !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
}

body.sidebar-collapsed .admin-sidebar__group.is-open .admin-sidebar__submenu,
.admin-sidebar.is-collapsed .admin-sidebar__group.is-open .admin-sidebar__submenu,
.admin-layout.sidebar-collapsed .admin-sidebar__group.is-open .admin-sidebar__submenu {
    display: none !important;
}

/* Ocultar líneas/indentación de submenús */
body.sidebar-collapsed .admin-sidebar__submenu::before,
.admin-sidebar.is-collapsed .admin-sidebar__submenu::before,
.admin-layout.sidebar-collapsed .admin-sidebar__submenu::before {
    display: none !important;
}

/* Activo rojo como tu referencia */
body.sidebar-collapsed .admin-sidebar__link.is-active,
.admin-sidebar.is-collapsed .admin-sidebar__link.is-active,
.admin-layout.sidebar-collapsed .admin-sidebar__link.is-active {
    width: 58px !important;
    height: 42px !important;
    background: #F0182D !important;
    color: #FFFFFF !important;
    border-radius: 12px !important;
}

/* Scroll limpio */
.admin-sidebar::-webkit-scrollbar,
.admin-sidebar__body::-webkit-scrollbar {
    width: 6px;
}

.admin-sidebar::-webkit-scrollbar-thumb,
.admin-sidebar__body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.22);
    border-radius: 999px;
}

.admin-sidebar::-webkit-scrollbar-track,
.admin-sidebar__body::-webkit-scrollbar-track {
    background: transparent;
}

/*lo puse recien para normalizar el css*/
/* =========================================================
   NORMALIZACIÓN VISUAL DEL MENÚ LATERAL
   Evita que los estilos particulares de cada página
   modifiquen la tipografía y apariencia del sidebar.
   ========================================================= */

/*
 * Normaliza únicamente los elementos de texto.
 * No modifica la fuente de los iconos Font Awesome.
 */
.admin-sidebar,
.admin-sidebar button,
.admin-sidebar a,
.admin-sidebar span,
.admin-sidebar p {
    font-family: var(--font-primary,
    "Inter",
    "Roboto",
    Arial,
    sans-serif);
}

.admin-sidebar button,
.admin-sidebar a {
    font-family: inherit;
    letter-spacing: normal;
    text-transform: none;
}

.admin-sidebar .admin-sidebar__link,
.admin-sidebar .admin-sidebar__sublink {
    font-style: normal;
    text-decoration: none;
}

.admin-sidebar .admin-sidebar__link {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
}

.admin-sidebar .admin-sidebar__sublink {
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.25;
}

.admin-sidebar .admin-sidebar__brand-text {
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

.admin-sidebar .admin-sidebar__link-text {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
}

.admin-sidebar .admin-sidebar__link i,
.admin-sidebar .admin-sidebar__sublink i {
    width: 18px;
    min-width: 18px;
    color: inherit;
    font-size: 14px;
    line-height: 1;
    text-align: center;
}

.admin-sidebar .admin-sidebar__link:hover,
.admin-sidebar .admin-sidebar__sublink:hover {
    color: var(--admin-white);
}

.admin-sidebar .admin-sidebar__link.is-active,
.admin-sidebar .admin-sidebar__sublink.is-active {
    background-color: var(--admin-red);
    color: var(--admin-white);
}


/* =========================================================
   BREADCRUMB (Dashboard > Sección > Página actual)
   ========================================================= */

.admin-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
    font-size: 14px;
    color: #6b7280;
}

.admin-breadcrumb a {
    color: #6b7280;
    font-weight: 400;
    text-decoration: none;
    transition: color 0.2s ease;
}

.admin-breadcrumb a:hover {
    color: var(--admin-red);
}

.admin-breadcrumb__separator {
    color: #9ca3af;
}

.admin-breadcrumb__current {
    color: var(--admin-black);
    font-weight: 600;
}

/* =========================
   ÍCONO DEL SELECTOR DE FECHA (input[type="date"])
   -------------------------
   admin.css está en $cssBase (admin_head.php), así que esto aplica a
   TODO input[type="date"] de portal-intranet sin tocar página por página.
   El ícono gris por defecto del navegador no admite currentColor, así
   que se reemplaza por un SVG propio ya coloreado en el rojo
   institucional (#c90000 -- el mismo de .maintenance-primary-button y
   compañía, no --admin-red que es un acento más claro y mucho menos
   usado). Solo cubre navegadores basados en WebKit/Blink (Chrome,
   Edge): Firefox no expone ::-webkit-calendar-picker-indicator ni un
   equivalente propio para recolorear este ícono por CSS.
========================= */
input[type="date"]::-webkit-calendar-picker-indicator {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c90000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px 16px;

    width: 20px;
    height: 20px;
    padding: 2px;
    border-radius: 6px;

    cursor: pointer;
    opacity: 1;
    transition: background-color 0.15s ease;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    background-color: rgba(201, 0, 0, 0.1);
}

/* Columnas con dinero (S/): cabecera y celdas alineadas a la derecha, con cifras de ancho
   fijo para que los decimales queden en columna. !important porque varias tablas centran
   sus columnas por posición (nth-child) con más especificidad. */
th.column-money,
td.column-money {
    text-align: right !important;
    font-variant-numeric: tabular-nums;
}

/* Fondo de los modales que usan un overlay propio (Ambientes, Página de inicio, Agenda, Etiquetas, Nueva publicación):
   mismo oscurecido y desenfoque que .maintenance-modal__backdrop, para que todos los modales del sistema se vean igual. */
.modal-overlay-blur {
    background-color: rgba(15, 23, 42, 0.58) !important;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

/* =========================
   MENÚ DEL USUARIO (barra superior)
========================= */
.admin-topbar__user-menu {
    min-width: 270px;
    padding: 12px;
}

.admin-avatar {
    position: relative;
    overflow: hidden;
}

.admin-avatar__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.admin-avatar--lg {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #c90000;
    color: #ffffff;
    font-size: 16px;
}

.admin-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 4px 12px;
}

.admin-user-card__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.admin-user-card__info strong {
    font-size: 14px;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-user-card__email {
    font-size: 12px;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-user-card__role {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding: 2px 8px;
    width: fit-content;
    border-radius: 999px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 11px;
    font-weight: 700;
}

.admin-user-menu__label {
    margin: 4px 4px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
}

.admin-user-menu__item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #111827;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.admin-user-menu__item:hover:not(:disabled) {
    background: #f1f5f9;
}

.admin-user-menu__item:disabled {
    opacity: 0.6;
    cursor: wait;
}

.admin-user-menu__item.is-active {
    color: #c90000;
    cursor: default;
}

.admin-user-menu__sep {
    height: 1px;
    margin: 8px 0;
    background: #e2e8f0;
}
