/* =============================================
   TBH Hub — Design System
   Soft/Modern — Acolhedor & Memorável
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,400&display=swap');

:root {
  /* ===== BRAND TBH — cores da marca ===== */
  /* Roxo/Lilás — cor principal da marca */
  --p: #7b6cb7;
  --pl: #f0eef8;
  --pd: #6558a3;
  --p-glow: rgba(123, 108, 183, .12);

  /* Verde — sucesso/confirmacao */
  --s: #6ebe4a;
  --sl: #f0f9ec;

  /* Amarelo — atencao/warning */
  --w: #f0c63e;
  --wl: #fdf9ec;

  /* Rosa/Coral — danger/urgente */
  --d: #e8637a;
  --dl: #fdf0f2;

  /* Cyan/Turquesa — info/destaque */
  --i: #38c5d0;
  --il: #ecfafb;

  /* Roxo marca (mesmo que primary, para IA e destaques) */
  --v: #7b6cb7;
  --vl: #f0eef8;

  /* Neutrals — leves e clean */
  --g50: #f9fafb;
  --g100: #f3f4f6;
  --g200: #e5e7eb;
  --g300: #d1d5db;
  --g400: #9ca3af;
  --g500: #6b7280;
  --g600: #4b5563;
  --g700: #374151;
  --g800: #1f2937;
  --g900: #111827;

  /* Layout */
  --sw: 260px;
  --swc: 72px;
  --r: 12px;
  --r-sm: 8px;
  --r-lg: 16px;
  --sh: 0 1px 3px rgba(0, 0, 0, .05), 0 1px 2px rgba(0, 0, 0, .03);
  --shm: 0 4px 12px rgba(0, 0, 0, .06), 0 2px 4px rgba(0, 0, 0, .03);
  --shl: 0 12px 32px rgba(0, 0, 0, .08), 0 4px 8px rgba(0, 0, 0, .04);

  /* Sidebar — roxo escuro da marca */
  --sidebar-bg: #2d2548;
  --sidebar-hover: rgba(255, 255, 255, .06);
  --sidebar-active: rgba(123, 108, 183, .25);

  /* Surface */
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --page-bg: #f5f6f8;

  /* Transitions */
  --ease-out: cubic-bezier(.2, 0, 0, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

/* =============================================
   Reset & Base
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--page-bg);
  color: var(--g700);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }

/* Selection */
::selection { background: var(--pl); color: var(--pd); }

/* Scrollbar — thin & soft */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--g300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--g400); }

/* =============================================
   Proto Banner — warm & friendly
   ============================================= */
.proto-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 32px;
  background: linear-gradient(135deg, #2d2548 0%, #3a3160 100%);
  color: rgba(255, 255, 255, .7);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 9999;
  letter-spacing: .3px;
  font-weight: 400;
}
.proto-tag {
  background: rgba(123, 108, 183, .3);
  color: #c8bfe0;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

/* =============================================
   Sidebar — warm & inviting
   ============================================= */
.sb {
  position: fixed;
  left: 0;
  top: 32px; /* below proto banner */
  bottom: 0;
  width: var(--sw);
  background: var(--sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  transition: width .3s var(--ease-out);
  overflow: visible;
  z-index: 1000;
  clip-path: inset(0 -20px 0 0);
}
.sb::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(123, 108, 183, .08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(56, 197, 208, .04) 0%, transparent 60%);
  pointer-events: none;
}
.sb.collapsed { width: var(--swc); }

/* Toggle button */
.sb-toggle {
  position: absolute;
  right: -16px;
  top: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--dl);
  border: 2px solid var(--d);
  box-shadow: 0 2px 8px rgba(232, 99, 122, .3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  transition: all .2s var(--ease-out);
}
.sb-toggle:hover { background: var(--d); border-color: var(--d); transform: scale(1.1); }
.sb-toggle .chevron-icon {
  width: 14px;
  height: 14px;
  color: var(--d);
  stroke-width: 2.5;
  transition: transform .3s var(--ease-out), color .2s;
}
.sb-toggle:hover .chevron-icon { color: #fff; }
.sb.collapsed .sb-toggle .chevron-icon { transform: rotate(180deg); }

/* Brand */
.sb-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.sb-logo {
  width: 38px;
  height: 38px;
  min-width: 38px;
  background: linear-gradient(135deg, var(--p) 0%, #9485cc 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .5px;
  box-shadow: 0 2px 8px rgba(123, 108, 183, .3);
}
.sb-brand-text {
  overflow: hidden;
  transition: opacity .25s, width .3s var(--ease-out);
  white-space: nowrap;
}
.sb-brand-text h2 {
  font-family: 'Fraunces', 'DM Sans', serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.2px;
}
.sb-brand-text span { font-size: 10px; color: rgba(255, 255, 255, .4); }
.sb.collapsed .sb-brand-text { opacity: 0; width: 0; }

/* Nav scroll area */
.sb-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .08) transparent;
  position: relative;
}
.sb-nav::-webkit-scrollbar { width: 3px; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .08); border-radius: 2px; }

