/* Management Pages Modern Styles */

.management-container {
    padding: 30px;
    max-width: 1600px;
    margin: 0 auto;
    min-height: 100vh;
    background: #f8f9fa;
}

/* ==================== Modern Header ==================== */
.modern-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding: 24px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.header-text h1 {
    margin: 0 0 6px 0;
    font-size: 28px;
    font-weight: 700;
    color: #1a202c;
}

.header-text p {
    margin: 0;
    font-size: 15px;
    color: #718096;
}

.header-right {
    display: flex;
    gap: 12px;
}

/* ==================== Modern Buttons ==================== */
.btn-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.btn-modern::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-modern:hover::before {
    width: 300px;
    height: 300px;
}

.btn-modern svg {
    position: relative;
    z-index: 1;
}

.btn-modern span {
    position: relative;
    z-index: 1;
}

.btn-modern-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-modern-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.btn-modern-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-modern-secondary {
    background: #e2e8f0;
    color: #4a5568;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-modern-secondary:hover {
    background: #cbd5e0;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.btn-modern-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ==================== Search and Filter Bar ==================== */
.search-filter-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 280px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-box svg {
    position: absolute;
    right: 16px;
    color: #a0aec0;
}

.search-input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    background: white;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-section {
    display: flex;
    gap: 12px;
}

.filter-select {
    padding: 12px 40px 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23718096' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.stats-section {
    display: flex;
    gap: 20px;
    margin-right: auto;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 20px;
    background: white;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
}

.stat-label {
    font-size: 12px;
    color: #718096;
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
}

/* ==================== Modern Loading ==================== */
.modern-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    gap: 20px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.modern-loading p {
    color: #718096;
    font-size: 16px;
    font-weight: 500;
}

/* ==================== Modern Alert ==================== */
.modern-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 15px;
    font-weight: 500;
}

.modern-alert-danger {
    background: #fff5f5;
    color: #c53030;
    border: 2px solid #feb2b2;
}

.modern-alert svg {
    flex-shrink: 0;
}

/* ==================== Empty State ==================== */
.empty-state {
    text-align: center;
    padding: 100px 40px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 2px dashed #e2e8f0;
}

.empty-state svg {
    color: #cbd5e0;
    margin-bottom: 28px;
    opacity: 0.6;
    animation: floatAnimation 3s ease-in-out infinite;
}

.empty-state h3 {
    margin: 0 0 14px 0;
    font-size: 24px;
    font-weight: 700;
    color: #2d3748;
}

.empty-state p {
    margin: 0;
    font-size: 17px;
    color: #718096;
    font-weight: 500;
}

/* ==================== Teams Grid ==================== */
.modern-teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
}

.modern-team-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e2e8f0;
}

.modern-team-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.modern-card-header {
    padding: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.team-icon, .dept-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.team-header-content, .dept-header-content {
    flex: 1;
}

.modern-card-header h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 700;
}

.department-tag, .parent-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}

.modern-card-body {
    padding: 24px;
}

.team-stats {
    display: grid;
    gap: 16px;
    margin-bottom: 20px;
}

.stat-box {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 12px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.members-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: #2d3748;
    line-height: 1;
}

.stat-text {
    font-size: 14px;
    color: #718096;
    margin-top: 4px;
}

.members-preview {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
}

.members-label {
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 12px;
}

.members-avatars {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.more-members {
    background: #e2e8f0;
    color: #4a5568;
}

.no-members-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px;
    background: #f7fafc;
    border-radius: 10px;
    color: #718096;
    font-size: 14px;
    margin-top: 16px;
}

.modern-card-actions {
    padding: 16px 20px;
    background: #f7fafc;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    border-top: 1px solid #e2e8f0;
}

.action-btn {
    flex: 1;
    min-width: 90px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn-members {
    background: #dff0e8;
    color: #22543d;
}

.action-btn-members:hover {
    background: #c6f6d5;
    transform: translateY(-1px);
}

.action-btn-edit {
    background: #e6e6ff;
    color: #4c1d95;
}

.action-btn-edit:hover {
    background: #d4d4ff;
    transform: translateY(-1px);
}

.action-btn-delete {
    background: #fed7d7;
    color: #9b2c2c;
}

.action-btn-delete:hover {
    background: #fc8181;
    color: white;
    transform: translateY(-1px);
}

.action-btn-teams {
    background: #bee3f8;
    color: #2c5282;
}

.action-btn-teams:hover {
    background: #90cdf4;
    transform: translateY(-1px);
}

.action-btn-leaders {
    background: #fef5d9;
    color: #975a16;
}

.action-btn-leaders:hover {
    background: #fef08a;
    transform: translateY(-1px);
}

/* ==================== Departments Grid ==================== */
.modern-departments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 24px;
}

