﻿/* ==========================================================
   PLATFORM USER MANAGEMENT — Enterprise Glass System 2025
   Scoped to .god-user-management
   ========================================================== */

.god-user-management {
    --bg: #f3f4f6;
    --surface: #ffffff;
    --surface-subtle: #f9fafb;
    --border-subtle: #e5e7eb;
    --border-strong: #d1d5db;
    --text-main: #0f172a;
    --text-muted: #6b7280;
    --accent: #2563eb;
    --accent-soft: #dbeafe;
    --accent-strong: #1d4ed8;
    --positive: #16a34a;
    --negative: #dc2626;
    --shadow-soft: 0 12px 32px rgba(15, 23, 42, 0.09);
    --shadow-strong: 0 18px 40px rgba(15, 23, 42, 0.16);
    --radius-card: 14px;
    --radius-pill: 999px;
    --transition-fast: 0.18s ease-out;
    max-width: 2560px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 1.75rem 2.2rem;
    box-sizing: border-box;
    font-size: 14px;
}

/* -------------------------
   HEADER
-------------------------- */

.god-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.1rem;
}

.god-header-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.god-title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1.3rem;
    letter-spacing: 0.02em;
    font-weight: 600;
    color: var(--text-main);
}

.god-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: radial-gradient(circle at 25% 10%, #facc15, #f97316 55%, #ea580c 100%);
    box-shadow: 0 10px 26px rgba(248, 250, 252, 0.9);
}

.god-subtitle {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.god-badge {
    padding: 0.35rem 0.9rem;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(234, 179, 8, 0.9);
    background: radial-gradient(circle at 10% 0%, #fef9c3, #facc15 45%, #f59e0b 100%);
    color: #78350f;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 10px 24px rgba(250, 204, 21, 0.38);
    white-space: nowrap;
}

/* -------------------------
   STATUS PILL
-------------------------- */

.um-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 24px rgba(148, 163, 184, 0.22);
    font-size: 0.78rem;
}

.um-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
}

.um-status-success {
    color: #166534;
}

    .um-status-success .um-status-dot {
        background: #22c55e;
    }

.um-status-error {
    color: #b91c1c;
}

    .um-status-error .um-status-dot {
        background: #ef4444;
    }

/* -------------------------
   PLATFORM STATS STRIP
-------------------------- */

.platform-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.1rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.8rem;
    border-radius: var(--radius-card);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(248, 250, 252, 0.98));
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: var(--shadow-soft);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

    .stat-card:hover {
        transform: translateY(-1px);
        box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14);
        border-color: rgba(37, 99, 235, 0.6);
    }

.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 20%, #e0f2fe, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #eff6ff;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.stat-label {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

/* -------------------------
   FILTERS
-------------------------- */

.filters-section {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 1rem;
    padding: 0.7rem 0.8rem;
    border-radius: var(--radius-card);
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-soft);
}

.filters-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 220px;
    flex: 1;
}

.search-group {
    flex: 2;
}

.filter-label {
    font-size: 0.76rem;
    font-weight: 500;
    color: #374151;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

    .filter-label i {
        font-size: 0.8rem;
        color: var(--accent);
    }

.filter-select,
.filter-input {
    border-radius: 10px;
    border: 1px solid rgba(209, 213, 219, 0.95);
    background: #ffffff;
    padding: 0.38rem 0.6rem;
    font-size: 0.8rem;
    color: var(--text-main);
    min-height: 2.1rem;
}

    .filter-select:focus,
    .filter-input:focus {
        outline: none;
        border-color: var(--accent);
        box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.35);
    }

.filter-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.results-count {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.filter-badge {
    padding: 0.15rem 0.6rem;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    background: var(--accent-soft);
    color: var(--accent-strong);
}

/* -------------------------
   TABLE CARD
-------------------------- */

.table-card {
    border-radius: var(--radius-card);
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-soft);
    padding: 0.75rem 0.9rem 0.85rem;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.table-title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

    .table-title i {
        font-size: 0.85rem;
        color: var(--accent);
    }

.table-container {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    background: #f9fafb;
}

/* -------------------------
   USERS TABLE
-------------------------- */

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    background: #ffffff;
}

    .users-table thead {
        background: #f3f4f6;
    }

    .users-table th,
    .users-table td {
        padding: 0.45rem 0.6rem;
        text-align: left;
        border-bottom: 1px solid #e5e7eb;
    }

    .users-table th {
        font-size: 0.72rem;
        font-weight: 600;
        color: #6b7280;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        white-space: nowrap;
    }

    .users-table tbody tr:last-child td {
        border-bottom: none;
    }

/* Column widths / behavior */
.col-user {
    width: 26%;
}

.col-org {
    width: 18%;
}

.col-role {
    width: 18%;
}

.col-account {
    width: 14%;
}

.col-status {
    width: 10%;
}

.col-login {
    width: 12%;
}

.col-actions {
    width: 12%;
    text-align: right;
}

