/* =======================================================================
   BQDC Intelligence Platform — styles.css
   Identidad visual: asociación dental premium. Azul marino de confianza,
   acento dorado institucional, turquesa clínico, blanco luminoso y grises
   suaves. Tipografía editorial (Fraunces) para titulares + Inter para UI.
   Verde/ámbar/rojo reservados exclusivamente para estados de indicadores.
   ======================================================================= */

:root {
  --navy-900: #0a1f36;
  --navy-800: #112c4a;
  --navy-700: #1a3a5c;
  --blue-600: #1d64c7;
  --blue-500: #2b7ad1;
  --blue-400: #4f97e0;
  --blue-100: #e9f2fb;
  --teal-500: #0f9b8e;
  --gold-600: #a97e2f;
  --gold-500: #c79a45;
  --gold-100: #faf3e3;
  --white: #ffffff;
  --gray-50: #f7f8fa;
  --gray-100: #eef1f5;
  --gray-200: #e2e7ee;
  --gray-300: #cdd5e0;
  --gray-400: #96a2b3;
  --gray-500: #67748a;
  --gray-600: #48566d;
  --gray-700: #30415a;
  --gray-800: #1c2b40;
  --green: #1a8f52;
  --green-bg: #e8f7ee;
  --amber: #c07c0e;
  --amber-bg: #fcf1dd;
  --red: #c1352b;
  --red-bg: #fbebe9;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(10,31,54,0.06);
  --shadow-md: 0 4px 16px rgba(10,31,54,0.08);
  --shadow-lg: 0 12px 32px rgba(10,31,54,0.14);
  --sidebar-w: 264px;
  --topbar-h: 68px;
  --font-display: "Fraunces", "Georgia", serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }

/* ---------------- App shell ---------------- */
#app {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-800) 100%);
  color: #cdd8ea;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 40;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand .logo-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue-500), var(--teal-500));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; font-size: 15px;
  flex-shrink: 0;
}

.sidebar-brand .brand-text {
  display: flex; flex-direction: column; line-height: 1.2;
}
.sidebar-brand .brand-text strong { color: #fff; font-size: 15.5px; font-family: var(--font-display); font-weight: 600; letter-spacing: 0.1px; }
.sidebar-brand .brand-text span { font-size: 10px; color: var(--gold-500); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 10px;
}

.sidebar-nav .nav-section-title {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6f85a9;
  padding: 14px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: #b9c7de;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.nav-item i { width: 18px; text-align: center; font-size: 14px; color: #8ea3c4; }
.nav-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.nav-item.active { background: rgba(255,255,255,0.1); color: #fff; }
.nav-item.active i { color: var(--gold-500); }
.nav-item.active::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px;
  background: var(--gold-500); border-radius: 2px;
}
.nav-item .badge-soon {
  margin-left: auto; font-size: 9px; background: rgba(255,255,255,0.12); color: #cdd8ea;
  padding: 2px 6px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.04em;
}

.sidebar-footer {
  padding: 14px 16px 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-footer .dev-credit { font-size: 10.5px; color: #6f85a9; line-height: 1.5; }
.sidebar-footer .dev-credit strong { color: #a9bbda; }

/* ---------- Main area ---------- */
.main-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ---------- Topbar ---------- */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 30;
  gap: 16px;
}

.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-title { font-family: var(--font-display); font-size: 19px; font-weight: 600; color: var(--navy-900); white-space: nowrap; letter-spacing: -0.01em; }
.topbar-sub { font-size: 12px; color: var(--gray-500); }

.demo-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--gold-100);
  color: var(--gold-600);
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em;
  padding: 5px 11px; border-radius: 20px;
  border: 1px solid #ecd9b0;
  text-transform: uppercase;
}

.topbar-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.topbar-divider { width: 1px; height: 26px; background: var(--gray-200); }
.period-field { display: flex; flex-direction: column; gap: 2px; }
.period-field label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray-400); font-weight: 700; padding-left: 2px; }

.select-control {
  appearance: none;
  background: var(--gray-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2364748b'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 8px 28px 8px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gray-700);
}
.select-control:focus { outline: 2px solid var(--blue-100); border-color: var(--blue-400); }

.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--gray-200);
  background: #fff; display: flex; align-items: center; justify-content: center;
  color: var(--gray-600); position: relative; transition: background .15s;
}
.icon-btn:hover { background: var(--gray-50); }
.icon-btn .dot {
  position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--red);
  border: 1.5px solid #fff;
}

