/* =====================================================================
   Faixa de ambiente (padrão Brittec) — homologação / desenvolvimento / personalizado
   Mesmas cores e medidas do Brittec Cloud Panel (panel.css). O popover usa a paleta do SG.
   Template: templates/partials/_env_banner.html · dados: app/core/ambiente.py
   ===================================================================== */
:root { --env-h: 0px; }
:root.has-env:not(.env-collapsed) { --env-h: 40px; }

.env-banner { position: fixed; top: 0; left: 0; right: 0; height: 40px; z-index: 900; display: none;
  --eb-bg: #f5a524; --eb-ink: #3a2400; --eb-soft: rgba(58, 36, 0, .12);
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(255,255,255,.10) 14px 28px),
    var(--eb-bg);
  color: var(--eb-ink); font-size: 13px; font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 6px 18px -10px rgba(0,0,0,.35); }
:root.has-env:not(.env-collapsed) .env-banner { display: block; }
.env-banner.env-dev { --eb-bg: #7c5cff; --eb-ink: #ffffff; --eb-soft: rgba(255,255,255,.18); }
.env-banner.env-custom { --eb-bg: #0fb5a8; --eb-ink: #04302c; --eb-soft: rgba(4,48,44,.12); }

.eb-in { height: 100%; display: flex; align-items: center; gap: 12px; padding: 0 12px 0 16px; max-width: 100%; }
.eb-tag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 12px; flex: none;
  background: var(--eb-ink); color: var(--eb-bg); font-weight: 800; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.eb-msg { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eb-sep { width: 1px; height: 18px; background: currentColor; opacity: .25; flex: none; }
.eb-ver { white-space: nowrap; font-variant-numeric: tabular-nums; }
.eb-ver b { font-family: 'JetBrains Mono', ui-monospace, monospace; font-weight: 600; }
.eb-grow { flex: 1; }
.eb-btn { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--eb-soft);
  background: var(--eb-soft); color: inherit; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.eb-btn:hover { text-decoration: none; filter: brightness(.96); color: inherit; }
.eb-btn.eb-primary { background: var(--eb-ink); color: var(--eb-bg); border-color: transparent; }
.eb-btn.eb-primary:hover { color: var(--eb-bg); filter: brightness(1.15); }
.eb-count { min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px; background: var(--eb-ink); color: var(--eb-bg); font-size: 11px; display: inline-grid; place-items: center; margin-left: 2px; }
.eb-x { width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: inherit; cursor: pointer; display: grid; place-items: center; font-size: 13px; flex: none; }
.eb-x:hover { background: var(--eb-soft); }

.eb-news { position: relative; }
.eb-pop { position: absolute; right: 0; top: calc(100% + 10px); width: 360px; max-width: calc(100vw - 24px); display: none; z-index: 5;
  background: var(--bg-elev-2, #1C1C1F); color: var(--text-primary, #ECECEE); border: 1px solid var(--border-strong, rgba(255,255,255,.09));
  border-radius: 12px; box-shadow: var(--shadow-float, 0 12px 32px rgba(0,0,0,.5)); padding: 16px 18px; }
.eb-pop.open { display: block; }
.eb-pop-head { display: flex; flex-direction: column; margin-bottom: 10px; }
.eb-pop-head b { font-size: 14px; }
.eb-pop-head small { color: var(--text-secondary, #A0A0A6); font-size: 12px; }
.eb-pop ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.eb-pop li { display: flex; gap: 8px; font-size: 13px; line-height: 1.4; }
.eb-pop li i { color: var(--status-active, #4ADE80); font-size: 14px; flex: none; margin-top: 2px; }
.eb-pop p { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--border-soft, rgba(255,255,255,.05)); color: var(--text-secondary, #A0A0A6); font-size: 12px; }

.env-pill { position: fixed; left: 16px; bottom: 16px; z-index: 900; display: none; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 15px; border: 0;
  background: #f5a524; color: #3a2400; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; box-shadow: 0 6px 18px -6px rgba(0,0,0,.4); }
.env-pill.env-dev { background: #7c5cff; color: #fff; }
.env-pill.env-custom { background: #0fb5a8; color: #04302c; }
:root.has-env.env-collapsed .env-pill { display: inline-flex; }

/* Empurra o layout do SG para baixo da faixa (o app ocupa 100vh) */
:root.has-env .app,
:root.has-env .login-shell { height: calc(100vh - var(--env-h)); margin-top: var(--env-h); }

@media (max-width: 520px) { .eb-msg { display: none; } }
@media (max-width: 760px) { .eb-hide-sm, .eb-sep { display: none; } .eb-in { gap: 8px; padding: 0 6px 0 10px; } .eb-msg { font-size: 12px; } }
