:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-soft: #fbfbfd;
  --surface-muted: #f7f7f9;
  --text: #1d1d1f;
  --text-soft: #424245;
  --muted: #6e6e73;
  --line: #e5e5ea;
  --line-strong: #d2d2d7;
  --blue: #0066cc;
  --blue-dark: #004f9f;
  --blue-soft: #edf5ff;
  --green: #0f7b61;
  --green-soft: #edf8f4;
  --yellow-soft: #fff8e8;
  --red: #b42318;
  --red-soft: #fff1f0;
  --purple: #5e5ce6;
  --purple-soft: #f3f2ff;
  --radius: 10px;
  --shadow: 0 8px 28px rgba(29, 29, 31, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 400;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.page-shell {
  width: min(100% - 40px, 1280px);
  margin: 0 auto;
  padding: 22px 0 40px;
}

.app-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 1px 2px rgba(29, 29, 31, 0.04);
  backdrop-filter: blur(18px);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #1d1d1f;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
}

.brand h1 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
}

.brand p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.side-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-muted);
}

.side-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 11px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
}

.side-nav a.active,
.side-nav a:hover {
  color: var(--text);
  background: var(--surface);
}

.main-content {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  align-items: stretch;
  gap: 16px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfd 100%);
  box-shadow: var(--shadow);
}

.eyebrow,
.panel-label,
.group-title {
  margin: 0;
  color: var(--blue);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h2,
h3 {
  margin: 0;
  line-height: 1.16;
  letter-spacing: 0;
}

h2 {
  max-width: 760px;
  margin-top: 8px;
  color: var(--text);
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 500;
}

h3 {
  font-size: 18px;
  font-weight: 500;
}

.follow-up-card {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.next-follow-up {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.45;
}

.topbar-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button,
.ghost-button,
.icon-button,
.mini-button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 500;
}

.primary-button {
  padding: 0 15px;
  background: var(--blue);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--blue-dark);
}