.role-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--gray-50); border: 1px solid var(--gray-200);
  border-radius: 20px; padding: 5px 12px 5px 6px;
}
.role-chip .avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-800), var(--blue-500));
  color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.role-chip .role-label { font-size: 12px; font-weight: 600; color: var(--gray-700); }
.role-chip .role-sub { font-size: 10px; color: var(--gray-400); }

/* ---------- Content ---------- */
.content {
  padding: 24px 28px 60px;
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
}

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.page-header h1 { font-size: 22px; font-weight: 800; color: var(--navy-900); letter-spacing: -0.01em; }
.page-header p.subtitle { margin-top: 4px; color: var(--gray-500); font-size: 13px; max-width: 640px; }
.page-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  border: 1px solid transparent; transition: all .15s; white-space: nowrap;
}
.btn-primary { background: var(--blue-600); color: #fff; box-shadow: 0 2px 8px rgba(29,100,199,0.3); }
.btn-primary:hover { background: #17519e; }
.btn-secondary { background: #fff; color: var(--gray-700); border-color: var(--gray-200); }
.btn-secondary:hover { background: var(--gray-50); }
.btn-ghost { background: transparent; color: var(--blue-600); }
.btn-ghost:hover { background: var(--blue-100); }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn-danger { background: var(--red); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-tour-cta { background: linear-gradient(135deg, var(--gold-600), var(--gold-500)); color: #fff; box-shadow: 0 2px 10px rgba(169,126,47,0.35); }
.btn-tour-cta:hover { filter: brightness(1.06); }

/* ---------- Filters bar ---------- */
.filters-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-md);
  padding: 14px 16px; margin-bottom: 20px; box-shadow: var(--shadow-sm);
}
.filters-bar .filter-group { display: flex; flex-direction: column; gap: 3px; }
.filters-bar label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-400); font-weight: 700; }
.filters-bar select, .filters-bar input { font-size: 12.5px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--gray-200); background: var(--gray-50); color: var(--gray-700); font-weight: 600; min-width: 130px; }

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1200px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 22px;
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 10px; flex-wrap: wrap; }
.card-header h3 { font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--navy-900); letter-spacing: -0.005em; }
.card-header .card-sub { font-size: 11.5px; color: var(--gray-400); }

.kpi-card {
  display: flex; flex-direction: column; gap: 9px; position: relative; overflow: hidden;
  border-top: 3px solid var(--gray-100);
}
.kpi-card .kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-card .kpi-icon {
  width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: var(--blue-100); color: var(--blue-600); font-size: 14px;
}
.kpi-card .kpi-label { font-size: 11.5px; color: var(--gray-500); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.kpi-card .kpi-value { font-family: var(--font-display); font-size: 27px; font-weight: 600; color: var(--navy-900); letter-spacing: -0.01em; }
.kpi-card .kpi-delta { font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 4px; }
.kpi-delta.up { color: var(--green); }
.kpi-delta.down { color: var(--red); }
.kpi-delta.flat { color: var(--gray-400); }

.chart-box { position: relative; width: 100%; }
.chart-box.h-220 { height: 220px; }
.chart-box.h-260 { height: 260px; }
.chart-box.h-300 { height: 300px; }
.chart-box.h-180 { height: 180px; }

/* ---------- Badges / states ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-gray { background: var(--gray-100); color: var(--gray-500); }
.badge-blue { background: var(--blue-100); color: var(--blue-600); }

.dot-state { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-green { background: var(--green); }
.dot-amber { background: var(--amber); }
.dot-red { background: var(--red); }
.dot-gray { background: var(--gray-300); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.bqdc-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.bqdc-table th {
  text-align: left; padding: 10px 12px; color: var(--gray-400); font-weight: 700; font-size: 10.5px;
  text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--gray-200); white-space: nowrap;
  cursor: pointer; user-select: none;
}
table.bqdc-table th:hover { color: var(--gray-600); }
table.bqdc-table td { padding: 11px 12px; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); white-space: nowrap; }
table.bqdc-table tbody tr:hover { background: var(--gray-50); }
table.bqdc-table tbody tr.clickable { cursor: pointer; }
.cell-strong { font-weight: 700; color: var(--navy-900); }
.cell-muted { color: var(--gray-400); }

.pagination { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; font-size: 12px; color: var(--gray-500); }
.pagination .pg-btns { display: flex; gap: 6px; }

/* ---------- Attention list ---------- */
.attention-item {
  display: flex; align-items: center; gap: 14px; padding: 13px 10px; border-bottom: 1px solid var(--gray-100);
  cursor: pointer; border-radius: 10px; transition: background .15s;
}
.attention-item:hover { background: var(--gray-50); }
.attention-item:last-child { border-bottom: none; }
.attention-item .ai-main { flex: 1; min-width: 0; }
.attention-item .ai-name { font-weight: 700; font-size: 13px; color: var(--navy-900); }
.attention-item .ai-detail { font-size: 11.5px; color: var(--gray-500); margin-top: 2px; }
.attention-item .ai-right { text-align: right; flex-shrink: 0; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--gray-200); margin-bottom: 20px; flex-wrap: wrap; }
.tab-btn { padding: 10px 16px; font-size: 13px; font-weight: 600; color: var(--gray-500); border-bottom: 2px solid transparent; }
.tab-btn.active { color: var(--navy-900); border-color: var(--gold-500); }
.tab-btn:hover { color: var(--navy-900); }

