/* GWorkspace Admin: the look of the panel, layered over Filament's compiled styles. */

:root {
    --gs-bg: #f6f7fb;
    --gs-surface: #ffffff;
    --gs-border: rgba(15, 23, 42, .08);
    --gs-border-strong: rgba(15, 23, 42, .14);
    --gs-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px -8px rgba(15, 23, 42, .10);
    --gs-text: #0f172a;
    --gs-muted: #64748b;
    --gs-tint: rgba(79, 70, 229, .08);
    --gs-accent: #4f46e5;
    --gs-critical: #dc2626;
    --gs-warning: #d97706;
    --gs-good: #059669;
    --gs-radius: 14px;
}

.dark {
    --gs-bg: #0b0f19;
    --gs-surface: #131826;
    --gs-border: rgba(255, 255, 255, .08);
    --gs-border-strong: rgba(255, 255, 255, .16);
    --gs-shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --gs-text: #e2e8f0;
    --gs-muted: #94a3b8;
    --gs-tint: rgba(129, 140, 248, .14);
    --gs-accent: #a5b4fc;
    --gs-critical: #f87171;
    --gs-warning: #fbbf24;
    --gs-good: #34d399;
}

/* ── Frame ── */
.fi-body { background: var(--gs-bg); }

.fi-topbar nav,
.fi-topbar {
    background: var(--gs-surface);
    box-shadow: none;
    border-bottom: 1px solid var(--gs-border);
}

.fi-sidebar-header { background: var(--gs-surface); box-shadow: none; border-bottom: 1px solid var(--gs-border); }

@media (min-width: 1024px) {
    .fi-sidebar { background: var(--gs-surface); border-inline-end: 1px solid var(--gs-border); }
}

.fi-sidebar-group-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--gs-muted);
}

.fi-sidebar-item-btn { border-radius: 9px; transition: background-color .12s ease; }
.fi-sidebar-item-label { font-size: 13.5px; }
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn { background: var(--gs-tint); }
.fi-sidebar-item.fi-active .fi-sidebar-item-label { font-weight: 600; }

/* ── Brand ── */
.gs-brand { display: inline-flex; align-items: center; gap: 10px; height: 100%; }
.gs-brand-mark { width: 30px; height: 30px; flex: none; }
.gs-brand-name { font-size: 16px; font-weight: 700; letter-spacing: -.01em; color: var(--gs-text); white-space: nowrap; }
.gs-brand-name span { font-weight: 500; color: var(--gs-muted); }

/* ── Workspace switcher (top bar) ── */
.gs-switcher { display: flex; align-items: center; gap: 10px; min-width: 0; margin-inline-start: 20px; padding-inline-start: 20px; border-inline-start: 1px solid var(--gs-border); }
.gs-switcher:empty { display: none; }