.ghost-button,
.mini-button,
.icon-button {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

.ghost-button,
.mini-button {
  padding: 0 13px;
}

.ghost-button:hover,
.mini-button:hover,
.icon-button:hover {
  background: var(--surface-muted);
}

.icon-button {
  min-width: 64px;
  padding: 0 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
}

.stat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 78px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(29, 29, 31, 0.03);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.stat-card strong {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(340px, 400px) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

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

.form-panel {
  position: sticky;
  top: 18px;
  padding: 20px;
}

.table-panel {
  padding: 20px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.prospect-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.form-group {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

label {
  display: grid;
  gap: 6px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  padding: 10px 11px;
  outline: none;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #9a9aa0;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(0, 102, 204, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.08);
}

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

.generated-link {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--blue-soft);
  font-size: 12px;
}

.generated-link span {
  color: var(--muted);
  font-weight: 500;
}

.generated-link a {
  color: var(--blue);
  font-weight: 500;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.filters {
  display: grid;
  grid-template-columns: minmax(240px, 1.6fr) repeat(4, minmax(130px, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.result-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

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

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  background: var(--surface);
}

th {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-align: left;
  text-transform: uppercase;
}

td {
  padding: 14px 12px;
  border-top: 1px solid #eeeeef;
  vertical-align: middle;
}

tbody tr:first-child td {
  border-top: 0;
}

tbody tr:hover {
  background: #fafafa;
}

.prospect-name {
  color: var(--text);
  font-weight: 500;
}

.subtext {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.channel-row,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-ig {
  color: #9f1239;
  background: #fff3f6;
}

.badge-wa {
  color: var(--green);
  background: var(--green-soft);
}

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

.status-belum {
  color: #6e6e73;
  background: #f1f1f3;
}

.status-sudah {
  color: var(--blue);
  background: var(--blue-soft);
}

.status-membalas {
  color: var(--purple);
  background: var(--purple-soft);
}

.status-tertarik,
.status-closing {
  color: var(--green);
  background: var(--green-soft);
}

.status-follow {
  color: #946200;
  background: var(--yellow-soft);
}

.status-tidak {
  color: var(--red);
  background: var(--red-soft);
}

.status-select {
  min-width: 136px;
  min-height: 36px;
  border-color: transparent;
  padding: 7px 9px;
  font-weight: 500;
}

.mini-button {
  min-height: 32px;
  font-size: 12px;
}

.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.action-row .mini-button {
  color: var(--text-soft);
  background: var(--surface);
  border-color: var(--line);
}

.action-row .mini-button:hover {
  color: var(--text);
  background: var(--surface-muted);
}

.empty-state {
  padding: 34px 12px;
  color: var(--muted);
  text-align: center;
}

.detail-dialog {
  width: min(720px, calc(100vw - 28px));
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  box-shadow: 0 24px 70px rgba(29, 29, 31, 0.18);
}

.detail-dialog::backdrop {
  background: rgba(29, 29, 31, 0.36);
}

.detail-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.detail-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

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

.detail-item {
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.detail-item span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.detail-item strong,
.detail-item p {
  margin: 7px 0 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hidden {
  display: none !important;
}

@media (max-width: 1180px) {
  .app-header {
    grid-template-columns: 1fr auto;
  }

  .side-nav {
    order: 3;
    grid-column: 1 / -1;
    justify-self: start;
  }

  .hero-panel,
  .workspace {
    grid-template-columns: 1fr;
  }

  .form-panel {
    position: static;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

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

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }

  .page-shell {
    width: min(100% - 20px, 1280px);
    padding: 10px 0 28px;
  }

  .app-header {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
    font-size: 14px;
  }

  .brand h1 {
    font-size: 20px;
  }

  .brand p {
    font-size: 14px;
  }

  .main-content {
    gap: 14px;
    margin-top: 14px;
  }

  .side-nav,
  .topbar-actions {
    width: 100%;
  }

  .side-nav {
    justify-content: stretch;
    gap: 4px;
    padding: 4px;
    overflow-x: auto;
  }

  .side-nav a {
    flex: 1 0 auto;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    font-size: 14px;
    text-align: center;
  }

  .topbar-actions button {
    flex: 1 1 calc(50% - 5px);
    min-height: 46px;
    padding: 0 12px;
    font-size: 14px;
  }

  .hero-panel {
    gap: 14px;
    padding: 18px;
  }

  h2 {
    font-size: 30px;
    line-height: 1.12;
  }

  h3 {
    font-size: 21px;
  }

  .eyebrow,
  .panel-label,
  .group-title {
    font-size: 12px;
  }

  .follow-up-card {
    padding: 16px;
  }

  .next-follow-up {
    font-size: 15px;
  }

  .stats-grid,
  .filters,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    gap: 10px;
  }

  .stat-card {
    min-height: 72px;
    padding: 16px;
  }

  .stat-card span {
    font-size: 14px;
  }

  .stat-card strong {
    font-size: 30px;
  }

  .form-panel,
  .table-panel {
    padding: 18px;
  }

  .prospect-form {
    gap: 16px;
    margin-top: 16px;
  }

  .form-group {
    gap: 14px;
    padding: 16px;
  }

  label {
    gap: 8px;
    font-size: 14px;
  }

  input,
  select,
  textarea {
    min-height: 48px;
    padding: 12px 13px;
    font-size: 16px;
  }

  textarea {
    min-height: 118px;
  }

  .generated-link {
    gap: 7px;
    padding: 14px;
    font-size: 14px;
  }

  .primary-button,
  .ghost-button,
  .icon-button,
  .mini-button {
    min-height: 46px;
    font-size: 14px;
  }

  .filters {
    gap: 10px;
    margin: 16px 0;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  table,
  thead,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  table {
    min-width: 0;
    background: transparent;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 12px;
  }

  td {
    display: grid;
    grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 12px 14px;
    border-top: 0;
  }

  tr {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(29, 29, 31, 0.03);
  }

  tr:hover {
    background: var(--surface);
  }

  td::before {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  td:nth-child(1)::before {
    content: "Prospek";
  }

  td:nth-child(2)::before {
    content: "Kontak";
  }

  td:nth-child(3)::before {
    content: "Jasa";
  }

  td:nth-child(4)::before {
    content: "Tanggal";
  }

  td:nth-child(5)::before {
    content: "Status";
  }

  td:nth-child(6)::before {
    content: "Aksi";
  }

  .prospect-name {
    font-size: 16px;
  }

  .subtext {
    font-size: 13px;
  }

  .badge {
    min-height: 26px;
    padding: 4px 9px;
    font-size: 12px;
  }

  .status-select {
    width: 100%;
    min-height: 44px;
    font-size: 14px;
  }

  .action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .action-row .mini-button {
    width: 100%;
  }

  .empty-state {
    display: block;
    padding: 28px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    font-size: 15px;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .detail-dialog {
    width: min(100vw - 20px, 720px);
  }

  .detail-header,
  .detail-body {
    padding: 16px;
  }

  .detail-header {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .page-shell {
    width: min(100% - 16px, 1280px);
  }

  .form-panel,
  .table-panel {
    padding: 16px;
  }

  .hero-panel {
    padding: 16px;
  }

  h2 {
    font-size: 28px;
  }

  .topbar-actions {
    gap: 8px;
  }

  .topbar-actions button {
    flex-basis: 100%;
  }

  td {
    grid-template-columns: 1fr;
    gap: 6px;
  }

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