/* Staff Management Module Stylesheet */
/* Light SaaS Theme (Consistent with Academic Setup and System Modules) */

:root {
    --staff-bg: #F4F6FA;
    --staff-card: #FFFFFF;
    --staff-card-hover: #F8FAFC;
    --staff-border: #E5E7EB;
    --staff-border-subtle: #F1F5F9;
    --staff-input-bg: #F8FAFC;
    --staff-input-border: #CBD5E1;
    --staff-navy: #1E3A8A;
    --staff-navy-hover: #2563EB;
    --staff-text-main: #0F172A;
    --staff-text-muted: #64748B;
    --staff-text-dim: #94A3B8;
}

/* Container */
.staff-module-wrap {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
    margin-bottom: 28px;
    color: var(--staff-text-main);
}

/* Page Header & Breadcrumb */
.staff-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 4px;
}

.staff-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--staff-text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.staff-breadcrumb a {
    color: var(--staff-navy);
    text-decoration: none;
    transition: color 0.15s;
}

.staff-breadcrumb a:hover {
    color: var(--staff-navy-hover);
}

.staff-title-row h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--staff-text-main);
    margin: 0;
    letter-spacing: -0.02em;
}

.staff-title-row p {
    font-size: 14px;
    color: var(--staff-text-muted);
    margin: 4px 0 0 0;
    line-height: 1.5;
}

/* Primary Action CTA Button (Navy matching Academic Setup) */
.btn-amber-add,
.btn-primary-action {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    background: var(--staff-navy) !important;
    color: #FFFFFF !important;
    font-weight: 700 !important;
    font-size: 13.5px !important;
    padding: 10px 18px !important;
    border-radius: 10px !important;
    border: none !important;
    cursor: pointer !important;
    text-decoration: none !important;
    box-shadow: 0 4px 14px rgba(30, 58, 138, 0.22) !important;
    transition: all 0.15s ease !important;
    touch-action: manipulation !important;
    white-space: nowrap !important;
}

.btn-amber-add:hover,
.btn-primary-action:hover {
    background: var(--staff-navy-hover) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.3) !important;
    color: #FFFFFF !important;
}

.btn-amber-add:active,
.btn-primary-action:active {
    transform: scale(0.97) !important;
}

/* Horizontal Sticky Sub-Tab Strip */
.staff-subnav-strip-wrap {
    position: sticky;
    top: 56px;
    z-index: 25;
    background: #FFFFFF !important;
    margin: 0 0 4px 0 !important;
    padding: 6px 10px !important;
    border: 1px solid var(--staff-border) !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05) !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.staff-subnav-strip-wrap::-webkit-scrollbar {
    display: none;
}

.staff-subnav-strip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    min-width: 100%;
}

.staff-subnav-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 13.5px;
    font-weight: 600;
    color: #475569;
    background: transparent;
    border-radius: 8px;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.15s ease;
}

.staff-subnav-pill:hover {
    color: #0F172A;
    background: #F8FAFC;
}

.staff-subnav-pill.active {
    color: #FFFFFF !important;
    background: var(--staff-navy) !important;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.35) !important;
    font-weight: 700 !important;
}

/* Filter Card Section */
.staff-filter-card {
    background: #FFFFFF !important;
    border: 1px solid var(--staff-border) !important;
    border-radius: 14px !important;
    padding: 18px 20px !important;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04) !important;
}

.staff-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    align-items: flex-end;
}