/* ---------- Login / landing (hero split-screen, estética asociación dental) ---------- */
.login-screen {
  min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr;
  background: var(--white);
}
@media (max-width: 980px) { .login-screen { grid-template-columns: 1fr; } }

.login-left {
  display: flex; flex-direction: column; justify-content: center;
  padding: 56px 64px; background: var(--white); position: relative;
}
@media (max-width: 980px) { .login-left { padding: 40px 28px; order: 2; } }
@media (max-width: 600px) { .login-left { padding: 32px 20px; } }

.login-right {
  position: relative; overflow: hidden; min-height: 320px;
  background: linear-gradient(160deg, var(--navy-900), var(--navy-700));
}
@media (max-width: 980px) { .login-right { order: 1; min-height: 42vh; } }
.login-right img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  object-position: center 28%;
}
.login-right .lr-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(10,31,54,0.78) 0%, rgba(10,31,54,0.08) 42%, rgba(10,31,54,0.0) 60%),
              linear-gradient(100deg, rgba(10,31,54,0.35) 0%, rgba(10,31,54,0) 38%);
}
.login-right .lr-caption {
  position: absolute; left: 40px; right: 40px; bottom: 36px; color: #fff;
}
.login-right .lr-caption .lr-quote { font-family: var(--font-display); font-size: 25px; font-weight: 600; line-height: 1.35; margin-bottom: 10px; max-width: 460px; }
.login-right .lr-caption .lr-sub { font-size: 12.5px; color: #cfe0f2; opacity: 0.9; }
.login-right .lr-badge {
  position: absolute; top: 32px; left: 40px; display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.14); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,0.25);
  color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 7px 14px; border-radius: 30px;
}

.login-brand-row { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; }
.login-brand-row .logo-mark-lg {
  width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--navy-800), var(--blue-600));
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 18px;
  font-family: var(--font-display);
}
.login-brand-row .lb-text strong { display: block; font-size: 15.5px; font-weight: 800; color: var(--navy-900); letter-spacing: -0.01em; }
.login-brand-row .lb-text span { font-size: 10.5px; color: var(--gold-600); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }

.login-left h1 {
  font-family: var(--font-display); font-size: 34px; line-height: 1.18; font-weight: 600;
  color: var(--navy-900); margin-bottom: 14px; max-width: 480px; letter-spacing: -0.01em;
}
.login-left h1 em { font-style: normal; color: var(--blue-600); }
.login-left p.lead { color: var(--gray-600); font-size: 14.5px; margin-bottom: 34px; max-width: 460px; line-height: 1.6; }

.login-section-label {
  font-size: 11px; font-weight: 800; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 14px; display: flex; align-items: center; gap: 10px;
}
.login-section-label::after { content: ""; flex: 1; height: 1px; background: var(--gray-200); }

.role-pick { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; max-width: 460px; }
.role-pick-btn {
  display: flex; align-items: center; gap: 14px; text-align: left;
  border: 1.5px solid var(--gray-200); border-radius: 14px; padding: 14px 16px; background: #fff;
  transition: all .15s;
}
.role-pick-btn:hover { border-color: var(--blue-400); background: var(--blue-100); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.role-pick-btn .rp-icon { width: 40px; height: 40px; border-radius: 11px; background: var(--navy-900); color: var(--gold-500); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 15px; }
.role-pick-btn .rp-text strong { display: block; font-size: 13.5px; color: var(--navy-900); font-weight: 700; }
.role-pick-btn .rp-text span { font-size: 11.5px; color: var(--gray-500); }
.login-footnote { font-size: 10.5px; color: var(--gray-400); line-height: 1.6; margin-top: 4px; max-width: 460px; }
.login-footnote strong { color: var(--gray-600); }

.login-trust-row { display: flex; gap: 22px; margin-top: 30px; flex-wrap: wrap; max-width: 460px; }
.login-trust-row .lt-item { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--gray-500); font-weight: 600; }
.login-trust-row .lt-item i { color: var(--teal-500); }

