/* LendKit App Styles - matches landing page design language */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --gold: #D4A853;
  --gold-light: #E8C97A;
  --gold-dim: rgba(212, 168, 83, 0.15);
  --dark: #0A0A0F;
  --dark-card: #12121A;
  --dark-card-hover: #181824;
  --dark-border: #1E1E2A;
  --dark-input: #16161F;
  --gray: #8A8A9A;
  --gray-light: #A0A0B0;
  --white: #F0F0F5;
  --green: #34D399;
  --green-dim: rgba(52, 211, 153, 0.12);
  --blue: #60A5FA;
  --blue-dim: rgba(96, 165, 250, 0.12);
  --purple: #A78BFA;
  --purple-dim: rgba(167, 139, 250, 0.12);
  --orange: #FB923C;
  --orange-dim: rgba(251, 146, 60, 0.12);
  --red: #F87171;
  --red-dim: rgba(248, 113, 113, 0.12);
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--dark);
  color: var(--white);
  overflow-x: hidden;
  min-height: 100vh;
}

h1, h2, h3, h4, h5 { font-family: 'Space Grotesk', sans-serif; }

/* AUTH SCREEN */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: 16px;
  padding: 48px;
  width: 100%;
  max-width: 420px;
}

.auth-card .logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold);
  text-align: center;
  margin-bottom: 8px;
}

.auth-card .logo span { color: var(--white); }

.auth-subtitle {
  text-align: center;
  color: var(--gray);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--dark);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray);
  transition: all 0.2s;
  border: none;
  background: none;
}

.auth-tab.active {
  background: var(--dark-card);
  color: var(--white);
}

/* FORM ELEMENTS */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gray-light);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--dark-input);
  border: 1px solid var(--dark-border);
  border-radius: 10px;
  color: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  transition: border-color 0.2s;
  outline: none;
}

.form-input:focus {
  border-color: var(--gold);
}

.form-input::placeholder {
  color: #555;
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238A8A9A' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

textarea.form-input {
  min-height: 80px;
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--gold);
  color: var(--dark);
}

.btn-primary:hover {
  background: var(--gold-light);
}

.btn-secondary {
  background: var(--dark);
  color: var(--white);
  border: 1px solid var(--dark-border);
}

.btn-secondary:hover {
  border-color: var(--gray);
}

.btn-ghost {
  background: transparent;
  color: var(--gray);
  padding: 8px 12px;
}

.btn-ghost:hover {
  color: var(--white);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.8rem;
  border-radius: 8px;
}

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(248, 113, 113, 0.2);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.2);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-full { width: 100%; }

.auth-error {
  background: var(--red-dim);
  color: var(--red);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: none;
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--gray);
}

.auth-switch a {
  color: var(--gold);
  text-decoration: none;
  cursor: pointer;
}

/* APP LAYOUT */
.app-container {
  display: none;
  flex-direction: column;
  min-height: 100vh;
}

.app-container.active {
  display: flex;
}

/* TOP NAV */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(10, 10, 15, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--dark-border);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold);
}

.nav-logo span { color: var(--white); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-badge {
  font-size: 0.8rem;
  color: var(--gray);
  padding: 6px 14px;
  border: 1px solid var(--dark-border);
  border-radius: 20px;
}

/* STATS BAR */
.stats-bar {
  display: flex;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--dark-border);
  overflow-x: auto;
}

.stat-card {
  flex: 1;
  min-width: 140px;
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: 12px;
  padding: 16px 20px;
}

.stat-card .stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--white);
}

.stat-card .stat-label {
  font-size: 0.75rem;
  color: var(--gray);
  margin-top: 2px;
}

/* TOOLBAR */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-input {
  padding: 10px 14px 10px 36px;
  background: var(--dark-input);
  border: 1px solid var(--dark-border);
  border-radius: 10px;
  color: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  width: 260px;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238A8A9A' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 10-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 001.415-1.414l-3.85-3.85a1.007 1.007 0 00-.115-.1zM12 6.5a5.5 5.5 0 11-11 0 5.5 5.5 0 0111 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  transition: border-color 0.2s;
}

.search-input:focus { border-color: var(--gold); }

/* KANBAN BOARD */
.kanban-board {
  display: flex;
  gap: 16px;
  padding: 0 24px 24px;
  flex: 1;
  overflow-x: auto;
  min-height: 0;
}

.kanban-column {
  flex: 0 0 280px;
  min-height: 400px;
  display: flex;
  flex-direction: column;
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  margin-bottom: 8px;
}

.column-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.column-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.column-count {
  font-size: 0.75rem;
  color: var(--gray);
  background: var(--dark-card);
  padding: 2px 8px;
  border-radius: 10px;
}

.column-cards {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  background: rgba(18, 18, 26, 0.4);
  border-radius: 12px;
  border: 1px solid transparent;
  min-height: 200px;
  transition: all 0.2s;
}

.column-cards.drag-over {
  border-color: var(--gold);
  background: rgba(212, 168, 83, 0.04);
}

/* LEAD CARD */
.lead-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: 10px;
  padding: 14px;
  cursor: grab;
  transition: all 0.15s;
  user-select: none;
}

.lead-card:hover {
  border-color: rgba(240, 240, 245, 0.15);
  background: var(--dark-card-hover);
}

