:root {
  /* Replace these with exact RemoteCircleAI Lovable CSS values when available. */
  --brand-primary: #6d5efc;
  --brand-primary-strong: #4f46e5;
  --brand-accent: #14b8a6;
  --brand-bg: #f6f7fb;
  --brand-surface: #ffffff;
  --brand-sidebar: #101828;
  --brand-sidebar-soft: #1d2939;
  --brand-text: #182230;
  --brand-muted: #667085;
  --brand-border: #e4e7ec;
  --brand-danger: #b42318;
  --brand-success: #067647;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-soft: 0 18px 50px rgba(16, 24, 40, 0.08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--brand-bg);
  color: var(--brand-text);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.app-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, var(--brand-sidebar), var(--brand-sidebar-soft));
  color: #fff;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  box-shadow: 0 12px 32px rgba(109, 94, 252, .35);
}
.brand-mark.small { width: 34px; height: 34px; border-radius: 10px; font-size: 13px; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav a {
  padding: 11px 12px;
  border-radius: 12px;
  color: rgba(255,255,255,.76);
}
.sidebar nav a:hover, .sidebar nav a.active { background: rgba(255,255,255,.1); color: #fff; }
.sidebar-footer { margin-top: auto; color: rgba(255,255,255,.68); font-size: 14px; padding: 0 8px; display: grid; gap: 8px; }
.sidebar-footer a { color: #fff; }
.main { padding: 28px; overflow-x: hidden; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 22px; }
.topbar h1 { margin: 3px 0 0; font-size: 30px; line-height: 1.1; }
.eyebrow { color: var(--brand-primary-strong); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.btn {
  border: 1px solid var(--brand-border);
  background: #fff;
  color: var(--brand-text);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
}
.btn.primary { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; box-shadow: 0 10px 28px rgba(109, 94, 252, .22); }
.btn:hover { transform: translateY(-1px); }
.alert { border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; border: 1px solid var(--brand-border); background: #fff; }
.alert.success { color: var(--brand-success); background: #ecfdf3; border-color: #abefc6; }
.alert.error { color: var(--brand-danger); background: #fef3f2; border-color: #fecdca; }
.panel, .stat-card, .lead-card, .column { background: var(--brand-surface); border: 1px solid var(--brand-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); }
.panel { padding: 18px; }
.panel h2, .panel h3 { margin-top: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; font-size: 18px; }
.panel-head a { color: var(--brand-primary-strong); font-weight: 700; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat-card { padding: 18px; }
.stat-card span { color: var(--brand-muted); display: block; font-size: 14px; }
.stat-card strong { display: block; font-size: 28px; margin-top: 8px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; }
.list { display: grid; gap: 8px; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: #f9fafb; border: 1px solid transparent; }
.list-row:hover { border-color: var(--brand-border); background: #fff; }
.list-row.static:hover { background: #f9fafb; border-color: transparent; }
.list-row span { display: grid; gap: 3px; }
small, .muted, .list-row small { color: var(--brand-muted); }
.list-row em { color: var(--brand-muted); font-style: normal; white-space: nowrap; font-size: 13px; }
.done { opacity: .65; }
.done strong { text-decoration: line-through; }
.board { display: grid; grid-template-columns: repeat(8, 310px); gap: 14px; overflow-x: auto; padding-bottom: 14px; }
.column { padding: 12px; min-height: 520px; box-shadow: none; }
.column-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 12px; font-weight: 800; }
.column-head strong { background: #eef2ff; color: var(--brand-primary-strong); border-radius: 999px; padding: 2px 8px; font-size: 12px; }
.cards { display: grid; gap: 10px; }
.lead-card { padding: 14px; box-shadow: none; transition: .15s ease; }
.lead-card:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(16, 24, 40, 0.1); }
.lead-card h3 { margin: 0 0 8px; font-size: 15px; }
.lead-card p { margin: 0 0 12px; color: var(--brand-muted); line-height: 1.35; }
.card-meta { display: flex; justify-content: space-between; align-items: center; color: var(--brand-muted); font-size: 12px; }
.pill { display: inline-flex; border-radius: 999px; padding: 4px 8px; font-size: 12px; font-weight: 700; background: #f2f4f7; color: #344054; }
.pill.high { background: #fef3f2; color: #b42318; }
.pill.medium { background: #fffaeb; color: #b54708; }
.pill.low { background: #ecfdf3; color: #067647; }
.filters { display: grid; grid-template-columns: minmax(250px, 1fr) 200px auto; gap: 10px; margin-bottom: 14px; }
input, select, textarea { width: 100%; border: 1px solid var(--brand-border); border-radius: 12px; padding: 10px 12px; background: #fff; color: var(--brand-text); }
textarea { resize: vertical; }
label { display: grid; gap: 6px; font-weight: 700; font-size: 13px; color: #344054; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 10px; border-bottom: 1px solid var(--brand-border); vertical-align: top; }
th { color: var(--brand-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
td a { display: grid; gap: 3px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; }
.detail-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px; }
.detail-title h2 { margin: 0 0 6px; font-size: 26px; }
.detail-title p { margin: 0; color: var(--brand-muted); }
.info-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.info-grid div { border: 1px solid var(--brand-border); border-radius: 14px; padding: 13px; background: #fcfcfd; }
.info-grid span { display: block; color: var(--brand-muted); font-size: 12px; margin-bottom: 5px; }
.notes { color: #344054; line-height: 1.6; }
.form-panel { max-width: 1040px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.lead-form { display: grid; gap: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.inline-form { display: grid; grid-template-columns: minmax(200px, 1fr) 160px 150px auto; gap: 8px; margin-bottom: 12px; }
.stack { display: grid; gap: 12px; }
.stack.compact { gap: 8px; margin-bottom: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.timeline { display: grid; gap: 10px; }
.timeline article { border-left: 3px solid var(--brand-primary); padding: 10px 12px; background: #f9fafb; border-radius: 0 12px 12px 0; }
.timeline p { margin: 6px 0; color: #344054; }
.link-btn { background: transparent; border: 0; color: var(--brand-primary-strong); cursor: pointer; font-weight: 800; }
.code { background: #101828; color: #d0d5dd; padding: 14px; border-radius: 12px; overflow: auto; }
.auth-body { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at top left, rgba(109,94,252,.18), transparent 34%), var(--brand-bg); padding: 20px; }
.auth-card { width: min(420px, 100%); background: #fff; border: 1px solid var(--brand-border); border-radius: 24px; box-shadow: var(--shadow-soft); padding: 28px; }
.auth-card h1 { margin: 18px 0 6px; }
.auth-card p { color: var(--brand-muted); margin: 0 0 18px; }
@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; flex-direction: row; align-items: center; overflow-x: auto; }
  .sidebar nav { display: flex; }
  .sidebar-footer { display: none; }
  .stat-grid, .two-col, .detail-layout { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .main { padding: 18px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .stat-grid, .form-grid, .filters, .inline-form, .info-grid { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(8, 280px); }
}
