/* Full Circle Business Command Dashboard */
:root {
  --bd-bg: #0a1210;
  --bd-panel: #111c18;
  --bd-panel-2: #15241f;
  --bd-border: rgba(105, 240, 174, 0.14);
  --bd-green: #00c853;
  --bd-green-dim: rgba(0, 200, 83, 0.12);
  --bd-text: #f3f7f5;
  --bd-muted: #9fb3aa;
  --bd-warn: #f59e0b;
  --bd-danger: #ef4444;
  --bd-radius: 16px;
  --bd-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --font-sans: "Source Sans 3", system-ui, -apple-system, Segoe UI, sans-serif;
  --font-serif: "Playfair Display", Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(0, 200, 83, 0.14), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(0, 120, 80, 0.12), transparent 50%),
    var(--bd-bg);
  color: var(--bd-text);
  font-family: var(--font-sans);
}

body.bd-page {
  padding-bottom: 48px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.bd-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(10, 18, 16, 0.88);
  border-bottom: 1px solid var(--bd-border);
}

.bd-header__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  justify-content: space-between;
}

.bd-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.bd-brand img {
  width: 52px;
  height: auto;
  border-radius: 10px;
  background: #fff;
  padding: 4px;
}

.bd-brand__text h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.bd-brand__text p {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--bd-muted);
}

.bd-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.bd-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--bd-border);
  background: var(--bd-panel);
  font-size: 0.8rem;
  color: var(--bd-muted);
  white-space: nowrap;
}

.bd-pill strong {
  color: var(--bd-text);
  font-weight: 700;
}

.bd-pill--ok {
  border-color: rgba(0, 200, 83, 0.35);
  color: #69f0ae;
}

.bd-pill--warn {
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.bd-pill--off {
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.bd-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(105, 240, 174, 0.12);
}

.bd-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px 20px 0;
}

.bd-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-bottom: 18px;
}

@media (max-width: 720px) {
  .bd-toolbar {
    grid-template-columns: 1fr;
  }
}

.bd-search {
  position: relative;
}

.bd-search input {
  width: 100%;
  padding: 14px 16px 14px 42px;
  border-radius: 14px;
  border: 1px solid var(--bd-border);
  background: var(--bd-panel);
  color: var(--bd-text);
  outline: none;
}

.bd-search input:focus {
  border-color: rgba(0, 200, 83, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 200, 83, 0.12);
}

.bd-search::before {
  content: "⌕";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--bd-muted);
  font-size: 1.1rem;
}

.bd-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--bd-border);
  background: var(--bd-panel);
  color: var(--bd-text);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.bd-btn:hover {
  border-color: rgba(0, 200, 83, 0.4);
  transform: translateY(-1px);
}

.bd-btn--green {
  background: linear-gradient(180deg, #00c853 0%, #009e3f 100%);
  border-color: transparent;
  color: #04140c;
}

.bd-btn--green:hover {
  filter: brightness(1.05);
}

.bd-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.bd-stat {
  padding: 14px 16px;
  border-radius: var(--bd-radius);
  border: 1px solid var(--bd-border);
  background: linear-gradient(180deg, var(--bd-panel-2), var(--bd-panel));
  box-shadow: var(--bd-shadow);
}

.bd-stat__label {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bd-muted);
}

.bd-stat__value {
  margin: 6px 0 0;
  font-size: 1.55rem;
  font-weight: 700;
  color: #69f0ae;
  line-height: 1.1;
}

.bd-stat__hint {
  margin: 4px 0 0;
  font-size: 0.75rem;
  color: var(--bd-muted);
}

.bd-section {
  --sec-accent: #00c853;
  --sec-soft: rgba(0, 200, 83, 0.1);
  --sec-mid: rgba(0, 200, 83, 0.18);
  --sec-border: rgba(0, 200, 83, 0.28);
  --sec-text: #69f0ae;
  margin-bottom: 28px;
  padding: 16px 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--sec-border);
  background:
    linear-gradient(165deg, var(--sec-soft) 0%, transparent 42%),
    rgba(12, 22, 18, 0.45);
}

.bd-section[hidden],
.bd-card[hidden] {
  display: none !important;
}

.bd-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--sec-border);
}

.bd-section__head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--sec-text);
}

.bd-section__head h2::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--sec-accent);
  box-shadow: 0 0 0 3px var(--sec-mid);
  vertical-align: middle;
  position: relative;
  top: -1px;
}

.bd-section__head p {
  margin: 0;
  color: var(--bd-muted);
  font-size: 0.88rem;
}

/* —— Section color palette (diverse hues on dark UI) —— */
.bd-section[data-section="favorites"] {
  /* Gold / amber — pins & stars */
  --sec-accent: #fbbf24;
  --sec-soft: rgba(251, 191, 36, 0.12);
  --sec-mid: rgba(251, 191, 36, 0.22);
  --sec-border: rgba(251, 191, 36, 0.4);
  --sec-text: #fcd34d;
}

