:root {
  --navy: #07152f;
  --navy-2: #0d2149;
  --blue: #155be7;
  --blue-2: #2f75ff;
  --red: #e22f3c;
  --white: #ffffff;
  --bg: #f3f6fb;
  --card: #ffffff;
  --text: #111c34;
  --muted: #6b7892;
  --line: #e1e7f0;
  --green: #1f9d69;
  --orange: #e89a2f;
  --purple: #7f56d9;
  --shadow: 0 18px 50px rgba(13, 33, 73, .10);
  --radius: 20px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }
.eyebrow { color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .15em; }
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 18% 15%, rgba(47,117,255,.32), transparent 28%), radial-gradient(circle at 85% 78%, rgba(226,47,60,.22), transparent 30%), linear-gradient(145deg, #050c1c 0%, #0a1d42 55%, #09142b 100%); overflow: hidden; position: relative; }
.auth-orb { position: absolute; border-radius: 50%; filter: blur(4px); opacity: .65; animation: float 8s ease-in-out infinite; }
.orb-one { width: 240px; height: 240px; left: 8%; top: 12%; background: linear-gradient(135deg, rgba(47,117,255,.75), rgba(47,117,255,.08)); }
.orb-two { width: 300px; height: 300px; right: 5%; bottom: 6%; background: linear-gradient(135deg, rgba(226,47,60,.45), rgba(226,47,60,.04)); animation-delay: -3s; }
@keyframes float { 0%,100%{ transform: translateY(0) rotate(0deg);} 50%{ transform: translateY(-18px) rotate(5deg);} }
.glass { background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(22px); box-shadow: 0 30px 90px rgba(0,0,0,.35); }
.auth-card { width: min(480px, 100%); padding: 36px; border-radius: 28px; color: #fff; position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 15px; }
.auth-brand img { width: 62px; height: 62px; object-fit: contain; border-radius: 16px; background: #fff; padding: 6px; }
.auth-brand h1 { margin: 2px 0 0; font-size: 34px; }
.auth-copy { color: rgba(255,255,255,.76); line-height: 1.7; margin: 24px 0 14px; }
.demo-badge { display: inline-flex; padding: 8px 11px; border-radius: 999px; background: rgba(255,255,255,.12); color: #dce7ff; font-size: 12px; font-weight: 700; margin-bottom: 24px; }
.auth-form { display: grid; gap: 16px; }
.auth-form label, .modal-form label, .settings-form label { display: grid; gap: 7px; font-size: 13px; font-weight: 700; }
.auth-form input { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.22); color: #fff; }
.auth-form input::placeholder { color: rgba(255,255,255,.48); }
.auth-note { color: rgba(255,255,255,.48); font-size: 11px; line-height: 1.6; margin: 16px 0 0; }
input, select, textarea { width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--text); outline: none; transition: .2s ease; }
input:focus, select:focus, textarea:focus { border-color: var(--blue-2); box-shadow: 0 0 0 4px rgba(47,117,255,.11); }
textarea { resize: vertical; }
.btn { border: 0; border-radius: 12px; padding: 11px 15px; font-weight: 800; transition: .2s ease; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--blue-2), #0e4dcc); box-shadow: 0 10px 22px rgba(21,91,231,.22); }
.btn-secondary { color: var(--navy-2); background: #edf2f9; }
.btn-light { color: var(--navy); background: #fff; }
.btn-ghost { color: #d8e5ff; background: rgba(255,255,255,.08); }
.btn-danger { color: #fff; background: var(--red); }
.btn-full { width: 100%; }
.link-btn { background: transparent; border: 0; color: var(--blue); font-weight: 800; padding: 5px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 12px; background: #eef3fa; color: var(--navy); font-size: 20px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar { background: linear-gradient(180deg, #07152f, #091b3c 78%, #081630); color: #fff; padding: 22px 16px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; z-index: 20; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 24px; }
.sidebar-brand img { width: 46px; height: 46px; border-radius: 12px; object-fit: contain; background: #fff; padding: 4px; }
.sidebar-brand strong { display: block; font-size: 16px; }
.sidebar-brand small { color: #8fa8d2; }
.nav-list { display: grid; gap: 6px; }
.nav-item { width: 100%; border: 0; color: #b8c9e8; background: transparent; border-radius: 12px; padding: 12px 13px; text-align: left; font-weight: 700; display: flex; align-items: center; gap: 11px; }
.nav-item span { width: 22px; text-align: center; font-size: 18px; }
.nav-item:hover, .nav-item.active { background: linear-gradient(135deg, rgba(47,117,255,.26), rgba(47,117,255,.10)); color: #fff; }
.nav-item.active { box-shadow: inset 3px 0 0 #4d87ff; }
.sidebar-footer { margin-top: auto; display: grid; gap: 12px; }
.plan-card { padding: 15px; border-radius: 16px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08); }
.plan-label { color: #8fa8d2; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.plan-card strong, .plan-card small { display: block; margin-top: 5px; }
.plan-card small { color: #9bb0d4; }
.main-content { min-width: 0; }
.topbar { min-height: 88px; padding: 18px 28px; background: rgba(255,255,255,.92); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 15; }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar h2 { margin: 3px 0 0; font-size: 26px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 900; background: linear-gradient(135deg, var(--red), #ff7b62); }
.mobile-only { display: none; }
.view { display: none; padding: 26px 28px 40px; animation: fade .25s ease; }
.active-view { display: block; }
@keyframes fade { from{opacity:0; transform:translateY(5px)} to{opacity:1; transform:none} }
.welcome-card { padding: 28px; border-radius: 24px; color: #fff; background: radial-gradient(circle at 82% 10%, rgba(255,255,255,.22), transparent 25%), linear-gradient(135deg, #0d4fc4, #123a83 68%, #0a2455); box-shadow: var(--shadow); display: flex; justify-content: space-between; align-items: center; gap: 20px; overflow: hidden; position: relative; }
.welcome-card::after { content:""; position:absolute; width:180px; height:180px; border-radius:50%; right:-50px; bottom:-100px; border:28px solid rgba(255,255,255,.08); }
.welcome-card .eyebrow { color: #bcd2ff; }
.welcome-card h3 { font-size: 30px; margin: 6px 0; }
.welcome-card p { color: #d6e3ff; margin: 0; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 20px 0; }
.kpi-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: 0 8px 26px rgba(13,33,73,.05); }
.kpi-top { display: flex; justify-content: space-between; align-items: center; }
.kpi-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: #edf3ff; color: var(--blue); font-weight: 900; }
.kpi-change { font-size: 11px; font-weight: 800; color: var(--green); }
.kpi-card h4 { font-size: 27px; margin: 18px 0 4px; }
.kpi-card p { color: var(--muted); margin: 0; font-size: 13px; }
.dashboard-grid { display: grid; grid-template-columns: 1.45fr .8fr; gap: 18px; margin-bottom: 18px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 9px 30px rgba(13,33,73,.05); padding: 20px; }
.compact-panel { padding: 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-head h3 { margin: 4px 0 0; font-size: 18px; }
.stage-chart { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; min-height: 250px; align-items: end; padding-top: 16px; }
.chart-column { display: grid; grid-template-rows: 1fr auto; gap: 10px; height: 220px; align-items: end; }
.chart-bar-wrap { height: 100%; display: flex; align-items: end; justify-content: center; }
.chart-bar { width: min(54px, 75%); min-height: 8px; border-radius: 12px 12px 6px 6px; background: linear-gradient(180deg, #397dff, #0d4fc4); position: relative; transition: height .35s ease; }
.chart-bar span { position: absolute; top: -25px; left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 800; }
.chart-label { text-align: center; font-size: 12px; color: var(--muted); }
.stack-list { display: grid; gap: 10px; }
.stack-item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; }
.stack-icon { width: 38px; height: 38px; border-radius: 11px; background: #fff3e6; color: var(--orange); display: grid; place-items: center; }
.stack-item strong { display: block; font-size: 13px; }
.stack-item small { color: var(--muted); }
.stack-item .spacer { margin-left: auto; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th { text-align: left; color: #75829b; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 12px 10px; border-bottom: 1px solid var(--line); }
td { padding: 14px 10px; border-bottom: 1px solid #eef2f7; font-size: 13px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.lead-cell { display: flex; align-items: center; gap: 10px; }
.lead-avatar { width: 35px; height: 35px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #225ecf, #6b93ff); font-weight: 900; flex: 0 0 auto; }
.lead-cell strong, .lead-cell small { display: block; }
.lead-cell small { color: var(--muted); max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-pill, .source-pill, .priority-pill, .badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 9px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.stage-New { color: #1758b7; background: #eaf2ff; }
.stage-Contacted { color: #8b5b10; background: #fff4db; }
.stage-Qualified { color: #6d35bf; background: #f2eaff; }
.stage-Won { color: #15744d; background: #e6f7ef; }
.stage-Lost { color: #b42b37; background: #fdebed; }
.source-pill { color: #48556e; background: #f0f3f8; }
.table-actions { display: flex; gap: 6px; }
.table-btn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--navy); }
.table-btn:hover { border-color: var(--blue); color: var(--blue); }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.search-wrap { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding-left: 12px; }
.search-wrap input { border: 0; box-shadow: none; padding-left: 0; }
.toolbar select { width: auto; min-width: 140px; }
.empty-state { text-align: center; padding: 50px 20px; }
.empty-icon { width: 60px; height: 60px; margin: 0 auto; display: grid; place-items: center; border-radius: 18px; background: #edf3ff; color: var(--blue); font-size: 28px; }
.empty-state h4 { margin: 14px 0 6px; }
.empty-state p { color: var(--muted); margin: 0; }
.view-intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.view-intro h3 { font-size: 24px; margin: 5px 0; }
.view-intro p { color: var(--muted); margin: 0; }
.pipeline-board { display: grid; grid-template-columns: repeat(5, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.pipeline-column { background: #edf2f8; border: 1px solid #dfe6f0; border-radius: 18px; min-height: 520px; padding: 12px; }
.pipeline-column.drag-over { border-color: var(--blue); background: #e7efff; }
.pipeline-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding: 4px 3px; }
.pipeline-head strong { font-size: 13px; }
.pipeline-count { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #fff; font-size: 11px; font-weight: 900; }
.pipeline-cards { display: grid; gap: 10px; }
.pipeline-card { background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 13px; box-shadow: 0 7px 18px rgba(13,33,73,.05); cursor: grab; }
.pipeline-card:active { cursor: grabbing; }
.pipeline-card h4 { margin: 0 0 4px; font-size: 14px; }
.pipeline-card p { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.pipeline-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.pipeline-meta strong { color: var(--navy); }
.task-summary { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.summary-card { padding: 18px; border-radius: 17px; background: #fff; border: 1px solid var(--line); }
.summary-card strong { display: block; font-size: 25px; margin-bottom: 3px; }
.summary-card span { color: var(--muted); font-size: 12px; }
.task-list { display: grid; gap: 12px; }
.task-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; align-items: center; gap: 14px; }
.task-check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #c8d2e2; background: #fff; }
.task-card.completed { opacity: .62; }
.task-card.completed .task-check { background: var(--green); border-color: var(--green); color: #fff; }
.task-card.completed .task-title { text-decoration: line-through; }
.task-info { min-width: 0; }
.task-title { font-weight: 800; font-size: 14px; }
.task-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.task-actions { margin-left: auto; display: flex; gap: 7px; }
.priority-High { color: #a5650b; background: #fff1d8; }
.priority-Urgent { color: #b42b37; background: #fdebed; }
.priority-Normal { color: #1b64bd; background: #eaf2ff; }
.integration-banner { background: linear-gradient(135deg, #0b6f52, #0a4e42); color: #fff; border-radius: 22px; padding: 24px; margin-bottom: 18px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.integration-banner h3 { margin: 10px 0 5px; font-size: 24px; }
.integration-banner p { margin: 0; color: #d7fff2; max-width: 780px; line-height: 1.6; }
.badge-warning { color: #77530d; background: #ffe9ad; }
.inbox-layout { padding: 0; display: grid; grid-template-columns: 310px 1fr; min-height: 600px; overflow: hidden; }
.conversation-list { border-right: 1px solid var(--line); overflow-y: auto; max-height: 650px; }
.conversation-item { width: 100%; border: 0; border-bottom: 1px solid #edf1f6; background: #fff; padding: 15px; display: flex; gap: 11px; text-align: left; }
.conversation-item:hover, .conversation-item.active { background: #eef5ff; }
.conversation-item .lead-avatar { border-radius: 50%; }
.conversation-copy { min-width: 0; flex: 1; }
.conversation-copy strong { display: block; }
.conversation-copy small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
.conversation-time { font-size: 10px; color: var(--muted); }
.conversation-panel { display: grid; grid-template-rows: auto 1fr auto; min-width: 0; }
.conversation-header { padding: 14px 18px; border-bottom: 1px solid var(--line); min-height: 66px; display: flex; align-items: center; justify-content: space-between; }
.message-thread { background: #eaf1ec; padding: 20px; overflow-y: auto; min-height: 460px; display: flex; flex-direction: column; gap: 10px; }
.message-bubble { max-width: 72%; border-radius: 15px; padding: 10px 12px; font-size: 13px; line-height: 1.5; box-shadow: 0 3px 10px rgba(13,33,73,.06); }
.message-in { align-self: flex-start; background: #fff; border-top-left-radius: 4px; }
.message-out { align-self: flex-end; background: #d8fbd8; border-top-right-radius: 4px; }
.message-bubble small { display: block; text-align: right; color: #738177; font-size: 9px; margin-top: 4px; }
.message-composer { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 13px; border-top: 1px solid var(--line); }
.report-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 15px; margin-bottom: 18px; }
.report-card { padding: 20px; border-radius: 18px; color: #fff; min-height: 140px; background: linear-gradient(135deg, #123a83, #0e5adf); position: relative; overflow: hidden; }
.report-card:nth-child(2) { background: linear-gradient(135deg, #0d6f4f, #1aa671); }
.report-card:nth-child(3) { background: linear-gradient(135deg, #6e36bb, #945cff); }
.report-card:nth-child(4) { background: linear-gradient(135deg, #b9313e, #ed5360); }
.report-card span { color: rgba(255,255,255,.72); font-size: 12px; }
.report-card strong { display: block; font-size: 29px; margin-top: 15px; }
.report-card small { display: block; color: rgba(255,255,255,.72); margin-top: 5px; }
.report-bars { display: grid; gap: 14px; }
.report-row { display: grid; grid-template-columns: 110px 1fr 40px; gap: 10px; align-items: center; font-size: 12px; }
.report-track { height: 9px; border-radius: 999px; background: #edf2f8; overflow: hidden; }
.report-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #1b64e4, #5b8fff); }
.report-note { margin-top: 18px; }
.report-note p { color: var(--muted); line-height: 1.7; max-width: 840px; }
.settings-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; }
.settings-form { display: grid; gap: 15px; }
.setup-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 13px; }
.setup-list li { display: flex; gap: 12px; padding: 12px; background: #f7f9fc; border-radius: 14px; }
.setup-list li > span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--blue); font-weight: 900; flex: 0 0 auto; }
.setup-list strong, .setup-list small { display: block; }
.setup-list small { color: var(--muted); margin-top: 4px; line-height: 1.5; }
.danger-zone { grid-column: 1 / -1; border-color: #f3c7cc; }
.danger-zone p { color: var(--muted); }
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(4,12,28,.67); backdrop-filter: blur(5px); padding: 18px; }
.modal-card { width: min(760px, 100%); max-height: 92vh; overflow-y: auto; background: #fff; border-radius: 22px; padding: 22px; box-shadow: 0 30px 90px rgba(0,0,0,.32); }
.small-modal { width: min(520px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h3 { margin: 4px 0 0; }
.modal-form { display: grid; gap: 15px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 5px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 200; padding: 13px 16px; color: #fff; background: var(--navy); border-radius: 12px; box-shadow: var(--shadow); transform: translateY(120px); opacity: 0; transition: .25s ease; font-weight: 700; font-size: 13px; }
.toast.show { transform: translateY(0); opacity: 1; }
@media (max-width: 1180px) {
  .kpi-grid, .report-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -280px; width: 260px; transition: .25s ease; box-shadow: 20px 0 60px rgba(0,0,0,.25); }
  .sidebar.open { left: 0; }
  .mobile-only { display: grid; }
  .settings-grid { grid-template-columns: 1fr; }
  .danger-zone { grid-column: auto; }
  .inbox-layout { grid-template-columns: 260px 1fr; }
}
@media (max-width: 700px) {
  .topbar { padding: 14px 16px; }
  .topbar h2 { font-size: 21px; }
  .topbar-actions .btn { display: none; }
  .view { padding: 18px 14px 30px; }
  .welcome-card, .view-intro, .integration-banner { align-items: flex-start; flex-direction: column; }
  .welcome-card h3 { font-size: 24px; }
  .kpi-grid, .report-grid, .task-summary { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; }
  .toolbar select, .toolbar .btn { width: 100%; }
  .search-wrap { flex-basis: 100%; }
  .inbox-layout { grid-template-columns: 1fr; }
  .conversation-list { max-height: 245px; border-right: 0; border-bottom: 1px solid var(--line); }
  .message-thread { min-height: 340px; }
  .message-composer { grid-template-columns: 1fr; }
  .message-bubble { max-width: 88%; }
  .auth-card { padding: 26px 20px; }
}