/* Phone and tablet: the top-bar spot is hidden there, so the copy at the top of the menu takes over */
.gs-switcher--sidebar {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    margin: 0 0 8px;
    padding: 0 0 16px;
    border-inline-start: 0;
    border-bottom: 1px solid var(--gs-border);
}
.gs-switcher--sidebar .gs-switcher-select { max-width: none; min-width: 0; }
@media (min-width: 1024px) { .gs-switcher--sidebar { display: none; } }
@media (max-width: 1023px) { .gs-switcher--topbar { display: none; } }
.gs-switcher-label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--gs-muted); white-space: nowrap; }
.gs-switcher-wrap {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
    border-radius: 10px;
    background: var(--gs-surface);
    box-shadow: 0 0 0 1px var(--gs-border-strong);
    transition: box-shadow .12s ease;
}
.gs-switcher-wrap:focus-within { box-shadow: 0 0 0 2px var(--gs-accent); }
.gs-switcher-active { background: var(--gs-tint); box-shadow: 0 0 0 1px var(--gs-accent); }
.gs-switcher-icon { position: absolute; left: 10px; width: 16px; height: 16px; color: var(--gs-muted); pointer-events: none; }
.gs-switcher-active .gs-switcher-icon { color: var(--gs-accent); }
.gs-switcher-chevron { position: absolute; right: 9px; width: 16px; height: 16px; color: var(--gs-muted); pointer-events: none; }
.gs-switcher-select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    max-width: 260px;
    min-width: 170px;
    padding: 7px 32px 7px 34px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--gs-text);
    text-overflow: ellipsis;
    cursor: pointer;
}
.gs-switcher-select:focus { outline: none; box-shadow: none; }
.gs-switcher-select option { color: #0f172a; background: #fff; }
.gs-switcher-select:disabled { opacity: .6; cursor: progress; }

/* ── User picker (New operation → Choose users) ── */
.gs-user-picker .fi-fo-checkbox-list-options {
    display: block;
    /* Filament lays options out in CSS columns; with a fixed height those overflow sideways, so turn them off */
    columns: auto;
    column-count: auto;
    margin: 0;
    max-height: 460px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 12px;
    background: var(--gs-surface);
    box-shadow: 0 0 0 1px var(--gs-border-strong);
}
.gs-user-picker .fi-fo-checkbox-list-option-ctn { padding: 0; margin: 0; border-bottom: 1px solid var(--gs-border); }
.gs-user-picker .fi-fo-checkbox-list-option-ctn:last-child { border-bottom: 0; }
.gs-user-picker .fi-fo-checkbox-list-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 9px 16px;
    cursor: pointer;
    transition: background-color .1s ease;
}
.gs-user-picker .fi-fo-checkbox-list-option:hover { background: var(--gs-tint); }
.gs-user-picker .fi-fo-checkbox-list-option:has(input:checked) { background: var(--gs-tint); }
.gs-user-picker .fi-fo-checkbox-list-option:has(input:disabled) { cursor: not-allowed; }
.gs-user-picker .fi-fo-checkbox-list-option:has(input:disabled) .fi-fo-checkbox-list-option-text { opacity: .55; }
.gs-user-picker .fi-fo-checkbox-list-option .fi-checkbox-input { margin: 0; flex: none; }
.gs-user-picker .fi-fo-checkbox-list-option-text { position: relative; flex: 1; min-width: 0; padding-inline-start: 46px; }
.gs-user-picker .fi-fo-checkbox-list-option-label { display: block; line-height: 20px; }
.gs-user-picker .fi-fo-checkbox-list-option-description {
    margin: 0;
    font-size: 13px;
    line-height: 18px;
    color: var(--gs-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gs-user-picker .fi-fo-checkbox-list-option-ctn { break-inside: auto; }
.gs-pick-count { font-weight: 600; color: var(--gs-accent); font-variant-numeric: tabular-nums; }
.gs-user-picker .fi-fo-checkbox-list-actions { display: flex; margin: 12px 0 10px; }
.gs-user-picker .fi-fo-checkbox-list-actions .fi-link {
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    background: var(--gs-tint);
}
.gs-user-picker .fi-fo-checkbox-list-actions .fi-link:hover { text-decoration: none; filter: brightness(.97); }

.gs-pick { display: flex; align-items: center; gap: 10px; min-width: 0; }
/* Initials from a data attribute, so they are not part of the searchable text */
.gs-pick::before {
    content: attr(data-initials);
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--gs-accent);
    background: var(--gs-tint);
}
.gs-pick-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: var(--gs-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-pick-tags { display: flex; flex: none; gap: 6px; }
.gs-pick-tag { padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.gs-pick-tag--suspended { color: #92400e; background: #fef3c7; }
.gs-pick-tag--admin { color: #9f1239; background: #ffe4e6; }
.dark .gs-pick-tag--suspended { color: #fcd34d; background: rgba(251, 191, 36, .14); }
.dark .gs-pick-tag--admin { color: #fda4af; background: rgba(244, 63, 94, .16); }

@media (max-width: 640px) {
    .gs-user-picker .fi-fo-checkbox-list-option { padding: 10px 12px; gap: 10px; }
    .gs-user-picker .fi-fo-checkbox-list-option-text { padding-inline-start: 0; }
    .gs-pick::before { display: none; }
}

/* ── Page headings ── */
.fi-header-heading { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }

/* ── Cards ── */
.fi-section,
.fi-wi-stats-overview-stat,
.fi-ta-ctn {
    border-radius: var(--gs-radius);
    background: var(--gs-surface);
    box-shadow: 0 0 0 1px var(--gs-border), var(--gs-shadow);
}

.fi-wi-stats-overview-stat { padding: 20px 22px; transition: border-color .12s ease; }
.fi-wi-stats-overview-stat-label { font-size: 13px; font-weight: 500; color: var(--gs-muted); }
.fi-wi-stats-overview-stat-value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* ── Tables ── */
.fi-ta-header-cell {
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--gs-muted);
}

.fi-ta-row { transition: background-color .1s ease; }
.fi-badge { border-radius: 7px; font-weight: 500; }

/* ── Buttons and inputs ── */
.fi-btn { border-radius: 9px; }
.fi-input-wrp { border-radius: 9px; }
.fi-modal-window { border-radius: 16px; }

/* ── Dashboard hero ── */
.gs-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px 32px;
    padding: 26px 30px;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(120deg, #312e81 0%, #4338ca 55%, #4f46e5 100%);
    box-shadow: 0 10px 28px -14px rgba(49, 46, 129, .65);
}

.gs-hero-date { margin: 0; font-size: 13px; color: #c7d2fe; }
.gs-hero-title { margin: 4px 0 0; font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; color: #fff; }
.gs-hero-summary { margin: 8px 0 0; font-size: 14px; color: #e0e7ff; }
.gs-hero-summary span { color: #c7d2fe; }
.gs-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.gs-hero-btn {
    display: inline-flex;
    align-items: center;
    padding: 9px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .32);
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .12s ease;
}

.gs-hero-btn:hover { background: rgba(255, 255, 255, .12); }
.gs-hero-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.gs-hero-btn-solid { background: #fff; border-color: #fff; color: #312e81; }
.gs-hero-btn-solid:hover { background: #e0e7ff; }

/* ── Needs attention ── */
.gs-attention { list-style: none; margin: -8px -10px; padding: 0; }
.gs-attention-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 10px;
    border-radius: 10px;
    color: inherit;
    text-decoration: none;
}
a.gs-attention-row { transition: background-color .1s ease; }
a.gs-attention-row:hover { background: var(--gs-tint); }
a.gs-attention-row:focus-visible { outline: 2px solid var(--gs-accent); outline-offset: -2px; }
.gs-attention li + li { border-top: 1px solid var(--gs-border); }
.gs-attention-icon { width: 20px; height: 20px; flex: none; color: var(--gs-muted); }
.gs-level-critical { color: var(--gs-critical); }
.gs-level-warning { color: var(--gs-warning); }
.gs-level-good { color: var(--gs-good); }
.gs-attention-label { flex: 1; min-width: 0; font-size: 14px; }
.gs-attention-count { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.gs-attention-chevron { width: 16px; height: 16px; flex: none; color: var(--gs-muted); }
.gs-all-clear { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--gs-muted); }

/* ── Login ── */
.fi-simple-layout {
    background:
        radial-gradient(900px 500px at 12% -10%, rgba(79, 70, 229, .16), transparent 70%),
        radial-gradient(800px 500px at 100% 110%, rgba(99, 102, 241, .12), transparent 70%),
        var(--gs-bg);
}

.fi-simple-main {
    border-radius: 18px;
    background: var(--gs-surface);
    box-shadow: 0 0 0 1px var(--gs-border), 0 18px 44px -24px rgba(15, 23, 42, .28);
}

/* ── Operation preview, setup modal, connection test ── */
.gs-summary { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 12px; font-size: 14px; }
.gs-summary strong { font-variant-numeric: tabular-nums; }
.gs-table-wrap { max-height: 420px; overflow: auto; border: 1px solid var(--gs-border-strong); border-radius: 10px; }
.gs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.gs-table th { position: sticky; top: 0; text-align: left; padding: 9px 12px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--gs-muted); background: var(--gs-bg); border-bottom: 1px solid var(--gs-border-strong); }
.gs-table td { padding: 8px 12px; border-bottom: 1px solid var(--gs-border); overflow-wrap: anywhere; }
.gs-table tr:last-child td { border-bottom: 0; }
.gs-row-error { color: var(--gs-critical); }
.gs-note { margin-top: 10px; font-size: 13px; color: var(--gs-muted); }
.gs-warning { margin-bottom: 12px; padding: 10px 12px; border-radius: 10px; font-size: 14px; background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.dark .gs-warning { background: #450a0a; color: #fecaca; border-color: #7f1d1d; }
.gs-scopes { width: 100%; min-height: 150px; padding: 10px; font: 12px/1.5 ui-monospace, Consolas, monospace; border: 1px solid var(--gs-border-strong); border-radius: 10px; background: transparent; }
.gs-kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; margin-bottom: 12px; }
.gs-kv dt { color: var(--gs-muted); }
.gs-kv dd { overflow-wrap: anywhere; }
.gs-checks { font-size: 14px; }
.gs-checks li { display: flex; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--gs-border); }
.gs-checks li:last-child { border-bottom: 0; }
.gs-ok { color: var(--gs-good); font-weight: 600; white-space: nowrap; }
.gs-bad { color: var(--gs-critical); font-weight: 600; white-space: nowrap; }

@media (max-width: 640px) {
    .gs-hero { padding: 20px; }
    .gs-hero-title { font-size: 22px; }
    .gs-hero-btn { flex: 1; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    .gs-hero-btn, .fi-sidebar-item-btn, .fi-ta-row, a.gs-attention-row { transition: none; }
}
