/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* ── Brand tokens (Boards & More) ──
 * The values come from the design system's :root variables (design-system/tokens/tokens.css, loaded
 * by the layout as /design-system/tokens/variables.css, #166). The --bam-* names stay for the
 * stylesheets that already use them. */
:root {
  --bam-slate:  var(--bm-main);
  --bam-grey:   #91979B;
  --bam-light:  #ECECEC;
  --font-base:  var(--font-sans);

  /* Status colours: derived, not from the package (PM open, #165/#167). Variables only - nothing
     here applies them to an element. */
  --status-ok:    #2e7d32;
  --status-warn:  #8a5300;
  --status-error: #b3261e;
  --status-info:  var(--bm-main);
}

/* ── Foundation (#166) ──
 * Arial as the base font; tools that set their own (body:has(...)) win by specificity.
 * Keyboard focus: 2px in the brand colour, white on dark ground. :where() keeps the specificity
 * at zero, so a tool's own focus style still wins. */
body {
  font-family: var(--font-sans);
}

:where(:focus-visible) {
  outline: 2px solid var(--bm-main);
  outline-offset: 2px;
}

:where(.bm-on-dark, .bm-on-dark *):focus-visible {
  outline-color: var(--white);
}

/* A light panel inside a dark area (the top bar's dropdown) takes the brand colour back. */
:where(.bm-on-light, .bm-on-light *):focus-visible {
  outline-color: var(--bm-main);
}

/* ── Top bar: dark slate, square, full width, a white 3px bar marks the active item (#166) ──
 * The root is .app-nav, not .nav: the design system's type class .nav belongs to the package. The
 * children keep their nav__ names. */
.app-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--bm-main);
  color: var(--white);
  font-family: var(--font-sans);
}

.nav__bar {
  display: flex;
  align-items: stretch;
  padding: 0 var(--space-28);
  height: var(--header-height);
}

.nav__brand {
  position: relative;
  text-decoration: none;
  margin-right: var(--space-16);
  display: flex;
  align-items: center;
  gap: var(--space-16);
}

.nav__group-logo {
  height: 32px;
  width: auto;
  display: block;
}

.nav__brand-name {
  font-weight: 700;
  font-size: 20px;
  color: var(--white);
  letter-spacing: 0.4px;
  padding-left: var(--space-16);
  border-left: 1px solid var(--grey-400);
  line-height: 28px;
}

.nav__brand[data-deploy]::after {
  content: attr(data-deploy);
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--fill-primary);
  color: var(--white);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  white-space: nowrap;
  padding: 5px 9px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}

.nav__brand[data-deploy]:hover::after {
  opacity: 1;
}

.nav__menu {
  display: flex;
  align-items: stretch;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
}

.nav__menu > li {
  display: flex;
  align-items: stretch;
}

.nav__menu a {
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-bottom: var(--underline-bar) solid transparent;
  border-top: var(--underline-bar) solid transparent;
  color: var(--white);
  text-decoration: none;
  font-size: 15px;
  white-space: nowrap;
  transition: border-color 0.15s;
}

.nav__menu a:hover {
  border-bottom-color: var(--grey-400);
}

.nav__menu a.active {
  border-bottom-color: var(--white);
  font-weight: 700;
  color: var(--white);
}

/* Dropdown nav item */
.nav__dropdown {
  position: relative;
  align-self: stretch;
  display: flex;
  align-items: stretch;
}

.nav__dropdown-trigger {
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-top: var(--underline-bar) solid transparent;
  border-bottom: var(--underline-bar) solid transparent;
  color: var(--white);
  font-size: 15px;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
  background: none;
  transition: border-color 0.15s;
  user-select: none;
}

.nav__dropdown-trigger:hover,
.nav__dropdown--open .nav__dropdown-trigger {
  border-bottom-color: var(--grey-400);
}

.nav__menu a.nav__dropdown-trigger.active {
  border-bottom-color: var(--white);
}

.nav__dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  border: 1px solid var(--rule);
  padding: var(--space-8) 0;
  list-style: none;
  margin: 0;
  z-index: 200;
  min-width: 180px;
  color: var(--fill-primary);
}

.nav__dropdown--open .nav__dropdown-menu {
  display: flex;
  flex-direction: column;
}

.nav__menu .nav__dropdown-menu li a {
  display: block;
  padding: var(--space-8) var(--space-16);
  border: 0;
  border-left: var(--underline-bar) solid transparent;
  color: var(--fill-primary);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
  background: none;
}

.nav__menu .nav__dropdown-menu li a:hover {
  border-left-color: var(--bm-main);
  background: var(--grey-100);
}

.nav__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-self: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 4px;
  margin-right: var(--space-12);
}

.nav__burger span {
  display: block;
  height: 2px;
  background: var(--white);
  width: 100%;
}

/* Admin-only domain-world switch (CC / LEA / LUCAS). Sits at the right edge
   next to the user info; margin-left:auto pushes both to the right. */
.nav__world-switch {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2px;
  margin-right: var(--space-12);
}

.nav__world-link {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-decoration: none;
  color: var(--white);
  padding: 4px 6px;
  border-bottom: 2px solid transparent;
}

.nav__world-link:hover {
  border-bottom-color: var(--grey-400);
}

.nav__world-link--active {
  border-bottom-color: var(--white);
}