@media (max-width: 1024px) {
    .staff-filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .staff-filter-card {
        padding: 12px 14px !important;
        border-radius: 12px !important;
    }
    .staff-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px 10px !important;
    }
    .staff-filter-item {
        width: 100% !important;
        min-width: 0 !important;
    }
    .staff-filter-item label {
        font-size: 11px !important;
        font-weight: 700 !important;
        margin-bottom: 3px !important;
        color: #64748B !important;
    }
    .staff-filter-item select,
    .staff-filter-item input {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: 38px !important;
        min-height: 38px !important;
        padding: 6px 10px !important;
        font-size: 13px !important;
        border-radius: 8px !important;
        box-sizing: border-box !important;
        text-overflow: ellipsis !important;
    }
    .staff-filter-actions {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        width: 100% !important;
    }
    .btn-filter-search,
    .btn-filter-clear {
        width: 100% !important;
        height: 38px !important;
        min-height: 38px !important;
        justify-content: center !important;
        font-size: 13px !important;
        font-weight: 700 !important;
        border-radius: 8px !important;
        box-sizing: border-box !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 6px !important;
    }
}

.staff-filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.staff-filter-item label {
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
    letter-spacing: 0.02em;
}

.staff-filter-item select,
.staff-filter-item input {
    background: var(--staff-input-bg) !important;
    border: 1px solid var(--staff-input-border) !important;
    border-radius: 10px !important;
    color: var(--staff-text-main) !important;
    padding: 10px 14px !important;
    font-size: 13.5px !important;
    width: 100% !important;
    min-height: 42px !important;
    box-sizing: border-box !important;
    transition: all 0.15s ease !important;
}

.staff-filter-item select:focus,
.staff-filter-item input:focus {
    outline: none !important;
    border-color: var(--staff-navy-hover) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
    background: #FFFFFF !important;
}

.staff-filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-filter-search {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--staff-navy) !important;
    color: #FFFFFF !important;
    font-weight: 700;
    font-size: 13.5px;
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(30, 58, 138, 0.22);
    transition: all 0.15s ease;
}

.btn-filter-search:hover {
    background: var(--staff-navy-hover) !important;
}

.btn-filter-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    background: #FFFFFF;
    border: 1px solid var(--staff-input-border);
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.btn-filter-clear:hover {
    color: #0F172A;
    background: #F8FAFC;
    border-color: #94A3B8;
}

/* Toolbar (Show entries & quick search) */
.staff-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 6px 0;
}

.staff-toolbar-entries {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--staff-text-muted);
}

.staff-toolbar-entries select {
    background: #FFFFFF !important;
    border: 1px solid var(--staff-input-border) !important;
    border-radius: 8px !important;
    color: var(--staff-text-main) !important;
    padding: 6px 12px !important;
    font-size: 13px !important;
}

.staff-toolbar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 360px;
}

.staff-toolbar-search input {
    width: 100% !important;
    background: #FFFFFF !important;
    border: 1px solid var(--staff-input-border) !important;
    border-radius: 10px !important;
    color: var(--staff-text-main) !important;
    padding: 8px 14px !important;
    font-size: 13.5px !important;
}

.staff-toolbar-search input:focus {
    outline: none !important;
    border-color: var(--staff-navy-hover) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

/* Table Surface */
.staff-card-wrap {
    background: #FFFFFF !important;
    border: 1px solid var(--staff-border) !important;
    border-radius: 14px !important;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04) !important;
}

.staff-table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
    min-height: 240px;
}

.staff-table {
    width: 100% !important;
    min-width: 980px !important;
    border-collapse: collapse !important;
    font-size: 13.5px;
    text-align: left;
}

.staff-table th {
    background: #F8FAFC !important;
    color: #475569 !important;
    font-weight: 700 !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    padding: 14px 18px !important;
    border-bottom: 1px solid var(--staff-border) !important;
}

.staff-table td {
    padding: 13px 18px !important;
    border-bottom: 1px solid var(--staff-border-subtle) !important;
    color: var(--staff-text-main) !important;
    vertical-align: middle;
}

.staff-table tbody tr:hover {
    background: #F8FAFC !important;
}

.staff-photo-name-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.staff-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: #EFF6FF;
    border: 1.5px solid #DBEAFE;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--staff-navy);
    flex-shrink: 0;
}

