/* ====================================
   MJP AGEN PORTAL — Stylesheet
   Mobile-first, professional partner aesthetic
   ==================================== */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f7f8f5;
  color: #0f1d17;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

:root {
  /* Color system: deep forest + warm gold accent */
  --color-bg: #f7f8f5;
  --color-bg-alt: #ffffff;
  --color-bg-card: #ffffff;
  --color-surface: #f0ede4;
  --color-surface-2: #e8e4d6;
  
  --color-ink: #0f1d17;
  --color-ink-2: #2d4339;
  --color-ink-3: #5b6f64;
  --color-ink-4: #8a9b91;
  
  --color-brand: #0a3d2e;        /* deep forest green */
  --color-brand-lighter: #14523f;
  --color-brand-dark: #062418;
  --color-accent: #d4a437;        /* warm gold */
  --color-accent-light: #e8c068;
  
  --color-success: #16a34a;
  --color-warning: #d97706;
  --color-error: #dc2626;
  --color-info: #2563eb;
  
  --color-hot: #dc2626;
  --color-warm: #d97706;
  --color-cold: #6b7280;
  
  --border: #e3e0d3;
  --border-strong: #cdc8b6;
  
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  
  --shadow-sm: 0 1px 2px rgba(15, 29, 23, 0.04);
  --shadow: 0 2px 8px rgba(15, 29, 23, 0.06);
  --shadow-lg: 0 8px 24px rgba(15, 29, 23, 0.08);
  
  --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============= SHARED ============= */

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--color-bg-alt);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgba(10, 61, 46, 0.1);
}

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

label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--color-ink-2);
}
label small, .form-group small {
  display: block;
  font-weight: 400;
  font-size: 12px;
  color: var(--color-ink-4);
  margin-top: 4px;
}

.req { color: var(--color-error); margin-left: 2px; }

/* Buttons */
.btn-primary, .btn-ghost, .btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
  user-select: none;
}
.btn-primary {
  background: var(--color-brand);
  color: white;
}
.btn-primary:hover { background: var(--color-brand-lighter); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: transparent;
  color: var(--color-ink-2);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--color-surface); }

.btn-lg { padding: 14px 24px; font-size: 16px; width: 100%; }

.btn-accent {
  background: var(--color-accent);
  color: var(--color-brand-dark);
  font-weight: 700;
}
.btn-accent:hover { background: var(--color-accent-light); }

.btn-danger {
  background: var(--color-error);
  color: white;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 20px;
  background: var(--color-ink);
  color: white;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: all 250ms;
  z-index: 9999;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { background: var(--color-success); }
.toast.error { background: var(--color-error); }

/* Loading overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--color-brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spin {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 6px;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============= DAFTAR PAGE ============= */

.page-daftar {
  background: linear-gradient(180deg, var(--color-brand-dark) 0%, var(--color-brand) 60%, var(--color-bg) 60.01%);
  min-height: 100vh;
}

.daftar-shell {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

.daftar-hero {
  padding: 32px 8px 28px;
  color: white;
  text-align: center;
}
.hero-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--color-accent);
  color: var(--color-brand-dark);
  font-weight: 800;
  font-size: 22px;
  border-radius: 12px;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
  box-shadow: 0 4px 16px rgba(212, 164, 55, 0.3);
}
.daftar-hero h1 {
  margin: 0 0 8px;
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.hero-em {
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-tag {
  margin: 0 0 24px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}
.hero-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
}
.meta-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.meta-num {
  font-size: 16px;
  font-weight: 700;
  color: white;
}
.meta-lbl {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}
.meta-divider {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.2);
}

.why-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: -8px 0 16px;
  box-shadow: var(--shadow-lg);
}
.why-card h3 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-brand);
}
.why-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.why-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  font-size: 14px;
  color: var(--color-ink-2);
}
.why-list .check {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background: var(--color-brand);
  color: white;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  margin-top: 1px;
}

.form-card, .success-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.form-card h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  color: var(--color-ink);
}
.form-sub {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--color-ink-3);
}

.form-group {
  margin-bottom: 16px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; gap: 0; }
}

.form-section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-brand);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.form-section-divider::before,
.form-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.form-consent {
  margin: 16px 0 20px;
  padding: 12px;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--color-ink-2);
}
.form-consent label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  font-weight: 400;
  cursor: pointer;
}
.form-consent input[type=checkbox] {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  flex-shrink: 0;
  accent-color: var(--color-brand);
}

