:root {
  --bg: #0b0f19;
  --bg-gradient: radial-gradient(circle at 50% 0%, #1e1b4b 0%, #0b0f19 70%);
  --surface: rgba(17, 24, 39, 0.7);
  --surface-border: rgba(255, 255, 255, 0.08);
  --surface-hover: rgba(255, 255, 255, 0.03);
  --surface-soft: rgba(31, 41, 55, 0.6);
  --surface-muted: rgba(24, 32, 49, 0.8);
  
  --text: #f3f4f6;
  --text-soft: #d1d5db;
  --muted: #9ca3af;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.15);
  
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-soft: rgba(99, 102, 241, 0.15);
  --primary-glow: rgba(99, 102, 241, 0.4);
  
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.15);
  --green-text: #34d399;
  
  --yellow: #f59e0b;
  --yellow-soft: rgba(245, 158, 11, 0.15);
  --yellow-text: #fbbf24;
  
  --red: #f43f5e;
  --red-soft: rgba(244, 63, 94, 0.15);
  --red-text: #fb7185;
  
  --purple: #8b5cf6;
  --purple-soft: rgba(139, 92, 246, 0.15);
  --purple-text: #a78bfa;
  
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  --brand-gradient: linear-gradient(to right, #ffffff, #c7d2fe);
  --dialog-bg: #111827;
  --input-bg: rgba(10, 15, 30, 0.6);
  --input-bg-focus: rgba(10, 15, 30, 0.8);
  --detail-p-bg: rgba(0, 0, 0, 0.2);
}

html[data-theme="light"] {
  --bg: #f3f4f6;
  --bg-gradient: radial-gradient(circle at 50% 0%, #e2e8f0 0%, #f3f4f6 70%);
  --surface: rgba(255, 255, 255, 0.7);
  --surface-border: rgba(0, 0, 0, 0.08);
  --surface-hover: rgba(0, 0, 0, 0.03);
  --surface-soft: rgba(243, 244, 246, 0.6);
  --surface-muted: rgba(229, 231, 235, 0.8);
  
  --text: #111827;
  --text-soft: #374151;
  --muted: #6b7280;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.15);
  
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-soft: rgba(79, 70, 229, 0.15);
  --primary-glow: rgba(79, 70, 229, 0.4);
  
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.15);
  --green-text: #059669;
  
  --yellow: #d97706;
  --yellow-soft: rgba(217, 119, 6, 0.15);
  --yellow-text: #b45309;
  
  --red: #e11d48;
  --red-soft: rgba(225, 29, 72, 0.15);
  --red-text: #be123c;
  
  --purple: #7c3aed;
  --purple-soft: rgba(124, 58, 237, 0.15);
  --purple-text: #6d28d9;
  
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.1);
  
  --brand-gradient: linear-gradient(to right, #111827, #4f46e5);
  --dialog-bg: #ffffff;
  --input-bg: rgba(255, 255, 255, 0.8);
  --input-bg-focus: #ffffff;
  --detail-p-bg: rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
}

body {
  min-height: 100vh;
  background: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Page Shell Layout */
.page-shell {
  width: min(100% - 40px, 1280px);
  margin: 0 auto;
  padding: 24px 0 60px;
}

/* App Header & Brand */
.app-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 16px 24px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  background: rgba(17, 24, 39, 0.6);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  user-select: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.brand h1 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand p {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Navigation Links */
.side-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  background: rgba(10, 15, 30, 0.5);
  justify-self: center;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
}

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

.side-nav a.active {
  color: #ffffff;
  background: var(--primary-soft);
  border: 1px solid rgba(99, 102, 241, 0.2);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.1);
}

.nav-icon {
  opacity: 0.8;
}

/* Sync status badge */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sync-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--surface-border);
  background: rgba(10, 15, 30, 0.4);
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ca3af;
  display: inline-block;
}

.synced .sync-dot {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s infinite;
}

.local-only .sync-dot {
  background: var(--yellow);
  box-shadow: 0 0 8px var(--yellow);
}

.sync-error {
  border-color: rgba(244, 63, 94, 0.3);
  background: rgba(244, 63, 94, 0.08);
  color: var(--red-text);
}

.sync-error .sync-dot {
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  animation: pulse 1s infinite;
}

.checking .sync-dot {
  background: var(--muted);
  box-shadow: none;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.5; }
}

/* Main Content & Section headings */
.main-content {
  display: grid;
  gap: 24px;
}

.hero-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 32px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow), var(--shadow-glow);
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}

.hero-panel::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.eyebrow {
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

h2 {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 600;
  line-height: 1.25;
  color: #ffffff;
}

.follow-up-card {
  padding: 20px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  min-width: 280px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.panel-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.next-follow-up {
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
}

/* Stats Section */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 22px 24px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4), 0 0 15px rgba(99, 102, 241, 0.1);
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.stat-card strong {
  color: var(--text);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
}

/* Panels (Form & Database Table) */
.form-panel,
.table-panel,
.settings-panel {
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  padding: 28px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 24px;
}

.section-heading h3 {
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
}

/* Forms */
.prospect-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.form-group {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  grid-column: span 1;
}

.form-group.full-width {
  grid-column: span 2;
}

.group-title {
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  padding: 10px 14px;
  outline: none;
  font-size: 14px;
  transition: var(--transition);
}

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

input::placeholder,
textarea::placeholder {
  color: #555e70;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  background: var(--input-bg-focus);
}

select option {
  background: var(--dialog-bg);
  color: var(--text);
}

.full-width {
  grid-column: span 2;
}

.generated-link {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.08);
  font-size: 13px;
  align-items: center;
}

