:root { color-scheme: light; }
* { box-sizing: border-box; }
body {
  margin: 0; padding: 0; background: #f7f7f8; color: #1f2937;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 20px 60px; }
h1 { font-size: 22px; margin: 0 0 2px; }
.subtitle { color: #6b7280; font-size: 13px; margin-bottom: 20px; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; background: #fff; border-bottom: 1px solid #e5e7eb;
}
.topbar .who { font-size: 13px; color: #374151; }
.topbar .who strong { color: #111827; }
.topbar a { color: #b45309; text-decoration: none; font-size: 13px; font-weight: 600; margin-left: 14px; }
.topbar a:hover { text-decoration: underline; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid #e5e7eb; margin-bottom: 20px; flex-wrap: wrap; }
.tabs a {
  padding: 9px 16px; text-decoration: none; font-size: 14px; color: #6b7280;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a.active { color: #b45309; border-bottom-color: #b45309; font-weight: 600; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 12px; margin-bottom: 20px; }
.card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px 16px; }
.card .num { font-size: 24px; font-weight: 700; }
.card .label { font-size: 12px; color: #6b7280; margin-top: 2px; }
.card.overdue .num { color: #dc2626; }

.panel-box { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px; margin-bottom: 18px; }
.panel-box h2 { font-size: 15px; margin: 0 0 12px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
select, input[type=text], input[type=date], input[type=email], input[type=password] {
  font-size: 13px; padding: 7px 9px; border: 1px solid #d1d5db; border-radius: 6px; background: #fff; color: #1f2937;
}
textarea { font-family: inherit; font-size: 13px; padding: 7px 9px; border: 1px solid #d1d5db; border-radius: 6px; resize: vertical; min-height: 60px; width: 100%; }

button, .btn {
  background: #b45309; color: #fff; border: none; padding: 8px 14px; border-radius: 6px;
  font-size: 13px; cursor: pointer; font-weight: 600; text-decoration: none; display: inline-block;
}
button:hover, .btn:hover { background: #92400e; }
.btn-ghost {
  background: none; border: 1px solid #d1d5db; padding: 7px 13px; border-radius: 6px; cursor: pointer;
  font-size: 13px; color: #374151; text-decoration: none; display: inline-block;
}
.btn-ghost:hover { background: #f3f4f6; }
.link-danger { background: none; border: none; color: #dc2626; cursor: pointer; font-size: 12px; padding: 2px 4px; }
.link-danger:hover { text-decoration: underline; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 8px; border-bottom: 1px solid #f0f0f1; vertical-align: top; }
th { color: #6b7280; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
tr.overdue-row td { background: #fef2f2; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge.Sales { background: #dbeafe; color: #1e40af; }
.badge.Academic { background: #dcfce7; color: #166534; }
.badge.High { background: #fee2e2; color: #991b1b; }
.badge.Medium { background: #fef3c7; color: #92400e; }
.badge.Low { background: #e5e7eb; color: #374151; }
.badge.role-founder { background: #ede9fe; color: #5b21b6; }
.badge.role-manager { background: #fce7f3; color: #9d174d; }
.badge.role-member { background: #e5e7eb; color: #374151; }

.badge.stage-New { background: #e5e7eb; color: #374151; }
.badge.stage-Contacted { background: #dbeafe; color: #1e40af; }
.badge.stage-Trial-Scheduled { background: #fef3c7; color: #92400e; }
.badge.stage-Trial-Completed { background: #fed7aa; color: #9a3412; }
.badge.stage-Enrolled { background: #dcfce7; color: #166534; }
.badge.stage-Lost { background: #fee2e2; color: #991b1b; }

.status-select { font-size: 12px; padding: 3px 5px; }

.empty { color: #9ca3af; font-size: 13px; padding: 20px 0; text-align: center; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: #374151; margin-bottom: 4px; font-weight: 600; }
.field select, .field input, .field textarea { width: 100%; }

.alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-success { background: #dcfce7; color: #166534; }

.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #f7f7f8;
}
.login-box { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 32px; width: 360px; max-width: 92vw; }
.login-box h1 { font-size: 18px; text-align: center; margin-bottom: 4px; }
.login-box .subtitle { text-align: center; margin-bottom: 20px; }
.login-box button { width: 100%; padding: 10px; margin-top: 4px; }

.roster { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip { background: #f3f4f6; border-radius: 999px; padding: 5px 10px; font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }

.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
