/* ------------------------------------------------------------------ */
/* Booking Agent — page styles on top of jaseir-kit.css.               */
/* The chat + calendar app keeps its class names (script.js uses them) */
/* and takes its colours from the --agent-* variables (cyan).          */
/* ------------------------------------------------------------------ */

body {
  margin: 0;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  background: var(--jk-bg);
  color: var(--jk-ink);
  font-family: var(--jk-font);
  -webkit-font-smoothing: antialiased;
}

.dashboard {
  --blue: var(--agent-accent);
  --blue-d: var(--agent-accent-ink);
  --blue-l: var(--agent-accent-soft);
  --ink: var(--jk-ink);
  --muted: var(--jk-muted);
  --line: var(--jk-line);
  --green: #047857;
  --green-l: #ecfdf5;
}

.dashboard button {
  font-family: inherit;
  cursor: pointer;
}

.dashboard svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard button:focus-visible,
.dashboard input:focus-visible,
#lead-card button:focus-visible {
  outline: 2px solid var(--agent-accent);
  outline-offset: 2px;
}

/* ---------------- Hero illustration ---------------- */

.bk-hero-card {
  position: relative;
  max-width: 480px;
  margin-inline: auto;
}

.bk-hero-card .jk-card {
  overflow: hidden;
  box-shadow: var(--jk-shadow-lg);
}

.bk-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--jk-line);
  font-size: 14px;
}

.bk-hero-top span {
  color: var(--jk-muted);
  font-size: 13px;
}

.bk-hero-week {
  display: grid;
  gap: 8px;
  padding: 18px 20px;
  grid-template-columns: repeat(5, 1fr);
}

.bk-hero-col {
  display: grid;
  gap: 6px;
  text-align: center;
}

.bk-hero-col b {
  color: var(--jk-muted);
  font-size: 11.5px;
  font-weight: 650;
  text-transform: uppercase;
}

.bk-hero-col .t {
  padding: 8px 0;
  border: 1px solid var(--agent-accent-line);
  border-radius: 9px;
  background: var(--agent-accent-soft);
  color: var(--agent-accent-ink);
  font-size: 12.5px;
  font-style: normal;
  font-weight: 600;
}

.bk-hero-col .t.x {
  border-color: var(--jk-line);
  background: var(--jk-surface-2);
  color: #9aa3b8;
  text-decoration: line-through;
}

.bk-hero-col .t.on {
  border-color: var(--agent-accent);
  background: var(--agent-accent);
  color: #fff;
  box-shadow: 0 0 0 3px rgb(var(--agent-accent-rgb) / 0.18);
}

.bk-hero-chat {
  display: grid;
  gap: 8px;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--jk-line);
  background: var(--jk-surface-2);
  font-size: 14px;
}

.bk-hero-chat p {
  max-width: 85%;
  margin: 0;
  padding: 10px 14px;
  border-radius: 14px;
  line-height: 1.45;
}

.bk-hero-chat .u {
  justify-self: end;
  background: var(--agent-accent);
  color: #fff;
}

.bk-hero-chat .a {
  background: var(--jk-surface);
  color: var(--jk-ink);
  box-shadow: var(--jk-shadow-sm);
}

.bk-float {
  position: absolute;
  top: -16px;
  right: -12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 9px 14px;
  border-radius: 12px;
  background: var(--jk-ink);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--jk-shadow);
}

.bk-float svg {
  color: var(--agent-accent-bright);
}

@media (max-width: 639px) {
  .bk-float {
    right: 12px;
  }
}

/* ---------------- The app (chat + calendar) ---------------- */

.dashboard {
  display: grid;
  height: min(780px, calc(100vh - var(--jk-header-h) - 48px));
  min-height: 620px;
  overflow: hidden;
  border: 1px solid var(--jk-line);
  border-radius: var(--jk-radius-lg);
  background: #fff;
  grid-template-columns: minmax(0, 1fr) 380px;
  grid-template-rows: minmax(0, 1fr);
  box-shadow: var(--jk-shadow);
}

.orb {
  position: relative;
  flex: none;
  border-radius: 50%;
  background: var(--agent-gradient);
}

.orb::after {
  content: "";
  position: absolute;
  inset: 26% 18% 36% 18%;
  border-radius: 50%;
  background: linear-gradient(180deg, #ecfeff, #a5f3fc);
  opacity: 0.9;
}

.orb-lg {
  width: 52px;
  height: 52px;
}

.orb-sm {
  width: 36px;
  height: 36px;
}

.chat-col {
  display: flex;
  height: 100%;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  border-right: 1px solid var(--line);
}

.agent-head {
  display: flex;
  flex: none;
  align-items: center;
  gap: 14px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}

.agent-info h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.agent-info p {
  margin: 2px 0 0;
}

.online {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
  font-size: 13.5px;
  font-weight: 600;
}

.online i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.head-icons {
  display: flex;
  margin-left: auto;
  gap: 8px;
}

.icon-btn {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 11px;
  background: var(--jk-surface-2);
  color: var(--jk-body);
}

.icon-btn:hover {
  background: var(--blue-l);
  color: var(--blue);
}

#chat-area {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 24px;
  scroll-behavior: smooth;
}

