
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #0b0e3b; color: #111827; }
a { color: #38bdf8; text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

.topbar { background: #02023a; color: #fff; padding: 8px 0; box-shadow: 0 4px 10px rgba(15,23,42,0.5); }
.brand { display: flex; align-items: center; gap: 10px; }
.logo-img { height: 40px; border-radius: 4px; background: #fff; padding: 2px; }
.brand-text { display: flex; flex-direction: column; }
.brand-title { font-weight: 700; font-size: 18px; letter-spacing: 0.05em; }
.brand-tagline { font-size: 11px; text-transform: uppercase; opacity: 0.8; }

nav a { margin-left: 12px; color: #e5e7eb; font-size: 14px; }
nav a.btn-sm { padding: 4px 10px; border-radius: 999px; background: #facc15; color: #1f2937; }
nav .user-info { margin-left: 16px; font-size: 13px; opacity: 0.85; }

.footer { margin-top: 40px; padding: 16px 0; border-top: 1px solid #1f2937; text-align: center; font-size: 12px; color: #9ca3af; }

main.container { margin-top: 18px; margin-bottom: 32px; }

.card { background: #ffffff; border-radius: 12px; padding: 16px; box-shadow: 0 18px 40px rgba(15,23,42,0.4); }
.mt { margin-top: 16px; }

.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.inline-form { display: flex; align-items: center; gap: 8px; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; margin-bottom: 4px; color: #4b5563; }
.field input, .field select, .field textarea {
  width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid #d1d5db; font-size: 14px;
}
.field-full { grid-column: 1 / -1; }

.btn { display: inline-block; padding: 8px 14px; border-radius: 999px; border: none; cursor: pointer; font-size: 14px; text-decoration: none; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-primary:hover { background: #1d4ed8; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 8px 6px; border-bottom: 1px solid #e5e7eb; text-align: left; }
.table th { background: #eff6ff; font-weight: 600; font-size: 13px; color: #1f2937; }
.clickable-row { cursor: pointer; }
.clickable-row:hover { background: #e0f2fe; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; background: #e5e7eb; }
.badge-new { background: #dbeafe; color: #1d4ed8; }
.badge-contacted { background: #fee2e2; color: #b91c1c; }
.badge-follow_up { background: #fef3c7; color: #92400e; }
.badge-quotation_sent { background: #e0f2fe; color: #0369a1; }
.badge-won { background: #dcfce7; color: #166534; }
.badge-lost { background: #fee2e2; color: #b91c1c; }

.status-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.status-card { flex: 1 1 140px; background: #eff6ff; border-radius: 10px; padding: 10px; border: 1px solid #dbeafe; }
.status-label { font-size: 12px; color: #6b7280; text-transform: uppercase; margin-bottom: 4px; }
.status-value { font-size: 20px; font-weight: 700; }

.lead-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 12px; }

.activity-list { list-style: none; margin-top: 12px; }
.activity-list li { padding: 8px 6px; border-bottom: 1px solid #e5e7eb; }
.activity-header { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; color: #4b5563; }
.activity-note { font-size: 14px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; }

.form-inline { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.form-inline input { flex: 1; min-width: 160px; }

/* Auth */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: radial-gradient(circle at top, #4f46e5, #020617); }
.auth-card {
  background: #f9fafb;
  padding: 24px 20px;
  border-radius: 16px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 50px rgba(15,23,42,0.7);
  text-align: center;
}
.auth-logo img { height: 48px; border-radius: 4px; margin-bottom: 8px; background: #fff; padding: 2px; }
.auth-logo h1 { margin-bottom: 4px; font-size: 22px; letter-spacing: 0.06em; }
.auth-logo .tagline { font-size: 12px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 12px; }
.alert { padding: 8px 10px; border-radius: 8px; font-size: 13px; margin-bottom: 10px; }
.alert-error { background: #fee2e2; color: #b91c1c; }
.hint { font-size: 12px; color: #6b7280; margin-top: 8px; }

@media (max-width: 640px) {
  .topbar nav a { display: inline-block; margin-top: 4px; }
  .container { padding: 0 10px; }
  .card { padding: 12px; }
  .brand-title { font-size: 16px; }
  .logo-img { height: 32px; }
}