.bd-section[data-section="command"] {
  /* FCIB green — HQ */
  --sec-accent: #00c853;
  --sec-soft: rgba(0, 200, 83, 0.12);
  --sec-mid: rgba(0, 200, 83, 0.22);
  --sec-border: rgba(0, 200, 83, 0.4);
  --sec-text: #69f0ae;
}

.bd-section[data-section="quoting"] {
  /* Sky blue — sales / quotes */
  --sec-accent: #38bdf8;
  --sec-soft: rgba(56, 189, 248, 0.12);
  --sec-mid: rgba(56, 189, 248, 0.22);
  --sec-border: rgba(56, 189, 248, 0.4);
  --sec-text: #7dd3fc;
}

.bd-section[data-section="comms"] {
  /* Violet — phone / chat / email */
  --sec-accent: #a78bfa;
  --sec-soft: rgba(167, 139, 250, 0.12);
  --sec-mid: rgba(167, 139, 250, 0.22);
  --sec-border: rgba(167, 139, 250, 0.4);
  --sec-text: #c4b5fd;
}

.bd-section[data-section="carriers"] {
  /* Coral / orange — markets */
  --sec-accent: #fb923c;
  --sec-soft: rgba(251, 146, 60, 0.12);
  --sec-mid: rgba(251, 146, 60, 0.22);
  --sec-border: rgba(251, 146, 60, 0.4);
  --sec-text: #fdba74;
}

.bd-section[data-section="ops"] {
  /* Teal — banking & ops */
  --sec-accent: #2dd4bf;
  --sec-soft: rgba(45, 212, 191, 0.11);
  --sec-mid: rgba(45, 212, 191, 0.2);
  --sec-border: rgba(45, 212, 191, 0.38);
  --sec-text: #5eead4;
}

.bd-section[data-section="marketing"] {
  /* Hot pink / magenta — ads & social */
  --sec-accent: #f472b6;
  --sec-soft: rgba(244, 114, 182, 0.12);
  --sec-mid: rgba(244, 114, 182, 0.22);
  --sec-border: rgba(244, 114, 182, 0.4);
  --sec-text: #f9a8d4;
}

.bd-section[data-section="automation"] {
  /* Indigo / blue-violet — integrations */
  --sec-accent: #818cf8;
  --sec-soft: rgba(129, 140, 248, 0.12);
  --sec-mid: rgba(129, 140, 248, 0.22);
  --sec-border: rgba(129, 140, 248, 0.4);
  --sec-text: #a5b4fc;
}

.bd-section[data-section="site"] {
  /* Slate / cool gray-blue — public pages */
  --sec-accent: #94a3b8;
  --sec-soft: rgba(148, 163, 184, 0.12);
  --sec-mid: rgba(148, 163, 184, 0.2);
  --sec-border: rgba(148, 163, 184, 0.36);
  --sec-text: #cbd5e1;
}

/* Cards inherit section green tint */
.bd-section .bd-card {
  border-color: var(--sec-border);
  background:
    linear-gradient(165deg, var(--sec-soft) 0%, transparent 55%),
    linear-gradient(165deg, rgba(21, 36, 31, 0.98), rgba(12, 22, 18, 0.98));
}

.bd-section .bd-card:hover {
  border-color: var(--sec-accent);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--sec-mid);
}

.bd-section .bd-card.is-active {
  border-color: var(--sec-accent);
  box-shadow: 0 0 0 2px var(--sec-mid);
}

.bd-section .bd-card__icon {
  background: var(--sec-soft);
  border-color: var(--sec-border);
  color: var(--sec-text);
}

.bd-section .bd-card__actions .bd-primary,
.bd-section .bd-card__actions a.bd-primary,
.bd-section .bd-card__actions button.bd-primary {
  background: linear-gradient(
    180deg,
    var(--sec-accent) 0%,
    color-mix(in srgb, var(--sec-accent) 72%, #0a0a0a) 100%
  );
  border-color: transparent;
  color: #0a0a0a;
}

/* Readable button text on lighter accents */
.bd-section[data-section="favorites"] .bd-primary,
.bd-section[data-section="quoting"] .bd-primary,
.bd-section[data-section="comms"] .bd-primary,
.bd-section[data-section="carriers"] .bd-primary,
.bd-section[data-section="marketing"] .bd-primary,
.bd-section[data-section="automation"] .bd-primary,
.bd-section[data-section="site"] .bd-primary {
  color: #0a0a0a;
}

.bd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.bd-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 148px;
  padding: 16px;
  border-radius: var(--bd-radius);
  border: 1px solid var(--bd-border);
  background: linear-gradient(165deg, rgba(21, 36, 31, 0.98), rgba(12, 22, 18, 0.98));
  box-shadow: var(--bd-shadow);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  user-select: none;
}