.staff-name-wrap {
    display: flex;
    flex-direction: column;
}

.staff-name {
    font-weight: 700;
    color: #0F172A;
}

.staff-id-badge {
    font-family: monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--staff-navy);
    background: #EFF6FF;
    padding: 2px 7px;
    border-radius: 6px;
    border: 1px solid #DBEAFE;
    display: inline-block;
}

/* Status Badges */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.status-pill.active {
    background: #ECFDF5 !important;
    color: #065F46 !important;
    border: 1px solid #A7F3D0 !important;
}

.status-pill.inactive,
.status-pill.archived {
    background: #FEF2F2 !important;
    color: #991B1B !important;
    border: 1px solid #FECACA !important;
}

.status-pill.resigned,
.status-pill.terminated {
    background: #FEF3C7 !important;
    color: #92400E !important;
    border: 1px solid #FCD34D !important;
}

/* Action Icons & Popovers */
.staff-actions-cell {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    white-space: nowrap !important;
}

.staff-actions-cell .btn-action-icon,
.btn-action-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    border-radius: 8px !important;
    border: 1px solid #E2E8F0 !important;
    background: #FFFFFF !important;
    color: #475569 !important;
    font-size: 13px !important;
    cursor: pointer !important;
    text-decoration: none !important;
    transition: all 0.15s ease !important;
    box-sizing: border-box !important;
    padding: 0 !important;
}

.staff-actions-cell .btn-action-icon:hover,
.btn-action-icon:hover {
    background: #F1F5F9 !important;
    color: #0F172A !important;
    border-color: #CBD5E1 !important;
}