/* Group */
.sb-group { margin-bottom: 18px; }
.sg-title {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: rgba(255, 255, 255, .25);
  padding: 0 6px 8px;
  transition: opacity .25s, height .3s var(--ease-out);
  overflow: hidden;
  white-space: nowrap;
  font-weight: 500;
}
.sb.collapsed .sg-title { opacity: 0; height: 0; padding-bottom: 0; }

/* Nav item */
.ni {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: rgba(255, 255, 255, .5);
  transition: all .2s var(--ease-out);
  cursor: pointer;
  margin-bottom: 2px;
  white-space: nowrap;
  position: relative;
}
.ni:hover { background: var(--sidebar-hover); color: rgba(255, 255, 255, .85); }
.ni.act {
  background: var(--sidebar-active);
  color: #fff;
}
.ni.act::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  background: var(--p);
  border-radius: 0 3px 3px 0;
}
.ni .ico { min-width: 20px; }
.ni-text { font-size: 13px; overflow: hidden; transition: opacity .2s; font-weight: 400; }
.sb.collapsed .ni { justify-content: center; padding: 10px; }
.sb.collapsed .ni-text { opacity: 0; width: 0; overflow: hidden; }
.sb.collapsed .ni.act::before { display: none; }

/* Badges */
.badge {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
  white-space: nowrap;
  transition: display .2s;
}
.badge.rd { background: rgba(232, 99, 122, .2); color: #f5a0b2; }
.badge.gn { background: rgba(110, 190, 74, .2); color: #8edc6a; }
.badge.bl { background: rgba(56, 197, 208, .2); color: #70dce5; }
.badge.vl { background: rgba(123, 108, 183, .2); color: #b8ade0; }
.sb.collapsed .badge { display: none; }

/* Footer */
.sb-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, .06);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.sb-avatar {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--p) 0%, #9485cc 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 2px 6px rgba(123, 108, 183, .25);
}
.sb-user-text {
  overflow: hidden;
  transition: opacity .2s, width .3s var(--ease-out);
  white-space: nowrap;
}
.sb-user-name { display: block; font-size: 12px; font-weight: 600; }
.sb-user-role { display: block; font-size: 10px; color: rgba(255, 255, 255, .4); }
.sb.collapsed .sb-user-text { opacity: 0; width: 0; }

/* =============================================
   Main area
   ============================================= */
.mn {
  margin-left: var(--sw);
  margin-top: 32px;
  min-height: calc(100vh - 32px);
  transition: margin-left .3s var(--ease-out);
}
body.sb-collapsed .mn { margin-left: var(--swc); }

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--g400);
  font-size: 14px;
}

/* =============================================
   Module header — soft & warm
   ============================================= */
.hd {
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--g200);
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.hd-left { display: flex; flex-direction: column; gap: 2px; }
.hd-left h1 {
  font-family: 'Fraunces', 'DM Sans', serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--g900);
  letter-spacing: -.3px;
}
.hd-left p { font-size: 12px; color: var(--g500); font-weight: 400; }
.hd-right { display: flex; align-items: center; gap: 8px; }

/* Module body */
.module-body { padding: 28px; }