.success-card {
  text-align: center;
  padding: 40px 24px;
}
.success-icon {
  width: 64px;
  height: 64px;
  background: var(--color-success);
  color: white;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 16px;
  font-weight: 700;
  animation: pop 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes pop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.success-card h2 {
  margin: 0 0 12px;
  font-size: 24px;
  color: var(--color-brand);
}
.success-card p {
  margin: 0 0 12px;
  color: var(--color-ink-3);
  line-height: 1.6;
}
.success-meta {
  font-size: 13px;
  color: var(--color-ink-4);
  margin-top: 16px !important;
}
.success-card .btn-ghost {
  margin-top: 16px;
}

.daftar-footer {
  text-align: center;
  padding: 20px;
  font-size: 13px;
  color: var(--color-ink-3);
}
.daftar-footer a {
  color: var(--color-brand);
  font-weight: 600;
  text-decoration: none;
}
.footer-meta {
  font-size: 11px;
  color: var(--color-ink-4);
  margin-top: 8px;
}

/* ============= APP SHELL ============= */

#app { min-height: 100vh; display: flex; flex-direction: column; }

/* ============= LOGIN PAGE ============= */

.login-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, var(--color-brand-dark) 0%, var(--color-brand) 100%);
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
}
.login-shell::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 80%;
  height: 80%;
  background: radial-gradient(circle, rgba(212, 164, 55, 0.15), transparent 70%);
  pointer-events: none;
}
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  margin: auto;
  background: white;
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}
.login-brand .hero-mark {
  margin-bottom: 12px;
}
.login-brand h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--color-brand);
  letter-spacing: -0.3px;
}
.login-brand p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--color-ink-3);
}
.login-form .form-group { margin-bottom: 14px; }
.login-actions {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.login-footer {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  color: var(--color-ink-3);
}
.login-footer a {
  color: var(--color-brand);
  font-weight: 600;
  text-decoration: none;
}

/* ============= DASHBOARD / APP LAYOUT ============= */

.app-header {
  background: var(--color-brand);
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.app-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.app-header-brand .mark {
  width: 32px;
  height: 32px;
  background: var(--color-accent);
  color: var(--color-brand-dark);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
}
.app-header-brand .title {
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
}
.app-header-brand .sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  margin-top: 2px;
}
.app-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.app-header-actions button {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-header-actions button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.app-content {
  flex: 1;
  padding: 16px;
  padding-bottom: 80px; /* space for bottom nav */
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid var(--border);
  padding: 8px 4px max(8px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-around;
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  text-decoration: none;
  color: var(--color-ink-4);
  font-size: 11px;
  font-weight: 600;
  transition: color var(--transition);
  border-radius: 8px;
}
.bottom-nav a.active {
  color: var(--color-brand);
}
.bottom-nav a svg {
  width: 22px;
  height: 22px;
  margin-bottom: 1px;
}

/* ============= CARDS / WIDGETS ============= */

.card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-ink);
  margin: 0;
}
.card-link {
  font-size: 13px;
  color: var(--color-brand);
  text-decoration: none;
  font-weight: 600;
}

/* Greeting card */
.greeting-card {
  background: linear-gradient(135deg, var(--color-brand) 0%, var(--color-brand-lighter) 100%);
  color: white;
  border: none;
}
.greeting-card .hello {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 4px;
}
.greeting-card h2 {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 700;
}
.greeting-card .ref-link-box {
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  word-break: break-all;
}
.greeting-card .ref-link-box .url {
  flex: 1;
  color: rgba(255, 255, 255, 0.95);
}
.greeting-card .ref-link-box button {
  background: var(--color-accent);
  color: var(--color-brand-dark);
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.stat-tile {
  background: var(--color-bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.stat-tile .label {
  font-size: 11px;
  color: var(--color-ink-3);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.stat-tile .value {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-ink);
  line-height: 1.1;
}
.stat-tile .meta {
  font-size: 12px;
  color: var(--color-ink-4);
  margin-top: 4px;
}
.stat-tile.tile-accent {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-light) 100%);
  border-color: transparent;
  color: var(--color-brand-dark);
}
.stat-tile.tile-accent .label,
.stat-tile.tile-accent .meta {
  color: rgba(6, 36, 24, 0.7);
}

/* Lead list */
.lead-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.lead-item:last-child { border-bottom: none; }
.lead-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--color-brand);
  flex-shrink: 0;
}
.lead-info {
  flex: 1;
  min-width: 0;
}
.lead-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-ink);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lead-meta {
  font-size: 12px;
  color: var(--color-ink-4);
  margin-top: 2px;
}
.lead-score {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
}
.score-hot { background: rgba(220, 38, 38, 0.1); color: var(--color-hot); }
.score-warm { background: rgba(217, 119, 6, 0.1); color: var(--color-warm); }
.score-cold { background: rgba(107, 114, 128, 0.1); color: var(--color-cold); }