.generated-link span {
  color: var(--muted);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.generated-link a {
  color: #a5b4fc;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.generated-link a:hover {
  text-decoration: underline;
  color: #ffffff;
}

/* Buttons */
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.primary-button,
.ghost-button,
.mini-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.primary-button {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.primary-button:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-color: var(--line);
}

.ghost-button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.danger-button {
  background: rgba(244, 63, 94, 0.1);
  color: var(--red-text);
  border-color: rgba(244, 63, 94, 0.2);
}

.danger-button:hover {
  background: var(--red);
  color: #ffffff;
}

/* Database Filters & Table */
.filters {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.result-count {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: 99px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  background: rgba(10, 15, 30, 0.3);
}

table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  text-align: left;
}

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

td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

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

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

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

.channel-row {
  display: flex;
  margin-top: 6px;
}

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

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.badge-ig {
  color: var(--purple-text);
  background: var(--purple-soft);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.badge-wa {
  color: var(--green-text);
  background: var(--green-soft);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-both {
  color: #818cf8;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Status selection cell and options */
.status-select {
  min-width: 140px;
  min-height: 32px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
}

.status-belum {
  color: #9ca3af;
  background: rgba(156, 163, 175, 0.15);
  border: 1px solid rgba(156, 163, 175, 0.25);
}

.status-sudah {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.status-membalas {
  color: var(--purple-text);
  background: var(--purple-soft);
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.status-tertarik {
  color: var(--green-text);
  background: var(--green-soft);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-follow {
  color: var(--yellow-text);
  background: var(--yellow-soft);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.status-closing {
  color: #ffffff;
  background: rgba(16, 185, 129, 0.4);
  border: 1px solid var(--green);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.status-tidak {
  color: var(--red-text);
  background: var(--red-soft);
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.mini-button {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--text-soft);
}

.mini-button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.mini-button.success {
  background: var(--green-soft);
  color: var(--green-text);
  border-color: rgba(16, 185, 129, 0.2);
}
.mini-button.success:hover {
  background: var(--green);
  color: #ffffff;
}

/* Detail dialog */
.detail-dialog {
  width: min(680px, calc(100% - 32px));
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 0;
  background: var(--dialog-bg);
  color: var(--text);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  margin: auto;
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
}

.detail-dialog[open] {
  display: flex;
}

.detail-dialog::backdrop {
  background: rgba(3, 7, 18, 0.7);
  backdrop-filter: blur(8px);
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.detail-header h3 {
  font-size: 20px;
  color: var(--text);
}

.detail-body {
  padding: 24px;
  display: grid;
  gap: 20px;
  overflow-y: auto;
}

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

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

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

.detail-item strong,
.detail-item p {
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.detail-item p {
  background: var(--detail-p-bg);
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-border);
  font-family: monospace;
  white-space: pre-wrap;
}

.detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 20px 24px;
  background: var(--surface-soft);
}

/* Empty states */
.empty-state {
  padding: 48px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* settings template UI */
.template-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.template-tokens {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.token-badge {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-family: monospace;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--surface-border);
  color: var(--text-soft);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: var(--transition);
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* In dark mode: show sun, hide moon */
html[data-theme="dark"] .theme-toggle-btn .moon-icon {
  display: none;
}
html[data-theme="dark"] .theme-toggle-btn .sun-icon {
  display: block;
}

/* In light mode: show moon, hide sun */
html[data-theme="light"] .theme-toggle-btn .sun-icon {
  display: none;
}
html[data-theme="light"] .theme-toggle-btn .moon-icon {
  display: block;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .app-header {
    grid-template-columns: 1fr auto;
    gap: 16px;
  }

  .side-nav {
    order: 3;
    grid-column: 1 / -1;
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
  }
  
  .side-nav a {
    flex-shrink: 0;
  }

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

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

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

  .form-group, .form-group.full-width {
    grid-column: span 1;
  }

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

@media (max-width: 768px) {
  .page-shell {
    width: min(100% - 24px, 1280px);
    padding: 16px 0 40px;
  }

  /* Table to Cards Transformation on Mobile */
  .table-wrap {
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  table, tbody, tr, td {
    display: block;
    width: 100%;
  }
  
  table {
    min-width: 0;
  }

  table thead {
    display: none; /* Hide header columns */
  }

  tbody tr {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    transition: var(--transition);
  }

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

  td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    text-align: right;
  }

  /* Prospect Name (First column) acts as Card Header */
  td:first-child {
    display: block;
    text-align: left;
    padding-top: 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--line);
  }

  td:first-child .prospect-name {
    font-size: 16px;
    margin-bottom: 2px;
  }

  /* Action row (Last column) at the bottom */
  td:last-child {
    border-bottom: 0;
    padding-bottom: 0;
    padding-top: 14px;
    justify-content: flex-end;
  }

  /* Pseudo-label injection for mobile fields */
  td:nth-child(2)::before {
    content: "Kontak";
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  td:nth-child(3)::before {
    content: "Jasa";
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  td:nth-child(4)::before {
    content: "Tanggal";
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  td:nth-child(5)::before {
    content: "Status";
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  /* Align status select nicely in mobile card */
  td select.status-select {
    margin-left: auto;
  }

  .action-row {
    justify-content: flex-end;
    width: 100%;
  }

  /* Hide scrollbars on navigation scroll */
  .side-nav {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
  }
  .side-nav::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
  }
}

@media (max-width: 640px) {
  .app-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    padding: 20px 16px;
  }

  .brand {
    flex-direction: column;
    gap: 8px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: center;
    gap: 8px;
  }

  .side-nav {
    width: 100%;
    justify-content: space-around;
  }

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

  .hero-panel {
    padding: 20px;
    text-align: center;
  }

  .follow-up-card {
    min-width: 100%;
  }

  .section-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

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