@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  --ink: #12172B;
  --ink-soft: #1C2340;
  --ink-line: #2B3358;
  --paper: #F7F8FB;
  --card: #FFFFFF;
  --border: #E4E7F0;
  --slate: #5B6478;
  --slate-light: #9098AC;
  --text: #1A1E2E;
  --amber: #E8A33D;
  --amber-deep: #C77F1E;
  --teal: #1F9E86;
  --coral: #E4574C;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(18,23,43,.04), 0 8px 24px rgba(18,23,43,.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--paper);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .display {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.01em;
}

.mono {
  font-family: 'IBM Plex Mono', monospace;
}

/* ================= LOGIN & REGISTER ================= */
.login-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

@media (max-width: 900px) {
  .login-wrap {
    grid-template-columns: 1fr;
  }
  .login-side {
    display: none;
  }
}

.login-side {
  background: var(--ink);
  color: #fff;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
}

.login-side::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 300px at 80% 10%, rgba(232,163,61,.16), transparent 60%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 20px;
  position: relative;
  z-index: 1;
  color: #fff;
  text-decoration: none;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rail-art {
  position: relative;
  z-index: 1;
}

.rail-art .stage-row {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 14px;
}

.rail-art .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink-line);
  border: 2px solid #3A4570;
  flex-shrink: 0;
}

.rail-art .dot.on {
  background: var(--amber);
  border-color: var(--amber);
}

.rail-art .seg {
  height: 2px;
  flex: 1;
  background: var(--ink-line);
}

.rail-art .seg.on {
  background: var(--amber);
}

.login-side .quote {
  position: relative;
  z-index: 1;
}

.login-side .quote p {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 26px;
  line-height: 1.35;
  max-width: 420px;
  font-weight: 600;
  margin-bottom: 8px;
}

.login-side .quote span {
  color: var(--slate-light);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
}

.login-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.login-form {
  width: 100%;
  max-width: 380px;
}

.login-form h1 {
  font-size: 26px;
  margin: 0 0 6px;
}

.login-form .sub {
  color: var(--slate);
  font-size: 14px;
  margin: 0 0 28px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--text);
}

.field input, .field select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  background: #fff;
  transition: border-color .15s;
}

.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(232,163,61,.15);
}

.btn-primary-vantage {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}

.btn-primary-vantage:hover {
  background: var(--ink-soft);
  color: #fff;
}

.form-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 14px 0 26px;
  font-size: 13px;
}

.form-foot a {
  color: var(--slate);
  text-decoration: none;
}

.form-foot a:hover {
  color: var(--amber-deep);
}

/* ================= APP LAYOUT SHELL ================= */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

@media (max-width: 992px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    height: auto !important;
    position: relative !important;
  }
}

.sidebar {
  background: var(--ink);
  color: #C7CCDE;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
}

.sidebar .brand {
  font-size: 18px;
  padding: 0 6px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--slate-light);
  padding: 0 10px;
  margin-bottom: 6px;
}

.nav-item-vantage {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #C7CCDE;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.nav-item-vantage svg {
  width: 18px;
  height: 18px;
  opacity: .85;
  flex-shrink: 0;
}

.nav-item-vantage:hover {
  background: var(--ink-soft);
  color: #fff;
}

.nav-item-vantage.active {
  background: var(--ink-soft);
  color: #fff;
}

.nav-item-vantage.active svg {
  opacity: 1;
  stroke: var(--amber);
}

.sidebar-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 10px 0;
  border-top: 1px solid var(--ink-line);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--amber);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.sidebar-foot .who {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-foot .role {
  font-size: 11px;
  color: var(--slate-light);
}

.btn-logout {
  background: transparent;
  border: 1px solid var(--ink-line);
  color: #C7CCDE;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
}

.btn-logout:hover {
  background: var(--coral);
  border-color: var(--coral);
  color: #fff;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  gap: 20px;
}

.search {
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--slate-light);
}

.search input {
  border: none;
  background: transparent;
  outline: none;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  width: 100%;
  color: var(--text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-add-vantage {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--amber);
  color: var(--ink);
  border: none;
  padding: 9px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
}

.btn-add-vantage:hover {
  background: var(--amber-deep);
  color: #fff;
}

.content {
  padding: 28px;
  flex-grow: 1;
}

.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 22px;
}

.page-head h1 {
  font-size: 24px;
  margin: 0;
  color: var(--ink);
}

.page-head .sub {
  color: var(--slate);
  font-size: 13.5px;
  margin-top: 4px;
}

/* ================= KPI & METRICS ================= */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.kpi .k-label {
  font-size: 12.5px;
  color: var(--slate);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kpi .k-val {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 28px;
  font-weight: 600;
  margin: 10px 0 4px;
  color: var(--ink);
}

.k-delta {
  font-size: 12px;
  font-weight: 600;
}

.k-delta.up { color: var(--teal); }
.k-delta.down { color: var(--coral); }

/* ================= PIPELINE VISUALIZER ================= */
.pipeline-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.pipeline-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.pipeline-head h3 {
  font-size: 16px;
  margin: 0;
}

.pipeline-head .total {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  color: var(--slate);
}

.stage-rail {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
}

.stage-block {
  flex: 1;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stage-bar {
  height: 10px;
  border-radius: 5px;
  background: var(--border);
  position: relative;
  overflow: hidden;
}

.stage-bar > i {
  position: absolute;
  inset: 0;
  border-radius: 5px;
}

.stage-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stage-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.stage-count {
  font-size: 11.5px;
  color: var(--slate-light);
  font-family: 'IBM Plex Mono', monospace;
}

.stage-val {
  font-size: 13px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  color: var(--ink);
}

/* ================= TWO COL PANELS ================= */
.two-col {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.panel-head h3 {
  font-size: 15px;
  margin: 0;
}

.panel-head a {
  font-size: 12.5px;
  color: var(--amber-deep);
  text-decoration: none;
  font-weight: 600;
}

/* ================= TABLES & CHIPS ================= */
.table-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.chip {
  padding: 8px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: var(--slate);
  cursor: pointer;
  transition: all .15s;
}

.chip.active, .chip:hover {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--slate-light);
  font-weight: 600;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--paper);
}

td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr.data-row:hover {
  background: #FBF9F5;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11.5px;
  font-weight: 600;
}

.pill.won { background: rgba(31,158,134,.12); color: var(--teal); }
.pill.risk { background: rgba(228,87,76,.12); color: var(--coral); }
.pill.active { background: rgba(232,163,61,.15); color: var(--amber-deep); }
.pill.new { background: rgba(18,23,43,.08); color: var(--ink); }

.owner-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
}

.owner-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--amber);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ================= MODALS OVERRIDE ================= */
.modal-content {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 12px 36px rgba(18,23,43,.15);
}

.modal-header {
  border-bottom: 1px solid var(--border);
  padding: 18px 24px;
}

.modal-header .modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 18px;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  border-top: 1px solid var(--border);
  padding: 16px 24px;
}
