/* Shared primitives for the admin/system panels on Profile & Settings.

   These panels (AI settings, Extraction logs, Tenant queries, Client app,
   Modules, Reset data) were standalone /admin/* pages before the Profile split.
   They render OUTSIDE the page's `.profile-panels` wrapper on purpose, so they
   keep their own compact styling rather than inheriting the profile-native
   look — which means they get none of `Index.razor.css`'s `::deep` rules.

   The primitives they share used to live in ProfileAiSettingsPanel.razor.css.
   Blazor scoped CSS applies to its own component only, so every sibling panel
   that reused the class names but had no `.razor.css` of its own (Modules,
   Client app, Tenant queries) rendered unstyled: `.card` at padding 0 with its
   heading flush against the border, and `.setting-group` / `.toggle-grid`
   falling back to `display: block` so a label and its status hint ran together
   ("VaultDisabled — off for everyone in this company").

   Anchored on `.admin-panel`, which each of those panels sets on its root
   element. Panel-specific rules stay in that panel's own scoped `.razor.css`,
   where the extra specificity of the scope attribute lets them override
   anything here. */

/* ---------- Layout ---------- */

/* The global `.card` deliberately ships without padding (evie.css) — consumers
   set their own. These panels' old pages did; restore it here for all of them. */
.admin-panel .card {
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.admin-panel .section-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--evie-text);
    margin-bottom: 0.75rem;
}

.admin-panel .subsection-title {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--evie-text-muted);
    margin: 1rem 0 0.5rem;
}

.admin-panel .section-spacer { margin-top: 1.5rem; }

/* ---------- Forms ---------- */

.admin-panel .settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1rem;
}

/* Stacks a control over its label and any hint/status text beneath it. Without
   this the sibling hint renders inline and butts up against the label. */
.admin-panel .setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.admin-panel .input-narrow { max-width: 8rem; }

.admin-panel .radio-group,
.admin-panel .toggle-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-panel .radio-label,
.admin-panel .toggle-label {
    font-size: 0.8125rem;
    color: var(--evie-text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.admin-panel .hint-text {
    font-size: 0.75rem;
    color: var(--evie-text-dim);
}

.admin-panel .action-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--evie-border);
}

/* ---------- Tables ---------- */

.admin-panel .data-table th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--evie-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--evie-border);
}

.admin-panel .data-table td {
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    color: var(--evie-text-muted);
    border-bottom: 1px solid rgba(50, 55, 72, 0.5);
}

.admin-panel .data-table tr:last-child td { border-bottom: none; }

.admin-panel .mono { font-family: var(--evie-font-mono); }

/* ---------- States ---------- */

/* These carry their own padding and follow `.card` so they win the tie when a
   node is both (e.g. `<div class="card success-state action-message">`). */
.admin-panel .loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 2rem;
    font-size: 0.875rem;
    color: var(--evie-text-dim);
}

.admin-panel .action-message {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
}

.admin-panel .success-state {
    color: var(--evie-teal);
    background: rgba(45, 212, 191, 0.1);
}

.admin-panel .error-state {
    color: var(--evie-coral);
    background: rgba(248, 113, 113, 0.1);
}
