/* CRM base stylesheet — shared classes used by every page. Do not fork; reuse. */
:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --ink: #1f2733;
  --muted: #6b7785;
  --border: #e2e7ee;
  --brand: #2d6cdf;
  --brand-dark: #1f4fa8;
  --green: #1f9d57;
  --amber: #d98a1f;
  --red: #d23f4b;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(20, 30, 50, .08), 0 1px 2px rgba(20, 30, 50, .06);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 210px; background: #11203a; color: #cdd7e6; flex-shrink: 0;
  display: flex; flex-direction: column; padding: 16px 0;
}
.sidebar .brand {
  font-weight: 700; font-size: 20px; color: #fff; letter-spacing: .5px;
  padding: 8px 22px 18px;
}
.sidebar nav { display: flex; flex-direction: column; }
.sidebar nav a {
  color: #cdd7e6; padding: 10px 22px; font-weight: 500; border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: #18294a; text-decoration: none; color: #fff; }
.sidebar nav a.active { background: #18294a; color: #fff; border-left-color: var(--brand); }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 24px; height: 56px;
}
.page-title { font-size: 17px; font-weight: 600; }
.user-box { display: flex; align-items: center; gap: 12px; }
.user-name { color: var(--muted); }
.content { padding: 24px; flex: 1; }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px;
}
.card h2, .card h3 { margin-top: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }

/* Stat tiles */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; }
.stat .value { font-size: 28px; font-weight: 700; }
.stat .label { color: var(--muted); margin-top: 4px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: #eef1f6; color: var(--ink); border: 1px solid var(--border);
  padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 500;
}
.btn:hover { background: #e3e8f0; text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-danger { background: #fff; color: var(--red); border-color: #f0c4c8; }
.btn-danger:hover { background: #fdecee; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.toolbar h1 { font-size: 22px; margin: 0; }

/* Tables */
.table { width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.table th { background: #f7f9fc; color: var(--muted); font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: .4px; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #f9fbfe; }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 5px; color: #344256; }
.form-row { display: flex; gap: 14px; }
.form-row > .form-group { flex: 1; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; font-family: inherit; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(45, 108, 223, .15); }
textarea { min-height: 90px; resize: vertical; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }

/* Badges (deal stages, activity types, tags) */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-lead { background: #eef1f6; color: #51607a; }
.badge-qualified { background: #e4f0ff; color: #2d6cdf; }
.badge-proposal { background: #fff1da; color: #b9740f; }
.badge-won { background: #e2f6ea; color: #1f9d57; }
.badge-lost { background: #fde8ea; color: #c43340; }
.tag { display: inline-block; background: #eef1f6; color: #51607a; padding: 2px 8px;
  border-radius: 6px; font-size: 12px; margin-right: 4px; }

/* Pipeline board */
.pipeline { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.pipeline-col { background: #eef1f6; border-radius: var(--radius); width: 250px; flex-shrink: 0; padding: 10px; }
.pipeline-col h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted);
  margin: 4px 6px 10px; display: flex; justify-content: space-between; }
.deal-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow); padding: 10px 12px; margin-bottom: 10px; }
.deal-card .title { font-weight: 600; }
.deal-card .meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.deal-card .moves { display: flex; gap: 6px; margin-top: 8px; }

/* Misc */
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.flash { padding: 11px 16px; border-radius: 8px; margin-bottom: 16px; }
.flash-error { background: #fde8ea; color: #c43340; }
.flash-ok { background: #e2f6ea; color: #1f9d57; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* Login page */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 32px; width: 340px; }
.login-card h1 { margin: 0 0 18px; font-size: 22px; text-align: center; }

/* Map */
#map { height: calc(100vh - 160px); min-height: 460px; border-radius: var(--radius);
  border: 1px solid var(--border); }
.map-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
