/* ACBIZ Communications - small supplement to CORE's own ui.css. No new theme: same tokens,
   same brand color, same components. Only what CORE doesn't already have. */

/* Org switcher (topbar) */
.org-switcher { position: relative; margin-left: 8px; }
.org-switcher-btn {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; font: 600 14px/1.2 var(--font); color: var(--text);
}
.org-switcher-btn:hover { background: var(--surface-2); }
.menu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 220px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 6px; z-index: 40;
  display: none;
}
.menu.open { display: block; }
.menu a, .menu button {
  text-decoration: none;
  display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; border: none;
  background: none; color: var(--text); font-size: 14px; cursor: pointer; font-family: inherit;
}
.menu a:hover, .menu button:hover { background: var(--surface-2); text-decoration: none; }
.menu hr { border: none; border-top: 1px solid var(--border); margin: 6px 0; }

/* Communications sub-navigation (Dashboard | Team | Wallet | Settings) */
.comm-tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.comm-tabs a {
  padding: 10px 16px; font-size: 14px; font-weight: 600; color: var(--text-3); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.comm-tabs a:hover { color: var(--text); text-decoration: none; }
.comm-tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }

/* Pagination (CORE has no generic pager yet) */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 16px; }
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); font-size: 13px; color: var(--text-2); text-decoration: none;
}
.pagination a:hover { background: var(--surface-2); }
.pagination .current { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

/* A couple of extra badge tones for ledger/role display */
.badge-info  { background: var(--info-bg); color: var(--info); }
.badge-brand { background: var(--brand-soft); color: var(--brand-hover); }

@media (max-width: 480px) {
  .org-switcher-btn span.nm-long { display: none; }
}

/* Platform-admin "view as" banner - deliberately loud (amber/black), always pinned to the very
   top of the page above the app shell, so it is never mistaken for part of the member's own UI
   and can't be scrolled away while the admin is looking around on their behalf. */
.impersonation-banner {
  position: sticky; top: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 16px; background: #f59e0b; color: #1f1300; font-size: 13.5px; font-weight: 600;
  text-align: center;
}
.impersonation-banner .i { vertical-align: -3px; }
.impersonation-banner form { margin: 0; }

/* Floating action buttons (WhatsApp click-to-chat + the Ask ACBIZ popover) - see
   layouts/_floating_actions.php. Fixed to the viewport, not any scrolling container, and placed
   outside .app/.side/.main in the DOM so no ancestor's CSS transform can break position:fixed. */
.fab-stack {
  position: fixed; right: 20px; bottom: 20px; z-index: 450;
  display: flex; flex-direction: column; align-items: flex-end; gap: 14px;
}
.fab {
  width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,.22); transition: transform .15s ease, box-shadow .15s ease;
  text-decoration: none;
}
.fab:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0,0,0,.28); }
.fab .i { width: 26px; height: 26px; stroke-width: 1.9; }
.fab-whatsapp { background: #25d366; }
.fab-ask-acbiz { background: var(--brand, #1a56db); }
.fab-ask-acbiz.fab-active { background: var(--brand-hover, #1648c0); }

.fab-panel {
  width: 320px; max-width: calc(100vw - 40px); max-height: 440px;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,.25); overflow: hidden;
}
/* The panel is shown/hidden via the native `hidden` attribute (see _floating_actions.php's
   setOpen()), but .fab-panel's own `display: flex` above has the same specificity as the
   browser's built-in `[hidden]{display:none}` rule - and author CSS always wins over the
   user-agent default at equal specificity. Without this override, toggling `hidden` has no
   visual effect at all: the panel never closes (or, depending on load order, never starts
   hidden). This rule restores the attribute's effect. */
.fab-panel[hidden] { display: none; }
.fab-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 14px;
}
.fab-panel-log {
  flex: 1; min-height: 160px; max-height: 260px; overflow-y: auto;
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.fab-panel-log .askacbiz-msg { max-width: 88%; font-size: 13.5px; padding: 8px 12px; }
.fab-panel-form {
  display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border);
}
.fab-panel-form input {
  flex: 1; padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 13.5px;
}
.fab-panel-form .icon-btn {
  background: var(--brand, #1a56db); color: #fff; border-radius: var(--radius-sm);
  width: 38px; flex: none;
}
.fab-panel-foot {
  display: block; text-align: center; padding: 8px; font-size: 12.5px;
  color: var(--text-3); text-decoration: none; border-top: 1px solid var(--border);
}
.fab-panel-foot:hover { color: var(--brand); }

@media (max-width: 480px) {
  .fab-stack { right: 14px; bottom: 14px; gap: 10px; }
  .fab { width: 50px; height: 50px; }
  .fab-panel { width: calc(100vw - 28px); }
}


/* Dropdown menu anchored to the right edge of its trigger (e.g. topbar user menu,
   where the trigger sits at the far right and a left-anchored .menu would overflow
   off-screen). */
.menu-right { left: auto; right: 0; }
