/* ==========================================================================
   ACADEMIAQR · MÓDULO PERSONAL DOCENTE Y ADMINISTRATIVO (DISEÑO AURORA MODERNO)
   ========================================================================== */

.staff-hero-bar {
    background:
        radial-gradient(circle at 92% 18%, rgba(56, 189, 248, 0.28) 0%, transparent 48%),
        radial-gradient(circle at 8% 88%, rgba(52, 211, 153, 0.24) 0%, transparent 46%),
        linear-gradient(130deg, #0f172a 0%, #0f766e 58%, #0d9488 100%);
    color: #ffffff;
    padding: 1.05rem 1.35rem;
    border-radius: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-bottom: 1.15rem;
    box-shadow: 0 12px 30px rgba(15, 118, 110, 0.18);
}

.staff-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #99f6e4;
}

.staff-hero-title {
    margin: 0.22rem 0 0.18rem;
    font-size: 1.18rem;
    font-weight: 800;
    letter-spacing: -0.015em;
    color: #ffffff;
}

.staff-hero-sub {
    margin: 0;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.86);
    line-height: 1.4;
    max-width: 620px;
}

.staff-hero-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Barra de Filtros 1-Toque + Buscador */
.staff-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.staff-pills-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.staff-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.42rem 0.82rem;
    border-radius: 999px;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.staff-filter-pill:hover {
    border-color: #94a3b8;
    color: #0f172a;
}

