/* System User Management Module Styles */

.users-container {
    padding: 20px;
    max-width: 1600px;
    margin: 0 auto;
}

.users-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #E0E0E0;
}

.users-header h2 {
    color: #31566D;
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.summary-stats {
    display: flex;
    gap: 24px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    padding: 12px 20px;
    background: #F5F5F5;
    border-radius: 8px;
    min-width: 150px;
}

.summary-item span {
    font-size: 12px;
    color: #78909C;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-item strong {
    font-size: 20px;
    color: #31566D;
    font-weight: 600;
}

.users-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 20px;
}

.filter-group {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid #E0E0E0;
    background: white;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #424242;
}

.filter-btn:hover {
    background: #F5F5F5;
}

.filter-btn.active {
    background: linear-gradient(135deg, #c91d2b 0%, #a01621 100%);
    color: white;
    border-color: #c91d2b;
}

.filter-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 500px;
}

.search-box svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #78909C;
    z-index: 10;
    pointer-events: none;
}

.search-box input {
    flex: 1;
    padding: 10px 14px 10px 44px;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    font-size: 14px;
    height: 42px;
    width: 300px;
}

.search-box input:focus {
    outline: none;
    border-color: #c91d2b;
    box-shadow: 0 0 0 3px rgba(201, 29, 43, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #c91d2b 0%, #a01621 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(201, 29, 43, 0.2);
}

.users-table-wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th {
    padding: 16px;
    text-align: left;
    background: #F5F5F5;
    color: #31566D;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 2px solid #E0E0E0;
}

.users-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #F0F0F0;
    font-size: 14px;
}

.user-row:hover {
    background: #F9F9F9;
}

.user-name {
    font-weight: 600;
    color: #31566D;
    font-size: 13px;
    white-space: nowrap;
}

.users-table td:first-child {
    min-width: 200px;
}

.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.badge-primary {
    background: #e7f1ff;
    color: #0d6efd;
    border: 1px solid #cfe2ff;
}

.badge-info {
    background: #e1f5fe;
    color: #0288d1;
    border: 1px solid #b3e5fc;
}

.badge-secondary {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.badge-success {
    background: #e6f4ea;
    color: #1e7e34;
    border: 1px solid #c3e6cb;
}

.badge-danger {
    background: #fdf2f2;
    color: #d32f2f;
    border: 1px solid #f5c6cb;
}

.badge-outline {
    background: #f8f9fa;
    color: #546E7A;
    border: 1px solid #E0E0E0;
}

/* ── Action Dropdown ─────────────────────────── */
.action-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.btn-action-dots {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 34px;
    height: 34px;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.btn-action-dots span {
    display: block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #546E7A;
}

.btn-action-dots:hover {
    background: #f5f5f5;
    border-color: #c91d2b;
    box-shadow: 0 2px 8px rgba(201, 29, 43, 0.12);
}

.btn-action-dots:hover span {
    background: #c91d2b;
}

.action-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 180px;
    background: #fff;
    border: 1px solid #E0E0E0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 1100;
    max-width: 90vw;
    overflow: hidden;
    animation: dropdownFadeIn 0.15s ease;
}

.action-dropdown-menu.open {
    display: block;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.action-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 500;
    color: #424242;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
}

.action-dropdown-item svg {
    flex-shrink: 0;
    color: #78909C;
}

.action-dropdown-item:hover {
    background: #F5F5F5;
    color: #c91d2b;
}

.action-dropdown-item:hover svg {
    color: #c91d2b;
}

.action-item-delete:hover {
    background: #FFEBEE;
    color: #D32F2F;
}

.action-item-delete:hover svg {
    color: #D32F2F;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #EEE;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #31566D;
    font-size: 20px;
    font-weight: 700;
}

.modal-close {
    background: #F5F5F5;
    border: none;
    color: #c91d2b;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #FFEBEE;
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #EEE;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #546E7A;
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    background: #FAFAFA;
}

.form-control:focus {
    outline: none;
    background: #FFF;
    border-color: #c91d2b;
    box-shadow: 0 0 0 3px rgba(201, 29, 43, 0.1);
}

.btn-secondary {
    background: #F5F5F5;
    color: #546E7A;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #fdfdfd;
    border-top: 1px solid #F0F0F0;
}

.pagination-info {
    font-size: 14px;
    color: #6c757d;
}

.pagination-info strong {
    color: #31566D;
}

.pagination-buttons {
    display: flex;
    gap: 6px;
}

.pagination-buttons .btn {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 6px;
    text-decoration: none;
    border: 1px solid #E0E0E0;
    background: white;
    color: #424242;
    transition: all 0.2s;
}

.pagination-buttons .btn:hover {
    background: #F5F5F5;
    border-color: #c91d2b;
    color: #c91d2b;
}

.pagination-buttons .btn.active {
    background: #c91d2b;
    color: white;
    border-color: #c91d2b;
}

.empty-state {
    padding: 80px 20px;
    text-align: center;
    color: #78909C;
}

.empty-state svg {
    margin-bottom: 20px;
    color: #CFD8DC;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-row input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-row label {
    margin: 0;
    cursor: pointer;
}

/* Mobile Responsiveness */
@media (max-width: 992px) {
    .users-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .users-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .filter-group {
        overflow-x: auto;
        padding-bottom: 8px;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .search-box {
        max-width: 100%;
    }

    .search-box input {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .users-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .users-table {
        min-width: 800px;
    }

    .modal-content {
        width: 95%;
        margin: 10px;
        max-height: 95vh;
        overflow-y: auto;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-footer {
        flex-direction: column-reverse;
        gap: 8px;
    }

    .modal-footer .btn {
        width: 100%;
        margin: 0 !important;
    }

    .pagination-container {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .pagination-buttons {
        justify-content: center;
    }
}

.req-star::after {
    content: " *";
    color: #c91d2b;
    font-weight: bold;
}

.modal-alert {
    margin: 10px 24px 0 24px;
    padding: 10px 14px;
    background: #FFEBEE;
    color: #D32F2F;
    border: 1px solid #FFCDD2;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}

.confirm-details {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.confirm-text {
    font-size: 16px;
    margin-bottom: 10px;
    color: #333;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row span {
    color: #666;
    font-size: 14px;
}

.detail-row strong {
    color: #31566D;
}