.modern-dept-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e2e8f0;
}

.modern-dept-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.dept-header {
    background: linear-gradient(135deg, #48c6ef 0%, #6f86d6 100%);
}

.dept-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    background: #f7fafc;
}

.stat-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card-teams .stat-icon-wrapper {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-card-leaders .stat-icon-wrapper {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.stat-card-members .stat-icon-wrapper {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.stat-card-subdepts .stat-icon-wrapper {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-info .stat-number {
    font-size: 22px;
    font-weight: 700;
    color: #2d3748;
    line-height: 1;
}

.stat-info .stat-label {
    font-size: 12px;
    color: #718096;
    margin-top: 4px;
}

.teams-preview {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 12px;
}

.teams-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.team-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #2d3748;
}

.team-members-count {
    padding: 2px 8px;
    background: #667eea;
    color: white;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.team-tag.more {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.dept-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 12px;
    background: #f7fafc;
    border-radius: 10px;
    font-size: 13px;
    color: #718096;
}

.dept-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
}

/* ==================== Modern Modals ==================== */
.modern-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
}

@keyframes fadeIn {
    from { 
        opacity: 0;
        backdrop-filter: blur(0px);
        -webkit-backdrop-filter: blur(0px);
    }
    to { 
        opacity: 1;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
}

.modern-modal-container {
    background: white;
    border-radius: 24px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(0, 0, 0, 0.1),
        0 0 100px rgba(102, 126, 234, 0.2);
    position: relative;
}

.modern-modal-container.large {
    max-width: 750px;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Scrollbar styling for modal */
.modern-modal-container::-webkit-scrollbar {
    width: 8px;
}

.modern-modal-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modern-modal-container::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

.modern-modal-container::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.modern-modal-header {
    padding: 32px;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
    flex-shrink: 0;
}

.modal-title-section {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 1;
    min-width: 0;
}

.modal-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.35);
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        box-shadow: 0 8px 20px rgba(102, 126, 234, 0.35);
    }
    50% {
        box-shadow: 0 8px 30px rgba(102, 126, 234, 0.5);
    }
}

.title-content {
    flex: 1;
    min-width: 0;
}

.modern-modal-header h2 {
    margin: 0 0 4px 0;
    font-size: 24px;
    font-weight: 700;
    color: #1a202c;
    line-height: 1.3;
}

.modal-subtitle {
    margin: 0;
    font-size: 15px;
    color: #718096;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modern-modal-close {
    width: 44px;
    height: 44px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #718096;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.modern-modal-close:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
    transform: rotate(90deg) scale(1.05);
}

.modern-modal-close:active {
    transform: rotate(90deg) scale(0.95);
}

.modern-modal-body {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
}

.modern-form-group {
    margin-bottom: 26px;
}

.modern-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #2d3748;
}

.modern-label svg {
    color: #667eea;
}

.required {
    color: #e53e3e;
    font-weight: 700;
    font-size: 16px;
}

.modern-input {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    font-size: 16px;
    background: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    font-family: inherit;
}

.modern-input:hover {
    border-color: #cbd5e0;
}

.modern-input:focus {
    outline: none;
    border-color: #667eea;
    background: #f7faff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.12);
    transform: translateY(-1px);
}

.modern-input::placeholder {
    color: #a0aec0;
}

.select-wrapper {
    position: relative;
}

.modern-select {
    width: 100%;
    padding: 16px 50px 16px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    font-size: 16px;
    background: white;
    cursor: pointer;
    appearance: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    font-family: inherit;
}

.modern-select:hover {
    border-color: #cbd5e0;
}

.modern-select:focus {
    outline: none;
    border-color: #667eea;
    background: #f7faff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.12);
}

.select-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    pointer-events: none;
    transition: all 0.3s;
}

.modern-select:focus + .select-icon {
    color: #667eea;
}

.modern-modal-actions {
    display: flex;
    gap: 14px;
    justify-content: flex-end;
    padding: 28px 32px;
    border-top: 2px solid #e2e8f0;
    margin: 0;
    background: linear-gradient(to top, #ffffff 0%, #f8f9fa 100%);
    flex-shrink: 0;
}

/* Members Selection */
.members-selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 14px;
    border: 2px solid #e2e8f0;
}

.selection-count {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #2d3748;
}

.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    animation: countPulse 2s ease-in-out infinite;
}

