/* =========================================================
   Assistant Manager — dashboard chat (demo)
   Uses the dashboard's own variables from stylesheet.css so it
   follows the existing look. Everything is prefixed .am- to
   avoid touching any existing rule.
   ========================================================= */

.am-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 18px 0 14px;
  border: 0;
  border-radius: 24px;
  background: var(--blue);
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: background .15s ease, transform .15s ease;
}
.am-launcher:hover { background: var(--blue-dark); transform: translateY(-1px); }
.am-launcher:focus-visible,
.am-panel button:focus-visible,
.am-input:focus-visible { outline: 2px solid var(--blue-dark); outline-offset: 2px; }
.am-launcher svg { width: 20px; height: 20px; flex: none; }
.am-launcher[aria-expanded="true"] { display: none; }

.am-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 61;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  font-family: var(--font);
  color: var(--text);
  overflow: hidden;
}
.am-panel[hidden] { display: none; }

.am-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--blue);
  color: #fff;
}
.am-header-icon {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
}
.am-header-icon svg { width: 18px; height: 18px; }
.am-title { flex: 1; min-width: 0; }
.am-title strong { display: block; font-size: 15px; font-weight: 500; line-height: 1.2; }
.am-title span { display: block; font-size: 12px; line-height: 1.3; opacity: .85; }
.am-badge {
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 10px; background: rgba(255,255,255,.22);
}
.am-close {
  width: 32px; height: 32px; flex: none;
  border: 0; border-radius: 50%;
  background: transparent; color: #fff;
  font-size: 18px; line-height: 1; cursor: pointer;
}
.am-close:hover { background: rgba(255,255,255,.18); }

.am-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg);
}
.am-msg {
  max-width: 86%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.am-msg-bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--border-light); border-bottom-left-radius: 4px; }
.am-msg-user { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.am-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.am-action {
  border: 1px solid var(--border); border-radius: 16px;
  background: var(--surface); color: var(--blue-dark);
  font-family: var(--font); font-size: 12.5px; font-weight: 500;
  padding: 5px 12px; cursor: pointer; text-decoration: none;
}
.am-action:hover { background: var(--grey-bg); }

.am-typing { display: inline-flex; gap: 4px; align-items: center; height: 18px; }
.am-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: am-bounce 1s infinite ease-in-out; }
.am-typing i:nth-child(2) { animation-delay: .15s; }
.am-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes am-bounce { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.am-suggestions { display: flex; gap: 6px; padding: 10px 12px 0; overflow-x: auto; background: var(--surface); border-top: 1px solid var(--border-light); }
.am-suggestions .am-action { white-space: nowrap; flex: none; }

.am-form { display: flex; gap: 8px; padding: 12px; background: var(--surface); }
.am-input {
  flex: 1; min-width: 0; height: 40px;
  border: 1px solid var(--border); border-radius: 20px;
  padding: 0 14px; font-family: var(--font); font-size: 14px; color: var(--text); background: var(--surface);
}
.am-send {
  width: 40px; height: 40px; flex: none;
  border: 0; border-radius: 50%;
  background: var(--blue); color: #fff; cursor: pointer;
  display: grid; place-items: center;
}
.am-send:hover { background: var(--blue-dark); }
.am-send:disabled { opacity: .5; cursor: default; }
.am-send svg { width: 18px; height: 18px; }
.am-note { margin: 0; padding: 0 12px 10px; font-size: 11px; color: var(--muted); background: var(--surface); text-align: center; }

.am-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 520px) {
  .am-launcher { right: 16px; bottom: 16px; }
  .am-panel { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .am-launcher, .am-typing i { transition: none; animation: none; }
}