.staff-actions-cell .btn-action-icon.view:hover,
.btn-action-icon.view:hover { color: #0284C7 !important; border-color: #38BDF8 !important; background: #F0F9FF !important; }

.staff-actions-cell .btn-action-icon.edit:hover,
.btn-action-icon.edit:hover { color: #D97706 !important; border-color: #FCD34D !important; background: #FEF3C7 !important; }

.staff-actions-cell .btn-action-icon.idcard:hover,
.btn-action-icon.idcard:hover { color: #7C3AED !important; border-color: #C4B5FD !important; background: #F5F3FF !important; }

.staff-actions-cell .btn-action-icon.status:hover,
.btn-action-icon.status:hover { color: #DC2626 !important; border-color: #FCA5A5 !important; background: #FEF2F2 !important; }

.staff-action-menu-wrap {
    position: relative;
    display: inline-block;
}

.btn-action-trigger {
    width: 34px !important;
    height: 34px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #F8FAFC !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 8px !important;
    color: #475569 !important;
    cursor: pointer !important;
    font-size: 14px !important;
    transition: all 0.15s ease !important;
    touch-action: manipulation !important;
}

.btn-action-trigger:hover,
.btn-action-trigger:focus {
    background: #F1F5F9 !important;
    border-color: #CBD5E1 !important;
    color: #0F172A !important;
}

.staff-action-dropdown,
.action-dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: #FFFFFF !important;
    border: 1px solid var(--staff-border) !important;
    border-radius: 10px !important;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.04) !important;
    min-width: 180px;
    z-index: 1000;
    display: none;
    padding: 6px;
    flex-direction: column;
    gap: 2px;
}

.staff-action-dropdown.is-open,
.staff-action-dropdown.show,
.action-dropdown-menu.is-open,
.action-dropdown-menu.show {
    display: flex !important;
}

.staff-action-item,
.action-dropdown-item {
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    width: 100% !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #334155 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 6px !important;
    text-align: left !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: background 0.12s ease !important;
    box-sizing: border-box !important;
}

.staff-action-item:hover,
.action-dropdown-item:hover {
    background: #F1F5F9 !important;
    color: #0F172A !important;
}

.staff-action-item.danger-text,
.action-dropdown-item.danger-text {
    color: #DC2626 !important;
}

.staff-action-item.danger-text:hover,
.action-dropdown-item.danger-text:hover {
    background: #FEF2F2 !important;
    color: #B91C1C !important;
}

/* Mobile Responsive Cards (< 700px) */
.staff-mobile-cards {
    display: none;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
}

.staff-mobile-card {
    background: #FFFFFF !important;
    border: 1px solid var(--staff-border) !important;
    border-radius: 12px !important;
    padding: 14px 16px !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
}

.staff-mobile-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.staff-mobile-card-meta {
    font-size: 12.5px;
    color: var(--staff-text-muted);
}

.staff-mobile-card-phone {
    font-size: 13px;
    color: #0284C7;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.staff-mobile-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 10px;
    margin-top: 4px;
    border-top: 1px solid #F1F5F9;
}

.staff-mobile-card-actions .btn-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 38px;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    color: #475569;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    touch-action: manipulation;
}

.staff-mobile-card-actions .btn-action-icon:hover {
    background: #F1F5F9;
    color: #0F172A;
    border-color: #CBD5E1;
}

.staff-mobile-card-actions .btn-action-icon.view:hover { color: #0284C7; border-color: #38BDF8; background: #F0F9FF; }
.staff-mobile-card-actions .btn-action-icon.edit:hover { color: #D97706; border-color: #FCD34D; background: #FEF3C7; }
.staff-mobile-card-actions .btn-action-icon.idcard:hover { color: #7C3AED; border-color: #C4B5FD; background: #F5F3FF; }
.staff-mobile-card-actions .btn-action-icon.status:hover { color: #DC2626; border-color: #FCA5A5; background: #FEF2F2; }

@media (max-width: 768px) {
    .staff-card-wrap,
    .staff-table-wrap {
        display: none !important;
    }
    .staff-mobile-cards {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
    }
}

/* ========================================================
   Modals (Professional Light SaaS Theme)
   ======================================================== */
.academic-modal-backdrop,
.staff-modal-backdrop {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(15, 23, 42, 0.5) !important;
    backdrop-filter: blur(4px) !important;
    z-index: 1000 !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px 16px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

.academic-modal-backdrop.is-active,
.academic-modal-backdrop.show,
.staff-modal-backdrop.is-active,
.staff-modal-backdrop.show {
    display: flex !important;
}

.academic-modal-dialog,
.staff-modal-sheet,
.staff-modal-dialog {
    width: 100% !important;
    max-width: 820px !important;
    background: #FFFFFF !important;
    border: 1px solid var(--staff-border) !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18) !important;
    display: flex !important;
    flex-direction: column !important;
    max-height: calc(100vh - 40px) !important;
    height: auto !important;
    overflow: hidden !important;
    animation: staffModalPop 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
    margin: auto !important;
    position: relative !important;
}

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

.staff-modal-dialog > form,
.staff-modal-sheet > form,
.academic-modal-dialog > form,
.staff-modal-dialog form,
.staff-modal-sheet form {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    margin: 0 !important;
}

.academic-modal-header,
.staff-modal-header {
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 18px 24px !important;
    border-bottom: 1px solid var(--staff-border-subtle) !important;
    background: #FFFFFF !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
}

.academic-modal-header h2,
.staff-modal-header h2 {
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #0F172A !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    letter-spacing: -0.01em !important;
}

.academic-modal-close,
.btn-modal-close {
    width: 34px !important;
    height: 34px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #F1F5F9 !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 8px !important;
    color: #64748B !important;
    cursor: pointer !important;
    font-size: 14px !important;
    transition: all 0.15s ease !important;
    padding: 0 !important;
}

.academic-modal-close:hover,
.btn-modal-close:hover {
    background: #E2E8F0 !important;
    color: #0F172A !important;
}

.staff-modal-body,
.academic-modal-body {
    padding: 24px !important;
    overflow-y: auto !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    background: #FFFFFF !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 #F8FAFC;
}

.staff-modal-body::-webkit-scrollbar,
.academic-modal-body::-webkit-scrollbar {
    width: 8px;
}
.staff-modal-body::-webkit-scrollbar-track,
.academic-modal-body::-webkit-scrollbar-track {
    background: #F8FAFC;
    border-radius: 4px;
}
.staff-modal-body::-webkit-scrollbar-thumb,
.academic-modal-body::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}
.staff-modal-body::-webkit-scrollbar-thumb:hover,
.academic-modal-body::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* Modal Form Section Card */
.staff-form-section {
    background: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 12px !important;
    padding: 18px 20px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    transition: border-color 0.15s ease !important;
}

.staff-form-section:focus-within {
    border-color: #CBD5E1 !important;
}

.staff-form-section-title {
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    font-size: 12.5px !important;
    font-weight: 800 !important;
    color: var(--staff-navy) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    padding-bottom: 8px !important;
    border-bottom: 2px solid #E2E8F0 !important;
    margin-bottom: 2px !important;
    margin-top: 0 !important;
}

.staff-form-section-title i {
    font-size: 13px !important;
    color: #2563EB !important;
}

/* Grid Layouts */
.staff-form-row-2,
.modal-row-2 {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
    width: 100% !important;
    margin: 0 !important;
}

.staff-form-row-3,
.modal-row-3 {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 16px !important;
    width: 100% !important;
    margin: 0 !important;
}

@media (max-width: 680px) {
    .staff-form-row-2,
    .staff-form-row-3,
    .modal-row-2,
    .modal-row-3 {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
}

/* Field Groups & Labels */
.staff-form-group,
.modal-field {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.staff-form-group label,
.modal-field label {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #334155 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    letter-spacing: 0.01em !important;
}

.staff-form-group label span.required,
.staff-form-group label .required,
.modal-field label span.required,
.modal-field label .required {
    color: #EF4444 !important;
    font-weight: 700 !important;
}

/* Inputs, Selects & Textareas (Text-like fields only) */
.staff-form-group input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]),
.staff-form-group select,
.staff-form-group textarea,
.modal-field input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]),
.modal-field select,
.modal-field textarea {
    background: #F8FAFC !important;
    border: 1.5px solid #E2E8F0 !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
    font-size: 13.5px !important;
    color: #0F172A !important;
    outline: none !important;
    width: 100% !important;
    min-height: 42px !important;
    box-sizing: border-box !important;
    transition: all 0.15s ease !important;
    font-family: inherit !important;
}

.staff-form-group input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]):focus,
.staff-form-group select:focus,
.staff-form-group textarea:focus,
.modal-field input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]):focus,
.modal-field select:focus,
.modal-field textarea:focus {
    background: #FFFFFF !important;
    border-color: #2563EB !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

/* Professional Modern Checkbox Styling */
.staff-form-group input[type="checkbox"],
.modal-field input[type="checkbox"],
.password-generator-box input[type="checkbox"],
.academic-modal-dialog input[type="checkbox"],
.staff-modal-sheet input[type="checkbox"],
.staff-modal-backdrop input[type="checkbox"],
.exam-modal-backdrop input[type="checkbox"],
.exam-checkbox-item input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 18px !important;
    height: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    border: 1.5px solid #CBD5E1 !important;
    border-radius: 5px !important;
    background: #FFFFFF !important;
    outline: none !important;
    cursor: pointer !important;
    display: inline-grid !important;
    place-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    transition: all 0.15s ease !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
}

