:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #fdfefe;
  --ink: #111827;
  --muted: #667085;
  --line: #e5e7eb;
  --line-strong: #d0d5dd;
  --green: #168a5b;
  --green-soft: #e9f7f1;
  --blue: #2563eb;
  --blue-soft: #eaf1ff;
  --amber: #b7791f;
  --amber-soft: #fff6df;
  --red: #c2413b;
  --red-soft: #fff0ef;
  --shadow: 0 18px 50px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.layout {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--surface);
  padding: 22px 16px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 26px;
  padding: 0 6px;
}

.brand strong {
  letter-spacing: 0.18em;
  font-size: 15px;
}

.demo-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 5px 8px;
}

.nav-group-label {
  margin: 18px 8px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #344054;
  padding: 11px 10px;
  text-align: left;
  font-weight: 700;
}

.nav-link:hover,
.nav-link.active {
  background: #f0f3f7;
  color: var(--ink);
}

.nav-count {
  color: var(--muted);
  font-size: 12px;
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 247, 249, 0.92);
  backdrop-filter: blur(12px);
  padding: 16px 22px;
}

.global-search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 11px 12px;
}

.role-switch {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.role-switch button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  font-weight: 800;
}

.role-switch button.active {
  background: var(--ink);
  color: white;
}

.profile {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px 10px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.content {
  padding: 26px 28px 48px;
}

.view-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 20px;
}

.eyebrow {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: 34px;
  letter-spacing: 0;
}

h2 {
  font-size: 22px;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

p,
.muted {
  color: var(--muted);
  line-height: 1.55;
}

.button {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 13px;
  font-weight: 800;
}

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

.button.danger {
  border-color: var(--red);
  background: var(--red);
  color: white;
}

.button.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.card,
.panel,
.table-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card,
.panel {
  padding: 18px;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.split {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
}

.filter-panel {
  align-self: start;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field label {
  color: #475467;
  font-size: 13px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 11px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.chip,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}

.chip {
  border: 1px solid var(--line);
  background: var(--surface);
}

.badge {
  background: #f2f4f7;
  color: #344054;
}

.badge.active,
.badge.approved,
.badge.success {
  background: var(--green-soft);
  color: var(--green);
}

.badge.pending,
.badge.review,
.badge.negotiation {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge.rejected,
.badge.flagged,
.badge.danger {
  background: var(--red-soft);
  color: var(--red);
}

.badge.info {
  background: var(--blue-soft);
  color: var(--blue);
}

.idea-card {
  display: grid;
  gap: 12px;
  border-left: 4px solid var(--green);
}

.idea-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.favorite {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  min-width: 38px;
  height: 34px;
  color: var(--muted);
  font-size: 18px;
}

.favorite.active {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-soft);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  border-left: 2px solid var(--line-strong);
  padding-left: 12px;
}

.deal-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 16px;
}

.list-item {
  display: grid;
  gap: 6px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 13px;
  text-align: left;
}

.list-item.active {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 138, 91, 0.12);
}

.message {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-2);
}

.offer {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 14px;
}

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

.stat strong {
  display: block;
  font-size: 30px;
  margin-bottom: 5px;
}

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

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

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tr:hover td {
  background: #fbfcfd;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(17, 24, 39, 0.42);
  padding: 20px;
}

.modal {
  width: min(620px, 100%);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(16, 24, 40, 0.24);
  padding: 20px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1040px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .topbar,
  .split,
  .detail-layout,
  .deal-layout,
  .grid.cols-2,
  .grid.cols-3,
  .stat-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .content {
    padding: 18px;
  }

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

  .view-head {
    align-items: start;
    flex-direction: column;
  }
}
