/* Admin / CRM — Pipedrive-style Kanban, Airtable-Theme */
@import url('style.css');

body { background: var(--surface); }

.admin-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--navy);
  color: #cbd5e1;
  padding: 24px 18px;
}
.sidebar .logo { color: white; margin-bottom: 32px; }
.sidebar .logo-mark { background: var(--blue); }
.sidebar .s-section { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: #64748b; margin: 18px 8px 10px; }
.sidebar a.s-link {
  display: flex; gap: 10px; align-items: center;
  padding: 9px 12px; border-radius: 8px;
  color: #cbd5e1; font-size: 14px;
  margin-bottom: 2px;
}
.sidebar a.s-link:hover { background: rgba(255,255,255,0.06); color: white; }
.sidebar a.s-link.active { background: var(--blue); color: white; }
.sidebar .s-icon { width: 18px; text-align: center; }

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 16px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.1px; }
.topbar .sub { color: var(--text-weak); font-size: 13px; margin-top: 2px; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 24px 28px 0;
}
.kpi {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
}
.kpi .l { font-size: 12px; color: var(--text-weak); text-transform: uppercase; letter-spacing: 0.5px; }
.kpi .v { font-size: 26px; font-weight: 800; letter-spacing: -0.4px; margin-top: 4px; }
.kpi .d { font-size: 12px; color: var(--success); margin-top: 2px; }
.kpi .d.neg { color: var(--danger); }

.kanban-wrap { padding: 24px 28px 40px; overflow-x: auto; }
.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(280px, 1fr));
  gap: 14px;
  min-width: 1200px;
}
.col {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
}
.col-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.col-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; display: flex; gap: 8px; align-items: center; }
.stage-dot { width: 8px; height: 8px; border-radius: 50%; }
.stage-new { background: #60a5fa; }
.stage-qualified { background: #fbbf24; }
.stage-angebot { background: #f97316; }
.stage-verhand { background: #a855f7; }
.stage-gewonnen { background: #22c55e; }
.col-count { font-size: 12px; color: var(--text-weak); background: var(--surface); padding: 2px 8px; border-radius: 999px; font-weight: 500; }

.deal {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: grab;
  transition: all 0.15s ease;
}
.deal:hover { box-shadow: var(--shadow-card); transform: translateY(-1px); }
.deal.drag { opacity: 0.4; }
.deal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.deal-company { font-weight: 600; font-size: 14px; letter-spacing: 0.05px; }
.deal-value { font-size: 13px; font-weight: 700; color: var(--blue); white-space: nowrap; }
.deal-contact { color: var(--text-weak); font-size: 12px; margin-top: 2px; }
.deal-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-weak);
}
.deal-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tag { font-size: 10px; padding: 2px 6px; background: var(--blue-soft); color: var(--blue); border-radius: 4px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600; }
.deal-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.action-btn {
  flex: 1;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  color: var(--navy);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  display: inline-flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
}
.action-btn:hover { background: var(--blue-soft); color: var(--blue); border-color: var(--blue); }
.action-btn.primary { background: var(--blue); color: white; border-color: var(--blue); }
.action-btn.primary:hover { background: var(--blue-mid); }

/* Toast */
.toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  background: var(--navy);
  color: white;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: var(--shadow-card);
  display: flex; gap: 10px; align-items: center;
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.25s ease;
  pointer-events: none;
  max-width: 380px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast .ok { color: #4ade80; font-size: 18px; }

/* Modal */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(4, 14, 32, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.modal-bg.show { display: flex; }
.modal {
  background: white;
  border-radius: 18px;
  padding: 28px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal h3 { font-size: 20px; font-weight: 700; letter-spacing: -0.1px; }
.modal .subtle { color: var(--text-weak); font-size: 14px; margin-top: 4px; margin-bottom: 18px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
}
