:root {
  --blue: #0055ff;
  --navy: #00194c;
  --orange: #f26101;
  --ink: #17213a;
  --muted: #687799;
  --line: #dce4f2;
  --soft: #f4f7fb;
  --white: #ffffff;
  --shadow: 0 18px 48px rgba(0, 25, 76, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--ink);
  background: var(--soft);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  background: var(--navy);
  color: var(--white);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--blue);
  font-weight: 800;
}

.brand span,
.owner-card span {
  display: block;
  margin-top: 4px;
  color: #b8c6e8;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  border: 0;
  border-radius: 8px;
  color: #dce6ff;
  background: transparent;
  text-align: left;
  padding: 12px 14px;
}

.nav-item.active,
.nav-item:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.12);
}

.owner-card {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  display: grid;
  gap: 8px;
}

.owner-card a {
  color: var(--white);
  text-decoration: none;
  font-size: 14px;
}

.main {
  padding: 28px;
  overflow: hidden;
}

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

.topbar h1,
.section-head h2,
.drawer h2,
.modal h2 {
  margin: 0;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--blue);
}

.topbar-actions,
.toolbar,
.investor-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.icon-button,
.danger-button {
  border: 0;
  border-radius: 8px;
  min-height: 40px;
  padding: 0 14px;
  font-weight: 700;
}

.primary-button {
  color: var(--white);
  background: var(--blue);
}

.secondary-button {
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--line);
}

.danger-button {
  color: #b42318;
  background: #fff3f0;
  border: 1px solid #ffd1c8;
}

.icon-button {
  width: 40px;
  padding: 0;
  font-size: 24px;
  color: var(--muted);
  background: transparent;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.metric.accent strong {
  color: var(--orange);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  padding: 11px 12px;
}

.toolbar input,
.investor-filters input {
  min-width: 320px;
  flex: 1;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 14px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 12px;
}

.column {
  background: #edf2fb;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 360px;
}

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

.column-head strong {
  font-size: 14px;
}

.column-body {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.lead-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 12px;
  box-shadow: 0 8px 20px rgba(0, 25, 76, 0.05);
}

.lead-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.lead-card p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 13px;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.card-actions button,
.card-actions select {
  min-height: 34px;
  font-size: 12px;
}

.table-wrap {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
}

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

th,
td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}

th {
  color: var(--muted);
  background: #f8faff;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--navy);
  background: #eaf1ff;
  font-size: 12px;
  font-weight: 700;
}

.offer-preview {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.offer-visual {
  min-height: 420px;
  border-radius: 8px;
  background:
    linear-gradient(rgba(0, 25, 76, 0.14), rgba(0, 25, 76, 0.14)),
    url("https://images.unsplash.com/photo-1560185007-c5ca9d2c014d?auto=format&fit=crop&w=1400&q=80") center/cover;
}

.offer-copy {
  align-self: center;
}

.offer-copy p {
  color: var(--muted);
  line-height: 1.6;
}

.tasks-list {
  display: grid;
  gap: 10px;
}

.task {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.task-button {
  width: 100%;
  color: var(--ink);
  text-align: left;
}

.task-button p {
  margin: 6px 0 0;
  color: var(--muted);
}

.modal,
.drawer {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 20;
}

.modal.open,
.drawer.open {
  display: block;
}

.modal {
  background: rgba(0, 25, 76, 0.38);
}

.modal-panel {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  margin: 24px auto;
  overflow: auto;
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.modal-head,
.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 18px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.full {
  grid-column: 1 / -1;
}

.drawer {
  left: auto;
  width: min(620px, 100vw);
  background: var(--white);
  box-shadow: var(--shadow);
  overflow: auto;
}

.accordion {
  border-bottom: 1px solid var(--line);
}

.accordion summary {
  padding: 16px 18px;
  font-weight: 800;
  cursor: pointer;
}

.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 18px 18px;
}

.drawer-form {
  padding-bottom: 18px;
}

.edit-grid label {
  min-width: 0;
}

.drawer-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: var(--white);
}

.detail {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.detail span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.muted-box,
.dispatch-box {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #f8faff;
}

.dispatch-box p {
  margin: 0 0 12px;
  line-height: 1.5;
}

.dispatch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.dispatch-row:last-child {
  border-bottom: 0;
}

.dispatch-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.dispatch-row a {
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.message-preview {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  text-align: center;
}

.message-preview p {
  margin: 10px 0;
  color: var(--ink);
  font-weight: 700;
}

.message-preview a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 8px;
  color: var(--white);
  background: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.notification-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.notification-card pre {
  white-space: pre-wrap;
  margin: 10px 0 0;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
}

.notification-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.notification-card a {
  display: inline-flex;
  margin-top: 10px;
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.photo-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8faff;
}

.reminder-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.reminder-row:last-child {
  border-bottom: 0;
}

.reminder-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.activity-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.activity-row:last-child {
  border-bottom: 0;
}

.activity-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(242, 97, 1, 0.12);
}

.activity-row span,
.activity-row p {
  display: block;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .metrics,
  .kanban,
  .offer-preview {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .main,
  .sidebar {
    padding: 16px;
  }

  .topbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .metrics {
    grid-template-columns: 1fr 1fr;
  }

  .form-grid,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .toolbar input,
  .investor-filters input {
    min-width: 100%;
  }

  .dispatch-row {
    grid-template-columns: 1fr;
  }

  .inline-form,
  .reminder-row {
    grid-template-columns: 1fr;
  }
}