.msg {
  display: flex;
  margin-bottom: 16px;
  align-items: flex-start;
  gap: 12px;
}

.msg.user {
  justify-content: flex-end;
}

.bubble {
  max-width: 520px;
  padding: 13px 17px;
  border-radius: 18px;
  background: var(--jk-surface-2);
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.msg.user .bubble {
  padding: 12px 18px;
  border-radius: 20px;
  background: var(--blue);
  color: #fff;
}

.user-av {
  display: grid;
  width: 36px;
  height: 36px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-l);
  color: var(--blue);
}

/* Step-by-step "thinking" indicator */
.bubble.thinking {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  white-space: normal;
}

.thinking span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #9aa3b8;
  font-size: 13.5px;
  font-weight: 550;
}

.thinking span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.thinking span.on {
  color: var(--agent-accent);
}

.thinking span.done {
  color: var(--jk-body);
}

@media (prefers-reduced-motion: no-preference) {
  .thinking span.on::before {
    animation: bk-pulse 1s ease-in-out infinite;
  }
}

@keyframes bk-pulse {
  50% {
    opacity: 0.35;
  }
}

/* Slot cards in chat */
.slots {
  display: flex;
  margin: 6px 0 20px;
  overflow-x: auto;
  gap: 12px;
  padding: 4px 2px 10px;
}

.slot-card {
  width: 168px;
  flex: none;
  padding: 16px 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  text-align: center;
  transition: 0.15s;
}

.slot-card.sel {
  border: 2px solid var(--blue);
  box-shadow: 0 6px 20px rgb(var(--agent-accent-rgb) / 0.16);
}

.slot-card h3 {
  margin: 0 0 2px;
  font-size: 16px;
}

.slot-card .d {
  color: var(--muted);
  font-size: 13.5px;
}

.slot-card .t {
  margin: 12px 0 14px;
  font-size: 18px;
  font-weight: 700;
}

.slot-card button {
  width: 100%;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: var(--blue-l);
  color: var(--blue-d);
  font-size: 14px;
  font-weight: 600;
}

.slot-card.sel button,
.slot-card button:hover {
  background: var(--blue);
  color: #fff;
}

/* Confirmation card */
.confirm {
  max-width: 640px;
  flex: 1;
  padding: 20px 22px;
  border: 1px solid var(--agent-accent-line);
  border-radius: 18px;
  background: var(--agent-accent-soft);
}

.confirm .top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tick {
  display: grid;
  width: 46px;
  height: 46px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
}

.tick svg {
  width: 24px;
  height: 24px;
  stroke-width: 3;
}

.confirm h3 {
  margin: 0;
  font-size: 18px;
}

.confirm .top p {
  margin: 2px 0 0;
  color: var(--jk-body);
}

.facts {
  display: grid;
  margin: 16px 0 14px;
  padding: 14px 16px;
  gap: 14px;
  border-radius: 14px;
  background: #fff;
  grid-template-columns: repeat(2, 1fr);
}

.fact {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--blue);
}

.fact div {
  color: var(--ink);
  font-size: 14px;
}

.fact b {
  display: block;
  font-weight: 650;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  height: 44px;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid var(--agent-accent-line);
  border-radius: 11px;
  background: #fff;
  color: var(--blue);
  font-size: 14px;
  font-weight: 600;
}

.btn.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.btn.primary:hover {
  background: var(--blue-d);
}

/* Input */
.input-row {
  display: flex;
  flex: none;
  gap: 10px;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--line);
}

.input-row input {
  height: 50px;
  flex: 1;
  min-width: 0;
  padding: 0 18px;
  border: 1px solid var(--jk-line-strong);
  border-radius: 14px;
  color: var(--jk-ink);
  font: inherit;
  font-size: 15px;
  outline: none;
}

.input-row input::placeholder {
  color: var(--jk-placeholder);
}

.input-row input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgb(var(--agent-accent-rgb) / 0.16);
}

.send {
  display: grid;
  width: 64px;
  height: 50px;
  place-items: center;
  border: 0;
  border-radius: 14px;
  background: var(--blue);
  color: #fff;
}

.send:hover {
  background: var(--blue-d);
}

/* Sidebar */
.side-col {
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  padding: 20px;
  background: #fff;
}

.row {
  display: flex;
  align-items: center;
}

.between {
  justify-content: space-between;
}

.side-col h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.cal-nav {
  display: flex;
  margin: 14px 0 10px;
  align-items: center;
  justify-content: space-between;
}

.nav-btn {
  width: 40px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: var(--jk-surface-2);
  color: var(--jk-body);
  font-size: 20px;
}

