/* BridgeBI team layer — the multi-user surfaces: the Admin (Equipo) page, the
   per-user dashboard customizer, and the read-only chrome a non-admin account
   sees.

   Lives outside index.html on purpose. index.html is a 45k-line single file that
   more than one session edits; keeping this here means the team feature can grow
   without fighting for the same lines. Tokens (--navy, --gold, --off-white…) come
   from index.html's :root, so this file inherits the design system instead of
   restating it. */

/* ---------------------------------------------------------------------------
   Role chrome
   --------------------------------------------------------------------------- */
/* A hidden button is not a permission — the server enforces read-only — but a
   button that 403s is a bad experience, so admin-only controls come off the
   screen for a user account too. */
body[data-bb-role="user"] [data-admin-only],
body[data-bb-role="user"] #syncLiveAdsBtn,
body[data-bb-role="user"] #openSettings {
  display: none !important;
}

.bb-role-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
}
.bb-role-pill.admin { background: rgba(201,164,63,.16); color: var(--gold-deep, #A8842C); }
.bb-role-pill.user  { background: rgba(13,42,94,.09);  color: var(--navy); }
.bb-role-pill.pend  { background: rgba(199,125,27,.14); color: var(--amber); }
.bb-role-pill.off   { background: rgba(178,59,59,.12);  color: var(--red); }

/* Read-only ribbon. Sits under the header so a user always knows why nothing is
   editable, instead of concluding the app is broken. */
.bb-ro-banner {
  display: none;
  align-items: center; gap: 10px;
  margin: 0 0 16px; padding: 11px 15px;
  background: linear-gradient(180deg, #fffdf6, #fdf9ee);
  border: 1px solid rgba(201,164,63,.4); border-left: 3px solid var(--gold);
  border-radius: 9px; font-size: 13px; color: #4a4235; line-height: 1.5;
}
body[data-bb-role="user"] .bb-ro-banner { display: flex; }
.bb-ro-banner b { color: var(--navy); }
.bb-ro-banner .bb-ro-x {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: #8b8578; font-size: 17px; line-height: 1; padding: 0 2px;
}

/* Sections a user turned off in their own layout. !important because the app's
   render code sets style.display on these cards when data arrives. */
.bb-sec-off { display: none !important; }

/* ---------------------------------------------------------------------------
   Header identity chip
   --------------------------------------------------------------------------- */
.bb-user-menu {
  position: fixed; z-index: 100000;
  min-width: 232px; padding: 8px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--sh-3, 0 18px 48px rgba(13,42,94,.14));
  font-family: 'Outfit', system-ui, sans-serif;
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity 140ms var(--ease-out-quint, ease), transform 140ms var(--ease-out-quint, ease);
}
.bb-user-menu.open { opacity: 1; transform: none; pointer-events: auto; }
.bb-user-menu-head { padding: 9px 11px 11px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.bb-user-menu-name { font-size: 14px; font-weight: 700; color: var(--navy); }
.bb-user-menu-mail {
  font-size: 11.5px; color: var(--text-muted); margin-top: 2px;
  font-family: 'JetBrains Mono', monospace; word-break: break-all;
}
.bb-user-menu-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 11px; border: none; background: none; border-radius: 8px;
  font-family: inherit; font-size: 13.5px; font-weight: 500; color: var(--text);
  text-align: left; cursor: pointer;
}
.bb-user-menu-item:hover { background: var(--off-white); }
/* background restated for the same reason as .bb-btn.danger — index.html's global
   `button.danger { background: var(--red) }` outranks the plain-class rule above
   and would paint red text on a red block. */
.bb-user-menu-item.danger { background: none; color: var(--red); }
.bb-user-menu-item.danger:hover { background: rgba(178,59,59,.08); }
.bb-user-menu-item svg { width: 15px; height: 15px; flex: 0 0 auto; opacity: .65; }

/* ---------------------------------------------------------------------------
   Modal shell (customizer + invite + user detail)
   --------------------------------------------------------------------------- */
.bb-modal-back {
  position: fixed; inset: 0; z-index: 99998;
  background: rgba(10,31,71,.42); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; transition: opacity 160ms ease;
}
.bb-modal-back.open { opacity: 1; }
.bb-modal {
  width: 100%; max-width: 560px; max-height: 88vh; overflow: auto;
  background: var(--warm-white, #FAF9F6); border-radius: 16px;
  box-shadow: 0 30px 80px rgba(10,31,71,.34);
  font-family: 'Outfit', system-ui, sans-serif;
  transform: translateY(14px) scale(.985); transition: transform 200ms var(--ease-out-quint, ease);
}
.bb-modal.wide { max-width: 820px; }
.bb-modal-back.open .bb-modal { transform: none; }
.bb-modal-head {
  position: sticky; top: 0; z-index: 2;
  padding: 20px 24px 14px; background: var(--warm-white, #FAF9F6);
  border-bottom: 1px solid var(--border);
}
.bb-modal-head h3 { margin: 0; font-size: 19px; font-weight: 800; color: var(--navy); letter-spacing: -.2px; }
.bb-modal-head p { margin: 5px 0 0; font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.bb-modal-x {
  position: absolute; top: 16px; right: 18px;
  width: 28px; height: 28px; border: none; border-radius: 8px;
  background: rgba(13,42,94,.06); color: var(--navy);
  font-size: 16px; line-height: 1; cursor: pointer;
}
.bb-modal-x:hover { background: rgba(13,42,94,.12); }
.bb-modal-body { padding: 20px 24px 24px; }
.bb-modal-foot {
  position: sticky; bottom: 0;
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 14px 24px; background: var(--warm-white, #FAF9F6);
  border-top: 1px solid var(--border);
}

.bb-btn {
  padding: 10px 18px; border-radius: 9px; border: 1px solid var(--border);
  background: #fff; font-family: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--text); cursor: pointer; transition: background 140ms, border-color 140ms, transform 100ms;
}
.bb-btn:hover { background: var(--off-white); }
.bb-btn:active { transform: translateY(1px); }
.bb-btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.bb-btn.primary:hover { background: var(--navy-3, #11326d); }
/* background is restated (not inherited from .bb-btn) because index.html carries a
   global `button.danger { background: var(--red) }`. That rule is less specific
   than this one but MORE specific than plain `.bb-btn`, so without an explicit
   background here the button renders red-on-red and the label disappears. */
.bb-btn.danger { background: #fff; color: var(--red); border-color: rgba(178,59,59,.32); }
.bb-btn.danger:hover { background: rgba(178,59,59,.07); }
.bb-btn.sm { padding: 6px 11px; font-size: 12px; border-radius: 7px; }
.bb-btn:disabled { opacity: .5; cursor: not-allowed; }

.bb-field { margin-bottom: 15px; }
.bb-field label {
  display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px;
}
.bb-field input[type="text"],
.bb-field input[type="email"],
.bb-field select {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 9px;
  font-family: inherit; font-size: 14px; color: var(--text); background: #fff;
}
.bb-field input:focus, .bb-field select:focus {
  outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(13,42,94,.1);
}
.bb-hint { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin-top: 6px; }
.bb-msg { font-size: 13px; font-weight: 600; margin-top: 10px; min-height: 17px; }
.bb-msg.bad { color: var(--red); }
.bb-msg.ok { color: var(--green); }

/* Segmented role picker */
.bb-seg { display: flex; gap: 6px; }
.bb-seg button {
  flex: 1; padding: 11px 12px; border: 1.5px solid var(--border); border-radius: 10px;
  background: #fff; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; text-align: left; line-height: 1.35;
  /* display:block is deliberate: index.html styles buttons as flex containers, and
     inside a flex parent the <b> below stays on the same line no matter what
     display it is given. */
  display: block;
}
.bb-seg button b { display: block; font-size: 14px; color: var(--text); font-weight: 700; }
.bb-seg button.on { border-color: var(--navy); background: rgba(13,42,94,.045); }
.bb-seg button.on b { color: var(--navy); }

/* Page-access checkbox chips */
.bb-pages { display: flex; flex-wrap: wrap; gap: 7px; }
.bb-pages label {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 8px;
  background: #fff; font-size: 13px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; text-transform: none; letter-spacing: 0; margin: 0;
}
.bb-pages label:has(input:checked) { border-color: var(--navy); background: rgba(13,42,94,.05); color: var(--navy); }
.bb-pages input { accent-color: var(--navy); width: 15px; height: 15px; }

/* ---------------------------------------------------------------------------
   Dashboard customizer rows
   --------------------------------------------------------------------------- */
.bb-sec-list { display: flex; flex-direction: column; gap: 8px; }
.bb-sec-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px; background: #fff;
  border: 1.5px solid var(--border); border-radius: 11px;
  transition: border-color 140ms, box-shadow 140ms, opacity 140ms;
}
.bb-sec-row.dragging { opacity: .45; border-style: dashed; }
.bb-sec-row.over { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,164,63,.16); }
.bb-sec-row.off { background: #faf9f6; }
.bb-sec-row.off .bb-sec-name { color: var(--text-muted); }
.bb-sec-grip { cursor: grab; color: #b8b3a6; flex: 0 0 auto; line-height: 0; }
.bb-sec-grip:active { cursor: grabbing; }
.bb-sec-body { display: block; flex: 1; min-width: 0; }
/* display:block because these are <span>s inside the row (a <div> would be
   invalid inside the <label> wrapper the switch needs). */
.bb-sec-name { display: block; font-size: 14.5px; font-weight: 700; color: var(--navy); line-height: 1.3; }
.bb-sec-desc { display: block; font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.45; }
.bb-sec-ord {
  display: flex; flex-direction: column; gap: 2px; flex: 0 0 auto;
}
.bb-sec-ord button {
  width: 24px; height: 18px; border: 1px solid var(--border); background: #fff;
  border-radius: 5px; cursor: pointer; color: var(--navy); line-height: 0;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.bb-sec-ord button:hover { background: var(--off-white); }
.bb-sec-ord button:disabled { opacity: .3; cursor: default; }
/* Switch */
.bb-sw { position: relative; width: 42px; height: 24px; flex: 0 0 auto; }
.bb-sw input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.bb-sw i {
  position: absolute; inset: 0; background: #d5d1c6; border-radius: 999px;
  transition: background 160ms; pointer-events: none;
}
.bb-sw i:after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.22);
  transition: transform 160ms var(--ease-out-quint, ease);
}
.bb-sw input:checked + i { background: var(--green); }
.bb-sw input:checked + i:after { transform: translateX(18px); }

/* ---------------------------------------------------------------------------
   Admin (Equipo) page
   --------------------------------------------------------------------------- */
.bb-console-head {
  display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap;
}
.bb-console-head > div:first-child { flex: 1; min-width: 260px; }
.bb-console-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.bb-console-eyebrow {
  font-size: 10.5px; font-weight: 800; letter-spacing: 1.3px; text-transform: uppercase;
  color: var(--gold-deep, #A8842C);
}

/* Sub-tabs: an underline rail, not pills — pills next to the sidebar's pills read
   as a second navigation. */
.bb-subtabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin: 20px -4px -4px; padding: 0 4px;
  border-bottom: 1px solid var(--border);
}
.bb-subtabs button {
  position: relative; display: flex; align-items: center; gap: 7px;
  padding: 11px 14px; border: none; background: none; cursor: pointer;
  font-family: inherit; font-size: 13.5px; font-weight: 600; color: var(--text-muted);
  border-radius: 8px 8px 0 0;
}
.bb-subtabs button:hover { background: var(--off-white); color: var(--text); }
.bb-subtabs button.on { color: var(--navy); font-weight: 700; }
.bb-subtabs button.on:after {
  content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px;
  height: 2.5px; border-radius: 2px 2px 0 0; background: var(--gold);
}
.bb-subtab-n {
  min-width: 19px; padding: 1px 5px; border-radius: 5px;
  background: var(--off-white); color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px; font-weight: 700;
  font-variant-numeric: tabular-nums; text-align: center;
}
.bb-subtabs button.on .bb-subtab-n { background: rgba(13,42,94,.1); color: var(--navy); }

.bb-admin-stats {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 20px;
}
.bb-admin-stats.seis { grid-template-columns: repeat(6, 1fr); }

/* Live presence */
.bb-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 0 2px #fff;
  animation: bb-pulse 2.4s ease-in-out infinite;
}
@keyframes bb-pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
.bb-role-pill.on { background: rgba(46,125,82,.13); color: var(--green); display: inline-flex; gap: 5px; align-items: center; }
.bb-role-pill.on .bb-dot { box-shadow: none; }

.bb-av.sm { width: 32px; height: 32px; border-radius: 9px; font-size: 12px; position: relative; }
.bb-av.sm .bb-dot { position: absolute; right: -2px; bottom: -2px; }

.bb-online-row { display: flex; flex-wrap: wrap; gap: 10px; }
.bb-online-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px 9px 10px; background: #fff;
  border: 1px solid var(--border); border-radius: 999px;
}
.bb-online-chip b { display: block; font-size: 13.5px; color: var(--navy); font-weight: 700; }
.bb-online-chip em { display: block; font-size: 11px; color: var(--text-muted); font-style: normal; }

.bb-note-amber {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 18px 0 0; padding: 12px 15px;
  background: #fffdf6; border: 1px solid rgba(201,164,63,.4); border-left: 3px solid var(--gold);
  border-radius: 9px; font-size: 13px; color: #4a4235; line-height: 1.55;
}

/* Usage bars */
.bb-bars { display: flex; flex-direction: column; gap: 7px; }
.bb-bar-row { display: flex; align-items: center; gap: 12px; }
.bb-bar-l { flex: 0 0 130px; font-size: 13px; font-weight: 600; color: var(--navy); }
.bb-bar-track { flex: 1; height: 22px; background: var(--off-white); border-radius: 6px; overflow: hidden; }
.bb-bar-track i {
  display: block; height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, var(--navy), #2a5296);
}
.bb-bar-n {
  flex: 0 0 42px; text-align: right;
  font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums;
  font-size: 13px; font-weight: 700; color: var(--navy);
}

/* Per-user usage block on the card */
.bb-uso { margin-top: 12px; padding: 11px 12px; background: #fff; border: 1px solid var(--border); border-radius: 9px; }
.bb-uso-nums { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--text-muted); }
.bb-uso-nums b {
  font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums;
  font-size: 14px; color: var(--navy);
}
.bb-uso-pags { margin-top: 9px; font-size: 11.5px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }

/* Dashboards side-by-side */
.bb-dash-cols {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 14px;
}
.bb-dash-col {
  padding: 14px; background: var(--off-white);
  border: 1px solid var(--border); border-radius: 13px;
}
.bb-dash-col.yo { background: #fffdf6; border-color: rgba(201,164,63,.5); }
.bb-dash-col-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.bb-dash-col-head b { display: block; font-size: 13.5px; color: var(--navy); font-weight: 700; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-dash-col-head em { display: block; font-size: 10.5px; color: var(--text-muted); font-style: normal; margin-top: 1px; }
.bb-dash-stack { display: flex; flex-direction: column; gap: 5px; }
.bb-dash-sec {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; background: #fff; border-radius: 7px;
  border-left: 3px solid var(--navy);
  font-size: 11.5px; font-weight: 600; color: var(--navy);
}
.bb-dash-sec.off {
  background: repeating-linear-gradient(135deg, #f2f0ea, #f2f0ea 5px, #ece9e1 5px, #ece9e1 10px);
  border-left-color: #c9c3b6; color: #8b8578;
}
.bb-dash-sec-n {
  flex: 0 0 auto; font-family: 'JetBrains Mono', monospace; font-size: 10px;
  color: var(--text-muted); min-width: 11px;
}
.bb-dash-sec-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-dash-sec-off {
  flex: 0 0 auto; font-size: 9px; font-weight: 800; letter-spacing: .5px;
  text-transform: uppercase; color: #a09889;
}
.bb-dash-col-foot { margin-top: 11px; font-size: 11px; color: var(--text-muted); line-height: 1.5; }
.bb-dash-col-foot b { color: var(--navy); }
.bb-stat {
  position: relative; overflow: hidden;
  padding: 16px 16px 14px; background: #fff;
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--sh-1, none);
  transition: transform 160ms var(--ease-out-quint, ease), box-shadow 160ms;
}
.bb-stat:hover { transform: translateY(-2px); box-shadow: var(--sh-2, 0 8px 20px rgba(13,42,94,.09)); }
.bb-stat:before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--navy); }
.bb-stat.gold:before  { background: var(--gold); }
.bb-stat.green:before { background: var(--green); }
.bb-stat.red:before   { background: var(--red); }
.bb-stat.amber:before { background: var(--amber); }
.bb-stat-n {
  font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums;
  font-size: 27px; font-weight: 700; color: var(--navy); line-height: 1.1;
}
.bb-stat-l { font-size: 11.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 5px; }

.bb-admin-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.bb-admin-bar h2 { margin: 0; font-size: 17px; font-weight: 800; color: var(--navy); }
.bb-admin-bar .sp { flex: 1; }

.bb-user-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px;
}
.bb-ucard {
  position: relative; padding: 18px; background: #fff;
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--sh-1, none);
  transition: transform 160ms var(--ease-out-quint, ease), box-shadow 160ms;
}
.bb-ucard:hover { transform: translateY(-2px); box-shadow: var(--sh-2, 0 8px 20px rgba(13,42,94,.09)); }
.bb-ucard.suspended { background: #fbf7f7; border-color: rgba(178,59,59,.25); }
.bb-ucard.yo { border-color: rgba(201,164,63,.55); box-shadow: 0 0 0 3px rgba(201,164,63,.12); }
.bb-ucard-top { display: flex; align-items: flex-start; gap: 12px; }
.bb-av {
  width: 44px; height: 44px; flex: 0 0 auto; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: #fff; letter-spacing: .5px;
  background: linear-gradient(150deg, var(--navy), #1a3d7a);
}
.bb-av.adm { background: linear-gradient(150deg, #A8842C, var(--gold)); }
.bb-av.off { background: linear-gradient(150deg, #8d8478, #b0a798); }
.bb-uname { font-size: 15.5px; font-weight: 700; color: var(--navy); line-height: 1.25; }
.bb-umail { font-size: 11.5px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; word-break: break-all; margin-top: 2px; }
.bb-utitle { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.bb-ucard-meta {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px;
}
.bb-chip {
  padding: 3px 8px; border-radius: 6px; background: var(--off-white);
  font-size: 11px; font-weight: 600; color: var(--text-muted);
}
.bb-chip.mono { font-family: 'JetBrains Mono', monospace; }
.bb-ucard-layout {
  margin-top: 12px; padding: 11px 12px; border-radius: 9px;
  background: var(--off-white); font-size: 12px; color: var(--text-muted); line-height: 1.55;
}
.bb-ucard-layout b { color: var(--navy); }
.bb-ucard-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }

.bb-inv-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 13px 15px; background: #fff; border: 1px solid var(--border);
  border-left: 3px solid var(--amber); border-radius: 11px; margin-bottom: 9px;
}
.bb-inv-row.vencida { border-left-color: var(--red); }
.bb-inv-mail { font-size: 13.5px; font-weight: 700; color: var(--navy); font-family: 'JetBrains Mono', monospace; }
.bb-inv-meta { font-size: 11.5px; color: var(--text-muted); }
.bb-inv-acts { margin-left: auto; display: flex; gap: 6px; }

.bb-act-feed { max-height: 420px; overflow: auto; }
.bb-act-row {
  display: flex; gap: 11px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 12.5px;
}
.bb-act-row:last-child { border-bottom: none; }
.bb-act-when { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-muted); flex: 0 0 118px; }
.bb-act-who { font-weight: 700; color: var(--navy); flex: 0 0 auto; }
.bb-act-what { color: var(--text-muted); }

.bb-empty { padding: 34px 20px; text-align: center; color: var(--text-muted); font-size: 13.5px; line-height: 1.6; }
.bb-empty .em { font-size: 34px; display: block; margin-bottom: 10px; }

/* Layout inspector (support view) — deliberately styled as a read-only readout,
   not an editor, so there is no doubt whose settings are on screen. */
.bb-inspect {
  background: #0f2340; border-radius: 11px; padding: 15px 17px; color: #cfd8e6;
  font-family: 'JetBrains Mono', monospace; font-size: 11.5px; line-height: 1.7;
  overflow: auto; max-height: 260px; white-space: pre-wrap; word-break: break-word;
}
.bb-inspect-note {
  display: flex; align-items: center; gap: 8px; margin: 0 0 10px;
  font-size: 12px; color: var(--text-muted); font-family: 'Outfit', sans-serif;
}

/* ---------------------------------------------------------------------------
   Notice composer (Avisar al equipo)
   --------------------------------------------------------------------------- */
.bb-bc { display: grid; grid-template-columns: 216px 1fr; gap: 20px; align-items: start; }
.bb-bc-side {
  position: sticky; top: 0;
  padding: 13px; background: var(--off-white);
  border: 1px solid var(--border); border-radius: 12px;
}
.bb-bc-side-h {
  font-size: 10.5px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 9px;
}
.bb-tpl {
  position: relative; display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 10px 26px 10px 10px; margin-bottom: 6px;
  background: #fff; border: 1.5px solid var(--border); border-radius: 10px;
  font-family: inherit; text-align: left; cursor: pointer;
  transition: border-color 140ms, background 140ms;
}
.bb-tpl:hover { border-color: var(--navy); }
.bb-tpl.on { border-color: var(--gold); background: #fffdf6; box-shadow: 0 0 0 2px rgba(201,164,63,.15); }
.bb-tpl-em { flex: 0 0 auto; font-size: 16px; line-height: 1; }
.bb-tpl-body { flex: 1; min-width: 0; }
.bb-tpl-name {
  display: block; font-size: 12.5px; font-weight: 700; color: var(--navy);
  line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bb-tpl-meta { display: block; font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }
.bb-tpl-x {
  position: absolute; top: 50%; right: 7px; transform: translateY(-50%);
  width: 17px; height: 17px; border-radius: 5px; line-height: 17px; text-align: center;
  font-size: 10px; color: #b0a898; opacity: 0; transition: opacity 120ms;
}
.bb-tpl:hover .bb-tpl-x { opacity: 1; }
.bb-tpl-x:hover { background: rgba(178,59,59,.12); color: var(--red); }

/* Placeholder fill-ins */
.bb-ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.bb-ph {
  padding: 9px 11px; background: #fff;
  border: 1.5px solid var(--border); border-left: 3px solid var(--gold); border-radius: 9px;
}
.bb-ph.auto { border-left-color: var(--green); background: #f8fbf9; }
.bb-ph-k {
  display: block; font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  font-weight: 700; color: var(--text-muted); margin-bottom: 5px;
}
.bb-ph input {
  width: 100%; padding: 7px 9px; border: 1px solid var(--border); border-radius: 7px;
  font-family: inherit; font-size: 13px; color: var(--text);
}
.bb-ph input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 2px rgba(13,42,94,.1); }
.bb-ph-auto { display: block; font-size: 13px; font-weight: 600; color: var(--navy); }
.bb-ph-auto em {
  font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; color: var(--green); margin-left: 4px;
}

/* Mail preview — a plain echo of what the mailer renders, so the sender is not
   guessing at what lands in the inbox. */
.bb-preview {
  padding: 15px 17px; background: #fff;
  border: 1px solid var(--border); border-left: 3px solid var(--navy); border-radius: 10px;
}
.bb-preview-sub { font-size: 15px; font-weight: 700; color: var(--navy); line-height: 1.35; }
.bb-preview ul { margin: 10px 0 0; padding-left: 19px; }
.bb-preview li { font-size: 13px; color: #3d4753; line-height: 1.6; margin-bottom: 4px; }
.bb-preview-cta {
  display: inline-block; margin-top: 13px; padding: 8px 15px;
  background: var(--navy); color: #fff; border-radius: 8px;
  font-size: 12.5px; font-weight: 700;
}

@media (max-width: 760px) {
  .bb-bc { grid-template-columns: 1fr; }
  .bb-bc-side { position: static; }
}

/* Toast */
.bb-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 14px);
  z-index: 100001; max-width: min(460px, 90vw);
  padding: 12px 18px; border-radius: 11px;
  background: var(--navy); color: #fff; font-family: 'Outfit', sans-serif;
  font-size: 13.5px; font-weight: 600; line-height: 1.45;
  box-shadow: 0 14px 40px rgba(10,31,71,.34);
  opacity: 0; pointer-events: none; transition: opacity 180ms, transform 180ms var(--ease-out-quint, ease);
}
.bb-toast.show { opacity: 1; transform: translate(-50%, 0); }
.bb-toast.bad { background: var(--red); }
.bb-toast.ok  { background: var(--green); }

@media (max-width: 900px) {
  .bb-admin-stats, .bb-admin-stats.seis { grid-template-columns: repeat(3, 1fr); }
  .bb-subtabs button { padding: 10px 11px; font-size: 12.5px; }
}
@media (max-width: 600px) {
  .bb-admin-stats, .bb-admin-stats.seis { grid-template-columns: repeat(2, 1fr); }
  .bb-dash-cols { grid-template-columns: 1fr; }
  .bb-bar-l { flex-basis: 96px; font-size: 12px; }
  .bb-user-grid { grid-template-columns: 1fr; }
  .bb-modal-back { padding: 0; align-items: flex-end; }
  .bb-modal { max-width: none; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .bb-act-when { flex-basis: 100%; }
}
