﻿

/* ── Page Header ── */
.users-page-header {
    margin-bottom: 20px;
}

    .users-page-header h2 {
        font-size: 22px;
        font-weight: 500;
        color: #1e293b;
        margin: 0 0 4px 0;
        font-family: var(--HeadingFont) !important;
    }

    .users-page-header p {
        font-size: 13px;
        color: #64748b;
        margin: 0;
        font-family: var(--HeadingFont) !important;
    }

/* ── Stats Strip ── */
.users-stats-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.users-stat-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.users-stat-label {
    font-size: 13px !important;
    color: #94a3b8;
    font-family: var(--HeadingFont) !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.users-stat-value {
    font-size: 28px !important;
    color: #1e293b;
    font-family: var(--HeadingFont) !important;
    line-height: 1;
    font-weight: 600;
}

    .users-stat-value.active {
        color: #16a34a;
    }

    .users-stat-value.managers {
        color: #1d4ed8;
    }

    .users-stat-value.pending {
        color: #854F0B;
    }

    .users-stat-value.inactive {
        color: #dc2626;
    }

/* ── Toolbar ── */
.users-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* ── Role Badge ── */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-family: var(--HeadingFont) !important;
}

    .role-badge.owner {
        background: #ede9fe;
        color: #6d28d9;
    }

    .role-badge.manager {
        background: #dbeafe;
        color: #1d4ed8;
    }

    .role-badge.user {
        background: #dcfce7;
        color: #15803d;
    }

/* ── Status Badge ── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    font-family: var(--HeadingFont) !important;
}

    .status-badge.active {
        background: #dcfce7;
        color: #15803d;
    }

    .status-badge.inactive {
        background: #fef9c3;
        color: #a16207;
    }

    .status-badge.pending {
        background: #fff7ed;
        color: #c2410c;
    }

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

    .status-dot.active {
        background: #22c55e;
    }

    .status-dot.inactive {
        background: #eab308;
    }

    .status-dot.pending {
        background: #f97316;
    }

/* ── Avatar ── */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #dbeafe;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #1d4ed8;
    font-family: var(--HeadingFont) !important;
    flex-shrink: 0;
}

.user-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}



.user-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.user-name-info {
    min-width: 0;
    flex: 1;
}

    .user-name-info strong {
        display: block;
        font-size: 14px;
        color: #1e293b;
        font-weight: 600;
        font-family: var(--HeadingFont) !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .user-name-info span {
        font-size: 12px;
        color: #94a3b8;
        font-family: var(--HeadingFont) !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }

/* ── Permission Pills ── */
.perm-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.perm-pill {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 5px;
    background: #f1f5f9;
    color: #475569;
    font-family: var(--HeadingFont) !important;
    border: 1px solid #e2e8f0;
}

/* ── Action Buttons ── */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
    color: #64748b;
}

    .action-btn:hover {
        background: #f8fafc;
    }

    .action-btn.view:hover {
        background: #f0fdf4;
        border-color: #86efac;
        color: #16a34a;
    }

    .action-btn.edit:hover {
        background: #eff6ff;
        border-color: #93c5fd;
        color: #2563eb;
    }

    .action-btn.delete:hover {
        background: #fff1f2;
        border-color: #fecaca;
        color: #dc2626;
    }

/* ── Expand Row Detail ── */
.row-expand-detail {
    padding: 14px 20px 16px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
}

.row-expand-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.row-expand-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.row-expand-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    font-weight: 600;
    font-family: var(--HeadingFont) !important;
}

.row-expand-value {
    font-size: 14px;
    color: #1e293b;
    font-family: var(--HeadingFont) !important;
    font-weight: 500;
}

/* ── Dialog Section Title ── */
.dialog-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    font-weight: 600;
    margin: 18px 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
    font-family: var(--HeadingFont) !important;
}

/* ── Dialog Field ── */
.dialog-field-label {
    font-size: 13px;
    color: #374151;
    font-weight: 500;
    margin-bottom: 5px;
    font-family: var(--HeadingFont) !important;
}

    .dialog-field-label .req {
        color: #ef4444;
        margin-left: 2px;
    }

.dialog-field-wrap {
    margin-bottom: 14px;
}

/* ── Dialog Info/Warn Notes ── */
.dialog-info-note {
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    font-size: 13px;
    color: #1d4ed8;
    font-family: var(--HeadingFont) !important;
    margin-bottom: 16px;
    line-height: 1.5;
}

.dialog-warn-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    font-size: 13px;
    color: #92400e;
    font-family: var(--HeadingFont) !important;
    margin-top: 6px;
    line-height: 1.5;
}

/* ── Permissions Grid ── */
.perms-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 4px;
}

.perm-check-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 9px 11px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

    .perm-check-item:hover {
        border-color: #93c5fd;
        background: #eff6ff;
    }

    .perm-check-item.checked {
        border-color: #3b82f6;
        background: #eff6ff;
    }

.perm-check-text strong {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    font-family: var(--HeadingFont) !important;
}

.perm-check-text small {
    font-size: 11px;
    color: #94a3b8;
    font-family: var(--HeadingFont) !important;
}

/* ── Dialog Footer ── */
.dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.btn-cancel {
    padding: 8px 20px;
    border-radius: 7px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    font-size: 13px;
    font-family: var(--HeadingFont) !important;
    cursor: pointer;
}

    .btn-cancel:hover {
        background: #f8fafc;
    }