/* =============================================
   Icons
   ============================================= */
.ico {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.ico-sm { width: 16px; height: 16px; }
.ico-lg { width: 24px; height: 24px; }

/* =============================================
   Buttons — soft & tactile
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--g200);
  background: var(--surface);
  font-size: 12px;
  font-weight: 500;
  color: var(--g700);
  cursor: pointer;
  transition: all .2s var(--ease-out);
  white-space: nowrap;
  position: relative;
}
.btn:hover {
  background: var(--g50);
  border-color: var(--g300);
  box-shadow: var(--sh);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }

.btn.pr {
  background: var(--p);
  border-color: var(--p);
  color: #fff;
  box-shadow: 0 2px 8px rgba(123, 108, 183, .25);
}
.btn.pr:hover {
  background: var(--pd);
  border-color: var(--pd);
  box-shadow: 0 4px 12px rgba(123, 108, 183, .35);
}

.btn.sc { background: var(--s); border-color: var(--s); color: #fff; box-shadow: 0 2px 8px rgba(110, 190, 74, .25); }
.btn.sc:hover { background: #5eab3e; border-color: #5eab3e; box-shadow: 0 4px 12px rgba(110, 190, 74, .3); }

.btn.wr { background: var(--w); border-color: var(--w); color: var(--g800); box-shadow: 0 2px 8px rgba(240, 198, 62, .25); }
.btn.wr:hover { background: #e0b630; border-color: #e0b630; }

.btn.dn { background: var(--d); border-color: var(--d); color: #fff; box-shadow: 0 2px 8px rgba(232, 99, 122, .25); }
.btn.dn:hover { background: #d4506d; border-color: #d4506d; }

.btn.vt { background: var(--v); border-color: var(--v); color: #fff; box-shadow: 0 2px 8px rgba(123, 108, 183, .25); }
.btn.vt:hover { background: var(--pd); border-color: var(--pd); }

.btn.sm { padding: 5px 12px; font-size: 11px; border-radius: 8px; }

.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--g100); transform: none; box-shadow: none; }

/* =============================================
   Stats Grid — cards with soft glow
   ============================================= */
.sg {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.sc {
  background: var(--surface);
  border-radius: var(--r);
  border: 1px solid var(--g100);
  box-shadow: var(--sh);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all .25s var(--ease-out);
  position: relative;
  overflow: hidden;
}
.sc::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--p), var(--i));
  opacity: 0;
  transition: opacity .25s;
}
.sc:hover { box-shadow: var(--shm); transform: translateY(-2px); }
.sc:hover::before { opacity: 1; }
.sc-top { display: flex; align-items: center; justify-content: space-between; }
.sc-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sc-value {
  font-family: 'Fraunces', 'DM Sans', serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--g900);
  line-height: 1;
  letter-spacing: -.5px;
}
.sc-label { font-size: 12px; color: var(--g500); font-weight: 400; }
.sc-change { font-size: 11px; font-weight: 600; }
.sc-change.up { color: var(--s); }
.sc-change.dn { color: var(--d); }

/* =============================================
   Cards — rounded & warm
   ============================================= */
.cd {
  background: var(--surface);
  border-radius: var(--r);
  border: 1px solid var(--g100);
  box-shadow: var(--sh);
  transition: box-shadow .25s var(--ease-out);
}
.cd:hover { box-shadow: var(--shm); }
.cd-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--g100);
  gap: 12px;
}
.cd-h h3 {
  font-family: 'Fraunces', 'DM Sans', serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--g900);
  letter-spacing: -.2px;
}
.cd-h .cd-actions { display: flex; align-items: center; gap: 8px; }
.cd-b { padding: 20px; }

/* =============================================
   Tables — soft zebra
   ============================================= */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  background: var(--g50);
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--g500);
  padding: 10px 16px;
  border-bottom: 1px solid var(--g200);
  white-space: nowrap;
}
.tbl td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--g100);
  font-size: 13px;
  color: var(--g700);
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: rgba(250, 249, 247, .6); }

/* =============================================
   Tags — pill shaped & soft
   ============================================= */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
