/* Disparo Sirius — stylesheet */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --border: #2a2d3a;
  --text: #e2e4ec;
  --muted: #8b8fa8;
  --accent: #6366f1;
  --accent-h: #4f52cc;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
  --radius: 10px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  min-height: 100vh;
}

/* ── Utils ── */
.hidden { display: none !important; }
.muted { color: var(--muted); }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.items-center { align-items: center; }
.ml-auto { margin-left: auto; }

/* ── Buttons ── */
button { cursor: pointer; border: none; font-size: 13px; border-radius: 6px; transition: opacity .15s; }
button:hover { opacity: .85; }
button:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; padding: 8px 16px; font-weight: 600; }
.btn-ghost { background: transparent; color: var(--muted); padding: 6px 10px; border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-danger { background: var(--red); color: #fff; padding: 6px 12px; }

/* ── Form inputs ── */
input, textarea, select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 8px 10px;
  font-size: 13px;
  width: 100%;
  outline: none;
  transition: border-color .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
select option { background: var(--surface); }
label { display: block; margin-bottom: 4px; font-size: 12px; color: var(--muted); }
.form-group { margin-bottom: 14px; }
textarea { resize: vertical; min-height: 80px; }

/* ── Login ── */
#login-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  width: 100%; max-width: 380px;
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo span { font-size: 20px; font-weight: 700; color: var(--text); }
.login-logo sub { font-size: 12px; color: var(--accent); display: block; margin-top: 2px; }
.login-error { color: var(--red); font-size: 12px; margin-bottom: 12px; }

/* ── App header ── */
#app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  height: 52px;
  display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 10;
}
.header-logo { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; }
.header-logo span { color: var(--accent); }
.header-ws { font-size: 12px; color: var(--muted); background: var(--bg); border: 1px solid var(--border); border-radius: 5px; padding: 3px 8px; }

/* ── Nav tabs ── */
#nav-tabs { display: flex; gap: 2px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.nav-tab { padding: 10px 16px; font-size: 13px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; transition: all .15s; }
.nav-tab:hover { color: var(--text); }
.nav-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Main content ── */
#main-content { padding: 24px; max-width: 900px; margin: 0 auto; }

/* ── Campaign list ── */
.campaign-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  margin-bottom: 10px;
}
.campaign-card:hover { background: #1f2235; }
.campaign-header { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.campaign-title { font-size: 14px; font-weight: 600; flex: 1; }
.campaign-meta { display: flex; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }

/* ── Progress bar ── */
.progress-bar-wrap {
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  margin: 6px 0 4px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width .5s ease;
}

/* ── Instance card ── */
.instance-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
}

/* ── Workspace selector ── */
#ws-selector {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
}
.ws-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 36px; width: 100%; max-width: 400px;
}
.ws-card h2 { margin-bottom: 20px; font-size: 18px; }
.ws-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer; margin-bottom: 8px;
  transition: border-color .15s;
}
.ws-item:hover { border-color: var(--accent); }
.ws-item-name { font-weight: 600; }
.ws-item-role { font-size: 11px; color: var(--muted); }
.ws-avatar { width: 36px; height: 36px; border-radius: 8px; background: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: #fff; }

/* ── Overlay / Modal ── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  display: flex; align-items: flex-start; justify-content: center;
  z-index: 50;
  overflow-y: auto;
  padding: 40px 16px;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%; max-width: 560px;
  padding: 28px;
}
.modal-lg { max-width: 700px; }
.modal h3 { font-size: 17px; font-weight: 700; margin-bottom: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.modal-close {
  position: absolute; top: 14px; right: 16px;
  background: transparent; color: var(--muted); font-size: 20px; padding: 0 4px;
}
.modal-close:hover { color: var(--text); }

/* ── Campaign detail panel (full overlay) ── */
#campaign-detail-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 50;
  display: flex; align-items: stretch; justify-content: flex-end;
}
.detail-panel {
  background: var(--surface);
  border-left: 1px solid var(--border);
  width: 100%; max-width: 600px;
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.panel-title { font-size: 16px; font-weight: 700; flex: 1; }
.panel-body { flex: 1; padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.detail-section h4 { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 10px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.detail-item label { font-size: 11px; color: var(--muted); }
.detail-item span { font-size: 13px; font-weight: 500; }

/* ── Table ── */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--border); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
td { padding: 8px 8px; border-bottom: 1px solid var(--border); font-size: 12px; }
tr:hover td { background: rgba(255,255,255,.02); }

/* ── Wizard ── */
.wizard-steps { display: flex; gap: 0; margin-bottom: 24px; }
.wizard-step-indicator {
  flex: 1; text-align: center; padding: 8px; font-size: 12px; color: var(--muted);
  border-bottom: 2px solid var(--border);
}
.wizard-step-indicator.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.wizard-step-indicator.done { color: var(--green); border-bottom-color: var(--green); }

/* ── Source tabs ── */
.src-tabs { display: flex; gap: 4px; margin-bottom: 14px; }
.src-tab {
  padding: 6px 14px; font-size: 12px; border-radius: 6px;
  background: var(--bg); border: 1px solid var(--border); color: var(--muted); cursor: pointer;
}
.src-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── CRM contact checklist ── */
#crm-contact-checklist { max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; }
#crm-contact-checklist label { padding: 7px 0; }

/* ── Empty state ── */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); font-size: 13px; line-height: 1.7; }

/* ── Toast ── */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--border);
  padding: 10px 20px; border-radius: 8px; font-size: 13px;
  z-index: 99; opacity: 0; transition: opacity .2s;
  pointer-events: none; white-space: nowrap;
}
#toast.show { opacity: 1; }
#toast.error { border-color: var(--red); color: var(--red); }
#toast.success { border-color: var(--green); color: var(--green); }

@media (max-width: 640px) {
  .detail-grid { grid-template-columns: 1fr; }
  .detail-panel { max-width: 100%; }
}