@keyframes countPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.search-members {
    position: relative;
    flex: 1;
    min-width: 220px;
    max-width: 320px;
}

.search-members svg {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    transition: all 0.3s;
}

.search-input-small {
    width: 100%;
    padding: 12px 14px 12px 44px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    background: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input-small:hover {
    border-color: #cbd5e0;
}

.search-input-small:focus {
    outline: none;
    border-color: #667eea;
    background: #f7faff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.12);
}

.search-input-small:focus + svg {
    color: #667eea;
}

.modern-checkbox-list {
    max-height: 450px;
    overflow-y: auto;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px;
    background: #fafbfc;
}

.modern-checkbox-list::-webkit-scrollbar {
    width: 10px;
}

.modern-checkbox-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modern-checkbox-list::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

.modern-checkbox-list::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.modern-checkbox-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    cursor: pointer;
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 8px;
    position: relative;
    background: white;
    border: 2px solid transparent;
}

.modern-checkbox-item:hover {
    background: #f7fafc;
    border-color: #e2e8f0;
    transform: translateX(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.modern-checkbox-item.selected {
    background: linear-gradient(135deg, #f0f4ff 0%, #f5f3ff 100%);
    border: 2px solid #c7d2fe;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.modern-checkbox-item.selected:hover {
    border-color: #a5b4fc;
    transform: translateX(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.2);
}

.modern-checkbox-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkbox-custom {
    width: 26px;
    height: 26px;
    border: 2.5px solid #cbd5e0;
    border-radius: 8px;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: white;
}

.modern-checkbox-item:hover .checkbox-custom {
    border-color: #a0aec0;
}

.modern-checkbox-item.selected .checkbox-custom {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.4);
    animation: checkboxPop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes checkboxPop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
    }
}

.modern-checkbox-item.selected .checkbox-custom::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
    animation: checkmarkDraw 0.3s ease-out forwards;
}

@keyframes checkmarkDraw {
    from {
        height: 0;
    }
    to {
        height: 11px;
    }
}

.user-info {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s;
}

.modern-checkbox-item:hover .user-avatar {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.team-avatar {
    background: linear-gradient(135deg, #48c6ef 0%, #6f86d6 100%);
    box-shadow: 0 4px 12px rgba(72, 198, 239, 0.3);
}

.modern-checkbox-item:hover .team-avatar {
    box-shadow: 0 6px 16px rgba(72, 198, 239, 0.4);
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-username {
    font-size: 14px;
    color: #718096;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.check-icon {
    color: #667eea;
    flex-shrink: 0;
    animation: checkIconAppear 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes checkIconAppear {
    from {
        opacity: 0;
        transform: scale(0.5) rotate(-180deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #a0aec0;
}

.no-results svg {
    margin-bottom: 20px;
    opacity: 0.5;
    animation: floatAnimation 3s ease-in-out infinite;
}

@keyframes floatAnimation {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.no-results p {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #718096;
}

/* ==================== Responsive Design ==================== */
@media (max-width: 1024px) {
    .modern-teams-grid,
    .modern-departments-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
    
    .dept-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .management-container {
        padding: 16px;
    }

    .modern-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        padding: 20px;
    }

    .header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header-right {
        width: 100%;
    }

    .btn-modern {
        width: 100%;
        justify-content: center;
    }

    .search-filter-bar {
        flex-direction: column;
    }

    .search-box {
        width: 100%;
    }

    .filter-section,
    .stats-section {
        width: 100%;
    }

    .stats-section {
        flex-wrap: wrap;
    }

    .modern-teams-grid,
    .modern-departments-grid {
        grid-template-columns: 1fr;
    }

    .dept-stats-grid {
        grid-template-columns: 1fr;
    }

    .modern-card-actions {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
        min-width: auto;
    }

    .modern-modal-container {
        width: 95%;
        max-height: 95vh;
    }

    .modern-modal-header {
        padding: 20px;
    }

    .modal-title-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .modern-modal-body {
        padding: 20px;
    }

    .members-selection-header {
        flex-direction: column;
        align-items: stretch;
    }

    .search-members {
        max-width: 100%;
    }

    .modern-modal-actions {
        flex-direction: column-reverse;
    }

    .modern-modal-actions button {
        width: 100%;
    }
}

/* ==================== Old Styles for Compatibility ==================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f3f4f6;
}

.header-content h1 {
    margin: 0 0 8px 0;
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
}

.header-content p {
    margin: 0;
    color: #6b7280;
    font-size: 15px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.alert-danger {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
}