.staff-form-group input[type="checkbox"]:hover,
.modal-field input[type="checkbox"]:hover,
.password-generator-box input[type="checkbox"]:hover,
.academic-modal-dialog input[type="checkbox"]:hover,
.staff-modal-sheet input[type="checkbox"]:hover,
.staff-modal-backdrop input[type="checkbox"]:hover,
.exam-modal-backdrop input[type="checkbox"]:hover,
.exam-checkbox-item input[type="checkbox"]:hover {
    border-color: #2563EB !important;
    background: #F8FAFC !important;
}

.staff-form-group input[type="checkbox"]:checked,
.modal-field input[type="checkbox"]:checked,
.password-generator-box input[type="checkbox"]:checked,
.academic-modal-dialog input[type="checkbox"]:checked,
.staff-modal-sheet input[type="checkbox"]:checked,
.staff-modal-backdrop input[type="checkbox"]:checked,
.exam-modal-backdrop input[type="checkbox"]:checked,
.exam-checkbox-item input[type="checkbox"]:checked {
    background: #2563EB !important;
    border-color: #2563EB !important;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2) !important;
}

.staff-form-group input[type="checkbox"]::before,
.modal-field input[type="checkbox"]::before,
.password-generator-box input[type="checkbox"]::before,
.academic-modal-dialog input[type="checkbox"]::before,
.staff-modal-sheet input[type="checkbox"]::before,
.staff-modal-backdrop input[type="checkbox"]::before,
.exam-modal-backdrop input[type="checkbox"]::before,
.exam-checkbox-item input[type="checkbox"]::before {
    content: "" !important;
    width: 9px !important;
    height: 5px !important;
    border-left: 2px solid #FFFFFF !important;
    border-bottom: 2px solid #FFFFFF !important;
    transform: rotate(-45deg) translate(1px, -1px) scale(0) !important;
    transition: transform 0.12s ease-in-out !important;
}

