/* ========================================
   Users Management Styles
   ======================================== */

/* Tabs (מטה / רכזים) */
.users-tab-btn.active {
    color: var(--primary, #2563eb);
    border-bottom-color: var(--primary, #2563eb) !important;
}

/* Table Styles */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-top: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
}

.data-table th {
    background: #e2e8f0;
    color: var(--text2);
    font-weight: 600;
    padding: 0.5rem 0.4rem;
    text-align: right;
    font-size: 0.7rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 0.4rem 0.4rem;
    text-align: right;
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
}

.departments-cell {
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
}

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

.data-table tbody tr:nth-child(even) {
    background: #f1f5f9;
}

.data-table tbody tr:hover {
    background: #e2e8f0;
    transition: background 0.2s ease;
}

/* Role Badges */
.role-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.role-ceo {
    background: #e3f2fd;
    color: #1565c0;
}

.role-deputy_ceo {
    background: #f3e5f5;
    color: #7b1fa2;
}

.role-system_admin {
    background: #f3e5f5;
    color: #7b1fa2;
}

.role-manager {
    background: #e8f5e9;
    color: #2e7d32;
}

.role-coordinator {
    background: #fff3e0;
    color: #ef6c00;
}

/* Status Badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-active {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-inactive {
    background: #ffebee;
    color: #c62828;
}

/* Icon Buttons */
.btn-icon {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: #f0f0f0;
}

/* Users Card */
.users-card {
    background: linear-gradient(135deg, #607d8b, #455a64) !important;
}

.users-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(96, 125, 139, 0.3);
}

/* Permissions Modal Styles */
.permissions-container {
    padding: 1rem;
}

.permissions-intro {
    color: var(--text2);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.permissions-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
    padding-left: 0.5rem;
}

.permission-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg2);
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.dept-perm-select {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg1, #fff);
    color: var(--text);
    font-size: 0.85rem;
}

.permission-item:hover {
    border-color: var(--green);
    background: rgba(16, 185, 129, 0.05);
}

.permission-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.permission-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--green);
    cursor: pointer;
}

.permission-checkbox input[type="checkbox"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.permission-label {
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
}

.permission-description {
    font-size: 0.75rem;
    color: var(--text3);
    margin-top: 0.25rem;
    margin-right: 1.75rem;
}

/* First permission item (all access) styling */
.permission-item:first-child {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
    border-color: var(--green);
}

.permission-item:first-child .permission-label {
    color: var(--green);
}

/* Dropbox folder assignment modal */
.dbx-cat-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.dbx-cat-tab {
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 600;
    color: var(--text2);
    border-bottom: 2px solid transparent;
}

.dbx-cat-tab.active {
    color: var(--green);
    border-bottom-color: var(--green);
}

.dbx-assigned-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 160px;
    overflow-y: auto;
    margin-bottom: 0.5rem;
}

.dbx-tree {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
}

.dbx-tree-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.25rem;
    border-radius: 6px;
}

.dbx-tree-row:hover {
    background: var(--bg2);
}

.dbx-tree-toggle {
    cursor: pointer;
    width: 1rem;
    text-align: center;
    color: var(--text3);
    user-select: none;
}

.dbx-tree-name {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dbx-tree-assign {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.dbx-tree-children {
    margin-right: 1.5rem;
    border-right: 1px solid var(--border-light);
}