/* ---------- Copilot chat ---------- */
.copilot-layout { display: grid; grid-template-columns: 300px 1fr; gap: 20px; height: calc(100vh - 190px); min-height: 520px; }
@media (max-width: 1000px) { .copilot-layout { grid-template-columns: 1fr; height: auto; } }
.copilot-suggestions { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 16px; overflow-y: auto; }
.copilot-suggestions h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-400); margin-bottom: 10px; }
.suggestion-chip {
  display: block; width: 100%; text-align: left; font-size: 12.5px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--gray-200); background: var(--gray-50); margin-bottom: 8px; color: var(--gray-700); font-weight: 500;
  transition: all .15s;
}
.suggestion-chip:hover { border-color: var(--blue-400); background: var(--blue-100); }

.chat-panel { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); display: flex; flex-direction: column; overflow: hidden; }
.chat-header { padding: 16px 20px; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; gap: 12px; }
.chat-header .ai-avatar { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, var(--navy-900), var(--blue-500)); display: flex; align-items: center; justify-content: center; color: #fff; }
.chat-header strong { font-size: 14px; color: var(--navy-900); display: block; }
.chat-header span { font-size: 11px; color: var(--gray-400); }
.chat-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.chat-msg { display: flex; gap: 10px; max-width: 85%; }
.chat-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg .msg-avatar { width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; }
.chat-msg.ai .msg-avatar { background: var(--navy-800); }
.chat-msg.user .msg-avatar { background: var(--blue-600); }
.chat-msg .msg-bubble { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 14px; padding: 12px 14px; font-size: 13px; line-height: 1.55; color: var(--gray-700); }
.chat-msg.user .msg-bubble { background: var(--blue-600); color: #fff; border-color: var(--blue-600); }
.chat-msg .msg-bubble ul { margin: 6px 0 0 18px; list-style: disc; }
.chat-msg .msg-bubble .mini-chart-wrap { margin-top: 10px; height: 160px; background: #fff; border-radius: 10px; padding: 8px; }
.chat-msg .msg-tag { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-400); margin-top: 6px; display: block; }
.chat-input-row { padding: 14px 16px; border-top: 1px solid var(--gray-200); display: flex; gap: 10px; }
.chat-input-row input { flex: 1; border: 1px solid var(--gray-200); border-radius: 12px; padding: 11px 14px; font-size: 13px; background: var(--gray-50); }
.chat-input-row input:focus { outline: 2px solid var(--blue-100); border-color: var(--blue-400); }
.typing-dots span { width: 6px; height: 6px; background: var(--gray-400); border-radius: 50%; display: inline-block; margin-right: 3px; animation: blink 1.2s infinite; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; } .typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.form-field label { display: block; font-size: 11.5px; font-weight: 700; color: var(--gray-600); margin-bottom: 6px; }
.form-field .hint { font-size: 10.5px; color: var(--gray-400); margin-top: 4px; }
.form-field input, .form-field select { width: 100%; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--gray-200); font-size: 13px; background: #fff; color: var(--gray-800); }
.form-field input:focus, .form-field select:focus { outline: 2px solid var(--blue-100); border-color: var(--blue-400); }
.form-section-title { font-size: 12px; font-weight: 800; color: var(--navy-900); text-transform: uppercase; letter-spacing: 0.04em; margin: 22px 0 12px; display: flex; align-items: center; gap: 8px; }
.form-section-title:first-child { margin-top: 0; }

/* ---------- Steps ---------- */
.step-flow { display: flex; align-items: center; gap: 0; margin-bottom: 26px; flex-wrap: wrap; }
.step-flow .step { display: flex; align-items: center; gap: 8px; }
.step-flow .step-num { width: 28px; height: 28px; border-radius: 50%; background: var(--gray-200); color: var(--gray-500); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.step-flow .step.active .step-num { background: var(--gold-600); color: #fff; }
.step-flow .step.done .step-num { background: var(--green); color: #fff; }
.step-flow .step-label { font-size: 12px; font-weight: 600; color: var(--gray-400); }
.step-flow .step.active .step-label, .step-flow .step.done .step-label { color: var(--navy-900); }
.step-flow .step-sep { width: 32px; height: 2px; background: var(--gray-200); margin: 0 8px; }

/* ---------- Dropzone ---------- */
.dropzone {
  border: 2px dashed var(--gray-300); border-radius: var(--radius-lg); padding: 40px 20px; text-align: center;
  background: var(--gray-50); transition: all .15s; cursor: pointer;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--blue-400); background: var(--blue-100); }
.dropzone i { font-size: 30px; color: var(--blue-500); margin-bottom: 10px; }

/* ---------- Progress bar ---------- */
.progress-bar { width: 100%; height: 8px; background: var(--gray-200); border-radius: 20px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--blue-500), var(--teal-500)); border-radius: 20px; transition: width 0.4s ease; }

/* ---------- Integration cards ---------- */
.integration-logo {
  width: 52px; height: 52px; border-radius: 13px; background: var(--navy-900); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex-shrink: 0;
}

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 50px 20px; color: var(--gray-400); }
.empty-state i { font-size: 32px; margin-bottom: 12px; display: block; }