/* Status badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  background: var(--color-surface);
  color: var(--color-ink-2);
}
.status-new { background: rgba(37, 99, 235, 0.1); color: var(--color-info); }
.status-contacted { background: rgba(217, 119, 6, 0.1); color: var(--color-warning); }
.status-booked { background: rgba(22, 163, 74, 0.1); color: var(--color-success); }

/* Leaderboard */
.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.leaderboard-row:last-child { border-bottom: none; }
.leaderboard-row.is-me {
  background: linear-gradient(90deg, rgba(212, 164, 55, 0.08), transparent);
  margin: 0 -18px;
  padding: 10px 18px;
}
.lb-rank {
  width: 28px;
  text-align: center;
  font-weight: 700;
  color: var(--color-ink-3);
  font-size: 14px;
}
.lb-rank.top { font-size: 18px; }
.lb-name {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
  color: var(--color-ink);
}
.lb-name .me-tag {
  background: var(--color-accent);
  color: var(--color-brand-dark);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.lb-stat {
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-ink-2);
}
.lb-stat .num { display: block; }
.lb-stat .label { font-size: 10px; color: var(--color-ink-4); font-weight: 500; }

/* Announcement */
.announcement {
  border-left: 3px solid var(--color-accent);
  padding: 12px 14px;
  background: linear-gradient(90deg, rgba(212, 164, 55, 0.08), transparent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 10px;
}
.announcement-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--color-ink);
  margin: 0 0 4px;
}
.announcement-body {
  font-size: 13px;
  color: var(--color-ink-3);
  line-height: 1.5;
}
.announcement-meta {
  font-size: 11px;
  color: var(--color-ink-4);
  margin-top: 6px;
}

/* Commission item */
.commission-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.commission-item:last-child { border-bottom: none; }
.commission-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}
.commission-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-ink);
}
.commission-amount {
  font-weight: 700;
  font-size: 15px;
  color: var(--color-brand);
}
.commission-meta {
  font-size: 12px;
  color: var(--color-ink-4);
  display: flex;
  justify-content: space-between;
}

/* Empty state */
.empty {
  text-align: center;
  padding: 32px 20px;
  color: var(--color-ink-3);
}
.empty-icon {
  font-size: 48px;
  margin-bottom: 8px;
  opacity: 0.5;
}
.empty-title {
  font-weight: 600;
  font-size: 15px;
  margin: 4px 0;
  color: var(--color-ink-2);
}
.empty-sub {
  font-size: 13px;
  color: var(--color-ink-4);
}

/* Page title */
.page-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--color-ink);
  margin: 0 0 4px;
  letter-spacing: -0.5px;
}
.page-subtitle {
  font-size: 14px;
  color: var(--color-ink-3);
  margin: 0 0 20px;
}

/* Filter chips */
.filter-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 14px;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.filter-chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  padding: 6px 14px;
  background: var(--color-bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-ink-3);
  cursor: pointer;
  transition: all var(--transition);
}
.chip.active {
  background: var(--color-brand);
  color: white;
  border-color: var(--color-brand);
}

/* FAB - Floating Action Button */
.fab {
  position: fixed;
  bottom: 80px;
  right: 16px;
  width: 56px;
  height: 56px;
  background: var(--color-brand);
  color: white;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  border: none;
  cursor: pointer;
  z-index: 90;
  transition: transform var(--transition);
  font-size: 24px;
}
.fab:hover { transform: scale(1.05); }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 29, 23, 0.5);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  animation: fadeIn 200ms;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-sheet {
  background: white;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px;
  animation: slideUp 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--border-strong);
  border-radius: 2px;
  margin: -10px auto 16px;
}
.modal-title {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 700;
}
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.modal-actions button { flex: 1; }

/* Profile */
.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--color-brand);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  margin: 0 auto 12px;
}
.profile-header {
  text-align: center;
  padding: 24px 0 16px;
}
.profile-name {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: var(--color-ink);
}
.profile-meta {
  font-size: 13px;
  color: var(--color-ink-3);
  margin-top: 2px;
}
.profile-ref-code {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 12px;
  background: var(--color-accent);
  color: var(--color-brand-dark);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
}

