:root {
    --bg: #f0f2f5;
    --panel: #ffffff;
    --text: #1a1f29;
    --muted: #5a6472;
    --heading: #0b1f33;
    --border: #d4dae2;
    --border-soft: #e8ecf0;
    --accent: #0c7a8a;
    --accent-soft: rgba(12,122,138,.10);
    --accent-strong: #096775;
    --ok-bg: #eaf5ec; --ok-text: #1a7a38;
    --warn-bg: #fff8e0; --warn-text: #8a5e00;
    --err-bg: #fef2f2; --err-text: #991b1b;
    --shadow: none;
    --shadow-lg: none;
    --radius: 0;
    --font-heading: 'Sora', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', "SF Mono", SFMono-Regular, ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
*, *::before, *::after { border-radius: 0 !important; }
html, body { margin: 0; padding: 0; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
}
code, kbd, samp { font-family: var(--font-mono); }

/* ---- Shell ---- */
.app-shell { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
    width: 240px; flex: 0 0 240px;
    background: #0b1f33; color: #b8c8d8;
    display: flex; flex-direction: column;
    padding: 16px 10px;
    border-right: 1px solid rgba(255,255,255,.05);
}
.brand {
    display: flex; gap: 10px; align-items: center;
    padding: 6px 10px 20px;
}
.brand-logo {
    width: 40px; height: 40px; border-radius: 10px;
    object-fit: contain; background: #fff; flex: 0 0 auto;
    padding: 2px;
}
.brand strong { color: #fff; display: block; font-size: 14px; line-height: 1.3; }
.brand small { color: #7a96ac; font-size: 11px; }

.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 12px; border-radius: 9px;
    color: #b8c8d8; text-decoration: none; font-size: 13.5px;
    transition: background .12s, color .12s;
}
.nav-item .icon { opacity: .75; flex: 0 0 auto; }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item:hover .icon { opacity: 1; }
.nav-item.active { background: var(--accent); color: #fff; font-weight: 600; }
.nav-item.active .icon { opacity: 1; }

/* ---- Content ---- */
.content { flex: 1; min-width: 0; background: #ffffff; position: relative; }
.content-inner { padding: 28px clamp(18px, 4vw, 48px) 60px; }

/* ---- Topbar (menú de cuenta) ----
   Se superpone (position:absolute) a la altura del titular h1 de cada página
   (que arranca en content-inner's padding-top, 28px) para que ambos queden
   alineados en la misma línea visual, en vez de ocupar su propia fila. */
.topbar {
    position: absolute; top: 28px; right: clamp(18px, 4vw, 48px);
    height: 40px; display: flex; align-items: center; justify-content: flex-end; gap: 8px;
    z-index: 10;
}
.fullscreen-btn {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border: 1px solid var(--border); background: none; cursor: pointer;
    color: var(--muted); flex: 0 0 auto;
}
.fullscreen-btn:hover { background: var(--bg); color: var(--text); }
.user-menu { position: relative; }
.user-menu-trigger {
    display: flex; align-items: center; gap: 7px;
    background: none; border: 1px solid var(--border); cursor: pointer;
    color: var(--text); font-size: 13px; font-family: var(--font-body);
    padding: 6px 10px;
}
.user-menu-trigger:hover { background: var(--bg); }
.user-avatar {
    display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden;
    width: 22px; height: 22px; background: var(--accent-soft); color: var(--accent-strong); flex: 0 0 auto;
}
/* La foto (si existe) se pinta encima del icono; si falla la carga (sin avatar),
   se oculta con onerror y queda el icono de respaldo debajo. */
.user-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.user-menu-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-chevron { transition: transform .12s; opacity: .6; }
.user-menu-chevron.open { transform: rotate(180deg); }
.user-menu-backdrop { position: fixed; inset: 0; z-index: 1000; }
.user-menu-panel {
    position: absolute; top: calc(100% + 6px); right: 0; z-index: 1001;
    min-width: 220px; background: var(--panel); border: 1px solid var(--border);
    box-shadow: 0 6px 20px rgba(11,31,51,.12); padding: 6px;
}
.user-menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border-soft); margin-bottom: 6px; }
.user-menu-head strong { display: block; font-size: 13.5px; color: var(--heading); }
.user-menu-head small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; color: var(--text); text-decoration: none; font-size: 13px;
    transition: background .12s;
}
.user-menu-item:hover { background: var(--bg); }
.user-menu-foot { padding: 8px 10px 4px; color: var(--muted); font-size: 11px; border-top: 1px solid var(--border-soft); margin-top: 4px; }

h1 { font-family: var(--font-heading); font-size: 25px; color: var(--heading); margin: 0 0 4px; letter-spacing: -.01em; font-weight: 700; }
h2 { font-family: var(--font-heading); font-size: 18px; color: var(--heading); margin: 28px 0 12px; font-weight: 600; }
h2 .btn { font-size: 13px; padding: 5px 11px; vertical-align: middle; }
.page-sub { color: var(--muted); margin: 0 0 22px; font-size: 14px; }

/* ---- Cards ---- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.stat-card {
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 8px 12px; box-shadow: var(--shadow);
}
.stat-card .label { color: var(--muted); font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.stat-card .big { font-size: 1.3rem; font-weight: 800; color: var(--heading); margin: 2px 0; font-variant-numeric: tabular-nums; }
.stat-card .split { display: flex; gap: 14px; font-size: 11px; margin-top: 4px; }
.stat-card .split .ok { color: var(--ok-text); font-weight: 700; }
.stat-card .split .ko { color: var(--err-text); font-weight: 700; }

/* ---- Panel ---- */
.panel {
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 18px 20px; margin: 14px 0;
}

/* ---- Tables ---- */
.table-wrap { margin-top: 10px; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 13px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
thead th { background: var(--bg); color: var(--heading); font-weight: 600; white-space: nowrap; position: sticky; top: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--accent-soft); }

/* ---- Inputs & buttons ---- */
/* Lista exhaustiva de tipos de input de texto: si un tipo se queda fuera (p.ej.
   type=number), el navegador le aplica su altura nativa (~21px) en vez de los
   ~37px del resto de campos, y el input se ve "cortado" junto a sus vecinos.
   input:not([type]) cubre los <input @bind="..."> sin atributo type: aunque
   el navegador los trata como texto, el selector input[type=text] NO los
   alcanza si no llevan el atributo type escrito explícitamente, y se quedan
   con el estilo nativo (borde grueso "inset") en vez del de la app. */
input[type=text], input[type=email], input[type=date], input[type=datetime-local],
input[type=password], input[type=number], input[type=search], input[type=tel],
input[type=url], input[type=month], input[type=week], input[type=time],
input:not([type]), select, textarea {
    border: 1px solid var(--border); border-radius: 8px; padding: 8px 11px;
    font-size: 14px; background: var(--panel); color: var(--text); outline: none;
    font-family: inherit; width: 100%;
    transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
input.cell { width: 100%; padding: 5px 8px; font-size: 13px; border-radius: 6px; }
input.bug, select.bug { border-color: #d97706; background: #fff8e0; }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
/* type=color no lleva padding de texto: mismo alto que el resto, ancho de swatch. */
input[type=color] {
    border: 1px solid var(--border); padding: 3px; width: 48px; height: 37px;
    background: var(--panel); outline: none; cursor: pointer; box-sizing: border-box;
    transition: border-color .12s, box-shadow .12s;
}
input[type=color]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.btn {
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid var(--border); background: var(--panel); color: var(--text);
    border-radius: 9px; padding: 7px 14px; font-size: 13.5px; cursor: pointer;
    transition: border-color .12s, background .12s, color .12s; font-weight: 500;
    white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-soft); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.warn { background: #d97706; color: #fff; border-color: #d97706; }
.btn.warn:hover { background: #b45309; border-color: #b45309; }
.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn .icon { flex: 0 0 auto; }

.toolbar { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .grow { flex: 1; min-width: 180px; }
/* min-width:0 evita que, dentro de un grid, el ancho mínimo intrínseco de un
   input/select empuje la columna y desborde el contenedor (bug clásico de
   CSS Grid: los items no se encogen por debajo de su contenido salvo que se
   indique explícitamente). */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

/* ---- Badges & alerts ---- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 2px 9px; border-radius: 999px; font-weight: 600; }
.badge.ok { background: var(--ok-bg); color: var(--ok-text); }
.badge.warn { background: var(--warn-bg); color: var(--warn-text); }
.badge.err { background: var(--err-bg); color: var(--err-text); }
.badge.muted { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }

.alert { border-radius: var(--radius); padding: 12px 16px; margin: 12px 0; font-size: 14px; border: 1px solid; line-height: 1.5; }
.alert.ok { background: var(--ok-bg); color: var(--ok-text); border-color: #b2d9bc; }
.alert.warn { background: var(--warn-bg); color: var(--warn-text); border-color: #f0d080; }
.alert.err { background: var(--err-bg); color: var(--err-text); border-color: #f3b4b4; }

/* ---- Severity rows ---- */
tr.sev-Error td:first-child { box-shadow: inset 3px 0 0 #dc2626; }
tr.sev-Warning td:first-child { box-shadow: inset 3px 0 0 #d97706; }
tr.sev-Success td:first-child { box-shadow: inset 3px 0 0 #16a34a; }
.sev-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.sev-dot.Error { background: #dc2626; }
.sev-dot.Warning { background: #d97706; }
.sev-dot.Success { background: #16a34a; }
.sev-dot.Info { background: #94a3b8; }

/* ---- Utils ---- */
.icon { display: inline-block; vertical-align: middle; flex: 0 0 auto; }
.icon-rotate { transform: rotate(180deg); transition: transform .2s; }
.mono { font-family: var(--font-mono); font-size: 12.5px; }
.muted-text { color: var(--muted); }

/* ---- Loader ---- */
/* Overlay de carga a pantalla completa con fondo difuminado (glassmorphism), usado en
   todas las páginas vía <div class="loading-wrap"><span class="spinner"></span></div>.
   El anillo del spinner y el texto "Cargando…" son puramente CSS: no requieren tocar
   cada página. Añadir la clase "compact" para un uso inline (no pantalla completa),
   p.ej. dentro de un panel expandido. */
.loading-wrap {
    position: fixed; inset: 0; z-index: 2000;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 14px; margin: 0; padding: 24px;
    background: rgba(255,255,255,.7);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.loading-wrap::after { content: "Cargando…"; color: var(--muted); font-size: 13px; letter-spacing: .02em; }
.loading-wrap.compact {
    position: static; inset: auto; z-index: auto;
    min-height: 40px; padding: 10px; margin: 6px 0;
    background: rgba(255,255,255,.55);
    border: 1px solid var(--border-soft);
}
.spinner {
    display: inline-block; width: 34px; height: 34px;
    border: 3px solid var(--border); border-top-color: var(--accent);
    border-radius: 50% !important; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.grow { flex: 1; }

/* ---- Selector de modelo ---- */
.model-selector { display: inline-flex; align-items: center; gap: 6px; }
.model-selector select { padding: 5px 8px; font-size: 12.5px; border-radius: 8px; max-width: 220px; width: auto; }
.btn-mini {
    border: 1px solid var(--border); background: var(--panel); color: var(--muted);
    border-radius: 7px; cursor: pointer; padding: 4px 7px; font-size: 12px; line-height: 1;
    display: inline-flex; align-items: center; gap: 3px;
}
.btn-mini:hover { border-color: var(--accent); color: var(--accent-strong); }

/* ---- Login ---- */
.auth-shell {
    min-height: 100vh; background: linear-gradient(135deg, #0b1f33 0%, #0c3050 100%);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-box {
    background: var(--panel); border-radius: 18px; box-shadow: var(--shadow-lg);
    padding: 40px 44px; width: 100%; max-width: 400px;
}
.login-logo-wrap { text-align: center; margin-bottom: 18px; }
.login-logo { max-height: 60px; max-width: 200px; object-fit: contain; }
.login-title { font-size: 22px; font-weight: 700; color: var(--heading); margin: 0 0 4px; text-align: center; }
.login-sub { color: var(--muted); font-size: 13px; margin: 0 0 24px; text-align: center; }
.login-btn { width: 100%; justify-content: center; padding: 10px; font-size: 15px; margin-top: 8px; }
.password-wrap { position: relative; display: flex; }
.password-wrap input { padding-right: 40px; }
.pwd-toggle {
    position: absolute; right: 0; top: 0; bottom: 0;
    border: none; background: none; cursor: pointer; padding: 0 10px;
    color: var(--muted); display: flex; align-items: center;
}
.pwd-toggle:hover { color: var(--accent); }
.remember-label { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; cursor: pointer; margin-bottom: 16px; }

/* ---- AI workflow steps ---- */
.ai-step {
    display: flex; gap: 14px; align-items: flex-start;
    padding: 14px 16px; border: 1px solid var(--border-soft);
    border-radius: 10px; background: var(--bg); margin-bottom: 10px;
}
.ai-step-num {
    width: 26px; height: 26px; border-radius: 50%; background: var(--accent);
    color: #fff; font-size: 13px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex: 0 0 26px; margin-top: 2px;
}

/* ---- Sidebar user admin ---- */
.sidebar-admin-sep { border-top: 1px solid rgba(255,255,255,.08); margin: 8px 0; }

/* ---- Blazor error banner ---- */
#blazor-error-ui {
    background: #fef3c7; color: #78350f; bottom: 0; border-top: 1px solid var(--border);
    display: none; left: 0; padding: 10px 18px; position: fixed; width: 100%; z-index: 1000;
    font-size: 14px; align-items: center; gap: 12px;
}
#blazor-error-ui .reload { color: #78350f; font-weight: 600; }
#blazor-error-ui .dismiss { border: none; background: none; cursor: pointer; color: #78350f; padding: 0 4px; }

/* ---- Docs layout ---- */
.docs-layout { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; }
.docs-toc { position: sticky; top: 18px; max-height: calc(100vh - 40px); overflow-y: auto; border-right: 1px solid var(--border-soft); padding-right: 12px; }
.docs-toc-title { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.docs-toc a { display: block; color: var(--muted); text-decoration: none; font-size: 12.5px; padding: 4px 8px; border-radius: 6px; line-height: 1.4; }
.docs-toc a:hover { background: var(--accent-soft); color: var(--accent-strong); }

/* ---- Markdown content ---- */
.md-content { min-width: 0; max-width: 860px; }
.md-content h1 { font-size: 26px; margin: 0 0 14px; }
.md-content h2 { font-size: 20px; margin: 36px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border-soft); scroll-margin-top: 18px; }
.md-content h3 { font-size: 16px; margin: 22px 0 8px; color: var(--heading); }
.md-content h4 { font-size: 14.5px; margin: 16px 0 6px; color: var(--heading); }
.md-content p { margin: 10px 0; }
.md-content ul, .md-content ol { margin: 10px 0; padding-left: 22px; }
.md-content li { margin: 5px 0; }
.md-content strong { color: var(--heading); }
.md-content a { color: var(--accent-strong); text-decoration: none; border-bottom: 1px solid var(--accent-soft); }
.md-content a:hover { border-bottom-color: var(--accent); }
.md-content hr { border: none; border-top: 1px solid var(--border-soft); margin: 28px 0; }
.md-content code { background: #f3f5f8; color: #9a2b8e; padding: .12em .4em; border-radius: 5px; font-size: .85em; font-family: var(--font-mono); }
.md-content pre { background: #0f172a; color: #e2e8f0; border-radius: var(--radius); padding: 16px 18px; overflow-x: auto; margin: 14px 0; font-size: 12.5px; line-height: 1.5; box-shadow: var(--shadow); }
.md-content pre code { background: none; color: inherit; padding: 0; font-size: 12.5px; }
.md-content blockquote { margin: 14px 0; padding: 12px 16px; border-radius: var(--radius); background: var(--warn-bg); border: 1px solid #f0d080; color: var(--warn-text); }
.md-content blockquote p { margin: 4px 0; }
.md-content table { border-collapse: collapse; width: 100%; font-size: 13.5px; margin: 14px 0; display: block; overflow-x: auto; }
.md-content th, .md-content td { text-align: left; padding: 9px 13px; border: 1px solid var(--border-soft); vertical-align: top; }
.md-content thead th { background: var(--bg); color: var(--heading); font-weight: 600; white-space: nowrap; }
.md-content tbody tr:hover { background: var(--accent-soft); }

/* ---- Azure Monitor ---- */
.nav-group-label {
    padding: 10px 12px 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #ffffff;
    user-select: none;
}

/* ---- Layout común de las vistas de configuración (tarjetas en rejilla) ---- */
.cfg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 20px; align-items: start; }
.cfg-card { border: 1px solid var(--border); border-radius: 10px; background: var(--panel-bg); padding: 16px; }
.cfg-card-title { margin: 0 0 10px; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.cfg-table { width: 100%; }
.cfg-table td { padding: 7px 4px; vertical-align: middle; }
.cfg-table td.cfg-val { text-align: right; white-space: nowrap; width: 1%; }
.cfg-input { height: 32px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--panel-bg); color: var(--fg); font-size: 13px; box-sizing: border-box; }
/* Split de 2 columnas: izquierda = config del bloque, derecha = TODO lo de Teams. */
.cfg-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 20px; align-items: start; }
.cfg-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
/* Dentro del split, los bloques de Teams (que traen su propio ancho) se ajustan a la columna. */
.cfg-col .table-wrap { max-width: none; }
.cfg-col h2 { margin-top: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.stat-card {
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    text-align: center;
}
.stat-card .stat-val { font-size: 1.3rem; font-weight: 700; line-height: 1; color: var(--heading); }
.stat-card .stat-lbl { font-size: 9.5px; color: var(--muted); margin-top: 2px; text-transform: uppercase; letter-spacing: .05em; }
.stat-card.ok   .stat-val { color: var(--success); }
.stat-card.err  .stat-val { color: var(--error); }
.stat-card.sev0 .stat-val { color: #ff6b6b; }
.stat-card.sev1 .stat-val { color: #ffa94d; }
.stat-card.sev2 .stat-val { color: #ffd43b; }
.stat-card.sev3 .stat-val { color: #4dabf7; }

.badge.sev0 { background: rgba(255,107,107,.15); color: #ff6b6b; border-color: rgba(255,107,107,.3); }
.badge.sev1 { background: rgba(255,169,77,.15);  color: #ffa94d; border-color: rgba(255,169,77,.3); }
.badge.sev2 { background: rgba(255,212,59,.12);  color: #c9a000; border-color: rgba(255,212,59,.3); }
.badge.sev3 { background: rgba(77,171,247,.12);  color: #4dabf7; border-color: rgba(77,171,247,.3); }
.badge.sev4 { background: rgba(148,163,184,.15); color: #64748b; border-color: rgba(148,163,184,.3); }

.run-dots { display: flex; gap: 3px; align-items: center; }
.run-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    opacity: .85;
}
.run-dot.ok   { background: var(--success); }
.run-dot.err  { background: var(--error); }
.run-dot.run  { background: var(--accent); }
.run-dot.skip { background: var(--border); }

/* ---- Responsive ---- */
@media (max-width: 820px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; flex: none; flex-direction: row; align-items: center; padding: 10px 14px; }
    .sidebar nav { flex-direction: row; margin: 0 0 0 auto; gap: 4px; }
    .brand { padding: 0; }
    .topbar { top: 14px; right: 14px; }
    .docs-layout { grid-template-columns: 1fr; }
    .docs-toc { position: static; max-height: none; border-right: none; border-bottom: 1px solid var(--border-soft); padding: 0 0 10px; margin-bottom: 10px; }
}

/* ---- Modal de flujo (Logic Apps) ---- */
.flow-modal-backdrop {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.flow-modal {
    background: var(--panel-bg, #fff);
    border: 1px solid var(--border, #ddd);
    border-radius: 10px;
    padding: 16px 18px;
    width: min(1100px, 95vw);
    max-height: 90vh;
    overflow: hidden;
}
.flow-modal #flow-diagram svg { max-width: none; height: auto; }
/* El min-width:180px de .toolbar .grow está pensado para barras de filtros
   anchas; dentro de una cabecera de modal estrecho (icono + título + botón
   cerrar) sobra y fuerza que el botón salte a su propia línea. */
.flow-modal .toolbar .grow { min-width: 0; }

/* Variante a pantalla completa (p.ej. el diagrama de flujo de Logic Apps: un
   grafo grande se aprovecha mucho mejor sin el margen de un modal normal). */
.flow-modal-backdrop.flow-fullscreen { padding: 0; }
.flow-modal.flow-fullscreen {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
}