/* When the switch is present it grabs the auto margin; user-info then sits
   directly next to it instead of also being pushed. */
.nav__world-switch ~ .nav__user-info {
  margin-left: 0;
}

/* User info tooltip on logout */
.nav__user-info {
  margin-left: auto;
  position: relative;
  display: flex;
  align-items: center;
}

.nav__user-info a {
  margin-left: 0 !important;
}

.nav__user-info::after {
  content: attr(data-user);
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--fill-primary);
  color: var(--white);
  font-size: 12px;
  white-space: nowrap;
  padding: 6px 10px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}

.nav__user-info:hover::after {
  opacity: 1;
}

/* Help link + badge and Logout link.
   .nav__help-link is scoped under .nav__menu to beat `.nav__menu a` (0,1,1). */
.nav__menu a.nav__help-link {
  gap: 6px;
  color: var(--white);
  font-size: 14px;
}
.nav__help-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: var(--white);
  color: var(--bm-main);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
.nav__logout {
  padding: 6px 14px;
  border: 1px solid var(--white);
  color: var(--white);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.nav__logout:hover {
  background: var(--white);
  color: var(--bm-main);
}

/* Push page content below the fixed nav */
.main-content {
  padding-top: 96px;
}

/* Dashboard and portal tiles: square, flat, the brand colour (#166) */
.dashboard {
  max-width: 900px;
  margin: 48px auto;
  padding: 0 24px;
}

.dashboard__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-16);
}

.dashboard__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-12);
  padding: var(--space-32) 20px;
  background: var(--bm-main);
  border-bottom: var(--underline-bar) solid var(--bm-main);
  text-decoration: none;
  color: var(--white);
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}

.dashboard__card:hover {
  background: var(--fill-primary);
  border-bottom-color: var(--white);
}

.dashboard__card-icon img {
  display: block;
  width: 48px;
  height: 48px;
}

.dashboard__card-label {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.21px;
}

.dashboard__section {
  margin-top: 40px;
}

.dashboard__section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--grey-600);
  margin: 0 0 12px 4px;
  font-family: var(--font-sans);
}

/* Collapsible JSON tree */
.struct-dump-container { list-style: none; margin: 0; padding: 0 0 0 16px; font-family: monospace; font-size: 12px; line-height: 1.6; }
.struct-dump-container-root { padding-left: 0; }
.struct-dump-key strong { color: #333; }
.struct-dump-value { color: #555; word-break: break-all; }
.struct-dump-container li { margin: 1px 0; }
.cursor-pointer { cursor: pointer; }
.hidden { display: none; }

/* Mobile */
@media (max-width: 640px) {
  .nav__burger {
    display: flex;
  }

  .nav__menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bm-main);
    flex-direction: column;
    padding: var(--space-8) 0;
    gap: 0;
  }

  .nav__menu--open {
    display: flex;
  }

  .nav__menu a {
    padding: 10px var(--space-16);
    border-top: 0;
    border-bottom: 0;
    border-left: var(--underline-bar) solid transparent;
  }

  .nav__menu a.active {
    border-left-color: var(--white);
  }
}

/* JSON viewer toggle */
[data-controller="json-viewer"] { position: relative; }
.json-viewer-toggle {
  position: absolute; top: 0; right: 0;
  background: #f3f4f6; border: 1px solid #d1d5db; border-radius: 4px;
  padding: 1px 6px; font-size: 11px; cursor: pointer;
  color: #6b7280; font-family: monospace; line-height: 1.6;
}
.json-viewer-toggle:hover { background: #e5e7eb; color: #111; }
@import "demo_beach_deal.css";

/* ── Flash toasts ── */
@keyframes flash-in  { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes flash-out { from { opacity: 1; } to { opacity: 0; } }

/* On the B&M design system (#166): the login-alert shape — grey-100 ground, a 3px bar in the
   state colour, square, no shadow. The status colours are the derived --status-* tokens (PM open,
   #165/#167); the flash is their first consumer. State is carried by the bar, not the text, so the
   text keeps --fill-primary and stays AA on grey-100. */
.flash {
  position: fixed;
  top: 96px;
  right: var(--space-16);
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-12) var(--space-16);
  border-left: var(--underline-bar) solid var(--status-info);
  background: var(--grey-100);
  color: var(--fill-primary);
  font-size: 14px;
  font-family: var(--font-sans);
  min-width: 240px;
  max-width: 420px;
  animation: flash-in .2s ease;
}
.flash--notice { border-left-color: var(--status-ok); }
.flash--alert  { border-left-color: var(--status-error); }
.flash--hiding { animation: flash-out .3s ease forwards; }
.flash__close  {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: inherit;
  opacity: .6;
  padding: 0 2px;
}
.flash__close:hover { opacity: 1; }
@import "tools/prompt_rules.css";
@import "help.css";
@import "tools/lea_raw.css";
@import "tools/personal_agent.css";
@import "tools/raider_facts.css";
@import "tools/running_agents.css";
@import "tools/seo_text_drafting.css";
@import "tools/seo_text_drafts.css";
@import "tools/ticket_comparison.css";
@import "tools/tickets_analysis.css";
@import "tools/doc_mixer.css";
@import "tools/analyze_product_images.css";
@import "tools/gorgias_rendering.css";
@import "gorgias/hil.css";
@import "sessions.css";
