/* ====================================================================
   ALZAR MOBILE MANAGEMENT
   Settings hub → Workspaces list → Workspace detail → User sheet.
   Mobile-only. Single-column, content-driven heights throughout.
   ==================================================================== */

/* ── Page shell ───────────────────────────────────────────────────── */
.mmg-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.mmg-screen {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* ── Utility ──────────────────────────────────────────────────────── */
@keyframes mmg-spin { to { transform: rotate(360deg); } }
.mmg-spin { display: inline-block; animation: mmg-spin 0.8s linear infinite; }

.mmg-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100%;
    color: var(--color-text-muted, #94a3b8);
    font-size: 13px;
}

.mmg-empty {
    padding: 48px 20px;
    text-align: center;
    font-size: 13px;
    color: var(--color-text-muted, #94a3b8);
    line-height: 1.6;
}

/* ── Shared top bar ───────────────────────────────────────────────── */
.mmg-top-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px 10px;
    border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.06));
    background: var(--color-bg, #0f172a);
}

.mmg-back-btn {
    background: none;
    border: none;
    color: var(--color-primary, #0ea5e9);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px 0;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.mmg-back-btn i { font-size: 16px; }

.mmg-top-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text, #f1f5f9);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ══════════════════════════════════════════════════════════════════════
   HUB SCREEN  (Settings / Management entry point)
   ══════════════════════════════════════════════════════════════════════ */
.mmg-hub-header {
    flex-shrink: 0;
    padding: 20px 16px 14px;
    border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.06));
    background: var(--color-bg, #0f172a);
}

.mmg-hub-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--color-text, #f1f5f9);
    display: flex;
    align-items: center;
    gap: 10px;
}
.mmg-hub-title i { color: var(--color-primary, #0ea5e9); font-size: 22px; }

.mmg-hub-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 14px 80px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mmg-hub-section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--color-text-muted, #94a3b8);
    padding: 6px 2px 4px;
}

.mmg-hub-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--color-bg-card, #1e293b);
    border: 1px solid var(--color-border, rgba(255,255,255,0.07));
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    width: 100%;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.12s;
}
.mmg-hub-card:active { background: var(--color-bg-hover, rgba(255,255,255,0.08)); }