/* Bigger screens */
@media (min-width: 768px) {
  .login-card { padding: 40px 32px; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .app-content { padding: 24px; padding-bottom: 100px; }
}

/* ============= DAFTAR PAGE ADDITIONS ============= */

/* Senjata (toolkit preview) card */
.senjata-card {
  background: linear-gradient(135deg, var(--color-ink) 0%, #1a2d25 100%);
  color: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-lg);
}
.senjata-card h3 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  color: var(--color-accent);
}
.senjata-sub {
  margin: 0 0 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}
.senjata-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.senjata-item {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 14px 12px;
  transition: all var(--transition);
}
.senjata-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}
.senjata-icon {
  font-size: 24px;
  margin-bottom: 6px;
}
.senjata-name {
  font-weight: 700;
  font-size: 13px;
  color: white;
  margin-bottom: 4px;
}
.senjata-desc {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.4;
}
@media (max-width: 380px) {
  .senjata-grid { grid-template-columns: 1fr; }
}

/* Step list */
.steps-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.step-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--color-brand);
  color: white;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
}
.step-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--color-ink);
  margin-bottom: 2px;
}
.step-desc {
  font-size: 13px;
  color: var(--color-ink-3);
  line-height: 1.5;
}

/* FAQ */
.faq-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.faq-card h3 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-brand);
}
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--color-ink);
  padding: 6px 0;
  list-style: none;
  position: relative;
  padding-right: 24px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  font-weight: 400;
  color: var(--color-brand);
  transition: transform var(--transition);
}
.faq-item[open] summary::after {
  content: '−';
}
.faq-item p {
  margin: 8px 0 4px;
  font-size: 13px;
  color: var(--color-ink-3);
  line-height: 1.6;
}

/* ============= TOOLKIT VIEW (agent portal) ============= */

.toolkit-header {
  margin-bottom: 20px;
}
.toolkit-header h1 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 800;
  color: var(--color-ink);
  letter-spacing: -0.5px;
}
.toolkit-header p {
  margin: 0;
  font-size: 14px;
  color: var(--color-ink-3);
}

.toolkit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.toolkit-tile {
  background: var(--color-bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 14px;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  min-height: 130px;
  position: relative;
  overflow: hidden;
}
.toolkit-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}
.toolkit-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--color-brand);
}
.toolkit-tile:hover::before { transform: scaleX(1); }
.toolkit-tile .tk-icon {
  font-size: 28px;
  margin-bottom: 10px;
}
.toolkit-tile .tk-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--color-ink);
  margin-bottom: 4px;
}
.toolkit-tile .tk-desc {
  font-size: 11px;
  color: var(--color-ink-3);
  line-height: 1.4;
  flex: 1;
}
.toolkit-tile .tk-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tk-badge.new { background: rgba(22, 163, 74, 0.1); color: var(--color-success); }
.tk-badge.soon { background: var(--color-surface-2); color: var(--color-ink-3); }
.tk-badge.popular { background: rgba(212, 164, 55, 0.15); color: #8a6815; }

/* Tier badge (used in dashboard later) */
.tier-display {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.tier-rookie { background: rgba(156, 163, 175, 0.15); color: #6b7280; }
.tier-bronze { background: rgba(180, 83, 9, 0.15); color: #b45309; }
.tier-silver { background: rgba(107, 114, 128, 0.15); color: #4b5563; }
.tier-gold { background: rgba(212, 164, 55, 0.2); color: #8a6815; }
.tier-platinum { background: linear-gradient(135deg, rgba(167, 139, 250, 0.2), rgba(99, 102, 241, 0.2)); color: #6b21a8; }



/* ═══ AI COPY GENERATOR ═══ */

.aic-quota {
  background: linear-gradient(135deg, var(--color-brand) 0%, var(--color-brand-lighter) 100%);
  color: white;
  padding: 16px 18px;
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.aic-quota-bar {
  height: 8px;
  background: rgba(0,0,0,0.25);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 10px;
}
.aic-quota-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
  transition: width 400ms ease;
}
.aic-quota-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: rgba(255,255,255,0.9);
}
.aic-quota-text strong { color: white; }

.aic-form-card { padding: 18px; }
.aic-field { margin-bottom: 14px; }
.aic-field label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--color-ink-2);
}

.aic-pill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
}
.aic-pill {
  display: block;
  cursor: pointer;
}
.aic-pill input { display: none; }
.aic-pill span {
  display: block;
  padding: 10px 12px;
  background: var(--color-bg-alt);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  transition: all 150ms;
  color: var(--color-ink-2);
}
.aic-pill input:checked + span {
  background: var(--color-brand);
  border-color: var(--color-brand);
  color: white;
}
.aic-pill:hover span:not([style]) {
  border-color: var(--color-brand);
}

.aic-select {
  width: 100%;
  padding: 11px 14px;
  background: var(--color-bg-alt);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  color: var(--color-ink);
  cursor: pointer;
}
.aic-select:focus {
  outline: none;
  border-color: var(--color-brand);
}

.aic-toggle {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--color-ink-3);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  margin: 8px 0;
  transition: all 200ms;
}
.aic-toggle:hover {
  background: var(--color-surface);
  color: var(--color-brand);
  border-color: var(--color-brand);
}

.aic-advanced-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
@media (max-width: 480px) {
  .aic-advanced-grid { grid-template-columns: 1fr; }
}

.aic-checks {
  display: flex;
  gap: 14px;
  margin-top: 12px;
  padding: 10px;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
}
.aic-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.aic-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--color-brand);
}

