﻿/* ── User Page Layout ── */
.users-page-header {
    margin-bottom: 28px;
}

    .users-page-header h2 {
        font-size: 22px;
        font-weight: 400;
        color: #1e293b;
        margin: 0 0 4px 0;
        font-family: var(--HeadingFont) !important;
    }

    .users-page-header p {
        font-size: 14px;
        color: #424242;
        margin: 0;
    }

/* ── Stats Strip ── */
.users-stats-strip {
    display: flex;
    gap: 14px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.users-stat-card {
    flex: 1;
    min-width: 130px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.users-stat-label {
    font-size:14px;
    color: #94a3b8;
    font-family: var(--HeadingFont) !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.users-stat-value {
    font-size: 26px;
    font-weight: 700;
    color: #1e293b;
    font-family: var(--HeadingFont) !important;
    line-height: 1.1;
}

    .users-stat-value.active {
        color: #016630;
    }

    .users-stat-value.managers {
        color: #1d4ed8;
    }

    .users-stat-value.inactive {
        color: #f59e0b;
    }

/* ── Toolbar ── */
.users-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.users-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 220px;
    max-width: 380px;
}

.users-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: radial-gradient(circle, #3A89F5, #6FD4FB);
    color: #fff !important;
    font-size: 14px !important;
    font-family: var(--HeadingFont) !important;
    padding: 15px 20px;
    border-radius: 8px;
    border: none !important;
    cursor: pointer;
    transition: box-shadow 0.18s, transform 0.12s;
    white-space: nowrap;
    text-decoration: none;
}

    .users-add-btn:hover {
        box-shadow: 0 4px 16px rgba(14,165,233,0.35);
        transform: translateY(-1px);
    }

/* ── Role Badge ── */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-family: var(--HeadingFont) !important;
    letter-spacing: 0.02em;
}

    .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: 3px 10px;
    border-radius: 20px;
    font-size: 13px;
    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;
}

    .status-dot.active {
        background: #22c55e;
    }

    .status-dot.inactive {
        background: #eab308;
    }

    .status-dot.pending {
        background: #f97316;
    }

/* ── Avatar ── */
.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #bfdbfe, #93c5fd);
    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-info strong {
    display: block;
    font-size: 15px;
    color: #1e293b;
    font-family: var(--HeadingFont) !important;
}

.user-name-info span {
    font-size: 14px;
    color: #94a3b8;
    font-family: var(--HeadingFont) !important;
}

/* ── Permission Pills ── */
.perm-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.perm-pill {
    font-size: 13px;
    padding: 2px 7px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #475569;
    font-family: var(--HeadingFont) !important;
    border: 1px solid #e2e8f0;
}

/* "+N more" overflow badge */
.perm-pill-more {
    background: #ede9fe;
    color: #6d28d9;
    border-color: #ddd6fe;
    font-weight: 600;
}

/* ── Add/Edit Dialog ── */
.dialog-section-title {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin: 18px 0 10px 0;
    font-family: var(--HeadingFont) !important;
}

.dialog-field-label {
    font-size: 14px;
    color: #374151;
    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-note {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    padding: 9px 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 7px;
    font-size: 14px;
    color: #1d4ed8;
    font-family: var(--HeadingFont) !important;
    margin-bottom: 16px;
    line-height: 1.5;
}

    .dialog-info-note svg {
        flex-shrink: 0;
        margin-top: 1px;
        color: #3b82f6;
    }

.dialog-warn-note {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    padding: 9px 12px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 7px;
    font-size: 14px;
    color: #92400e;
    font-family: var(--HeadingFont) !important;
    margin-top: 6px;
    line-height: 1.5;
}

/* ── Permissions Checkboxes ── */
.perms-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.perm-check-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    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: 14px;
    font-weight: 400;
    color: #1e293b;
    font-family: var(--HeadingFont) !important;
}

.perm-check-text small {
    font-size: 13px;
    color: #94a3b8;
    font-family: var(--HeadingFont) !important;
}

/* ── Action Buttons in grid ── */
.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.view {
        background: #f0fdf4;
        border-color: #86efac;
        color: #16a34a;
    }

    .action-btn:hover.edit {
        background: #eff6ff;
        border-color: #93c5fd;
        color: #2563eb;
    }

    .action-btn:hover.delete {
        background: #fff1f2;
        border-color: #fecaca;
        color: #dc2626;
    }

    .action-btn:hover.toggle {
        background: #f0fdf4;
        border-color: #86efac;
        color: #16a34a;
    }

/* ── View User info blocks ── */
.view-info-block {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.view-info-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    font-family: var(--HeadingFont) !important;
}

.view-info-value {
    font-size: 13.5px;
    color: #1e293b;
    font-family: var(--HeadingFont) !important;
    font-weight: 500;
}

/* ── Empty State ── */
.users-empty-state {
    text-align: center;
    padding: 56px 20px;
    color: #94a3b8;
}

    .users-empty-state svg {
        color: #cbd5e1;
    }

    .users-empty-state p {
        font-size: 14px;
        margin: 0 0 16px 0;
        font-family: var(--HeadingFont) !important;
    }

/* ── Validation error ── */
.field-error {
    font-size: 11.5px;
    color: #ef4444;
    margin-top: 4px;
    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: 15px !important;
    font-family: var(--HeadingFont) !important;
    cursor: pointer;
    transition: background 0.15s;
}

    .btn-cancel:hover {
        background: #f8fafc;
    }

.btn-save {
    padding: 8px 24px;
    border-radius: 7px;
    border: none;
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    font-family: var(--HeadingFont) !important;
    cursor: pointer;
    transition: box-shadow 0.15s;
}

    .btn-save:hover {
        box-shadow: 0 4px 14px rgba(14,165,233,0.35);
    }

    .btn-save:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }


/* ── Expandable Row Detail ── */
.row-expand-detail {
    padding: 14px 20px 16px 20px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
}

.row-expand-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.row-expand-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.row-expand-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    font-family: var(--HeadingFont) !important;
}

.row-expand-value {
    font-size: 16px;
    color: #1e293b;
    font-family: var(--HeadingFont) !important;
    font-weight: 500;
}