/* =========================================================================
   ORDA Platform — styles
   ========================================================================= */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --border: #e5e9f2;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #94a3b8;
  --primary: #3b6ef6;
  --primary-dark: #2554d6;
  --violet: #8b5cf6;
  --teal: #0d9488;
  --green: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 16px rgba(15, 23, 42, .05);
  --sidebar-w: 248px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
.mono { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text-2); }
.muted { color: var(--muted); }
svg.lucide { width: 18px; height: 18px; flex: none; }

#app { display: flex; min-height: 100vh; }

/* ============ Sidebar ============ */
.sidebar {
  width: var(--sidebar-w);
  background: #0e1628;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 20px 16px;
}
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, #3b6ef6, #8b5cf6);
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 4px 14px rgba(59, 110, 246, .45);
}
.brand-name { display: block; font-weight: 800; font-size: 17px; letter-spacing: .12em; color: #fff; }
.brand-sub { font-size: 11px; color: #64748b; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 4px 12px; }
.nav-section { margin-bottom: 14px; }
.nav-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em;
  color: #56637d; padding: 8px 10px 6px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 9px;
  color: #9aa8c2; text-decoration: none; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(148, 163, 184, .1); color: #e2e8f0; }
.nav-item.active { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(59, 110, 246, .4); }
.nav-item.locked { opacity: .45; }
.nav-item .lock-ico { margin-left: auto; width: 13px; height: 13px; }

.sidebar-footer { padding: 14px; }
.env-badge {
  display: flex; gap: 10px; align-items: center;
  background: rgba(16, 185, 129, .1);
  border: 1px solid rgba(16, 185, 129, .25);
  border-radius: 10px; padding: 10px 12px;
}
.env-title { font-size: 12px; font-weight: 600; color: #6ee7b7; }
.env-sub { font-size: 10.5px; color: #56637d; }
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none;
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .5); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

/* ============ Main / topbar ============ */
.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.topbar-title h1 { font-size: 19px; font-weight: 700; }
.page-subtitle { font-size: 12px; color: var(--muted); margin-top: 1px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }

.role-switch {
  display: flex; background: #eef2f9; border-radius: 10px; padding: 3px; gap: 2px;
}
.role-switch button {
  display: flex; align-items: center; gap: 6px;
  border: 0; background: transparent; cursor: pointer;
  padding: 6px 12px; border-radius: 8px;
  font: 600 12.5px 'Inter'; color: var(--text-2);
  transition: all .15s;
}
.role-switch button svg { width: 14px; height: 14px; }
.role-switch button.active { background: #fff; color: var(--primary); box-shadow: 0 1px 4px rgba(15, 23, 42, .12); }

.icon-btn {
  position: relative;
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--border); background: #fff;
  display: grid; place-items: center; cursor: pointer; color: var(--text-2);
  transition: all .15s;
}
.icon-btn:hover { border-color: #c7d2e8; color: var(--text); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn.sm svg { width: 14px; height: 14px; }
.icon-btn.danger { color: var(--red); }
.icon-btn.danger:hover { background: #fef2f2; border-color: #fecaca; }
.icon-btn:disabled { opacity: .4; cursor: default; }
.notif-dot {
  position: absolute; top: 7px; right: 8px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red); border: 1.5px solid #fff;
}

.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #3b6ef6, #8b5cf6);
  color: #fff; font-weight: 700; font-size: 13px;
  display: grid; place-items: center; flex: none;
}
.avatar.sm { width: 28px; height: 28px; font-size: 10.5px; }
.user-name { display: block; font-weight: 600; font-size: 13px; }
.user-role { font-size: 11px; color: var(--muted); }
.mobile-menu { display: none; }

/* ============ Content & cards ============ */
.content { padding: 24px 28px 48px; display: flex; flex-direction: column; gap: 20px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.card-head h3 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-head h3 svg { color: var(--primary); }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

.chip {
  font-size: 11px; font-weight: 600; color: var(--text-2);
  background: #eef2f9; border-radius: 999px; padding: 4px 10px;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip.green { background: #ecfdf5; color: #059669; }
.chip.xs { font-size: 10.5px; padding: 3px 8px; }
.chip .brand-icon { width: 18px; height: 18px; display: inline-block; vertical-align: middle; filter: none; }

.banner {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 16px; border-radius: 12px;
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
  font-size: 13px; line-height: 1.5;
}
.banner svg { flex: none; margin-top: 1px; }
.banner.blue { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.banner.violet { background: #f5f3ff; border-color: #ddd6fe; color: #6d28d9; }

/* ============ Grids ============ */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 1.4fr; gap: 20px; align-items: start; }

/* ============ KPI cards ============ */
.kpi { display: flex; gap: 14px; align-items: flex-start; }
.kpi-ico {
  width: 44px; height: 44px; border-radius: 12px; flex: none;
  background: #eff4ff; color: var(--primary);
  display: grid; place-items: center;
}
.kpi-ico svg { width: 21px; height: 21px; }
.kpi-ico.teal { background: #f0fdfa; color: var(--teal); }
.kpi-ico.violet { background: #f5f3ff; color: var(--violet); }
.kpi-label { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi-value { display: block; font-size: 22px; font-weight: 800; margin: 3px 0 4px; letter-spacing: -.01em; }
.kpi-delta { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; }
.kpi-delta svg { width: 14px; height: 14px; }
.kpi-delta.up { color: var(--green); }
.kpi-delta.down { color: var(--red); }
.kpi-delta em { font-style: normal; color: var(--muted); font-weight: 500; }

.mini-kpi { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.mini-kpi svg { color: var(--primary); }
.mini-kpi b { display: block; font-size: 16px; }
.mini-kpi small { color: var(--muted); }
.crm-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ============ Charts ============ */
.chart-box { height: 280px; position: relative; }
.chart-box.donut { height: 280px; }

/* ============ Funnel ============ */
.funnel { display: flex; flex-direction: column; gap: 14px; padding-top: 4px; }
.funnel-row { display: flex; align-items: center; gap: 10px; }
.funnel-stage { width: 96px; font-size: 12px; color: var(--text-2); font-weight: 500; flex: none; }
.funnel-stage.wide { width: 148px; }
.funnel-track { flex: 1; height: 22px; background: #f1f5f9; border-radius: 6px; overflow: hidden; }
.funnel-bar { height: 100%; border-radius: 6px; background: var(--primary); transition: width .6s ease; }
.funnel-bar.f0 { background: #3b6ef6; } .funnel-bar.f1 { background: #5a7ef6; }
.funnel-bar.f2 { background: #7b8ef7; } .funnel-bar.f3 { background: #9d9ef8; }
.funnel-bar.f4 { background: #10b981; }
.funnel-bar.violet { background: var(--violet); }
.funnel-val { width: 44px; text-align: right; font-weight: 700; font-size: 13px; flex: none; }

/* ============ Tables ============ */
.table-wrap { overflow-x: auto; margin: 0 -20px -20px; padding: 0 20px 20px; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 600; padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
td { padding: 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; font-size: 13px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fafc; }
.row-muted { opacity: .55; }
.td-actions { white-space: nowrap; }
.td-actions .icon-btn { display: inline-grid; vertical-align: middle; }
.td-actions .icon-btn + .icon-btn { margin-left: 6px; }
.cell-person { display: flex; align-items: center; gap: 10px; }

/* ============ Status badges ============ */
.status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 4px 10px;
  text-transform: capitalize;
}
.s-success, .s-confirmed { background: #ecfdf5; color: #059669; }
.s-pending { background: #fffbeb; color: #b45309; }
.s-updated { background: #eff6ff; color: #1d4ed8; }
.s-refunded { background: #fef2f2; color: #dc2626; }
.s-running { background: #eff6ff; color: #1d4ed8; }
.s-demo { background: #f1f5f9; color: #64748b; }
.spin {
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid #bfdbfe; border-top-color: #1d4ed8;
  animation: rot .8s linear infinite; display: inline-block;
}
@keyframes rot { to { transform: rotate(360deg); } }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); background: #fff; color: var(--text);
  font: 600 13px 'Inter'; padding: 9px 16px; border-radius: 10px; cursor: pointer;
  transition: all .15s;
}
.btn:hover { border-color: #c7d2e8; }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(59, 110, 246, .35); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { background: #94a3b8; border-color: #94a3b8; box-shadow: none; cursor: default; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; }

/* ============ Access denied ============ */
.denied { text-align: center; padding: 64px 24px; max-width: 520px; margin: 48px auto; }
.denied-ico {
  width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 18px;
  background: #fef2f2; color: var(--red); display: grid; place-items: center;
}
.denied-ico svg { width: 30px; height: 30px; }
.denied h2 { margin-bottom: 10px; }
.denied p { color: var(--text-2); line-height: 1.6; margin-bottom: 22px; }
.denied .btn { margin: 0 auto; }

/* ============ DWH architecture ============ */
.arch {
  display: grid;
  grid-template-columns: 1.15fr auto 1.3fr auto 1fr;
  gap: 14px;
  align-items: center;
  padding: 8px 0;
}
.arch-col { display: flex; flex-direction: column; gap: 12px; }
.arch-col-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted);
}
.arch-col-title svg { width: 14px; height: 14px; }

.arch-node {
  border: 1px solid var(--border); border-radius: 12px;
  background: #fbfcfe; padding: 14px;
}
.arch-node.vps { border-color: #c7d7fb; background: linear-gradient(180deg, #f6f9ff, #fff); }
.arch-node.vps.external { border-color: #fcd9a8; background: linear-gradient(180deg, #fffaf2, #fff); }
.arch-node.dwh-node { border-color: #99e6dc; background: linear-gradient(180deg, #f2fbfa, #fff); }
.arch-node-head { display: flex; align-items: center; gap: 11px; }
.arch-node-head b { display: block; font-size: 13.5px; }
.arch-node-head small { color: var(--muted); font-size: 11px; }
.arch-node-head .status { margin-left: auto; }

.srv-icon {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
}
.srv-icon.blue { background: #e5edff; color: var(--primary); }
.srv-icon.teal { background: #ccf3ee; color: var(--teal); }
.srv-icon.orange { background: #ffedd5; color: #ea580c; }
.srv-icon.violet { background: #ede9fe; color: var(--violet); }

.arch-sub { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.arch-service {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px;
}
.arch-service b { display: block; font-size: 12.5px; }
.arch-service small { color: var(--muted); font-size: 11px; }
.brand-badge {
  width: 32px; height: 32px; border-radius: 8px; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 11px; color: #fff;
}
.brand-badge.bitrix { background: #2fc7f7; }
.brand-badge.booking { background: var(--primary); }
.brand-badge svg { width: 16px; height: 16px; }

/* Realistic brand / service icons */
.brand-icon {
  width: 38px; height: 38px; flex: none; display: block;
  filter: drop-shadow(0 2px 6px rgba(15, 23, 42, .12));
}
.brand-icon svg { width: 100%; height: 100%; display: block; }
.brand-icon.sm { width: 32px; height: 32px; }
.brand-icon.lg { width: 48px; height: 48px; }

.integration-row .brand-icon { width: 36px; height: 36px; }
.arch-service .brand-icon { width: 36px; height: 36px; }

/* Service catalog cards */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.service-card {
  border: 1px solid var(--border); border-radius: 12px; padding: 16px;
  background: linear-gradient(180deg, #fbfcfe, #fff);
  display: flex; flex-direction: column; gap: 10px;
  transition: transform .15s, box-shadow .15s;
}
.service-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15, 23, 42, .08); }
.service-card-head { display: flex; align-items: center; gap: 12px; }
.service-card-head b { font-size: 14px; }
.service-card-head small { color: var(--muted); font-size: 11.5px; }
.service-price { font-weight: 800; font-size: 15px; color: var(--primary); }
.service-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.service-meta .chip { font-size: 10.5px; }

/* Data flow legend */
.flow-legend {
  display: flex; gap: 20px; flex-wrap: wrap; margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--border); font-size: 12px; color: var(--text-2);
}
.flow-legend span { display: inline-flex; align-items: center; gap: 7px; }
.flow-swatch { width: 28px; height: 3px; border-radius: 2px; }
.flow-swatch.api { background: var(--primary); }
.flow-swatch.etl { background: repeating-linear-gradient(90deg, var(--teal) 0 4px, transparent 4px 8px); }
.flow-swatch.sql { background: var(--violet); }

/* Portfolio footer strip */
.demo-footer {
  text-align: center; padding: 20px; color: var(--muted); font-size: 12px;
  border-top: 1px solid var(--border); margin-top: 8px;
}

.dwh-layers { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.dwh-layer {
  display: flex; gap: 10px; align-items: center;
  background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px;
}
.dwh-layer svg { color: var(--teal); width: 16px; height: 16px; flex: none; }
.dwh-layer b { display: block; font-size: 12.5px; }
.dwh-layer small { color: var(--muted); font-size: 11px; line-height: 1.4; }

.arch-node.consumer { display: flex; align-items: center; gap: 11px; }
.arch-node.consumer b { display: block; font-size: 12.5px; }
.arch-node.consumer small { color: var(--muted); font-size: 11px; }

.arch-flow { display: flex; flex-direction: column; gap: 22px; min-width: 110px; }
.flow-line { display: flex; flex-direction: column; gap: 5px; }
.flow-label { font-size: 10px; color: var(--muted); font-weight: 600; text-align: center; white-space: nowrap; }
.flow-track {
  position: relative; height: 3px; border-radius: 3px;
  background: repeating-linear-gradient(90deg, #c7d2e8 0 6px, transparent 6px 12px);
  overflow: visible;
}
.flow-dot {
  position: absolute; top: -2.5px; left: 0;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary); box-shadow: 0 0 6px rgba(59, 110, 246, .6);
  animation: flow 2.6s linear infinite;
}
.flow-dot.d2 { animation-delay: 1.3s; background: var(--teal); box-shadow: 0 0 6px rgba(13, 148, 136, .6); }
@keyframes flow {
  0% { left: 0; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { left: calc(100% - 8px); opacity: 0; }
}

.etl-node {
  border: 1.5px dashed #b6c6ea; border-radius: 12px;
  padding: 14px 12px; text-align: center;
  background: #f8faff;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.etl-node svg { color: var(--primary); width: 20px; height: 20px; }
.etl-node b { font-size: 12.5px; }
.etl-node small { font-size: 10.5px; color: var(--muted); line-height: 1.45; }

/* ============ Kanban (CRM) ============ */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; align-items: start; }
.kanban-col {
  background: #eef1f7; border-radius: var(--radius); padding: 10px;
  display: flex; flex-direction: column; gap: 10px;
}
.kanban-head {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; font-size: 13px; padding: 6px 8px 4px;
  border-top: 3px solid transparent; border-radius: 4px;
}
.kanban-head.blue { border-color: var(--primary); }
.kanban-head.violet { border-color: var(--violet); }
.kanban-head.amber { border-color: var(--amber); }
.kanban-head.green { border-color: var(--green); }
.kanban-meta { font-size: 11px; color: var(--muted); font-weight: 600; }

.deal-card {
  background: #fff; border: 1px solid var(--border); border-radius: 11px;
  padding: 12px; box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
  display: flex; flex-direction: column; gap: 6px;
  transition: transform .15s, box-shadow .15s; cursor: default;
}
.deal-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(15, 23, 42, .1); }
.deal-top { display: flex; justify-content: space-between; align-items: center; }
.deal-age { font-size: 10.5px; color: var(--muted); background: #f1f5f9; border-radius: 6px; padding: 2px 6px; }
.deal-company { font-size: 13px; }
.deal-contact { display: flex; align-items: center; gap: 5px; color: var(--text-2); font-size: 11.5px; }
.deal-contact svg { width: 12px; height: 12px; }
.deal-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 2px; }
.deal-amount { font-weight: 700; font-size: 13px; color: var(--primary); }
.deal-source { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10.5px; }
.deal-source svg { width: 11px; height: 11px; }

/* ============ AI Agent chat ============ */
.agent-grid { align-items: start; }
.chat-card { display: flex; flex-direction: column; }
.chat-window {
  height: 380px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
  padding: 6px 2px 14px;
}
.msg { display: flex; gap: 10px; align-items: flex-end; max-width: 85%; }
.msg.user { align-self: flex-end; flex-direction: row; }
.msg .bubble {
  padding: 11px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.55;
}
.msg.bot .bubble { background: #f1f5f9; border-bottom-left-radius: 4px; color: var(--text); }
.msg.user .bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.bot-av { background: linear-gradient(135deg, #8b5cf6, #6366f1); width: 32px; height: 32px; }
.bot-av svg { width: 16px; height: 16px; }
.msg.user .avatar { width: 32px; height: 32px; font-size: 11px; }

.typing { display: inline-flex; gap: 4px; padding: 3px 2px; }
.typing span {
  width: 7px; height: 7px; border-radius: 50%; background: #94a3b8;
  animation: blink 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

.chat-input { display: flex; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.chat-input input {
  flex: 1; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; font: 400 13.5px 'Inter'; outline: none;
  transition: border-color .15s;
}
.chat-input input:focus { border-color: var(--primary); }
.chat-suggest { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 12px; }
.chat-suggest button {
  border: 1px solid var(--border); background: #fff; border-radius: 999px;
  padding: 6px 13px; font: 500 12px 'Inter'; color: var(--text-2); cursor: pointer;
  transition: all .15s;
}
.chat-suggest button:hover { border-color: var(--primary); color: var(--primary); }

.agent-note { display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); line-height: 1.5; }
.agent-note svg { color: var(--teal); flex: none; margin-top: 1px; }

/* ============ Calendar ============ */
.cal-head { margin-bottom: 10px; }
.cal-nav { display: flex; align-items: center; gap: 12px; }
.cal-nav h3 { min-width: 150px; text-align: center; }
.cal-legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.dot.confirmed { background: var(--green); }
.dot.pending { background: var(--amber); }
.dot.updated { background: var(--primary); }
.dot.refunded { background: var(--red); }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-week { margin-bottom: 6px; }
.cal-wd { text-align: center; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; padding: 4px 0; }
.cal-cell {
  min-height: 92px; border: 1px solid var(--border); border-radius: 10px;
  padding: 6px; background: #fbfcfe;
  display: flex; flex-direction: column; gap: 4px; overflow: hidden;
}
.cal-cell.empty { border: 0; background: transparent; }
.cal-cell.today { border-color: var(--primary); background: #f0f5ff; box-shadow: inset 0 0 0 1px var(--primary); }
.cal-day { font-size: 12px; font-weight: 700; color: var(--text-2); }
.cal-cell.today .cal-day { color: var(--primary); }
.cal-event {
  font-size: 10.5px; font-weight: 600; border-radius: 6px; padding: 3px 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default;
}
.ev-time { opacity: .75; font-weight: 500; }
.ev-confirmed { background: #d1fae5; color: #047857; }
.ev-pending { background: #fef3c7; color: #92400e; }
.ev-updated { background: #dbeafe; color: #1d4ed8; }
.ev-refunded { background: #fee2e2; color: #b91c1c; text-decoration: line-through; }

/* ============ Ratings ============ */
.rank {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-grid; place-items: center;
  font-weight: 800; font-size: 12.5px;
  background: #f1f5f9; color: var(--text-2);
}
.rank.gold { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; box-shadow: 0 3px 8px rgba(245, 158, 11, .4); }
.rank.silver { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #fff; }
.rank.bronze { background: linear-gradient(135deg, #d6a06b, #b98150); color: #fff; }

.score-cell { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.score-track { flex: 1; height: 8px; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.score-bar { height: 100%; border-radius: 999px; }
.score-bar.green { background: var(--green); }
.score-bar.blue { background: var(--primary); }
.score-bar.amber { background: var(--amber); }
.bonus { color: var(--green); }
.bonus-total { display: block; font-size: 20px; color: var(--green); }
.ratings-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 18px; margin-top: 4px; border-top: 1px solid var(--border);
  gap: 16px; flex-wrap: wrap;
}

/* ============ Settings & logs ============ */
.integrations, .access-list { display: flex; flex-direction: column; }
.integration-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 2px; border-bottom: 1px solid #f1f5f9;
}
.integration-row:last-child { border-bottom: 0; }
.log-body { flex: 1; min-width: 0; }
.log-body b { display: block; font-size: 13px; }
.log-body small { display: block; }

.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0; border-radius: 999px;
  background: #cbd5e1; transition: .2s; cursor: pointer;
}
.switch span::before {
  content: ''; position: absolute; width: 16px; height: 16px;
  left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::before { transform: translateX(18px); }

.log-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  border: 1px solid var(--border); background: #fff; border-radius: 999px;
  padding: 5px 12px; font: 600 11.5px 'Inter'; color: var(--text-2);
  cursor: pointer; text-transform: capitalize; transition: all .15s;
}
.pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.log-list { display: flex; flex-direction: column; max-height: 560px; overflow-y: auto; }
.log-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 2px; border-bottom: 1px solid #f1f5f9;
}
.log-row:last-child { border-bottom: 0; }
.log-ico {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
}
.log-ico svg { width: 16px; height: 16px; }
.log-ico.blue { background: #eff4ff; color: var(--primary); }
.log-ico.red { background: #fef2f2; color: var(--red); }
.log-ico.teal { background: #f0fdfa; color: var(--teal); }
.log-ico.violet { background: #f5f3ff; color: var(--violet); }
.log-action { display: block; font-size: 13px; line-height: 1.45; }
.log-row .chip { margin-top: 4px; }

/* ============ Modal ============ */
.modal-overlay[hidden] { display: none; }
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 23, 42, .45); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px;
}
.modal {
  background: #fff; border-radius: 18px; padding: 28px;
  width: 100%; max-width: 440px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .25);
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { transform: translateY(12px) scale(.97); opacity: 0; } }
.modal-ico {
  width: 52px; height: 52px; border-radius: 14px; margin-bottom: 14px;
  display: grid; place-items: center;
}
.modal-ico.danger { background: #fef2f2; color: var(--red); }
.modal-ico svg { width: 24px; height: 24px; }
.modal h3 { font-size: 17px; margin-bottom: 8px; }
.modal-text { color: var(--text-2); line-height: 1.6; margin-bottom: 16px; font-size: 13.5px; }
.modal-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid #f1f5f9; font-size: 13px;
}
.modal-row span { color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ============ Toasts ============ */
.toast-stack {
  position: fixed; bottom: 22px; right: 22px; z-index: 120;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: #0e1628; color: #e2e8f0;
  border-radius: 12px; padding: 13px 18px;
  font-size: 13px; font-weight: 500; max-width: 380px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .3);
  transform: translateX(24px); opacity: 0; transition: all .3s ease;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast.success svg { color: var(--green); }
.toast.info svg { color: #60a5fa; }
.toast svg { flex: none; }

/* ============ Responsive ============ */
@media (max-width: 1280px) {
  .arch { grid-template-columns: 1fr; }
  .arch-flow { flex-direction: row; justify-content: center; min-width: 0; }
  .arch-flow .flow-line { flex: 1; max-width: 300px; }
  .kpi-grid, .crm-summary { grid-template-columns: repeat(2, 1fr); }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2-1, .grid-2, .grid-1-2 { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 60px rgba(0, 0, 0, .4); }
  .main { margin-left: 0; }
  .mobile-menu { display: grid; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; }
  .content { padding: 16px 16px 40px; }
  .kpi-grid, .crm-summary, .kanban, .services-grid { grid-template-columns: 1fr; }
  .user-meta { display: none; }
  .cal-cell { min-height: 64px; }
  .cal-event { font-size: 9px; }
}