/* ── Empty State ── */
.users-empty-state {
    text-align: center;
    padding: 56px 20px;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

    .users-empty-state p {
        font-size: 14px;
        margin: 0;
        font-family: var(--HeadingFont) !important;
    }

/* ── Validation Error ── */
.field-error {
    font-size: 12px;
    color: #ef4444;
    margin-top: 4px;
    font-family: var(--HeadingFont) !important;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .users-stats-strip {
        grid-template-columns: repeat(2, 1fr);
    }

    .row-expand-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .perms-grid {
        grid-template-columns: 1fr;
    }

    .dialog-form-grid.two-col {
        grid-template-columns: 1fr;
    }

    .dialog-form-grid.phone-grid {
        grid-template-columns: 100px 1fr;
    }
}

/* ── Header top row ── */
.users-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

/* ── Invite button (replaces add btn) ── */
.users-invite-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #185FA5;
    color: #fff !important;
    font-size: 13px !important;
    font-family: var(--HeadingFont) !important;
    padding: 10px 18px;
    border-radius: 8px;
    border: none !important;
    cursor: pointer;
    transition: background 0.15s, transform 0.12s;
    white-space: nowrap;
}

    .users-invite-btn:hover {
        background: #0C447C;
        transform: translateY(-1px);
    }

    .users-invite-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

/* ── Pending stat value color ── */
.users-stat-value.pending {
    color: #854F0B;
}

/* ── Invite status badge ── */
.invite-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-family: var(--HeadingFont) !important;
}

    .invite-status-badge.active {
        background: #EAF3DE;
        color: #27500A;
    }

    .invite-status-badge.pending {
        background: #FAEEDA;
        color: #633806;
    }

    .invite-status-badge.inactive {
        background: #FCEBEB;
        color: #791F1F;
    }

/* ── Expand accordion action buttons ── */
.expand-action-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 7px;
    font-size: 12px;
    font-family: var(--HeadingFont) !important;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #374151;
    transition: all 0.15s;
}

    .expand-action-btn.view {
        border-color: #B5D4F4;
        color: #0C447C;
        background: #E6F1FB;
    }

    .expand-action-btn.edit {
        border-color: #B5D4F4;
        color: #185FA5;
        background: #fff;
    }

    .expand-action-btn.resend {
        border-color: #FAC775;
        color: #633806;
        background: #FAEEDA;
    }

    .expand-action-btn.activate {
        border-color: #C0DD97;
        color: #27500A;
        background: #EAF3DE;
    }

    .expand-action-btn.deactivate {
        border-color: #FAC775;
        color: #854F0B;
        background: #FAEEDA;
    }

    .expand-action-btn.delete {
        border-color: #F7C1C1;
        color: #791F1F;
        background: #FCEBEB;
    }

/* ── Dialog overlay (replaces inline position:fixed) ── */
.dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.dialog-box {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}

.dialog-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.dialog-header-title {
    font-size: 17px;
    font-weight: 700;
    color: #1e293b;
    font-family: var(--HeadingFont) !important;
}

.dialog-header-sub {
    font-size: 12.5px;
    color: #94a3b8;
    font-family: var(--HeadingFont) !important;
    margin-top: 3px;
}

.dialog-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    padding: 4px;
    flex-shrink: 0;
}

.dialog-body {
    padding: 20px 24px;
}

/* ── Dialog form grids ── */
.dialog-form-grid.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.dialog-form-grid.phone-grid {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 12px;
}

/* ── View dialog hero ── */
.view-user-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.view-hero-name {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    font-family: var(--HeadingFont) !important;
}

.view-hero-email {
    font-size: 12.5px;
    color: #94a3b8;
    font-family: var(--HeadingFont) !important;
    margin-top: 2px;
}

.view-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 18px;
}

/* ── Delete dialog ── */
.delete-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff1f2;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.delete-title {
    font-size: 20px;
    color: #1e293b;
    font-family: var(--HeadingFont) !important;
    margin-bottom: 6px;
    font-weight: 600;
}

.delete-desc {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 20px;
    font-family: var(--HeadingFont) !important;
}

.btn-delete {
    padding: 8px 20px;
    border-radius: 7px;
    border: none;
    background: #ef4444;
    color: #fff;
    font-size: 14px;
    font-family: var(--HeadingFont) !important;
    cursor: pointer;
    transition: background 0.15s;
}

    .btn-delete:hover {
        background: #dc2626;
    }

/* ── Loading ── */
.users-loading {
    padding: 40px;
    text-align: center;
    color: #94a3b8;
    font-family: var(--HeadingFont) !important;
    font-size: 13.5px;
}


.rep-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 28px;
    padding: 8px 4px;
}

.rep-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 140px;
}

.rep-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9CA3AF;
    font-family: var(--HeadingFont) !important;
}

.rep-val {
    font-size: 13px;
    color: #1e293b;
    font-weight: 500;
    font-family: var(--HeadingFont) !important;
}

.rz-datatable .rz-col-icon {
    width: 100px;
}

.rz-accordion-header{
    font-weight: 600;
    font-size: 15px;
    padding: 0px;
    background: #fff !important;
}
/* ── Invite email preview box ── */
.invite-email-preview {
    margin-top: 6px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    color: #1e293b;
    font-family: var(--HeadingFont) !important;
    line-height: 1.7;
    white-space: pre-wrap;
}

/* ── Template hint row ── */
.invite-template-hint {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    font-size: 12px;
    color: #94a3b8;
    font-family: var(--HeadingFont) !important;
}

/* ── Placeholder tag pills ── */
.placeholder-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 5px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid #bfdbfe;
    font-family: var(--HeadingFont) !important;
}