.tag.gn { background: var(--sl); color: var(--s); }
.tag.yw { background: var(--wl); color: var(--w); }
.tag.rd { background: var(--dl); color: var(--d); }
.tag.bl { background: var(--pl); color: var(--p); }
.tag.gy { background: var(--g100); color: var(--g600); }
.tag.vt { background: var(--vl); color: var(--v); }
.tag.cy { background: var(--il); color: var(--i); }

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot.gn { background: var(--s); }
.dot.yw { background: var(--w); }
.dot.rd { background: var(--d); }
.dot.bl { background: var(--p); }
.dot.gy { background: var(--g400); }
.dot.vt { background: var(--v); }
.dot.cy { background: var(--i); }

/* =============================================
   Layout Grids
   ============================================= */
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.g3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.g4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }

/* =============================================
   Kanban — soft rounded cards
   ============================================= */
.kb { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.kc {
  min-width: 268px;
  max-width: 296px;
  flex-shrink: 0;
  background: var(--g100);
  border-radius: var(--r);
  padding: 14px;
}
.kc-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.kc-h h4 { font-size: 12px; font-weight: 600; color: var(--g700); }
.kc-count {
  background: var(--g300);
  color: var(--g600);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}
.kk {
  background: var(--surface);
  border-radius: var(--r-sm);
  padding: 14px;
  margin-bottom: 10px;
  border-left: 3px solid var(--g300);
  box-shadow: var(--sh);
  cursor: pointer;
  transition: all .2s var(--ease-out);
}
.kk:hover { box-shadow: var(--shm); transform: translateY(-1px); }
.kk.selected { box-shadow: 0 0 0 2px var(--p); border-left-color: var(--p); }
.kk[draggable="true"] { cursor: grab; user-select: none; }
.kk[draggable="true"]:active { cursor: grabbing; }
.kk-placeholder { border: 2px dashed var(--g300); border-radius: var(--r-sm); background: rgba(123,108,183,.04); transition: height .15s; }
.kc.kc-drag-over { background: rgba(123,108,183,.06) !important; }
.kk.hot { border-left-color: var(--d); }
.kk.warm { border-left-color: var(--w); }
.kk.cold { border-left-color: var(--i); }
.kk-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--g800); }
.kk-sub { font-size: 11px; color: var(--g500); margin-bottom: 8px; }
.kk-footer { display: flex; align-items: center; justify-content: space-between; }
.kk-date { font-size: 10px; color: var(--g400); }

/* =============================================
   Tabs — soft underline
   ============================================= */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--g200);
  gap: 0;
  overflow-x: auto;
}
.tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--g500);
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all .2s var(--ease-out);
  border-radius: 8px 8px 0 0;
}
.tab:hover { color: var(--g800); background: rgba(123, 108, 183, .04); }
.tab.act {
  color: var(--p);
  border-bottom-color: var(--p);
  font-weight: 600;
  background: rgba(123, 108, 183, .04);
}

/* Tab panels */
.tab-panel { display: none; }
.tab-panel.act { display: block; }

/* =============================================
   Form Builder
   ============================================= */
.fbl {
  display: grid;
  grid-template-columns: 220px 1fr 240px;
  gap: 0;
  height: calc(100vh - 160px);
  border: 1px solid var(--g200);
  border-radius: var(--r);
  overflow: hidden;
}
.fbl-panel {
  background: var(--surface);
  border-right: 1px solid var(--g200);
  overflow-y: auto;
}
.fbl-panel:last-child { border-right: none; border-left: 1px solid var(--g200); }
.fbl-panel-h {
  padding: 14px 16px;
  border-bottom: 1px solid var(--g200);
  font-size: 12px;
  font-weight: 600;
  color: var(--g700);
  background: var(--g50);
}
.fbl-fields { padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.ffp {
  border: 1px dashed var(--g300);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12px;
  color: var(--g600);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all .2s var(--ease-out);
}
.ffp:hover { background: var(--pl); border-color: var(--p); color: var(--p); }
.ffp.selected { background: var(--pl); border-color: var(--p); color: var(--p); border-style: solid; }
.fbl-preview { background: var(--g50); padding: 20px; overflow-y: auto; }
.fbl-props { padding: 16px; overflow-y: auto; }

/* =============================================
   Match cards — NPS scores
   ============================================= */
.mc {
  background: var(--surface);
  border-radius: var(--r);
  border: 1px solid var(--g100);
  box-shadow: var(--sh);
  padding: 18px;
  position: relative;
}
.mc-score {
  position: absolute;
  top: 14px;
  right: 14px;
  font-family: 'Fraunces', serif;
  font-size: 17px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--r-sm);
}
.mc-score.hi { background: var(--sl); color: var(--s); }
.mc-score.md { background: var(--wl); color: var(--w); }
.mc-score.lo { background: var(--g100); color: var(--g500); }

