﻿:root {
  --bg: #0f172a;
  --panel: #111827;
  --card: #1f2937;
  --text: #f3f4f6;
  --muted: #9ca3af;
  --accent: #22c55e;
  --danger: #ef4444;
  --border: #374151;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
}

.sidebar {
  width: 220px;
  min-height: 100vh;
  background: #020617;
  padding: 24px;
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
}

.sidebar h1 {
  font-size: 22px;
  margin-top: 0;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar a {
  color: var(--text);
  text-decoration: none;
  padding: 10px 12px;
  background: #111827;
  border-radius: 8px;
}

.content {
  flex: 1;
  padding: 28px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.card, .panel, .item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.card strong {
  display: block;
  font-size: 28px;
  margin-bottom: 6px;
}

.card span,
.muted {
  color: var(--muted);
}

.grid.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

form {
  display: grid;
  gap: 10px;
}

.toolbar {
  margin-bottom: 14px;
}

input, textarea, select, button {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}

textarea {
  min-height: 90px;
}

button {
  background: var(--accent);
  color: #052e16;
  font-weight: bold;
  cursor: pointer;
}

button.danger {
  background: var(--danger);
  color: white;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  border-bottom: 1px solid var(--border);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

pre {
  white-space: pre-wrap;
  background: #0b1220;
  padding: 12px;
  border-radius: 8px;
}

.item {
  margin-bottom: 12px;
}

.actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.link-btn {
  display: inline-block;
  padding: 8px 10px;
  border-radius: 8px;
  background: #0b1220;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border);
}

label {
  display: block;
  margin-top: 8px;
  margin-bottom: 6px;
  font-weight: bold;
}

@media (max-width: 900px) {
  body { display: block; }
  .sidebar { width: 100%; min-height: auto; position: relative; }
  .grid.two { grid-template-columns: 1fr; }
}

/* ===== PUBLIC ASSISTANT ===== */
.public-assistant-body {
  display: block;
  background:
    radial-gradient(circle at top, rgba(34,197,94,.12), transparent 30%),
    linear-gradient(180deg, #081122 0%, #0f172a 100%);
}

.assistant-public {
  min-height: 100vh;
  padding: 0;
}

.assistant-hero {
  padding: 56px 24px 20px;
}

.assistant-hero-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.assistant-badge {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(34,197,94,.14);
  color: #86efac;
  border: 1px solid rgba(34,197,94,.35);
  margin-bottom: 16px;
  font-size: 14px;
}

.assistant-hero h1 {
  margin: 0 0 12px 0;
  font-size: 42px;
  line-height: 1.05;
}

.assistant-hero p {
  max-width: 760px;
  color: #cbd5e1;
  font-size: 18px;
  line-height: 1.5;
  margin: 0 0 20px 0;
}

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

.quick-chip {
  width: auto;
  padding: 10px 14px;
  border-radius: 999px;
  background: #0b1220;
  color: #e5e7eb;
  border: 1px solid var(--border);
  cursor: pointer;
}

.quick-chip:hover {
  border-color: #22c55e;
}

.assistant-wrap {
  padding: 12px 24px 42px;
}

.assistant-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 20px;
}

.assistant-card {
  background: rgba(15, 23, 42, .9);
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  backdrop-filter: blur(8px);
}

.assistant-card h2 {
  margin-top: 0;
  margin-bottom: 8px;
}

.public-chat-box {
  height: 470px;
  overflow: auto;
  padding: 14px;
  background: #091120;
  border-radius: 14px;
  border: 1px solid var(--border);
  margin-bottom: 14px;
}

.chat-bubble {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  white-space: pre-wrap;
  line-height: 1.45;
  max-width: 88%;
}

.chat-bubble.assistant {
  background: #111827;
  border: 1px solid #1f2937;
}

.chat-bubble.user {
  background: #1f2937;
  border: 1px solid #334155;
  margin-left: auto;
}

.chat-input-wrap {
  display: grid;
  gap: 10px;
}

.assistant-cta-grid {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.assistant-link-btn {
  text-align: center;
  padding: 12px;
  background: #0b1220;
}

@media (max-width: 900px) {
  .assistant-hero h1 {
    font-size: 32px;
  }

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

  .assistant-wrap,
  .assistant-hero {
    padding-left: 16px;
    padding-right: 16px;
  }

  .chat-bubble {
    max-width: 100%;
  }
}

/* ===== PUBLIC ASSISTANT V3 ===== */
.public-assistant-body {
  display: block;
  background:
    radial-gradient(circle at 20% 0%, rgba(34,197,94,.12), transparent 28%),
    radial-gradient(circle at 80% 0%, rgba(59,130,246,.10), transparent 24%),
    linear-gradient(180deg, #081122 0%, #0f172a 100%);
  color: #f8fafc;
}

.assistant-public {
  min-height: 100vh;
}

.assistant-hero {
  padding: 64px 20px 22px;
}

.assistant-hero-inner {
  max-width: 1180px;
  margin: 0 auto;
}

.assistant-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 999px;
  background: rgba(34,197,94,.12);
  color: #86efac;
  border: 1px solid rgba(34,197,94,.34);
  margin-bottom: 16px;
  font-size: 14px;
  letter-spacing: .2px;
}

.assistant-hero h1 {
  margin: 0 0 12px 0;
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.02;
  max-width: 860px;
}

.assistant-hero p {
  max-width: 760px;
  color: #cbd5e1;
  font-size: 18px;
  line-height: 1.55;
  margin: 0 0 24px 0;
}

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

.quick-chip {
  width: auto;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .9);
  color: #e5e7eb;
  border: 1px solid rgba(148,163,184,.25);
  cursor: pointer;
  transition: .18s ease;
  font-weight: 600;
}

.quick-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(34,197,94,.65);
  box-shadow: 0 10px 24px rgba(34,197,94,.14);
}

.assistant-wrap {
  padding: 10px 20px 46px;
}

.assistant-grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  gap: 22px;
  align-items: start;
}

.assistant-card {
  background: rgba(15, 23, 42, .78);
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 22px 60px rgba(0,0,0,.28);
  backdrop-filter: blur(10px);
}

.assistant-chat-card {
  min-height: 690px;
}

.assistant-side-card {
  position: sticky;
  top: 18px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0 0 6px 0;
  font-size: 30px;
}

.mini-status {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(59,130,246,.12);
  color: #bfdbfe;
  border: 1px solid rgba(59,130,246,.28);
  font-size: 13px;
  white-space: nowrap;
}

.public-chat-box {
  height: 500px;
  overflow: auto;
  padding: 16px;
  background: linear-gradient(180deg, rgba(9,17,32,.98), rgba(10,18,32,.92));
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,.16);
  margin-bottom: 14px;
}

