/* =========================
   Base compartida admin
========================= */

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f6f8;
    color: #111827;
}

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

.page-bg {
    background: #f4f6f8;
}

/* =========================
   Layout admin
========================= */

.admin-page {
    min-height: 100vh;
    background: #f4f6f8;
    padding-top: 5px;
}

.admin-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(244, 246, 248, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #dbe3ea;
    margin: 0 0 20px 0;
}

.admin-header__inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.admin-header__left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.admin-header__right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.admin-header__menu-button {
    width: 44px;
    height: 44px;
    border: 1px solid #dbe3ea;
    border-radius: 12px;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.admin-header__menu-button:hover {
    transform: translateY(-1px);
    border-color: #bfdbfe;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
}

.admin-header__menu-icon {
    display: block;
    width: 20px;
    height: 2px;
    background: #1565c0;
    border-radius: 999px;
    position: relative;
}

.admin-header__menu-icon::before,
.admin-header__menu-icon::after {
    content: "";
    position: absolute;
    left: 0;
    width: 20px;
    height: 2px;
    background: #1565c0;
    border-radius: 999px;
}

.admin-header__menu-icon::before {
    top: -6px;
}

.admin-header__menu-icon::after {
    top: 6px;
}

.admin-header__title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: #1565c0;
    line-height: 1.2;
    word-break: break-word;
}

.admin-profile {
    position: relative;
    flex-shrink: 0;
}

.admin-profile__toggle {
    border: 1px solid #dbe3ea;
    background: #ffffff;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.admin-profile__toggle:hover {
    transform: translateY(-1px);
    border-color: #bfdbfe;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
}

.admin-profile__avatar {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    overflow: hidden;
}

.admin-profile__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.admin-profile__dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 250px;
    background: #ffffff;
    border: 1px solid #dbe3ea;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
    padding: 0;
    display: none;
    overflow: hidden;
    z-index: 1300;
}

.admin-profile__dropdown.is-open {
    display: block;
}

.admin-profile__summary {
    padding: 14px 16px 12px 16px;
}

.admin-profile__name {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.admin-profile__email {
    margin: 6px 0 0 0;
    font-size: 13px;
    color: #6b7280;
    word-break: break-word;
}

.admin-profile__divider {
    height: 1px;
    background: #eef2f7;
}

.admin-profile__menu {
    padding: 8px;
}

.admin-profile__link {
    display: block;
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    text-decoration: none;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    transition: 0.2s ease;
}

.admin-profile__link:hover {
    background: #f8fafc;
    color: #1565c0;
}

.admin-profile__link--logout:hover {
    background: #fef2f2;
    color: #b91c1c;
}

.admin-sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.45);
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: 0.25s ease;
}

.admin-sidebar-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 320px;
    max-width: 88vw;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border-right: 1px solid #dbe3ea;
    border-radius: 0 22px 22px 0;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.16);
    overflow-y: auto;
    z-index: 1200;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
}

.admin-sidebar.is-open {
    transform: translateX(0);
}

.admin-sidebar__inner {
    padding: 22px 18px 20px 18px;
}

.admin-sidebar__brand {
    padding: 0 0 18px 0;
    margin-bottom: 18px;
    border-bottom: 1px solid #e5e7eb;
}

.admin-sidebar__eyebrow {
    margin: 0 0 4px 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
}

.admin-sidebar__title {
    margin: 0;
    font-size: 24px;
    color: #1565c0;
    line-height: 1.15;
    font-weight: 800;
}

.admin-sidebar__subtitle {
    margin: 6px 0 0 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.45;
}

.admin-sidebar__user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    margin-bottom: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.65);
}

.admin-sidebar__avatar {
    width: 50px;
    height: 50px;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
}

.admin-sidebar__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.admin-sidebar__user-data {
    min-width: 0;
}

.admin-sidebar__user-name {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.admin-sidebar__user-email {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: #6b7280;
    word-break: break-word;
}

.admin-sidebar__section + .admin-sidebar__section {
    margin-top: 22px;
}

.admin-sidebar__section-title {
    margin: 0 0 10px 2px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

.admin-sidebar__nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.admin-sidebar__nav li + li {
    margin-top: 8px;
}

.admin-sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 50px;
    padding: 12px 14px;
    border: 1px solid #dbe3ea;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
    color: #334155;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
}

.admin-sidebar__link:hover {
    transform: translateY(-1px);
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.10);
}

.admin-sidebar__link--active {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #93c5fd;
    color: #1d4ed8;
    box-shadow: 0 14px 26px rgba(37, 99, 235, 0.12);
}

.admin-sidebar__link-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: #eef2ff;
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

.admin-sidebar__link--active .admin-sidebar__link-icon {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
}

.admin-sidebar__link-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.admin-sidebar__link-label {
    min-width: 0;
    flex: 1;
    line-height: 1.35;
}