.staff-filter-pill.is-active {
    background: linear-gradient(135deg, #0f766e, #0d9488);
    border-color: #0d9488;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}

.staff-filter-pill .pill-count {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.06rem 0.42rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    color: inherit;
}

.staff-filter-pill.is-active .pill-count {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

.staff-search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}

.staff-search-wrap {
    flex: 1;
    min-width: 220px;
    position: relative;
}

.staff-search-wrap i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.82rem;
    pointer-events: none;
}

.staff-search-wrap input {
    width: 100%;
    padding: 0.56rem 0.85rem 0.56rem 2.3rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    font-size: 0.84rem;
    font-weight: 500;
    color: #0f172a;
    transition: border-color 0.15s ease, background 0.15s ease;
    box-sizing: border-box;
}

.staff-search-wrap input:focus {
    outline: none;
    border-color: #0d9488;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.14);
}

.staff-grade-select {
    min-width: 185px;
    padding: 0.56rem 0.8rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    font-size: 0.82rem;
    font-weight: 700;
    color: #0f172a;
    cursor: pointer;
}

/* Tabla Moderna & Badges */
.staff-table-wrap {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow-x: auto;
    background: #ffffff;
}

.staff-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.staff-table thead th {
    background: #f8fafc;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.78rem 0.95rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.staff-table tbody td {
    padding: 0.82rem 0.95rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.staff-table tbody tr:last-child td {
    border-bottom: none;
}

.staff-table tbody tr:hover {
    background: #f8fafc;
}

.staff-avatar-badge {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.86rem;
    flex-shrink: 0;
}

.staff-avatar-badge.is-docente {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
}

.staff-avatar-badge.is-admin {
    background: linear-gradient(135deg, #cffafe, #bae6fd);
    color: #075985;
}

.badge-docente {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.badge-administrativo {
    background: #ecfeff;
    color: #0e7490;
    border: 1px solid #a5f3fc;
}

.badge-pending-profile {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
}

.tg-status-linked {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    border-radius: 999px;
    padding: 0.14rem 0.5rem;
    font-size: 0.69rem;
    font-weight: 800;
}

.tg-status-pending {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
    border-radius: 999px;
    padding: 0.14rem 0.5rem;
    font-size: 0.69rem;
    font-weight: 800;
}

.btn-tg-invite-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
    padding: 0.14rem 0.48rem;
    border-radius: 999px;
    border: 1px solid #bae6fd;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 0.68rem;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
}

.btn-tg-invite-inline:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

.staff-actions-cell {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
}

.staff-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.staff-icon-btn:hover {
    border-color: #0d9488;
    color: #0d9488;
    background: #f0fdfa;
}

.staff-icon-btn.is-danger {
    color: #dc2626;
    border-color: #fecaca;
}

.staff-icon-btn.is-danger:hover {
    background: #fef2f2;
    border-color: #ef4444;
}

.staff-empty-card {
    text-align: center;
    padding: 2.4rem 1.5rem;
    background: #f8fafc;
    border: 1.5px dashed #cbd5e1;
    border-radius: 14px;
    margin: 0.4rem 0;
}

/* ==========================================================================
   MODAL AURORA MODERNO (#staffMemberModal y #staffDeleteConfirmModal)
   ========================================================================== */
.staff-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(15, 23, 42, 0.62);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

.staff-modal-shell {
    width: 100%;
    max-width: 680px;
    max-height: calc(100dvh - 2rem);
    background: #ffffff;
    border-radius: 22px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(148, 163, 184, 0.16);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: staffModalPop 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes staffModalPop {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.staff-modal-header {
    flex-shrink: 0;
    padding: 1.05rem 1.3rem;
    background:
        radial-gradient(circle at 92% 14%, rgba(56, 189, 248, 0.32) 0%, transparent 50%),
        radial-gradient(circle at 12% 90%, rgba(52, 211, 153, 0.28) 0%, transparent 48%),
        linear-gradient(130deg, #0f172a 0%, #0f766e 58%, #0d9488 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.staff-modal-header-left {
    display: flex;
    align-items: center;
    gap: 0.72rem;
    min-width: 0;
}

.staff-modal-icon {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    color: #ffffff;
    flex-shrink: 0;
}

.staff-modal-title {
    margin: 0;
    font-size: 1.04rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
}

.staff-modal-sub {
    margin: 2px 0 0;
    font-size: 0.73rem;
    color: rgba(255, 255, 255, 0.85);
}

.staff-modal-close {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.staff-modal-close:hover {
    background: rgba(255, 255, 255, 0.24);
}

.staff-modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1.15rem 1.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.staff-type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.staff-type-card {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.72rem 0.85rem;
    border-radius: 14px;
    border: 1.5px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: all 0.16s ease;
}

.staff-type-card i {
    font-size: 1.2rem;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #0d9488;
    flex-shrink: 0;
}

.staff-type-card strong {
    display: block;
    font-size: 0.84rem;
    font-weight: 800;
    color: #0f172a;
}

.staff-type-card small {
    display: block;
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 1px;
}

.staff-type-card.is-active {
    border-color: #0d9488;
    background: linear-gradient(145deg, #f0fdfa 0%, #ecfeff 100%);
    box-shadow: 0 6px 16px rgba(13, 148, 136, 0.14);
}

.staff-type-card.is-active i {
    background: #0d9488;
    color: #ffffff;
}

.staff-form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.staff-form-field label {
    display: block;
    font-size: 0.74rem;
    font-weight: 800;
    color: #334155;
    margin-bottom: 0.3rem;
}

.staff-form-field input,
.staff-form-field select {
    width: 100%;
    padding: 0.56rem 0.78rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 11px;
    font-size: 0.84rem;
    font-family: inherit;
    color: #0f172a;
    background: #ffffff;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.staff-form-field input:focus,
.staff-form-field select:focus {
    outline: none;
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.14);
}

.staff-tg-auto-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.55rem 0.78rem;
    border-radius: 11px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    font-size: 0.74rem;
    color: #0369a1;
}

.staff-grades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
    gap: 0.42rem;
    max-height: 145px;
    overflow-y: auto;
    padding: 0.6rem;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
}

.staff-grade-chip {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    padding: 0.24rem 0.42rem;
    border-radius: 7px;
}

.staff-grade-chip:hover {
    background: #e2e8f0;
}

.admin-preset-box {
    padding: 0.85rem 0.95rem;
    border-radius: 14px;
    background: linear-gradient(145deg, #f0fdfa 0%, #f8fafc 100%);
    border: 1.5px solid #99f6e4;
}

.admin-preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
    gap: 0.45rem;
    margin-top: 0.5rem;
}

.admin-preset-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.58rem 0.42rem;
    border-radius: 11px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-size: 0.73rem;
    font-weight: 800;
    text-align: center;
    cursor: pointer;
    transition: all 0.16s ease;
    font-family: inherit;
}

.admin-preset-card i {
    font-size: 0.98rem;
    color: var(--preset-color, #0e7490);
}

.admin-preset-card.active {
    border-color: var(--preset-color, #0e7490);
    background: color-mix(in srgb, var(--preset-color, #0e7490) 10%, #ffffff);
    color: var(--preset-color, #0e7490);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.admin-fine-perms-details {
    margin-top: 0.7rem;
    border-top: 1px dashed #cbd5e1;
    padding-top: 0.55rem;
}

.admin-fine-perms-details summary {
    font-size: 0.76rem;
    font-weight: 700;
    color: #0f766e;
    cursor: pointer;
    user-select: none;
}

.admin-fine-perms-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
    gap: 0.42rem;
    margin-top: 0.6rem;
}

.admin-fine-perm-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    padding: 0.4rem 0.55rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    font-size: 0.74rem;
    font-weight: 700;
    color: #334155;
}

.admin-fine-perm-row select {
    font-size: 0.71rem;
    font-weight: 700;
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
    width: auto;
}

.staff-modal-footer {
    flex-shrink: 0;
    padding: 0.85rem 1.3rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
}

.staff-btn-cancel {
    padding: 0.58rem 1rem;
    border-radius: 11px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.staff-btn-save {
    padding: 0.58rem 1.2rem;
    border-radius: 11px;
    border: none;
    background: linear-gradient(135deg, #0f766e, #0d9488);
    color: #ffffff;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 6px 16px rgba(13, 148, 136, 0.28);
}

/* Responsivo Móvil: Tarjetas Limpias sin Scroll Horizontal */
@media (max-width: 768px) {
    .staff-type-selector,
    .staff-form-grid-2 {
        grid-template-columns: 1fr;
    }

    .staff-table thead {
        display: none;
    }

    .staff-table,
    .staff-table tbody,
    .staff-table tr,
    .staff-table td {
        display: block;
        width: 100%;
    }

    .staff-table tbody tr {
        padding: 0.8rem 0.9rem;
        border-bottom: 6px solid #f1f5f9;
    }

    .staff-table tbody td {
        padding: 0.28rem 0;
        border-bottom: none;
    }

    .staff-actions-cell {
        width: 100%;
        justify-content: flex-start;
        margin-top: 0.35rem;
    }

    .staff-modal-backdrop {
        padding: 0.5rem 0.5rem 5.2rem 0.5rem;
        align-items: flex-end;
    }

    .staff-modal-shell {
        max-height: calc(100dvh - 5.8rem);
        border-radius: 20px;
    }
}