.aic-generate-btn {
  margin-top: 16px;
  background: linear-gradient(135deg, var(--color-brand) 0%, var(--color-brand-lighter) 100%);
  font-size: 15px;
  font-weight: 700;
}

.aic-generating {
  padding: 40px 20px;
  text-align: center;
  background: var(--color-bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-top: 14px;
}
.aic-generating .spinner { margin: 0 auto 14px; }
.aic-generating p {
  font-size: 14px;
  color: var(--color-ink-3);
  line-height: 1.5;
}

.aic-results {
  margin-top: 18px;
}
.aic-results-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-ink);
  margin: 0 0 4px;
}
.aic-results-sub {
  font-size: 13px;
  color: var(--color-ink-3);
  margin: 0 0 14px;
}

.aic-variant {
  background: white;
  border: 1px solid var(--border);
  border-left: 4px solid var(--variant-color, var(--color-brand));
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.aic-variant-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.aic-variant-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-ink);
}
.aic-variant-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--variant-color);
  color: white;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}
.aic-variant-meta {
  font-size: 11px;
  color: var(--color-ink-4);
  font-weight: 500;
}

.aic-variant-section {
  margin-bottom: 10px;
}
.aic-variant-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-ink-4);
  margin-bottom: 4px;
}
.aic-variant-section-body {
  font-size: 14px;
  color: var(--color-ink);
  line-height: 1.5;
  padding: 8px 10px;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
}
.aic-variant-full {
  font-size: 14px;
  color: var(--color-ink);
  line-height: 1.6;
  padding: 12px;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 300px;
  overflow-y: auto;
}
.aic-variant-hashtags {
  font-size: 13px;
  color: var(--color-brand);
  font-weight: 500;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  word-wrap: break-word;
}
.aic-variant-notes {
  font-size: 12px;
  color: var(--color-ink-3);
  padding: 10px;
  background: rgba(212, 164, 55, 0.08);
  border-radius: var(--radius-sm);
  line-height: 1.5;
  border-left: 3px solid var(--color-accent);
  margin-top: 10px;
}
.aic-variant-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-top: 12px;
}
.aic-variant-actions button {
  padding: 9px 6px;
  font-size: 12px;
  font-weight: 700;
}
@media (max-width: 380px) {
  .aic-variant-actions { grid-template-columns: 1fr; }
}

/* History items */
.aic-history-item {
  padding: 12px;
  background: var(--color-bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 200ms;
}
.aic-history-item:hover {
  border-color: var(--color-brand);
  background: var(--color-surface);
}
.aic-history-header {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 11px;
}
.aic-history-platform {
  background: var(--color-brand);
  color: white;
  padding: 2px 8px;
  border-radius: 100px;
  font-weight: 700;
}
.aic-history-tone {
  background: var(--color-surface-2);
  color: var(--color-ink-2);
  padding: 2px 8px;
  border-radius: 100px;
  font-weight: 600;
}
.aic-history-time {
  margin-left: auto;
  color: var(--color-ink-4);
}
.aic-history-preview {
  font-size: 13px;
  color: var(--color-ink-2);
  line-height: 1.4;
  margin-bottom: 6px;
}
.aic-history-meta {
  font-size: 11px;
  color: var(--color-ink-4);
}