/* ---------- Tour overlay ---------- */
.tour-banner {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--navy-900); color: #fff; padding: 16px 20px; border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3); z-index: 200; display: flex; align-items: center; gap: 16px;
  max-width: 560px; width: calc(100% - 40px);
}
.tour-banner .tour-text { flex: 1; }
.tour-banner .tour-step-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: #8ea3c4; margin-bottom: 4px; }
.tour-banner .tour-title { font-size: 13.5px; font-weight: 700; margin-bottom: 3px; }
.tour-banner .tour-desc { font-size: 12px; color: #c3d0e6; line-height: 1.4; }
.tour-banner .tour-actions { display: flex; gap: 8px; flex-shrink: 0; }
.tour-highlight { position: relative; z-index: 150; box-shadow: 0 0 0 4px rgba(37,99,235,0.5), 0 0 0 9999px rgba(11,31,58,0.55) !important; border-radius: 14px; }

/* ---------- Toasts ---------- */
.bqdc-toast-holder { position: fixed; top: 20px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.bqdc-toast {
  display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 12px; padding: 12px 16px;
  box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 600; color: var(--navy-900); opacity: 0; transform: translateX(20px);
  transition: all .3s; border-left: 4px solid var(--blue-500); min-width: 260px;
}
.bqdc-toast.show { opacity: 1; transform: translateX(0); }
.bqdc-toast.toast-success { border-color: var(--green); } .bqdc-toast.toast-success i { color: var(--green); }
.bqdc-toast.toast-warn { border-color: var(--amber); } .bqdc-toast.toast-warn i { color: var(--amber); }
.bqdc-toast.toast-error { border-color: var(--red); } .bqdc-toast.toast-error i { color: var(--red); }
.bqdc-toast.toast-info i { color: var(--blue-500); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(11,31,58,0.55); z-index: 250;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-box { background: #fff; border-radius: 18px; max-width: 640px; width: 100%; max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-header { padding: 18px 22px; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 15px; font-weight: 800; color: var(--navy-900); }
.modal-body { padding: 22px; }
.modal-footer { padding: 16px 22px; border-top: 1px solid var(--gray-200); display: flex; justify-content: flex-end; gap: 10px; }
.modal-close-btn { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--gray-500); }
.modal-close-btn:hover { background: var(--gray-100); }

/* ---------- Misc ---------- */
.muted { color: var(--gray-400); }
.mb-0 { margin-bottom: 0; }
.text-right { text-align: right; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.divider { height: 1px; background: var(--gray-200); margin: 18px 0; }

.soon-banner {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
  color: #fff; border-radius: var(--radius-lg); padding: 28px 30px; margin-bottom: 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.soon-banner h2 { font-size: 19px; font-weight: 800; margin-bottom: 6px; }
.soon-banner p { font-size: 13px; color: #b9c7de; max-width: 560px; }
.soon-banner .soon-tag { background: rgba(255,255,255,0.12); padding: 5px 12px; border-radius: 20px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }

.kh-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 20px; opacity: 0.88; position: relative; }
.kh-card .kh-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--blue-100); color: var(--blue-600); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; font-size: 17px; }
.kh-card h4 { font-size: 14px; font-weight: 700; color: var(--navy-900); margin-bottom: 6px; }
.kh-card p { font-size: 12px; color: var(--gray-500); line-height: 1.5; }
.kh-card .kh-lock { position: absolute; top: 16px; right: 16px; color: var(--gray-300); font-size: 13px; }

.print-only { display: none; }
@media print {
  .sidebar, .topbar, .page-header-actions, .no-print { display: none !important; }
  .main-area { margin-left: 0 !important; }
  .content { padding: 0 !important; max-width: 100% !important; }
  .print-only { display: block; }
  body { background: #fff; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c7d2e0; border-radius: 10px; }

/* Mobile sidebar toggle */
.mobile-nav-toggle { display: none; }
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .mobile-nav-toggle { display: flex; }
  .content { padding: 18px 16px 40px; }
}
