/* ================================================
   DASHBOARD — ExitOS
   Matches landing page tokens from theme.css
   ================================================ */

/* ---- Layout ---- */
.dash-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ivory);
  border-bottom: 1px solid var(--mist);
}
.dash-nav__inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.dash-nav__left, .dash-nav__right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.dash-nav__brand {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  text-decoration: none;
}
.dash-nav__logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--navy);
}
.dash-nav__sep {
  color: var(--mist);
  font-weight: 300;
}
.dash-nav__page {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--slate);
  font-weight: 400;
}

.dash-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

/* ---- View Toggle ---- */
.view-btn {
  background: none;
  border: 1px solid var(--mist);
  border-radius: var(--radius);
  padding: 0.4rem 1rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--slate);
  cursor: pointer;
  transition: all 0.15s;
}
.view-btn:hover { border-color: var(--gold); color: var(--navy); }
.view-btn--active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

/* ---- Kanban ---- */
.kanban {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
}
.kanban__col {
  flex: 0 0 220px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
}
.kanban__col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--white);
  border: 1px solid var(--mist);
  border-radius: var(--radius) var(--radius) 0 0;
}
.kanban__col-name {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy);
}
.kanban__col-count {
  background: var(--mist);
  color: var(--slate);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  min-width: 1.5rem;
  text-align: center;
}
.kanban__col-body {
  flex: 1;
  background: var(--white);
  border: 1px solid var(--mist);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 200px;
}

/* ---- Deal Cards ---- */
.deal-card {
  background: var(--ivory);
  border: 1px solid var(--mist);
  border-radius: var(--radius);
  padding: 0.875rem;
  cursor: pointer;
  transition: all 0.15s;
}
.deal-card:hover {
  border-color: var(--gold);
  box-shadow: 0 2px 8px rgba(15,31,56,0.08);
}
.deal-card__company {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--navy);
  margin-bottom: 0.25rem;
}
.deal-card__sector {
  font-size: 0.75rem;
  color: var(--slate);
  margin-bottom: 0.25rem;
}
.deal-card__size {
  font-family: var(--font-display);
  font-size: 0.875rem;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.deal-card__activity {
  font-size: 0.7rem;
  color: var(--slate);
  opacity: 0.7;
  margin-bottom: 0.2rem;
}
.deal-card__step {
  font-size: 0.75rem;
  color: var(--navy);
  font-style: italic;
  border-top: 1px solid var(--mist);
  padding-top: 0.4rem;
  margin-top: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- List View ---- */
.list-view { width: 100%; }
.deal-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border: 1px solid var(--mist);
  border-radius: var(--radius);
  overflow: hidden;
}
.deal-table th {
  background: var(--ivory);
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate);
  border-bottom: 1px solid var(--mist);
}
.deal-table td {
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  color: var(--ink);
  border-bottom: 1px solid var(--mist);
  vertical-align: middle;
}
.deal-row:hover td { background: rgba(232,210,168,0.15); }
.deal-row:last-child td { border-bottom: none; }
.empty-row { text-align: center; color: var(--slate); padding: 3rem; }

.deal-row__company { font-weight: 600; color: var(--navy); }

.stage-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--mist);
  color: var(--slate);
}
.stage-badge--understanding { background: #e8f0fe; color: #1a73e8; }
.stage-badge--positioning   { background: #fef3e2; color: #b06000; }
.stage-badge--outreach      { background: #f3e8fe; color: #7c3aed; }
.stage-badge--offers        { background: #fef9e2; color: #a07000; }
.stage-badge--dd            { background: #e2fef3; color: #007a5e; }
.stage-badge--closing       { background: #e2f7fe; color: #0070b0; }

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.5;
  transition: opacity 0.15s;
  padding: 0.25rem;
}
.btn-icon:hover { opacity: 1; }

/* ---- Modal ---- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,31,56,0.5);
}
.modal__box {
  position: relative;
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(15,31,56,0.25);
}
.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.modal__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
}
.modal__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--slate);
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.modal__close:hover { color: var(--navy); }

/* ---- Form ---- */
.deal-form { display: flex; flex-direction: column; gap: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-field { display: flex; flex-direction: column; gap: 0.375rem; }
.form-field label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--navy);
}
.form-field input,
.form-field select,
.form-field textarea {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--ink);
  background: var(--ivory);
  border: 1px solid var(--mist);
  border-radius: var(--radius);
  padding: 0.6rem 0.875rem;
  outline: none;
  transition: border-color 0.15s;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { border-color: var(--gold); }
.form-field textarea { resize: vertical; }
.form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  align-items: center;
  padding-top: 0.5rem;
  border-top: 1px solid var(--mist);
  margin-top: 0.5rem;
}

/* ---- Buttons ---- */
.btn-primary {
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 0.6rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: #1a3350; }

.btn-ghost {
  background: none;
  border: 1px solid var(--mist);
  border-radius: var(--radius);
  padding: 0.6rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--slate);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-ghost:hover { border-color: var(--slate); }

.btn-danger {
  background: #d32f2f;
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 0.6rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  margin-right: auto;
  transition: background 0.15s;
}
.btn-danger:hover { background: #b71c1c; }

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(15,31,56,0.25);
  z-index: 300;
  animation: toastIn 0.2s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .dash-main { padding: 1rem; }
  .kanban { gap: 0.75rem; }
  .kanban__col { flex: 0 0 180px; }
  .form-row { grid-template-columns: 1fr; }
  .deal-table th:nth-child(5),
  .deal-table td:nth-child(5),
  .deal-table th:nth-child(6),
  .deal-table td:nth-child(6) { display: none; }
  .modal__box { margin: 1rem; }
}