.staff-form-group input[type="checkbox"]:checked::before,
.modal-field input[type="checkbox"]:checked::before,
.password-generator-box input[type="checkbox"]:checked::before,
.academic-modal-dialog input[type="checkbox"]:checked::before,
.staff-modal-sheet input[type="checkbox"]:checked::before,
.staff-modal-backdrop input[type="checkbox"]:checked::before,
.exam-modal-backdrop input[type="checkbox"]:checked::before,
.exam-checkbox-item input[type="checkbox"]:checked::before {
    transform: rotate(-45deg) translate(1px, -1px) scale(1) !important;
}

.staff-form-group input[type="checkbox"]:focus-visible,
.modal-field input[type="checkbox"]:focus-visible,
.password-generator-box input[type="checkbox"]:focus-visible,
.exam-modal-backdrop input[type="checkbox"]:focus-visible,
.exam-checkbox-item input[type="checkbox"]:focus-visible {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25) !important;
    outline: none !important;
}

.staff-form-group input::placeholder,
.staff-form-group textarea::placeholder,
.modal-field input::placeholder,
.modal-field textarea::placeholder {
    color: #94A3B8 !important;
}

.staff-form-group select,
.modal-field select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748B'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 16px 16px !important;
    padding-right: 38px !important;
    cursor: pointer !important;
}

.staff-form-group textarea,
.modal-field textarea {
    min-height: 74px !important;
    line-height: 1.5 !important;
    resize: vertical !important;
    padding: 10px 14px !important;
}

small.muted {
    font-size: 12.5px !important;
    color: #64748B !important;
    margin-top: 4px !important;
    line-height: 1.4 !important;
}

/* Modal Actions / Footer */
.academic-modal-footer,
.staff-modal-footer,
.modal-actions {
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 12px !important;
    padding: 16px 24px !important;
    background: #FAFBFD !important;
    border-top: 1px solid #E2E8F0 !important;
    position: sticky !important;
    bottom: 0 !important;
    z-index: 10 !important;
}

.btn-modal-save,
.btn-save {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 10px 22px !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    color: #FFFFFF !important;
    background: #F59E0B !important;
    border: none !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25) !important;
    transition: all 0.15s ease !important;
}

.btn-modal-save:hover,
.btn-save:hover {
    background: #D97706 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35) !important;
}

.btn-modal-cancel,
.btn-cancel {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 10px 20px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: #475569 !important;
    background: #F1F5F9 !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
}