.lead-card.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
}

.lead-card-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lead-card-company {
  font-size: 0.8rem;
  color: var(--gray);
  margin-bottom: 10px;
}

.lead-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lead-tag {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 500;
}

.tag-amount {
  background: var(--green-dim);
  color: var(--green);
}

.tag-credit {
  background: var(--blue-dim);
  color: var(--blue);
}

.tag-score {
  background: var(--gold-dim);
  color: var(--gold);
}

.tag-score.high { background: var(--green-dim); color: var(--green); }
.tag-score.low { background: var(--orange-dim); color: var(--orange); }

/* MODAL */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  margin: 20px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-header h3 {
  font-size: 1.1rem;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: none;
  background: var(--dark);
  color: var(--gray);
  cursor: pointer;
  font-size: 1.1rem;
}

.modal-close:hover { color: var(--white); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--dark-border);
}

/* CSV IMPORT */
.csv-dropzone {
  border: 2px dashed var(--dark-border);
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 20px;
}

.csv-dropzone:hover,
.csv-dropzone.drag-hover {
  border-color: var(--gold);
  background: rgba(212, 168, 83, 0.04);
}

.csv-dropzone-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.csv-dropzone-text {
  color: var(--gray);
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.csv-dropzone-hint {
  color: #555;
  font-size: 0.75rem;
}

.csv-preview {
  display: none;
  margin-top: 16px;
}

.csv-preview.active { display: block; }

.csv-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.csv-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  overflow-x: auto;
  display: block;
}

.csv-preview-table th {
  text-align: left;
  padding: 8px 10px;
  color: var(--gray);
  font-weight: 500;
  border-bottom: 1px solid var(--dark-border);
  white-space: nowrap;
}

.csv-preview-table td {
  padding: 8px 10px;
  color: var(--white);
  border-bottom: 1px solid rgba(30, 30, 42, 0.5);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-results {
  display: none;
  margin-top: 16px;
}

.import-results.active { display: block; }

.import-result-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.result-badge {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
}

.result-badge.success {
  background: var(--green-dim);
  color: var(--green);
}

.result-badge.failed {
  background: var(--red-dim);
  color: var(--red);
}

/* LEAD DETAIL SLIDE-OVER */
.slide-over {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  width: 460px;
  max-width: 100%;
  height: 100vh;
  background: var(--dark-card);
  border-left: 1px solid var(--dark-border);
  z-index: 90;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
}

.slide-over.active {
  display: flex;
}

.slide-over-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--dark-border);
  position: sticky;
  top: 0;
  background: var(--dark-card);
  z-index: 5;
}

.slide-over-body {
  padding: 24px;
  flex: 1;
}

.detail-section {
  margin-bottom: 24px;
}

.detail-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 12px;
}

.detail-field {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(30, 30, 42, 0.5);
  font-size: 0.85rem;
}

.detail-field-label { color: var(--gray); }
.detail-field-value { color: var(--white); font-weight: 500; text-align: right; max-width: 60%; }

.ai-score-display {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--dark);
  border-radius: 12px;
  margin-bottom: 12px;
}

.ai-score-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  flex-shrink: 0;
}

.ai-score-circle.high { background: var(--green-dim); color: var(--green); }
.ai-score-circle.medium { background: var(--gold-dim); color: var(--gold); }
.ai-score-circle.low { background: var(--orange-dim); color: var(--orange); }

.ai-score-text {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--gray-light);
}

.ai-detail-list {
  list-style: none;
  padding: 0;
}

.ai-detail-list li {
  padding: 8px 0;
  border-bottom: 1px solid rgba(30, 30, 42, 0.5);
  font-size: 0.85rem;
  color: var(--gray-light);
}

.ai-detail-list li strong {
  color: var(--white);
}

/* ACTIVITY LOG */
.activity-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(30, 30, 42, 0.5);
  font-size: 0.8rem;
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  margin-top: 5px;
  flex-shrink: 0;
}

.activity-text { color: var(--gray-light); }
.activity-time { color: #555; font-size: 0.75rem; margin-top: 2px; }

/* TOAST */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.85rem;
  animation: slideIn 0.3s ease;
  max-width: 360px;
}

.toast.success { background: var(--green-dim); color: var(--green); border: 1px solid rgba(52, 211, 153, 0.2); }
.toast.error { background: var(--red-dim); color: var(--red); border: 1px solid rgba(248, 113, 113, 0.2); }
.toast.info { background: var(--blue-dim); color: var(--blue); border: 1px solid rgba(96, 165, 250, 0.2); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* LOADING */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(212, 168, 83, 0.3);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--gray);
  gap: 12px;
}

/* EMPTY STATE */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--gray);
  text-align: center;
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state-text {
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.empty-state-hint {
  font-size: 0.75rem;
  color: #555;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .stats-bar { padding: 12px 16px; }
  .toolbar { padding: 12px 16px; }
  .kanban-board { padding: 0 16px 16px; }
  .kanban-column { flex: 0 0 260px; }
  .top-nav { padding: 12px 16px; }
  .search-input { width: 180px; }
  .slide-over { width: 100%; }
  .form-row { grid-template-columns: 1fr; }
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--dark-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray); }
