:root {
  --navy: #0b2e5e;
  --navy-light: #133a73;
  --gold: #b8924a;
  --blue: #2a9bdb;
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #16233a;
  --muted: #6b7686;
  --danger: #c0392b;
  --ok: #2e8b57;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.hidden { display: none !important; }

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  padding: 16px;
}
.login-card {
  background: var(--card);
  border-radius: 12px;
  padding: 32px;
  max-width: 360px;
  width: 100%;
  text-align: center;
}
.login-card h1 { color: var(--navy); margin-top: 0; }
.login-card input {
  width: 100%;
  padding: 12px;
  margin: 16px 0;
  border: 1px solid #ccd3df;
  border-radius: 8px;
  font-size: 15px;
}
.login-card button {
  width: 100%;
  padding: 12px;
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
}
.error-text { color: var(--danger); min-height: 20px; font-size: 13px; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 210px;
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  flex-shrink: 0;
}
.brand { font-size: 20px; font-weight: 700; padding: 8px 20px 20px; }
.brand span { color: var(--gold); display: block; font-size: 13px; font-weight: 400; }
.nav-item {
  background: none;
  border: none;
  color: #cfd9ec;
  text-align: left;
  padding: 12px 20px;
  font-size: 15px;
  cursor: pointer;
}
.nav-item.active { background: var(--navy-light); color: #fff; border-left: 3px solid var(--gold); }
.nav-item.logout { margin-top: auto; color: #9fb0cc; }

.view-root { flex: 1; padding: 24px; max-width: 1100px; }

h2 { color: var(--navy); margin-top: 0; }
.tile-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.tile {
  background: var(--card);
  border-radius: 10px;
  padding: 16px 20px;
  min-width: 140px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.tile .n { font-size: 28px; font-weight: 700; color: var(--navy); }
.tile .label { color: var(--muted); font-size: 13px; }

.section { background: var(--card); border-radius: 10px; padding: 18px 20px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.section h3 { margin-top: 0; color: var(--navy); font-size: 16px; }
.empty { color: var(--muted); font-size: 14px; padding: 8px 0; }

.item-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid #eef1f6;
}
.item-row:first-child { border-top: none; }
.item-row .main { flex: 1; }
.item-row .company { font-weight: 600; color: var(--navy); font-size: 13px; }
.item-row .text { font-size: 14px; }
.item-row .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; background: #eaf3fb; color: var(--blue); }
.pill.danger { background: #fbeaea; color: var(--danger); }
.pill.gold { background: #faf1e2; color: var(--gold); }

button.small {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
button.small.secondary { background: #e2e7ee; color: var(--text); }
button.small.danger { background: var(--danger); }

.pipeline-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.stage-column { background: var(--card); border-radius: 10px; padding: 12px; min-width: 220px; flex-shrink: 0; }
.stage-column h4 { margin: 0 0 10px; font-size: 13px; color: var(--navy); display: flex; justify-content: space-between; }
.company-card {
  background: var(--bg);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid #e3e8f0;
}
.company-card .name { font-weight: 600; }
.company-card .country { color: var(--muted); font-size: 12px; }
.stage-column.fraud { background: #fdf1f0; }

textarea, input[type=text], input[type=date], select {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccd3df;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 8px;
}

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50;
}
.modal {
  background: #fff; border-radius: 10px; padding: 20px; max-width: 600px; width: 100%;
  max-height: 85vh; overflow-y: auto;
}
.modal h3 { color: var(--navy); margin-top: 0; }
.close-btn { float: right; background: none; border: none; font-size: 18px; cursor: pointer; }

@media (max-width: 760px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; overflow-x: auto; padding: 8px; }
  .brand { display: none; }
  .nav-item { padding: 10px 14px; white-space: nowrap; }
  .nav-item.logout { margin-top: 0; margin-left: auto; }
  .view-root { padding: 14px; }
}