/* =============================================
   Step bar — pill steps
   ============================================= */
.stb { display: flex; gap: 6px; flex-wrap: wrap; }
.stp {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--g100);
  color: var(--g600);
  cursor: pointer;
  transition: all .2s var(--ease-out);
}
.stp:hover { background: var(--g200); }
.stp.act {
  background: linear-gradient(135deg, var(--p), #9485cc);
  color: #fff;
  box-shadow: 0 2px 8px rgba(123, 108, 183, .3);
}
.stp.done { background: var(--sl); color: var(--s); }

/* =============================================
   Group avatars
   ============================================= */
.grp-avatar-row { display: flex; align-items: center; }
.grp-avatar {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 2px solid var(--surface);
  margin-left: -6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: var(--p);
  color: #fff;
}
.grp-avatar:first-child { margin-left: 0; }

/* =============================================
   Checklist — soft & tactile
   ============================================= */
.ck-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--g100);
  transition: background .15s;
}
.ck-item:last-child { border-bottom: none; }
.ck-item:hover { background: rgba(250, 249, 247, .5); }
.ck-box {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 6px;
  border: 2px solid var(--g300);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s var(--ease-out);
}
.ck-box.done {
  background: var(--s);
  border-color: var(--s);
  box-shadow: 0 1px 4px rgba(61, 154, 126, .3);
}
.ck-box.wip { border-color: var(--w); }
.ck-label { font-size: 13px; color: var(--g700); }
.ck-item.done .ck-label { text-decoration: line-through; color: var(--g400); }

/* =============================================
   AI Chat — warm bubbles
   ============================================= */
.ai-chat { display: flex; flex-direction: column; gap: 16px; padding: 20px; }
.ai-msg { display: flex; gap: 10px; align-items: flex-end; }
.ai-msg.user { flex-direction: row-reverse; }
.ai-av {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.ai-msg .ai-av { background: var(--vl); color: var(--v); }
.ai-msg.user .ai-av { background: var(--pl); color: var(--p); }
.ai-bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.6;
}
.ai-msg .ai-bubble {
  background: var(--g100);
  color: var(--g800);
  border-bottom-left-radius: 4px;
}
.ai-msg.user .ai-bubble {
  background: linear-gradient(135deg, var(--p), #9485cc);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(123, 108, 183, .2);
}
.ai-input-area {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--g100);
  background: var(--surface);
}
.ai-input {
  flex: 1;
  border: 1px solid var(--g200);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 13px;
  resize: none;
  outline: none;
  transition: all .2s var(--ease-out);
}
.ai-input:focus { border-color: var(--p); box-shadow: 0 0 0 3px var(--p-glow); }

/* =============================================
   Integration cards
   ============================================= */
.ic {
  background: var(--surface);
  border-radius: var(--r);
  border: 1px solid var(--g100);
  box-shadow: var(--sh);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all .25s var(--ease-out);
}
.ic:hover { box-shadow: var(--shm); transform: translateY(-2px); }
.ic-logo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--g100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.ic-name { font-size: 14px; font-weight: 600; color: var(--g800); }
.ic-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.ic-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.ic-status { font-size: 11px; }
.ic-status.connected { color: var(--s); font-weight: 600; }

/* =============================================
   Alerts — soft & warm
   ============================================= */
