:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1b1f2a;
  --muted: #6b7280;
  --accent: #0f766e;
  --accent-2: #0ea5a4;
  --danger: #b91c1c;
  --border: #e5e7eb;
  --shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--accent); text-decoration: none; }
.muted { color: var(--muted); }

.container { max-width: 1200px; margin: 0 auto; padding: 24px; }

.nav {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav .brand { font-weight: 700; letter-spacing: 0.5px; }
.nav .links a { margin-left: 16px; color: var(--muted); font-weight: 600; }
.nav .links a.active { color: var(--accent); }

.card {
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.leads-card {
  background: linear-gradient(145deg, rgba(255,255,255,0.7), rgba(236,245,255,0.7));
  border: 1px solid rgba(255,255,255,0.55);
  box-shadow: 0 18px 55px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px; border-bottom: 1px solid #e5e7eb; text-align: left; }
.table th { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; }
.table-modern { border-radius: 14px; overflow: hidden; border: 1px solid #e5e7eb; table-layout: fixed; border-spacing: 0; }
.table-modern th { background: rgba(255,255,255,0.65); font-size: 12px; letter-spacing: 0.7px; }
.table-modern td { font-size: 15px; background: rgba(255,255,255,0.9); height: 56px; }
.table-modern tr:hover td { background: rgba(236,244,255,0.9); }
.table-modern th, .table-modern td { vertical-align: middle; }
.table-modern tr:last-child td { border-bottom: none; }
.leads-table tr:hover { background: rgba(236,244,255,0.9); }
.leads-table th { font-size: 12px; letter-spacing: 0.6px; }
.leads-table td { padding: 16px 12px; font-size: 15px; }
.leads-table .actions a { color: #0f766e; font-weight: 600; }
.table-scroll { width: 100%; overflow-x: auto; }

.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.new { background: #e0f2fe; color: #075985; }
.badge.won { background: #dcfce7; color: #166534; }
.badge.lost { background: #fee2e2; color: #991b1b; }
.badge.contact { background: #fef9c3; color: #854d0e; }
.badge.demo { background: #e0e7ff; color: #3730a3; }
.badge.negotiation { background: #fae8ff; color: #7e22ce; }
.badge.interested { background: #ffedd5; color: #c2410c; }
.badge.bad { background: #e5e7eb; color: #374151; }
.badge.ongoing { background: #e0f2fe; color: #075985; }
.badge.pending { background: #fef9c3; color: #854d0e; }
.badge.closed { background: #e5e7eb; color: #374151; }
.badge.renew { background: #f3e8ff; color: #6b21a8; }
.badge.completed { background: #dcfce7; color: #166534; }
.note-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0ea5a4;
  color: white;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  margin-left: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}
.note-icon:hover { background: #0f766e; }
.note-empty { background: #cbd5e1; color: #1f2937; }

.note-tooltip {
  position: fixed;
  background: #0f172a;
  color: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  max-width: 260px;
  font-size: 13px;
  z-index: 9999;
  pointer-events: none;
  transform: translateY(-6px);
}
.remark-cell { text-align: center; }

.btn {
  border: none;
  background: var(--accent);
  color: white;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}
.btn.secondary { background: #1f2937; }
.btn.danger { background: var(--danger); }

.form-row { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
input, select, textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}

.kanban { display: grid; grid-template-columns: repeat(6, minmax(180px, 1fr)); gap: 12px; }
.kanban-column { background: #f9fafb; border: 1px dashed var(--border); border-radius: 12px; padding: 12px; min-height: 260px; }
.kanban-column h4 { margin: 0 0 10px 0; font-size: 14px; color: var(--muted); }
.kanban-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin-bottom: 10px; cursor: grab; box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08); }

@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-row { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .grid-4 { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: 1fr; }
  .nav { flex-direction: column; gap: 10px; align-items: flex-start; }
}