.chat-row {
  display: flex;
  margin-bottom: 12px;
}

.chat-row.assistant {
  justify-content: flex-start;
}

.chat-row.user {
  justify-content: flex-end;
}

.chat-bubble {
  padding: 12px 14px;
  border-radius: 18px;
  white-space: pre-wrap;
  line-height: 1.5;
  max-width: 84%;
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
}

.chat-bubble.assistant {
  background: #111827;
  border: 1px solid rgba(148,163,184,.14);
}

.chat-bubble.user {
  background: linear-gradient(180deg, #1f2937, #243244);
  border: 1px solid rgba(148,163,184,.2);
}

.chat-role {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: #93c5fd;
  margin-bottom: 5px;
  font-weight: 700;
}

.chat-input-wrap {
  display: grid;
  gap: 10px;
}

.assistant-card label {
  margin-top: 10px;
}

.assistant-cta-grid {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.assistant-link-btn {
  text-align: center;
  padding: 12px;
  background: #0b1220;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,.2);
}

.assistant-link-btn:hover {
  border-color: rgba(34,197,94,.55);
}

@media (max-width: 980px) {
  .assistant-grid {
    grid-template-columns: 1fr;
  }

  .assistant-side-card {
    position: relative;
    top: auto;
  }

  .section-head {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .assistant-hero {
    padding: 46px 16px 16px;
  }

  .assistant-wrap {
    padding: 8px 16px 30px;
  }

  .assistant-card {
    padding: 16px;
    border-radius: 18px;
  }

  .public-chat-box {
    height: 420px;
  }

  .chat-bubble {
    max-width: 100%;
  }

  .quick-actions {
    gap: 10px;
  }

  .quick-chip {
    width: 100%;
  }
}

/* ===== ASSISTANT CONVERSION V4 ===== */
.thinking-box {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(59,130,246,.10);
  border: 1px solid rgba(59,130,246,.22);
  color: #bfdbfe;
  font-size: 14px;
}

.smart-cta-box {
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(34,197,94,.08);
  border: 1px solid rgba(34,197,94,.22);
}

.smart-cta-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: #86efac;
  margin-bottom: 6px;
  font-weight: 700;
}

.smart-cta-text {
  color: #e5e7eb;
  line-height: 1.45;
}