.nav-btn:hover {
  background: var(--blue-l);
}

.calendar {
  display: grid;
  row-gap: 6px;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
}

.calendar .dow {
  padding: 4px 0;
  color: var(--muted);
  font-size: 12px;
}

.day {
  position: relative;
  width: 36px;
  height: 36px;
  margin: auto;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink);
  font-size: 14px;
}

.day.out {
  color: #c3cad6;
}

.day.off {
  color: #a3acbd;
  cursor: default;
}

.day.has {
  background: var(--blue-l);
  color: var(--blue-d);
  font-weight: 650;
}

.day.has::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--blue);
}

.day.sel {
  background: var(--blue);
  color: #fff;
  font-weight: 700;
}

.day.sel::after {
  display: none;
}

.day.has:hover {
  background: var(--agent-accent-line);
}

.sel-date {
  font-size: 14px;
  font-weight: 550;
}

#slot-list {
  display: flex;
  margin-top: 12px;
  flex-direction: column;
  gap: 8px;
}

.slot-row {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--jk-ink);
  font-size: 15px;
  font-weight: 550;
  text-align: left;
}

.slot-row .dot {
  width: 18px;
  height: 18px;
  flex: none;
  border: 2px solid var(--jk-line-strong);
  border-radius: 50%;
}

.slot-row.sel {
  border-color: var(--blue);
  background: var(--blue-l);
}

.slot-row.sel .dot {
  border: 5px solid var(--blue);
}

.pill {
  margin-left: auto;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
}

.pill.av {
  background: var(--green-l);
  color: var(--green);
}

.slot-row.sel .pill.av {
  background: #fff;
  color: var(--blue-d);
}

.pill.bk {
  background: var(--jk-surface-2);
  color: var(--jk-muted);
}

.slot-row.booked {
  cursor: not-allowed;
  opacity: 0.8;
}

.empty {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}

/* More menu */
.menu-wrap {
  position: relative;
}

.menu {
  position: absolute;
  top: 48px;
  right: 0;
  z-index: 50;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--jk-shadow-lg);
}

.menu[hidden] {
  display: none;
}

.menu button {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--ink);
  font-size: 14px;
  text-align: left;
}

.menu button:hover {
  background: var(--blue-l);
  color: var(--blue-d);
}

.flash {
  animation: flash 1s ease;
}

@keyframes flash {
  0% {
    box-shadow: 0 0 0 0 rgb(var(--agent-accent-rgb) / 0.5);
  }
  100% {
    box-shadow: 0 0 0 14px rgb(var(--agent-accent-rgb) / 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .flash {
    animation: none;
  }
}

/* Lead card */
#lead-card {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 880;
  display: none;
  width: min(340px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid var(--jk-line);
  border-radius: 20px;
  background: #fff;
  color: var(--jk-ink);
  font-family: var(--jk-font);
  box-shadow: var(--jk-shadow-lg);
}

#lead-card h3 {
  margin: 0 0 6px;
  font-size: 17px;
}

#lead-card p {
  margin: 0;
  color: var(--jk-muted);
  line-height: 1.5;
}

#lead-card .lead-icon {
  display: inline-grid;
  width: 40px;
  height: 40px;
  margin-bottom: 10px;
  place-items: center;
  border-radius: 11px;
  background: var(--agent-accent-soft);
  color: var(--agent-accent);
}

#lead-form {
  display: flex;
  margin: 12px 0 4px;
  flex-direction: column;
  gap: 10px;
}

#lead-form[hidden] {
  display: none;
}

#lead-form input {
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--jk-line-strong);
  border-radius: 11px;
  font: inherit;
  outline: none;
}

#lead-form input:focus {
  border-color: var(--agent-accent);
  box-shadow: 0 0 0 3px rgb(var(--agent-accent-rgb) / 0.16);
}

.lead-msg {
  margin: 8px 0 12px !important;
  color: var(--jk-ink) !important;
  font-size: 14px;
}

#lead-card .close {
  position: absolute;
  top: 8px;
  right: 12px;
  border: 0;
  background: none;
  color: var(--jk-muted);
  font-size: 24px;
  cursor: pointer;
}

.demo-btn {
  width: 100%;
  padding: 13px;
  border: 0;
  border-radius: 12px;
  background: var(--agent-accent);
  color: #fff;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.demo-btn:hover {
  background: var(--agent-accent-ink);
}

.demo-btn:disabled {
  opacity: 0.6;
}

/* Responsive */
@media (max-width: 980px) {
  .dashboard {
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .chat-col {
    height: 78vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .side-col {
    height: auto;
  }

  .facts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 479px) {
  .agent-head {
    padding: 14px 16px;
  }

  .head-icons .icon-btn:not(:last-child) {
    display: none;
  }

  #chat-area {
    padding: 16px;
  }

  .input-row {
    padding: 12px;
  }
}