.alert {
  padding: 14px 18px;
  border-radius: var(--r);
  border: 1px solid;
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.alert.ai {
  background: linear-gradient(135deg, var(--vl) 0%, rgba(244, 240, 250, .6) 100%);
  border-color: #d4c5ed;
  color: #6b4fa0;
}
.alert.info { background: var(--pl); border-color: #f5ccc6; color: #a04a3e; }
.alert.warn { background: var(--wl); border-color: #f0d9a8; color: #8b6a2a; }
.alert.danger { background: var(--dl); border-color: #f0b5be; color: #9e3f4e; }
.alert.success { background: var(--sl); border-color: #a8e0cc; color: #2d7a61; }

/* =============================================
   Progress bars — rounded & colorful
   ============================================= */
.progress {
  height: 10px;
  background: var(--g200);
  border-radius: 10px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: 10px;
  transition: width .4s var(--ease-out);
}
.progress-bar.bl { background: linear-gradient(90deg, var(--p), #9485cc); }
.progress-bar.gn { background: linear-gradient(90deg, var(--s), #8cd468); }
.progress-bar.yw { background: linear-gradient(90deg, var(--w), #f5d56a); }
.progress-bar.rd { background: linear-gradient(90deg, var(--d), #f08a9e); }
.progress-bar.vt { background: linear-gradient(90deg, var(--v), #9485cc); }

/* =============================================
   Toggle switches — soft pill
   ============================================= */
.tgs {
  width: 38px;
  height: 22px;
  border-radius: 11px;
  background: var(--g300);
  position: relative;
  cursor: pointer;
  transition: background .25s var(--ease-out);
  flex-shrink: 0;
}
.tgs::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: transform .25s var(--ease-spring);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
}
.tgs.on { background: var(--s); }
.tgs.on::after { transform: translateX(16px); }

/* =============================================
   Form elements — rounded & soft
   ============================================= */
.fm-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.fm-label { font-size: 12px; font-weight: 500; color: var(--g700); }
.fm-input, .fm-select, .fm-textarea {
  padding: 9px 12px;
  border: 1px solid var(--g200);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--g800);
  background: var(--surface);
  outline: none;
  transition: all .2s var(--ease-out);
  width: 100%;
}
.fm-input:focus, .fm-select:focus, .fm-textarea:focus {
  border-color: var(--p);
  box-shadow: 0 0 0 3px var(--p-glow);
}
.fm-textarea { resize: vertical; min-height: 80px; }
.fm-row { display: flex; gap: 12px; }
.fm-row .fm-group { flex: 1; }

/* =============================================
   Search bar
   ============================================= */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--g200);
  border-radius: var(--r-sm);
  background: var(--surface);
  transition: all .2s var(--ease-out);
}
.search-bar:focus-within { border-color: var(--p); box-shadow: 0 0 0 3px var(--p-glow); }
.search-bar input {
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--g800);
  background: transparent;
  min-width: 180px;
}

/* =============================================
   Utilities
   ============================================= */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-0 { gap: 0; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-gray { color: var(--g500); }
.text-bold { font-weight: 600; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Avatar generic */
.av {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--p), #9485cc);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.av.sm { width: 26px; height: 26px; font-size: 10px; border-radius: 8px; }
.av.lg { width: 42px; height: 42px; font-size: 15px; border-radius: 12px; }

/* Divider */
.divider { border: none; border-top: 1px solid var(--g100); margin: 16px 0; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 52px 28px;
  color: var(--g400);
}
.empty-state p { font-size: 13px; margin-top: 8px; }

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 1200px) {
  .fbl { grid-template-columns: 1fr; }
  .fbl-panel:last-child { border-left: none; border-top: 1px solid var(--g200); }
  .g2, .g3 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sb { transform: translateX(-100%); }
  .sb.mobile-open { transform: translateX(0); }
  .mn { margin-left: 0 !important; }
  body.sb-collapsed .mn { margin-left: 0; }
  .kb { flex-direction: column; }
  .sg { grid-template-columns: 1fr 1fr; }
  .g4 { grid-template-columns: 1fr; }
  .hd { flex-wrap: wrap; padding: 16px 20px; }
  .module-body { padding: 20px; }
}