.btn-modal-cancel:hover,
.btn-cancel:hover {
    background: #E2E8F0 !important;
    color: #0F172A !important;
}

/* Photo Upload Component */
.staff-photo-upload-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
    padding: 14px 18px !important;
    background: #F8FAFC !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 12px !important;
}

.staff-photo-preview-box {
    width: 72px !important;
    height: 72px !important;
    border-radius: 50% !important;
    background: #E2E8F0 !important;
    border: 2px solid #CBD5E1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    position: relative !important;
    color: #94A3B8 !important;
    flex-shrink: 0 !important;
}

.staff-photo-preview-box img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Password Generator Widget */
.password-generator-box {
    background: #F8FAFC !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 12px !important;
    padding: 16px 18px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

.password-input-row {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-top: 6px !important;
}

.password-input-row input {
    font-family: monospace !important;
    font-size: 14px !important;
    letter-spacing: 0.05em !important;
    color: var(--staff-navy) !important;
    font-weight: 700 !important;
    background: #FFFFFF !important;
    border: 1.5px solid #CBD5E1 !important;
    border-radius: 8px !important;
    padding: 9px 12px !important;
    flex: 1 !important;
}

.btn-tool {
    background: #FFFFFF !important;
    border: 1.5px solid #CBD5E1 !important;
    border-radius: 8px !important;
    padding: 8px 14px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    color: #334155 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: all 0.15s ease !important;
    min-height: 38px !important;
    white-space: nowrap !important;
}

.btn-tool:hover {
    background: #F1F5F9 !important;
    border-color: #94A3B8 !important;
    color: #0F172A !important;
}

/* Staff Detail Modal Cards */
.staff-detail-card {
    background: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 12px !important;
    padding: 16px 18px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
    display: flex !important;
    flex-direction: column !important;
}

.staff-detail-card-title {
    margin: 0 0 12px 0 !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid #F1F5F9 !important;
    font-size: 12.5px !important;
    font-weight: 800 !important;
    color: #1E3A8A !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.staff-detail-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 6px 0 !important;
    font-size: 13px !important;
    border-bottom: 1px dashed #F1F5F9 !important;
}

.staff-detail-row:last-child {
    border-bottom: none !important;
}

.staff-detail-label {
    color: #64748B !important;
    font-weight: 500 !important;
}

.staff-detail-val {
    color: #0F172A !important;
    font-weight: 700 !important;
    text-align: right !important;
}

.btn-tool:hover {
    border-color: var(--staff-navy);
    color: var(--staff-navy);
    background: #F1F5F9;
}

/* ========================================================
   CR80 Standard ID Card Container & Dual-Sided Layout
   ======================================================== */
.id-cards-preview-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.id-card-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
    margin: 10px 0;
}

.cr80-card {
    width: 400px;
    height: 252px;
    background: #FFFFFF;
    color: #0F172A;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    border: 1px solid #CBD5E1;
    box-sizing: border-box;
    user-select: none;
}

.cr80-front-banner {
    background: var(--staff-navy);
    color: #FFFFFF;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #F59E0B;
}

.cr80-school-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cr80-school-logo {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--staff-navy);
    font-size: 12px;
    font-weight: 900;
}