.admin-shell {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.admin-main {
    width: 100%;
    min-width: 0;
}

/* =========================
   Layout app RRHH operativo
========================= */

.app-page {
    min-height: 100vh;
    background: #f4f6f8;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(244, 246, 248, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #dbe3ea;
}

.app-header__inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.app-header__left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.app-header__right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.app-header__menu-button {
    width: 44px;
    height: 44px;
    border: 1px solid #dbe3ea;
    border-radius: 12px;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.app-header__menu-button:hover {
    transform: translateY(-1px);
    border-color: #bfdbfe;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
}

.app-header__menu-icon {
    display: block;
    width: 20px;
    height: 2px;
    background: #1565c0;
    border-radius: 999px;
    position: relative;
}

.app-header__menu-icon::before,
.app-header__menu-icon::after {
    content: "";
    position: absolute;
    left: 0;
    width: 20px;
    height: 2px;
    background: #1565c0;
    border-radius: 999px;
}

.app-header__menu-icon::before {
    top: -6px;
}

.app-header__menu-icon::after {
    top: 6px;
}

.app-header__title-group {
    min-width: 0;
    flex: 1;
}

.app-header__title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: #1565c0;
    line-height: 1.2;
    word-break: break-word;
}

.app-header__subtitle {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
}

.app-profile {
    position: relative;
    flex-shrink: 0;
}

.app-profile__toggle {
    border: 1px solid #dbe3ea;
    background: #ffffff;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.app-profile__toggle:hover {
    transform: translateY(-1px);
    border-color: #bfdbfe;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
}

.app-profile__avatar {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    overflow: hidden;
}

.app-profile__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.app-profile__dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 250px;
    background: #ffffff;
    border: 1px solid #dbe3ea;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
    padding: 0;
    display: none;
    overflow: hidden;
    z-index: 1300;
}

.app-profile__dropdown.is-open {
    display: block;
}

.app-profile__summary {
    padding: 14px 16px 12px 16px;
}

.app-profile__name {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.app-profile__email {
    margin: 6px 0 0 0;
    font-size: 13px;
    color: #6b7280;
    word-break: break-word;
}

.app-profile__divider {
    height: 1px;
    background: #eef2f7;
}

.app-profile__menu {
    padding: 8px;
}

.app-profile__link {
    display: block;
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    text-decoration: none;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    transition: 0.2s ease;
}

.app-profile__link:hover {
    background: #f8fafc;
    color: #1565c0;
}

.app-profile__link--logout:hover {
    background: #fef2f2;
    color: #b91c1c;
}

.app-sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.45);
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: 0.25s ease;
}

.app-sidebar-overlay.is-open,
.app-sidebar-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 320px;
    max-width: 88vw;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border-right: 1px solid #dbe3ea;
    border-radius: 0 22px 22px 0;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.16);
    overflow-y: auto;
    z-index: 1200;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
}

.app-sidebar.is-open {
    transform: translateX(0);
}

.app-sidebar__inner {
    padding: 22px 18px 20px 18px;
}

.app-sidebar__brand {
    padding-bottom: 18px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 18px;
}

.app-sidebar__eyebrow {
    margin: 0 0 4px 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
}

.app-sidebar__title {
    margin: 0;
    font-size: 24px;
    color: #1565c0;
    line-height: 1.15;
    font-weight: 800;
}

.app-sidebar__subtitle {
    margin: 6px 0 0 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
}

.app-sidebar__close {
    width: 40px;
    height: 40px;
    border: 1px solid #dbe3ea;
    border-radius: 12px;
    background: #ffffff;
    color: #1565c0;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    margin-bottom: 14px;
}

.app-sidebar__user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    margin-bottom: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.65);
}

.app-sidebar__avatar {
    width: 50px;
    height: 50px;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
}

.app-sidebar__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.app-sidebar__user-data {
    min-width: 0;
}

.app-sidebar__user-name {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.app-sidebar__user-email {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: #6b7280;
    word-break: break-word;
}

.app-sidebar__section + .app-sidebar__section {
    margin-top: 22px;
}

.app-sidebar__section-title {
    margin: 0 0 10px 2px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

.app-sidebar__nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.app-sidebar__nav li + li {
    margin-top: 8px;
}

.app-sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 50px;
    padding: 12px 14px;
    border: 1px solid #dbe3ea;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
    color: #334155;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
}

.app-sidebar__link:hover {
    transform: translateY(-1px);
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.10);
}

.app-sidebar__link--active {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #93c5fd;
    color: #1d4ed8;
    box-shadow: 0 14px 26px rgba(37, 99, 235, 0.12);
}

.app-sidebar__link-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: #eef2ff;
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

.app-sidebar__link--active .app-sidebar__link-icon {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
}

.app-sidebar__link-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.app-sidebar__link-label {
    min-width: 0;
    flex: 1;
    line-height: 1.35;
}

.app-shell {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.app-main {
    width: 100%;
    min-width: 0;
    padding: 20px 16px 32px;
}

.app-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.app-section {
    width: 100%;
    min-width: 0;
}

/* =========================
   Responsive
========================= */

@media (max-width: 640px) {
    .admin-page {
        padding-top: 82px;
    }

    .admin-header__inner {
        padding: 12px 14px;
    }

    .admin-header__title {
        font-size: 20px;
    }

    .admin-profile__dropdown {
        width: 220px;
    }

    .admin-sidebar {
        width: 310px;
        max-width: 88vw;
    }

    .app-header__inner {
        padding: 12px 14px;
    }

    .app-header__title {
        font-size: 20px;
    }

    .app-profile__dropdown {
        width: 220px;
    }

    .app-sidebar {
        width: 310px;
        max-width: 88vw;
    }

    .app-main {
        padding: 18px 12px 28px;
    }
}