/* Row hover */
.user-row {
    background: #ffffff;
    transition: background 0.15s ease-out;
}

    .user-row:hover {
        background: #f9fafb;
    }

/* -------------------------
   USER CELL
-------------------------- */

.user-cell {
    vertical-align: top;
}

.user-info {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
}

.owner-crown {
    font-size: 1rem;
    margin-top: 2px;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}

.user-name {
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text-main);
}

.user-email {
    font-size: 0.76rem;
    color: var(--text-muted);
}

/* -------------------------
   ORGANIZATION CELL
-------------------------- */

.org-info {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}

.org-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-main);
}

.org-date {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.org-unassigned {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-pill);
    background: #fef2f2;
    color: #b91c1c;
    font-size: 0.72rem;
}

/* -------------------------
   ROLE CELL
-------------------------- */

.roles-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.role-badge {
    border-radius: var(--radius-pill);
    padding: 0.15rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 500;
    border: 1px solid rgba(209, 213, 219, 0.9);
    background: #f9fafb;
    color: #374151;
}

/* Optional specific accents by role key (role-@role.ToLower().Replace(" ","-")) */
.role-admin,
.role-executive,
.role-corporate-chef {
    background: rgba(37, 99, 235, 0.06);
    border-color: rgba(37, 99, 235, 0.25);
    color: #1d4ed8;
}

.role-head-chef,
.role-sous-chef,
.role-assistant-manager {
    background: rgba(22, 163, 74, 0.06);
    border-color: rgba(22, 163, 74, 0.25);
    color: #15803d;
}

.role-power-user {
    background: rgba(234, 179, 8, 0.08);
    border-color: rgba(234, 179, 8, 0.3);
    color: #92400e;
}

.no-role {
    font-size: 0.74rem;
    color: var(--text-muted);
}

/* -------------------------
   ACCOUNT CELL
-------------------------- */

.account-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-main);
}

.regions-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-pill);
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.72rem;
}

.org-level {
    font-size: 0.74rem;
    padding: 0.12rem 0.55rem;
    border-radius: var(--radius-pill);
    background: #ecfeff;
    color: #155e75;
}

.text-muted {
    color: var(--text-muted);
}

/* -------------------------
   STATUS CELL
-------------------------- */

.status-cell {
    white-space: nowrap;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.18rem 0.6rem;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* relies on status-@user.Status.ToLower() */
.status-active {
    background: #dcfce7;
    color: #166534;
}

.status-inactive,
.status-deactivated {
    background: #fee2e2;
    color: #991b1b;
}

.status-pending {
    background: #fef9c3;
    color: #92400e;
}

/* -------------------------
   LOGIN CELL
-------------------------- */

.login-date {
    display: block;
    font-size: 0.78rem;
    color: var(--text-main);
}

.login-time {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.login-never {
    font-size: 0.76rem;
    color: var(--text-muted);
    font-style: italic;
}

/* -------------------------
   ACTIONS CELL & BUTTONS
-------------------------- */

.actions-cell {
    text-align: right;
    white-space: nowrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.28rem 0.8rem;
    cursor: pointer;
    background: #ffffff;
    color: #111827;
    text-decoration: none;
    transition: var(--transition-fast);
}

    .btn i {
        font-size: 0.78rem;
    }

/* primary */
.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    border-color: var(--accent-strong);
    color: #f9fafb;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.35);
}

    .btn-primary:hover {
        box-shadow: 0 14px 28px rgba(37, 99, 235, 0.45);
        transform: translateY(-1px);
    }

/* secondary */
.btn-secondary {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #374151;
}

    .btn-secondary:hover {
        background: #e5e7eb;
    }

/* outline */
.btn-outline {
    background: #ffffff;
    border-color: #d1d5db;
    color: #374151;
}

    .btn-outline:hover {
        border-color: var(--accent);
        color: #1d4ed8;
        background: #eff6ff;
    }

/* small size */
.btn-sm {
    padding: 0.22rem 0.7rem;
    font-size: 0.76rem;
}

/* Disabled */
.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

/* -------------------------
   EMPTY STATE
-------------------------- */

.empty-state {
    text-align: center;
    padding: 1.4rem 0.8rem 1.5rem;
    background: #ffffff;
}

.empty-message {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

    .empty-message i {
        font-size: 1.4rem;
        color: #9ca3af;
    }

/* -------------------------
   RESPONSIVE
-------------------------- */

@media (max-width: 1024px) {
    .god-user-management {
        padding: 1.25rem 1.3rem 1.8rem;
    }

    .col-org,
    .col-role,
    .col-account {
        width: auto;
    }
}

@media (max-width: 768px) {
    .god-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filters-form {
        flex-direction: column;
        align-items: stretch;
    }

    .actions-cell {
        text-align: left;
    }

    .users-table th,
    .users-table td {
        padding: 0.4rem 0.45rem;
    }
}

@media (max-width: 640px) {
    .table-card {
        padding: 0.6rem 0.6rem 0.7rem;
    }

    .table-container {
        overflow-x: auto;
    }

    .users-table {
        min-width: 720px;
    }
}
