/* ============================================
   USERS MANAGEMENT - Premium Styles
   Design inspire: Stripe, Linear, Notion
   ============================================ */

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header-users {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    gap: 24px;
}

.page-header-users__left {
    flex: 1;
}

.page-header-users__title {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin: 8px 0 4px;
    line-height: 1.2;
}

.page-header-users__subtitle {
    font-size: 15px;
    color: #6b7280;
    margin: 0;
}

.page-header-users__actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .page-header-users {
        flex-direction: column;
        gap: 16px;
    }

    .page-header-users__actions {
        width: 100%;
    }

    .page-header-users__actions .btn-users-primary {
        flex: 1;
        justify-content: center;
    }
}

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb-users {
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb-users__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-users__item:hover {
    color: #7c3aed;
}

.breadcrumb-users__item--current {
    color: #111827;
    font-weight: 500;
}

.breadcrumb-users__separator {
    color: #d1d5db;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.breadcrumb-users__item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-users-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 0.5rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25);
}

.btn-users-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.35);
    color: #ffffff;
}

.btn-users-primary svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-users-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #ffffff;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-users-secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.btn-users-secondary svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ============================================
   KPI (uses shared styles from company.css)
   ============================================ */

/* ============================================
   TOOLBAR
   ============================================ */
.toolbar-users {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.toolbar-users__left {
    flex: 1;
    min-width: 280px;
    max-width: 400px;
}

.toolbar-users__right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.toolbar-users__divider {
    width: 1px;
    height: 32px;
    background: #e5e7eb;
}

@media (max-width: 768px) {
    .toolbar-users {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-users__left {
        max-width: none;
    }

    .toolbar-users__right {
        justify-content: space-between;
    }
}

/* ============================================
   SEARCH BOX
   ============================================ */
.search-box-users {
    position: relative;
}

.search-box-users__icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.search-box-users__input {
    width: 100%;
    padding: 10px 14px 10px 44px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 14px;
    color: #111827;
    transition: all 0.2s ease;
}

.search-box-users__input:focus {
    background: #ffffff;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
    outline: none;
}

.search-box-users__input::placeholder {
    color: #9ca3af;
}

/* ============================================
   FILTER TABS
   ============================================ */
.filter-tabs-users {
    display: flex;
    background: #f3f4f6;
    border-radius: 0.5rem;
    padding: 4px;
}

.filter-tab-users {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    background: transparent;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.filter-tab-users:hover {
    color: #374151;
}

.filter-tab-users.active {
    background: #ffffff;
    color: #7c3aed;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filter-tab-users__count {
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    background: #e5e7eb;
    border-radius: 9999px;
}

.filter-tab-users.active .filter-tab-users__count {
    background: #ede9fe;
    color: #7c3aed;
}

/* ============================================
   TABLE CONTAINER
   ============================================ */
.table-container-users {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
}

.table-users {
    width: 100%;
    border-collapse: collapse;
}

/* Table Header */
.table-users thead {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.table-users__th {
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table-users__th--checkbox {
    width: 48px;
    padding-left: 20px;
}

.table-users__th--actions {
    text-align: right;
    padding-right: 20px;
}

/* Table Body */
.table-users__row {
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s ease;
}

.table-users__row:hover {
    background: #faf5ff;
}

.table-users__row:last-child {
    border-bottom: none;
}

.table-users__td {
    padding: 16px;
    vertical-align: middle;
}

.table-users__td--checkbox {
    width: 48px;
    padding-left: 20px;
}

.table-users__td--actions {
    text-align: right;
    padding-right: 20px;
}

/* ============================================
   USER CELL
   ============================================ */
.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-cell__avatar {
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
}

.user-cell__info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-cell__name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-cell__meta {
    font-size: 13px;
    color: #6b7280;
    margin-top: 2px;
}

/* ============================================
   CONTACT CELL
   ============================================ */
.contact-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.contact-cell__email {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #374151;
    text-decoration: none;
    transition: color 0.2s ease;
}

.contact-cell__email:hover {
    color: #7c3aed;
}

.contact-cell__email svg {
    width: 14px;
    height: 14px;
    color: #9ca3af;
    flex-shrink: 0;
}

.contact-cell__phone {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
}

.contact-cell__phone svg {
    width: 14px;
    height: 14px;
    color: #9ca3af;
    flex-shrink: 0;
}

/* ============================================
   FUNCTION CELL
   ============================================ */
.function-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #374151;
}

.function-cell svg {
    width: 14px;
    height: 14px;
    color: #9ca3af;
    flex-shrink: 0;
}

.function-cell--empty {
    color: #9ca3af;
    font-style: italic;
}

/* ============================================
   ROLE BADGES
   ============================================ */
.roles-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
}

.role-badge svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.role-badge--admin {
    background: #fee2e2;
    color: #dc2626;
}

.role-badge--manager {
    background: #dbeafe;
    color: #2563eb;
}

.role-badge--user {
    background: #f3f4f6;
    color: #4b5563;
}

/* ============================================
   STATUS BADGES
   ============================================ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 9999px;
}

.status-badge svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.status-badge--active {
    background: #d1fae5;
    color: #059669;
}

.status-badge--pending {
    background: #fef3c7;
    color: #d97706;
}

.status-badge--inactive {
    background: #f3f4f6;
    color: #6b7280;
}

/* ============================================
   ACTIONS CELL
   ============================================ */
.actions-cell {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: #6b7280;
    background: transparent;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.action-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.action-btn:hover {
    background: #f3f4f6;
    color: #7c3aed;
}

.action-btn--view:hover {
    background: #dbeafe;
    color: #2563eb;
}

.action-btn--edit:hover {
    background: #ede9fe;
    color: #7c3aed;
}

.action-btn--assign:hover {
    background: #d1fae5;
    color: #059669;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state-users {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    text-align: center;
}

.empty-state-users__icon {
    width: 64px;
    height: 64px;
    background: #f3f4f6;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.empty-state-users__icon svg {
    width: 32px;
    height: 32px;
    color: #9ca3af;
}

.empty-state-users__title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px;
}

.empty-state-users__text {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 20px;
    max-width: 300px;
}

/* ============================================
   CHECKBOX
   ============================================ */
.checkbox-users {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    accent-color: #7c3aed;
}

.checkbox-users:checked {
    border-color: #7c3aed;
    background: #7c3aed;
}

/* ============================================
   PAGINATION INFO
   ============================================ */
.pagination-info-users {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.pagination-info-users__text {
    font-size: 13px;
    color: #6b7280;
}

/* ============================================
   ANIMATIONS
   ============================================ */
.table-users__row {
    animation: fadeIn-users 0.3s ease-out both;
}

@keyframes fadeIn-users {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .table-users__row {
        animation: none;
    }
}