.mmg-hub-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.mmg-hub-card-body { flex: 1; min-width: 0; }
.mmg-hub-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text, #f1f5f9);
}
.mmg-hub-card-sub {
    font-size: 12px;
    color: var(--color-text-muted, #94a3b8);
    margin-top: 2px;
}
.mmg-hub-caret { font-size: 14px; color: var(--color-text-muted, #94a3b8); flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════════════
   SHARED CHIPS
   ══════════════════════════════════════════════════════════════════════ */
.mmg-chip-sm {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════════════════
   SEARCH + FILTER BAR
   ══════════════════════════════════════════════════════════════════════ */
.mmg-search-bar {
    flex-shrink: 0;
    padding: 10px 14px 8px;
    background: var(--color-bg, #0f172a);
    border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.06));
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mmg-search-row {
    display: flex;
    align-items: center;
    background: var(--color-bg-card, #1e293b);
    border: 1px solid var(--color-border, rgba(255,255,255,0.1));
    border-radius: 10px;
    padding: 0 12px;
    gap: 8px;
}
.mmg-search-row i { color: var(--color-text-muted, #94a3b8); font-size: 15px; flex-shrink: 0; }

.mmg-search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    padding: 10px 0;
    font-size: 14px;
    color: var(--color-text, #f1f5f9);
    font-family: inherit;
    min-width: 0;
}
.mmg-search-input::placeholder { color: var(--color-text-muted, #94a3b8); }

.mmg-filter-row {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.mmg-filter-row::-webkit-scrollbar { display: none; }

.mmg-filter-chip {
    flex-shrink: 0;
    padding: 4px 13px;
    border-radius: 99px;
    border: 1px solid var(--color-border, rgba(255,255,255,0.12));
    background: none;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-muted, #94a3b8);
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}
.mmg-filter-chip.active {
    background: var(--color-primary, #0ea5e9);
    border-color: var(--color-primary, #0ea5e9);
    color: #fff;
}

/* ══════════════════════════════════════════════════════════════════════
   WORKSPACES LIST
   ══════════════════════════════════════════════════════════════════════ */
.mmg-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0 80px;
}

.mmg-ws-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.04));
    cursor: pointer;
    width: 100%;
    background: none;
    border-left: none;
    border-right: none;
    border-top: none;
    font-family: inherit;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}
.mmg-ws-row:active { background: var(--color-bg-card, #1e293b); }

.mmg-ws-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.mmg-ws-body { flex: 1; min-width: 0; }

.mmg-ws-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text, #f1f5f9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mmg-ws-chips {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.mmg-ws-hint {
    font-size: 11px;
    color: var(--color-text-muted, #94a3b8);
    margin-top: 3px;
}

.mmg-ws-caret { font-size: 14px; color: var(--color-text-muted, #94a3b8); flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════════════
   WORKSPACE DETAIL
   ══════════════════════════════════════════════════════════════════════ */
.mmg-detail-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 40px;
    min-height: 0;
}

/* Header card */
.mmg-ws-hdr-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 14px;
    background: var(--color-bg-card, #1e293b);
    border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.06));
}

.mmg-ws-hdr-icon {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}

.mmg-ws-hdr-info { flex: 1; min-width: 0; }
.mmg-ws-hdr-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text, #f1f5f9);
    word-break: break-word;
    line-height: 1.2;
}
.mmg-ws-hdr-tagline {
    font-size: 12px;
    color: var(--color-text-muted, #94a3b8);
    margin-top: 4px;
}
.mmg-ws-hdr-chips {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 8px;
}

/* Quick actions row */
.mmg-quick-row {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    background: var(--color-bg-card, #1e293b);
    border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.06));
}

.mmg-qa-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 8px 4px;
    background: var(--color-bg-hover, rgba(255,255,255,0.05));
    border: 1px solid var(--color-border, rgba(255,255,255,0.1));
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.12s;
}
.mmg-qa-btn:active { background: rgba(255,255,255,0.1); }
.mmg-qa-btn i    { font-size: 20px; color: var(--color-primary, #0ea5e9); }
.mmg-qa-btn span { font-size: 11px; color: var(--color-text-muted, #94a3b8); }
.mmg-qa-btn.is-go i { color: #22c55e; }

/* Overview KPIs */
.mmg-kpi-strip {
    display: flex;
    padding: 14px 0 10px;
}
.mmg-kpi {
    flex: 1;
    text-align: center;
    border-right: 1px solid var(--color-border, rgba(255,255,255,0.06));
    padding: 0 10px;
}
.mmg-kpi:last-child { border-right: none; }
.mmg-kpi-val {
    font-size: 22px;
    font-weight: 800;
    color: var(--color-text, #f1f5f9);
    line-height: 1;
}
.mmg-kpi-lbl {
    font-size: 10px;
    color: var(--color-text-muted, #94a3b8);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mmg-roles-line {
    padding: 0 14px 10px;
    font-size: 12px;
    color: var(--color-text-muted, #94a3b8);
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.mmg-roles-line i { color: var(--color-primary, #0ea5e9); flex-shrink: 0; margin-top: 1px; }

.mmg-mod-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 4px 14px 14px;
}
.mmg-mod-tag {
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 11px;
    background: rgba(255,255,255,0.06);
    color: var(--color-text-muted, #94a3b8);
    text-transform: capitalize;
}

/* ── Accordion ──────────────────────────────────────────────────────── */
.mmg-accordion {
    border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.06));
}
.mmg-acc-hdr {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 14px;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}
.mmg-acc-hdr:active { background: rgba(255,255,255,0.03); }
.mmg-acc-icon  { font-size: 16px; color: var(--color-primary, #0ea5e9); flex-shrink: 0; }
.mmg-acc-label { flex: 1; font-size: 14px; font-weight: 600; color: var(--color-text, #f1f5f9); }
.mmg-acc-count {
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(255,255,255,0.08);
    color: var(--color-text-muted, #94a3b8);
    flex-shrink: 0;
}
.mmg-acc-chevron {
    font-size: 13px;
    color: var(--color-text-muted, #94a3b8);
    transition: transform 0.15s;
    flex-shrink: 0;
}
.mmg-accordion.collapsed .mmg-acc-chevron { transform: rotate(-90deg); }
.mmg-accordion.collapsed .mmg-acc-body   { display: none; }
.mmg-acc-empty {
    padding: 14px;
    text-align: center;
    font-size: 12px;
    color: var(--color-text-muted, #94a3b8);
}

/* ══════════════════════════════════════════════════════════════════════
   USERS LIST (inside accordion)
   ══════════════════════════════════════════════════════════════════════ */
.mmg-user-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-top: 1px solid var(--color-border, rgba(255,255,255,0.04));
    cursor: pointer;
    width: 100%;
    background: none;
    border-left: none;
    border-right: none;
    border-bottom: none;
    text-align: left;
    font-family: inherit;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}
.mmg-user-row:active { background: rgba(255,255,255,0.03); }

.mmg-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.mmg-user-body { flex: 1; min-width: 0; }
.mmg-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text, #f1f5f9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mmg-user-email {
    font-size: 11px;
    color: var(--color-text-muted, #94a3b8);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mmg-user-end {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════════════
   USER DETAIL BOTTOM SHEET
   ══════════════════════════════════════════════════════════════════════ */
.mmg-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 400;
    display: flex;
    align-items: flex-end;
    animation: mmg-fade-in 0.15s ease;
}
@keyframes mmg-fade-in { from { opacity: 0; } to { opacity: 1; } }

.mmg-user-sheet {
    width: 100%;
    max-height: 76dvh;
    background: var(--color-bg-surface, #1a1a2e);
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: mmg-slide-up 0.2s ease;
}
@keyframes mmg-slide-up {
    from { transform: translateY(40px); opacity: 0.5; }
    to   { transform: translateY(0);    opacity: 1;   }
}

.mmg-sheet-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.08));
    flex-shrink: 0;
}
.mmg-sheet-label {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text, #f1f5f9);
}
.mmg-sheet-close-btn {
    background: none;
    border: none;
    color: var(--color-text-muted, #94a3b8);
    font-size: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    -webkit-tap-highlight-color: transparent;
}
.mmg-sheet-close-btn:active { background: rgba(255,255,255,0.06); }

.mmg-sheet-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.mmg-ud-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.07));
}
.mmg-ud-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}
.mmg-ud-name  { font-size: 17px; font-weight: 700; color: var(--color-text, #f1f5f9); line-height: 1.2; }
.mmg-ud-email { font-size: 12px; color: var(--color-text-muted, #94a3b8); margin-top: 2px; word-break: break-all; }

.mmg-ud-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--color-text, #f1f5f9);
    min-width: 0;
}
.mmg-ud-row i { color: var(--color-primary, #0ea5e9); font-size: 16px; flex-shrink: 0; }
.mmg-ud-row.top { align-items: flex-start; }

.mmg-ws-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.mmg-ws-pill {
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 11px;
    background: rgba(255,255,255,0.07);
    color: var(--color-text-muted, #94a3b8);
}