.cr80-school-name {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cr80-role-pill {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    background: #FEF3C7;
    color: #92400E;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.cr80-front-body {
    flex: 1;
    display: grid;
    grid-template-columns: 84px 1fr 68px;
    gap: 10px;
    padding: 10px 14px 6px 14px;
    align-items: center;
}

.cr80-photo-col {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cr80-photo {
    width: 78px;
    height: 98px;
    border-radius: 6px;
    border: 1.5px solid #CBD5E1;
    object-fit: cover;
    background: #F1F5F9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #94A3B8;
}

.cr80-details-col {
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
}

.cr80-name {
    font-size: 14.5px;
    font-weight: 800;
    color: #0F172A;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cr80-code {
    font-family: monospace;
    font-size: 12px;
    font-weight: 700;
    color: var(--staff-navy);
}

.cr80-field {
    font-size: 11px;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.35;
}

.cr80-field strong {
    color: #64748B;
    font-weight: 600;
    display: inline-block;
    min-width: 68px;
}

.cr80-qr-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cr80-qr-box {
    width: 64px;
    height: 64px;
    border: 1px solid #E2E8F0;
    border-radius: 4px;
    padding: 2px;
    background: #FFFFFF;
}

.cr80-qr-box svg,
.cr80-qr-box canvas {
    width: 100% !important;
    height: 100% !important;
}

.cr80-front-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 14px 6px 14px;
    border-top: 1px dashed #E2E8F0;
    background: #F8FAFC;
}

.cr80-barcode-wrap {
    height: 28px;
    display: flex;
    align-items: center;
}

.cr80-barcode-wrap svg {
    height: 24px;
    max-width: 180px;
}

.cr80-validity {
    font-size: 10px;
    font-weight: 700;
    color: #475569;
}

/* Back Side Layout */
.cr80-back-body {
    flex: 1;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #FFFFFF;
    position: relative;
}

.cr80-back-watermark {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.05;
    pointer-events: none;
    font-size: 80px;
    color: #0F172A;
}

.cr80-back-disclaimer {
    font-size: 10.5px;
    color: #475569;
    line-height: 1.5;
    text-align: center;
    z-index: 1;
}

.cr80-back-contact {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 10.5px;
    color: #334155;
    text-align: center;
    z-index: 1;
}

.cr80-back-signature-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-top: 12px;
    z-index: 1;
}

.cr80-sig-line {
    border-top: 1px solid #94A3B8;
    width: 110px;
    text-align: center;
    font-size: 9.5px;
    font-weight: 600;
    color: #64748B;
    padding-top: 2px;
/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .staff-page-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .staff-page-header .btn-primary-action,
    .staff-page-header .btn-amber-add,
    .staff-page-header .button {
        width: 100% !important;
        justify-content: center !important;
    }

    .staff-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .staff-modal-dialog {
        width: calc(100vw - 20px) !important;
        max-width: calc(100vw - 20px) !important;
        max-height: calc(100dvh - 36px) !important;
    }

    .staff-modal-body {
        padding: 16px 14px !important;
        max-height: calc(100dvh - 160px) !important;
    }

    .staff-modal-footer {
        padding: 12px 14px !important;
        flex-direction: column-reverse !important;
        gap: 8px !important;
    }

    .staff-modal-footer button {
        width: 100% !important;
        justify-content: center !important;
    }

    .cr80-card {
        max-width: 100% !important;
    }
}

/* ========================================================
   Print Stylesheet (@media print)
   ======================================================== */

@media print {
    @page {
        size: A4 portrait;
        margin: 8mm;
    }
    body {
        background: #FFFFFF !important;
        color: #000000 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .no-print,
    .sidebar,
    .workspace-header,
    .language-switch,
    .staff-subnav-strip-wrap,
    .staff-filter-card,
    .page-footer,
    .toast-stack {
        display: none !important;
    }
    .workspace,
    .workspace-body,
    .workspace-main {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        max-width: none !important;
    }
    .print-sheet {
        width: 194mm;
        margin: 0 auto;
        display: grid;
        grid-template-columns: repeat(2, 85.6mm);
        grid-gap: 4mm 10mm;
        justify-content: center;
        page-break-after: always;
    }
    .cr80-card {
        width: 85.6mm !important;
        height: 53.98mm !important;
        border: 0.5pt solid #CBD5E1 !important;
        border-radius: 3mm !important;
        box-shadow: none !important;
        overflow: hidden !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        page-break-inside: avoid !important;
    }
    .cr80-front-banner {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}
