:root {
  --as-bg: #f5f7fa;
  --as-card: #ffffff;
  --as-sidebar: #ffffff;
  --as-border: #e5e9f0;
  --as-text: #181c32;
  --as-muted: #7e8299;
  --as-primary: #075cff;
  --as-primary-dark: #004ee8;
  --as-primary-soft: #eef4ff;
  --as-success: #19b866;
  --as-danger: #f1416c;
  --as-warning: #ffc700;
  --as-activity-conversations: #19b866;
  --as-activity-review: #f59e0b;
  --as-radius: 9px;
  --as-shadow: 0 1px 2px rgba(31,45,61,.025);
  --as-sidebar-width: 248px;
  --as-topbar-height: 58px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--as-text);
  background: var(--as-bg);
  font-family: Inter, Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font-family: inherit; }
.page { display: none; }
.page.active { display: block; }

/* Auth */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: #f7f9fc;
}
.auth-card { max-width: 470px; border-radius: 18px; }
.auth-logo { width: 210px; max-width: 78%; height: auto; }
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  background: #f2f4f7;
  border-radius: 12px;
}
.auth-tab {
  border: 0;
  border-radius: 9px;
  padding: 10px 12px;
  color: var(--as-muted);
  background: transparent;
  font-weight: 700;
}
.auth-tab.active { background: #fff; color: var(--as-primary); box-shadow: 0 2px 8px rgba(31,45,61,.08); }

/* Shell */
.app-shell { min-height: 100vh; }
.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--as-sidebar-width);
  display: flex;
  flex-direction: column;
  background: var(--as-sidebar);
  border-right: 1px solid var(--as-border);
  z-index: 1040;
}
.sidebar-brand {
  height: var(--as-topbar-height);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--as-border);
}
.sidebar-brand-link { border: 0; background: transparent; padding: 0; }
.sidebar-logo { width: 112px; max-height: 54px; height: auto; object-fit: contain; display: block; }
.sidebar-close { width: 36px; height: 36px; padding: 0; display: grid; place-items: center; }
.sidebar-nav { padding: 18px 14px; display: grid; gap: 4px; }
.sidebar-link {
  width: 100%;
  border: 0;
  background: transparent;
  color: #5e6278;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 9px;
  font-weight: 650;
  text-align: left;
  transition: background .15s ease, color .15s ease;
}
.sidebar-link svg { width: 19px; height: 19px; stroke-width: 2; }
.sidebar-link:hover { color: var(--as-primary); background: #f7f9fc; }
.sidebar-link.active { color: var(--as-primary); background: var(--as-primary-soft); }
.sidebar-link-muted { margin-top: 4px; }
.sidebar-footer { margin-top: auto; padding: 14px; border-top: 1px solid var(--as-border); }
.sidebar-user {
  width: 100%;
  border: 0;
  background: #f8f9fb;
  border-radius: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  margin-bottom: 6px;
  color: var(--as-text);
  text-align: left;
}
.sidebar-user-icon { width: 35px; height: 35px; border-radius: 9px; background: #fff; display: grid; place-items: center; color: var(--as-primary); }
.sidebar-user-icon svg { width: 19px; }
.sidebar-user-copy { min-width: 0; display: flex; flex-direction: column; }
.sidebar-user-copy strong { font-size: .84rem; }
.sidebar-user-copy small { color: var(--as-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 165px; }

.app-workspace { min-height: 100vh; margin-left: var(--as-sidebar-width); }
.app-topbar {
  position: sticky;
  top: 0;
  height: var(--as-topbar-height);
  display: flex;
  align-items: center;
  padding: 0 30px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--as-border);
  z-index: 1020;
}
.topbar-title { font-size: .95rem; font-weight: 700; color: #5e6278; }
.topbar-menu { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; margin-right: 8px; }
.app-main { max-width: 1580px; padding: 20px 24px 32px; }
.page-head { margin-bottom: 14px; }
.page-head h1 { margin: 0; font-size: 1.25rem; font-weight: 700; letter-spacing: -.018em; }

/* Bootstrap overrides */
.card {
  border: 1px solid var(--as-border) !important;
  border-radius: var(--as-radius);
  background: var(--as-card);
  box-shadow: var(--as-shadow);
  overflow: hidden;
}
.card-header { min-height: 50px; padding: 11px 15px; border-bottom: 1px solid var(--as-border); background: #fff !important; }
.card-body { padding: 16px; }
.card-title { font-size: .9rem; font-weight: 700; }
.form-card { max-width: 1100px; }
.account-form { max-width: 640px; }

.btn { border-radius: 8px; font-weight: 650; padding: .57rem .9rem; }
.btn:hover { transform: none; }
.btn-primary { background: var(--as-primary); border-color: var(--as-primary); box-shadow: none; }
.btn-primary:hover, .btn-primary:focus { background: var(--as-primary-dark); border-color: var(--as-primary-dark); }
.btn-light { background: #f5f7fa; border-color: #f5f7fa; color: #5e6278; }
.btn-light:hover { background: #eef1f5; border-color: #eef1f5; color: var(--as-text); }
.btn-outline-primary { color: var(--as-primary); border-color: #cddcff; }
.btn-outline-primary:hover { color: #fff; background: var(--as-primary); border-color: var(--as-primary); }
.btn-outline-secondary { color: #5e6278; border-color: #e1e4ea; }
.btn-outline-danger { color: var(--as-danger); border-color: #ffd8e2; }
.btn-icon, .nav-icon { width: 18px; height: 18px; }
.btn-icon-only { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; }
.btn-icon-only svg { width: 18px; }

.form-label { font-size: .84rem; font-weight: 650; color: #3f4254; margin-bottom: 7px; }
.form-control, .form-select {
  border: 1px solid #e4e6ef;
  border-radius: 8px;
  color: var(--as-text);
  background: #fff;
  padding: .68rem .82rem;
}
.form-control:focus, .form-select:focus { border-color: #9cbcff; box-shadow: 0 0 0 .2rem rgba(7,92,255,.08); }
.form-check-input:checked { background-color: var(--as-primary); border-color: var(--as-primary); }
.form-text, .text-muted { color: var(--as-muted) !important; }
.settings-panel { border: 1px solid var(--as-border); border-radius: 10px; background: #f8f9fb; padding: 18px; }

.table { --bs-table-bg: transparent; --bs-table-hover-bg: #fafbfc; }
.table thead th {
  color: #a1a5b7;
  font-size: .71rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .045em;
  background: #fbfcfd;
  border-color: var(--as-border);
  padding: 12px 16px;
}
.table tbody td { border-color: #eef1f5; padding: 10px 13px; font-size: .82rem; }
.table tbody tr:last-child td { border-bottom: 0; }

/* Stats */
.stat-card .card-body { min-height: 130px; }
.stat-top { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.stat-icon { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; color: var(--as-primary); background: var(--as-primary-soft); }
.stat-icon svg { width: 19px; height: 19px; }
.stat-label { color: var(--as-muted); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 2rem; line-height: 1; font-weight: 750; letter-spacing: -.05em; }
.badge { border-radius: 6px; font-weight: 650; }
.badge-soft, .text-bg-light { color: #5e6278 !important; background: #f3f5f8 !important; border: 0; }
.text-bg-primary { background: var(--as-primary) !important; }

/* Modals */
.modal-content { border: 1px solid var(--as-border); border-radius: 14px; box-shadow: 0 20px 60px rgba(31,45,61,.15); overflow: hidden; }
.modal-header, .modal-footer { border-color: var(--as-border); background: #fff; padding: 16px 20px; }
.modal-body { padding: 20px; }
.modal-title { font-weight: 700; font-size: 1rem; }
.dropdown-menu { border: 1px solid var(--as-border); border-radius: 10px; box-shadow: 0 10px 35px rgba(31,45,61,.12); padding: 6px; }
.dropdown-item { border-radius: 7px; padding: 8px 10px; font-size: .86rem; }
.toast { border: 1px solid var(--as-border); border-radius: 10px; box-shadow: var(--as-shadow); }

/* Chat + details */
.chat-transcript { background: #f8f9fb; border: 1px solid var(--as-border); border-radius: 10px; padding: 14px; max-height: 65vh; overflow-y: auto; }
.chat-row { display: flex; margin-bottom: 10px; }
.chat-row.visitor { justify-content: flex-end; }
.chat-row.agent { justify-content: flex-start; }
.chat-row.system { justify-content: center; }
.chat-message-wrap { max-width: 78%; }
.chat-row.system .chat-message-wrap { max-width: 92%; }
.chat-meta { font-size: .7rem; color: var(--as-muted); margin-bottom: 4px; }
.chat-row.visitor .chat-meta { text-align: right; }
.chat-bubble { padding: 10px 12px; border-radius: 10px; white-space: pre-wrap; line-height: 1.5; }
.chat-bubble.visitor { color: #fff; background: var(--as-primary); border-bottom-right-radius: 3px; }
.chat-bubble.agent { color: var(--as-text); background: #fff; border: 1px solid var(--as-border); border-bottom-left-radius: 3px; }
.chat-bubble.system { color: #7a5d00; background: #fff8dc; border: 1px solid #ffec9f; }

.visitor-name-cell strong { display: block; }
.visitor-muted { color: var(--as-muted); font-size: .78rem; }
.visitor-kpi, .crawler-kpi { height: 100%; border: 1px solid var(--as-border); border-radius: 10px; padding: 14px; background: #fff; }
.visitor-kpi-label, .crawler-kpi-label { color: var(--as-muted); font-size: .69rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.visitor-kpi-value, .crawler-kpi-value { font-size: 1.25rem; font-weight: 750; margin-top: 4px; }
.visitor-page-list { display: grid; gap: 8px; }
.visitor-page-item, .visitor-info-box { border: 1px solid var(--as-border); background: #fafbfc; border-radius: 9px; padding: 12px; }
.visitor-info-box { white-space: pre-wrap; }
.visitor-technical-list { display: grid; gap: 8px; }
.visitor-technical-list div { border-bottom: 1px solid var(--as-border); padding-bottom: 8px; }
.visitor-technical-list div:last-child { border-bottom: 0; }

.summary-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.summary-meta-item { display: inline-flex; align-items: center; gap: 6px; background: #f5f7fa; border-radius: 7px; padding: 7px 9px; color: #5e6278; font-size: .77rem; font-weight: 650; }
.summary-panel { border: 1px solid var(--as-border); background: #fff; border-radius: 10px; padding: 16px; }
.summary-panel-title { display: flex; align-items: center; gap: 7px; font-weight: 700; margin-bottom: 12px; }
.summary-highlights { display: grid; gap: 8px; margin: 0; padding-left: 18px; }
.summary-full-text { white-space: pre-wrap; line-height: 1.65; }

/* Knowledge */
.website-source-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.website-source-update { display: flex; align-items: center; gap: 6px; color: #5e6278; font-size: .78rem; font-weight: 600; }
.website-source-update .update-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--as-success); }
.website-progress-card { min-width: 250px; }
.website-progress-labels { display: flex; justify-content: space-between; gap: 12px; color: #5e6278; font-size: .76rem; font-weight: 650; }
.progress { background: #eef1f5; }
.progress-bar { background: var(--as-primary); }
.website-explorer-modal .modal-dialog { max-width: min(1500px, calc(100vw - 2rem)); }
.crawler-toolbar { border: 1px solid var(--as-border); border-radius: 10px; padding: 10px; background: #fff; }
.crawler-pages-shell { border: 1px solid var(--as-border); border-radius: 10px; overflow: hidden; background: #fff; }
.crawler-page-title { font-weight: 650; }
.crawler-page-url { max-width: 580px; color: var(--as-muted); font-size: .74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crawler-status-badge { display: inline-flex; border-radius: 6px; padding: 5px 7px; font-size: .71rem; font-weight: 650; }
.crawler-status-completed { color:#087b3d; background:#e8fff3; }
.crawler-status-pending { color:#8a6a00; background:#fff8d6; }
.crawler-status-processing { color:var(--as-primary); background:var(--as-primary-soft); }
.crawler-status-failed { color:#b3221c; background:#fff0ef; }
.crawler-status-ignored { color:#59627f; background:#f1f2f4; }
.crawler-detail-panel { min-height: 420px; white-space: pre-wrap; line-height: 1.65; color: #3f4254; background: #fafbfc; border: 1px solid var(--as-border); border-radius: 9px; padding: 14px; }
.crawler-detail-meta { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.crawler-detail-meta > div { border: 1px solid var(--as-border); background: #fafbfc; border-radius: 8px; padding: 10px; }
.crawler-empty { padding: 42px 12px; text-align: center; color: var(--as-muted); }
.integration-code { border-radius: 10px; background: #181c32; color: #f5f8fa; padding: 18px; overflow: auto; }

.sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 10px 0 35px rgba(31,45,61,.14); }
  body.sidebar-open .app-sidebar { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 1035; background: rgba(24,28,50,.28); }
  body.sidebar-open .sidebar-backdrop { display: block; }
  .app-workspace { margin-left: 0; }
  .app-topbar { padding: 0 16px; }
  .app-main { padding: 22px 16px 34px; }
}

@media (max-width: 767.98px) {
  .page-head { margin-bottom: 16px; }
  .page-head h1 { font-size: 1.3rem; }
  .card-body { padding: 16px; }
  .table tbody td, .table thead th { padding-left: 12px; padding-right: 12px; }
  .chat-message-wrap { max-width: 92%; }
  .crawler-detail-meta { grid-template-columns: 1fr; }
  .crawler-page-url { max-width: 260px; }
}


/* Actions full-screen workspace */
@media (min-width: 992px) {
  body.actions-mode {
    height: 100vh;
    overflow: hidden;
  }

  body.actions-mode .app-shell,
  body.actions-mode .app-workspace {
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
  }

  body.actions-mode .app-topbar {
    display: none;
  }

  body.actions-mode .app-main {
    height: 100vh;
    max-width: none;
    padding: 20px 26px;
    overflow: hidden;
  }

  body.actions-mode #page-actions.active {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }
}


/* =========================================================
   AskSimpli App V2 — compact extranet / Metronic direction
========================================================= */

body { font-size: 14px; }

.sidebar-brand {
  height: var(--as-topbar-height);
  padding: 0 15px;
}

.sidebar-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.sidebar-brand-mark {
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  background: #fff;
}

.sidebar-logo {
  width: 25px;
  height: 25px;
  object-fit: contain;
}

.sidebar-brand-name {
  color: #181c32;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -.02em;
  white-space: nowrap;
}

.sidebar-brand-name span { color: var(--as-primary); }

.sidebar-nav {
  padding: 14px 11px;
  gap: 2px;
}

.sidebar-section-label {
  padding: 8px 11px 6px;
  color: #a1a8b8;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sidebar-section-spaced { margin-top: 10px; }

.sidebar-link {
  min-height: 39px;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: .84rem;
  font-weight: 600;
}

.sidebar-link svg {
  width: 17px;
  height: 17px;
}

.sidebar-link.active {
  color: #2459d6;
  background: #edf3ff;
}

.sidebar-footer { padding: 10px; }

.sidebar-user {
  min-height: 46px;
  padding: 7px 8px;
  border-radius: 8px;
  background: #f8f9fb;
}

.sidebar-user-icon {
  width: 31px;
  height: 31px;
  border-radius: 7px;
}

.sidebar-user-copy strong { font-size: .79rem; }
.sidebar-user-copy small { font-size: .68rem; }

.sidebar-user-chevron {
  width: 14px;
  margin-left: auto;
  color: #b2b7c4;
}

.app-topbar { padding: 0 24px; }

.topbar-title {
  color: #353b4a;
  font-size: .86rem;
  font-weight: 700;
}

.topbar-status {
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid #e8edf3;
  border-radius: 6px;
  color: #6c7486;
  background: #fff;
  font-size: .7rem;
  font-weight: 650;
}

.topbar-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--as-success);
}

.btn {
  border-radius: 7px;
  font-size: .82rem;
}

.btn-sm { font-size: .75rem; }

.btn-icon-only {
  width: 34px;
  height: 34px;
}

.form-control,
.form-select {
  border-radius: 7px;
  padding: .56rem .7rem;
  font-size: .84rem;
}

.card-subtitle,
.page-subtitle {
  margin-top: 3px;
  color: #9299aa;
  font-size: .72rem;
  line-height: 1.35;
}

.modal-content {
  border-radius: 10px;
  box-shadow: 0 16px 46px rgba(31,45,61,.12);
}

/* Activity */
.activity-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.activity-head h1 {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 720;
  letter-spacing: -.02em;
}

.activity-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.activity-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--as-border);
  border-radius: var(--as-radius);
  background: #fff;
}

.activity-kpi {
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid var(--as-border);
}

.activity-kpi:last-child { border-right: 0; }

.activity-kpi span {
  display: block;
  overflow: hidden;
  margin-bottom: 5px;
  color: #858da0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.activity-kpi strong {
  color: #202534;
  font-size: 1.35rem;
  font-weight: 720;
  letter-spacing: -.035em;
}

.activity-kpi strong.activity-kpi-value-conversations { color: var(--as-activity-conversations); }
.activity-kpi strong.activity-kpi-value-review { color: var(--as-activity-review); }

.activity-kpi-action {
  appearance: none;
  width: 100%;
  border: 0;
  border-right: 1px solid var(--as-border);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease;
}

.activity-kpi-action:hover {
  background: #fffbf3;
}

.activity-kpi-action:focus-visible {
  position: relative;
  z-index: 2;
  outline: 0;
  box-shadow: inset 0 0 0 2px rgba(245,158,11,.35);
}

.activity-kpi-action .activity-kpi-action-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  color: #a86b00;
  font-size: .66rem;
  font-weight: 650;
  text-transform: none;
  letter-spacing: 0;
}

.activity-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 29px;
  padding: 4px 8px;
  border: 1px solid #f6d69b;
  border-radius: 7px;
  color: #9a6200;
  background: #fff9ed;
  font-size: .7rem;
  font-weight: 700;
}

.activity-filter-chip button {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #9a6200;
  background: transparent;
}

.activity-filter-chip button:hover { background: #ffedc9; }

.as-state-success {
  color: #0c7a42;
  background: #e9f9f0;
}

.activity-chart-card { margin-bottom: 14px; }

.activity-chart-wrap {
  position: relative;
  height: 275px;
}

.activity-intelligence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.insight-list { display: grid; }

.insight-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 14px;
  border-bottom: 1px solid #eef1f4;
}

.insight-row:last-child { border-bottom: 0; }

.insight-row-main { min-width: 0; }

.insight-row-title {
  overflow: hidden;
  color: #303646;
  font-size: .8rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.insight-row-sub {
  overflow: hidden;
  margin-top: 2px;
  color: #9299a8;
  font-size: .7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.insight-count {
  min-width: 28px;
  padding: 3px 6px;
  border-radius: 6px;
  color: #4569c9;
  background: #eff4ff;
  font-size: .7rem;
  font-weight: 750;
  text-align: center;
}

.insight-row-button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
}

.topic-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.topic-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid #e5eaf2;
  border-radius: 7px;
  color: #4d5668;
  background: #fafbfc;
  font-size: .72rem;
  font-weight: 600;
}

.topic-chip b {
  color: #8991a2;
  font-size: .65rem;
}

.activity-table-card { overflow: visible; }

.activity-table-head {
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

.activity-table-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.activity-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 7px;
  background: #f3f5f8;
}

.activity-tab {
  border: 0;
  border-radius: 5px;
  padding: 5px 9px;
  color: #7e8798;
  background: transparent;
  font-size: .72rem;
  font-weight: 650;
}

.activity-tab.active {
  color: #2e5dcc;
  background: #fff;
  box-shadow: 0 1px 2px rgba(31,45,61,.06);
}

.activity-search { width: 230px; }

.activity-search .input-group-text {
  border-color: #e4e8ef;
  background: #fff;
}

.activity-search svg { width: 15px; }

.activity-pagination-bar {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 13px;
  border-top: 1px solid var(--as-border);
}

.table .activity-primary {
  color: #2f3544;
  font-weight: 650;
}

.table .activity-secondary {
  max-width: 420px;
  overflow: hidden;
  margin-top: 2px;
  color: #8a92a2;
  font-size: .7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.as-state-badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 3px 7px;
  border-radius: 5px;
  font-size: .67rem;
  font-weight: 700;
}

.as-state-resolved { color: #176b49; background: #eaf8f1; }
.as-state-partial { color: #825e00; background: #fff7da; }
.as-state-unresolved { color: #a23838; background: #fff0f0; }
.as-state-unknown { color: #71798a; background: #f1f3f6; }
.as-state-opportunity { color: #305abf; background: #edf3ff; }

.page-item .page-link {
  min-width: 30px;
  border-color: #e4e8ef;
  color: #667085;
  font-size: .72rem;
  text-align: center;
}

.page-item.active .page-link {
  color: #fff;
  background: var(--as-primary);
  border-color: var(--as-primary);
}

/* Conversation + visiteur = drawers extranet */
.modal.as-side-modal .modal-dialog {
  width: min(620px, 96vw);
  max-width: 620px;
  min-height: 100%;
  margin: 0 0 0 auto;
}

.modal.as-side-modal .modal-content {
  min-height: 100vh;
  border-radius: 0;
  border-top: 0;
  border-bottom: 0;
  border-right: 0;
}

.modal.as-side-modal .modal-header { min-height: 58px; }
.modal.as-side-modal .modal-body { padding: 15px; }

.chat-transcript {
  max-height: calc(100vh - 150px);
  padding: 8px;
  border: 0;
  border-radius: 7px;
  background: #f7f8fa;
}

.chat-row { margin-bottom: 7px; }
.chat-meta { margin-bottom: 2px; font-size: .64rem; }

.chat-bubble {
  padding: 7px 9px;
  border-radius: 7px;
  line-height: 1.42;
  font-size: .8rem;
}

.chat-bubble.agent {
  border-color: #e7eaf0;
  background: #fff;
}

.chat-bubble.visitor {
  color: #304d94;
  border: 1px solid #dae5ff;
  background: #eef4ff;
}

.visitor-kpi {
  border-radius: 7px;
  padding: 9px;
}

.visitor-kpi-value { font-size: 1rem; }

@media (max-width: 1100px) {
  .activity-kpi-strip { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .activity-kpi:nth-child(2n) { border-right: 0; }
  .activity-kpi:nth-child(n+3) { border-top: 1px solid var(--as-border); }
  .activity-intelligence-grid { grid-template-columns: 1fr; }
}

@media (max-width: 767.98px) {
  .activity-head { flex-direction: column; }
  .activity-head-actions { width: 100%; justify-content: space-between; }

  .activity-kpi-strip { grid-template-columns: 1fr 1fr; }
  .activity-kpi { border-top: 1px solid var(--as-border); }
  .activity-kpi:nth-child(1), .activity-kpi:nth-child(2) { border-top: 0; }
  .activity-kpi:nth-child(2n) { border-right: 0; }

  .activity-table-tools { width: 100%; flex-wrap: wrap; }
  .activity-search { width: 100%; }
  .activity-chart-wrap { height: 220px; }
}

.activity-journey-card {
  grid-column: 1 / -1;
}
