/* ════════════════════════════════════════════════════════════════════
   Ev component library — global styles for the shared Ev* components
   (Shared/Ev/). Consumes tokens from css/ev/tokens.css only.

   Component-specific visuals that no other component needs belong in the
   component's own scoped .razor.css — this sheet is for cross-component
   structural CSS (the dialog system chrome, which renders user content
   from many components and therefore can't be scoped).

   Legacy note: entity-view.css still holds the original ev- class
   families; new sections belong here, and entity-view.css gets carved up
   into css/ev/ during the migration waves.
   ════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────  Icon  ──────────────────────────────── */
.ev-icon { font-size: 22px; line-height: 1; vertical-align: middle; }
.ev-icon--sm { font-size: 17px; }
.ev-icon--lg { font-size: 28px; }
.ev-icon--primary { color: var(--ev-primary); }
.ev-icon--cta { color: var(--ev-cta); }
.ev-icon--success { color: var(--ev-success); }
.ev-icon--warn { color: var(--ev-warn); }
.ev-icon--danger { color: var(--ev-danger); }
.ev-icon--violet { color: var(--ev-violet); }
.ev-icon--muted { color: var(--ev-text-muted); }

/* ─────────────────────────  Dialog system  ─────────────────────────── */
/* Structural chrome for EvDialogHost/EvDialog (namespaced ev-dialog-* —
   the older ev-dlg-* classes style CONTENT inside dialogs and coexist). */

.ev-dialog-scrim {
    position: fixed;
    inset: 0;
    z-index: var(--ev-z-dialog);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.48);
    animation: evDialogFade 0.18s ease-out both;
}

html[data-theme="dark"] .ev-dialog-scrim {
    background: rgba(2, 6, 17, 0.62);
}

.ev-dialog-scrim--top {
    align-items: flex-start;
    padding-top: 9vh;
}

.ev-dialog-scrim--blur {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.ev-dialog {
    display: flex;
    flex-direction: column;
    max-height: min(90vh, 100%);
    max-width: 100%;
    background: var(--ev-surface);
    color: var(--ev-text);
    font-family: var(--ev-font);
    border-radius: var(--ev-radius);
    box-shadow: var(--ev-shadow-pop);
    overflow: hidden;
    animation: evDialogRise 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Width presets (mirroring the MudBlazor MaxWidth values in use).
   Without --fullwidth the panel is content-sized up to the preset cap. */
.ev-dialog--xsmall { max-width: min(400px, 96vw); }
.ev-dialog--small  { max-width: min(520px, 96vw); }
.ev-dialog--medium { max-width: min(680px, 96vw); }
.ev-dialog--large  { max-width: min(860px, 96vw); }
.ev-dialog--xlarge { max-width: min(1180px, 96vw); }
.ev-dialog--auto   { max-width: 96vw; }

.ev-dialog--fullwidth:not(.ev-dialog--auto) { width: 100%; }

.ev-dialog-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px 14px 24px;
    border-bottom: 1px solid var(--ev-border);
    flex: 0 0 auto;
}

.ev-dialog-head .ev-dlg-title { flex: 1 1 auto; min-width: 0; }

.ev-dialog-x {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--ev-radius-sm);
    background: transparent;
    color: var(--ev-text-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.ev-dialog-x:hover {
    background: var(--ev-surface-2);
    color: var(--ev-text);
}

.ev-dialog-x .material-icons { font-size: 20px; }

.ev-dialog-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 20px 24px;
}

.ev-dialog-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    border-top: 1px solid var(--ev-border);
    background: var(--ev-surface-2);
    flex: 0 0 auto;
}

.ev-dialog-message {
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--ev-text);
}

@keyframes evDialogFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes evDialogRise {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 640px) {
    .ev-dialog-scrim { padding: 12px; }
    .ev-dialog-head { padding: 14px 14px 12px 18px; }
    .ev-dialog-body { padding: 16px 18px; }
    .ev-dialog-actions { padding: 12px 18px; }
}

/* ─────────────────────  Small utilities  ───────────────────────────── */
/* Vertical gap between stacked fields inside dialog bodies. */
.ev-field--gap { margin-top: 12px; }