.bd-card:hover {
  transform: translateY(-2px);
}

.bd-card.is-active {
  /* accent from section vars when nested */
}

.bd-card__hint {
  margin: 0;
  font-size: 0.72rem;
  color: rgba(159, 179, 170, 0.85);
  line-height: 1.3;
}

/* —— 7" × 7" PiP screen (floating over the dashboard) —— */
.bd-pip {
  position: fixed;
  z-index: 9000;
  width: 7in;
  height: 7in;
  max-width: min(7in, calc(100vw - 24px));
  max-height: min(7in, calc(100vh - 24px));
  display: none;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  border: 1.5px solid rgba(0, 200, 83, 0.45);
  background: #0d1613;
  box-shadow:
    0 28px 64px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04);
}

.bd-pip.is-open {
  display: flex;
}

.bd-pip__titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: linear-gradient(180deg, #163028 0%, #0f1c18 100%);
  border-bottom: 1px solid rgba(0, 200, 83, 0.22);
  cursor: grab;
  flex-shrink: 0;
  touch-action: none;
}

.bd-pip__titlebar:active {
  cursor: grabbing;
}

.bd-pip__title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--bd-text);
}

.bd-pip__title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bd-pip__badge {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #69f0ae;
  border: 1px solid rgba(0, 200, 83, 0.35);
  background: rgba(0, 200, 83, 0.1);
}

.bd-pip__actions {
  display: flex;
  flex-shrink: 0;
  gap: 4px;
}

.bd-pip__actions button {
  width: 32px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--bd-text);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bd-pip__actions button:hover {
  background: rgba(0, 200, 83, 0.2);
}

.bd-pip__actions .bd-pip-close:hover {
  background: rgba(239, 68, 68, 0.35);
}

.bd-pip__body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: #fff;
}

.bd-pip__frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.bd-pip__fallback {
  display: none;
  position: absolute;
  inset: 0;
  padding: 20px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  background: rgba(10, 18, 16, 0.97);
  color: var(--bd-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.bd-pip__fallback.is-visible {
  display: flex;
}

.bd-pip__fallback strong {
  color: var(--bd-text);
}

.bd-pip__resize {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  opacity: 0.45;
  background:
    linear-gradient(135deg, transparent 50%, rgba(0, 200, 83, 0.7) 50%);
  border-radius: 2px;
}

.bd-pip.is-dragging {
  opacity: 0.96;
  user-select: none;
}

@media (max-width: 720px) {
  .bd-pip {
    width: min(7in, calc(100vw - 16px));
    height: min(7in, calc(100vh - 16px));
  }
}

.bd-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.bd-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bd-green-dim);
  border: 1px solid rgba(0, 200, 83, 0.22);
  font-size: 1.15rem;
  flex-shrink: 0;
}

.bd-card__fav {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--bd-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.bd-card__fav.is-on,
.bd-card__fav:hover {
  color: #fbbf24;
}

.bd-card h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.25;
}

.bd-card p {
  margin: 0;
  flex: 1;
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--bd-muted);
}

.bd-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bd-tag {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.05);
  color: var(--bd-muted);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.bd-tag--local {
  color: #69f0ae;
  border-color: rgba(0, 200, 83, 0.28);
  background: rgba(0, 200, 83, 0.08);
}

.bd-tag--external {
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.28);
  background: rgba(59, 130, 246, 0.08);
}

.bd-tag--admin {
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.08);
}

.bd-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.bd-card__actions a,
.bd-card__actions button {
  flex: 1 1 auto;
  min-width: 0;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--bd-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--bd-text);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.bd-card__actions a:hover,
.bd-card__actions button:hover {
  border-color: rgba(0, 200, 83, 0.45);
  background: rgba(0, 200, 83, 0.1);
}

.bd-card__actions .bd-primary {
  background: linear-gradient(180deg, rgba(0, 200, 83, 0.95), rgba(0, 140, 55, 0.95));
  border-color: transparent;
  color: #04140c;
}

.bd-empty {
  padding: 28px 18px;
  border-radius: var(--bd-radius);
  border: 1px dashed rgba(105, 240, 174, 0.25);
  color: var(--bd-muted);
  text-align: center;
}

.bd-footer {
  max-width: 1280px;
  margin: 28px auto 0;
  padding: 0 20px;
  color: var(--bd-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.bd-footer code {
  font-size: 0.78rem;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
}

.bd-banner {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
  color: #fde68a;
  font-size: 0.88rem;
  line-height: 1.45;
}

.bd-banner[hidden] {
  display: none !important;
}

.bd-banner a {
  color: #fff;
  text-decoration: underline;
}

@media (max-width: 560px) {
  .bd-brand__text h1 {
    font-size: 1.05rem;
  }

  .bd-card {
    min-height: 0;
  }
}
