/* Lead Management System - Modern Minimalist CSS */
@import url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.0/font/bootstrap-icons.css');

:root {
  /* Color Palette */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --secondary: #1e293b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --neutral-bg: #f8fafc;
  --neutral-border: #e2e8f0;
  --neutral-text: #475569;
  --text-dark: #1e293b;
  --text-light: #94a3b8;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --radius: 8px;
  --transition: all 0.3s ease;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #f1f5f9;
  color: var(--text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============ LAYOUT ============ */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

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

/* ============ HEADER ============ */

header {
  background-color: white;
  border-bottom: 1px solid var(--neutral-border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.5px;
}

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

.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.user-menu strong {
  color: var(--text-dark);
}

.user-menu .role {
  background-color: var(--primary-light);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* ============ LAYOUT SCHEME ============ */

.main-layout {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 70px);
}

.main-content {
  flex: 1;
  padding: 32px 40px 100px 40px;
  background-color: var(--neutral-bg);
}

/* ============ TOP NAVIGATION ============ */

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

.top-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-nav li {
  margin: 0;
}

.top-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  color: #64748b;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease-in-out;
  font-weight: 500;
  font-size: 14px;
}

.top-nav a i {
  font-size: 16px;
}

.top-nav a:hover {
  background-color: #f1f5f9;
  color: var(--primary);
}

.top-nav a.active {
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

/* ============ MAIN CONTENT ============ */

.content {
  flex: 1;
  padding: 32px 0;
}

.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.page-header p {
  color: var(--text-light);
  font-size: 14px;
}

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

.card {
  background-color: white;
  border: 1px solid var(--neutral-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.card-header {
  margin-bottom: 20px;
}

.card-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
}

/* ============ BUTTONS ============ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

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

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

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

.btn-secondary:hover {
  background-color: #e2e8f0;
}

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

.btn-success:hover {
  background-color: #059669;
}

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

.btn-danger:hover {
  background-color: #dc2626;
}

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

.btn-warning:hover {
  background-color: #d97706;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

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

/* ============ FORMS ============ */

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-dark);
}

.form-group label.optional::after {
  content: ' (optional)';
  color: var(--text-light);
  font-weight: 400;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--neutral-border);
  border-radius: var(--radius);
  transition: var(--transition);
  font-family: inherit;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

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

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232563eb' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ============ TABLES ============ */

.table-container {
  overflow-x: auto;
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  background-color: var(--neutral-bg);
  padding: 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-dark);
  border-bottom: 2px solid var(--neutral-border);
}

td {
  padding: 12px;
  border-bottom: 1px solid var(--neutral-border);
}

tr:hover {
  background-color: var(--primary-light);
}

/* ============ BADGE/STATUS ============ */

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-pending {
  background-color: #f3f4f6;
  color: #6b7280;
}

.badge-interested {
  background-color: #dbeafe;
  color: #0284c7;
}

.badge-not-interested {
  background-color: #fee2e2;
  color: #dc2626;
}

.badge-confirmed {
  background-color: #dcfce7;
  color: #16a34a;
}

.badge-followup {
  background-color: #fef3c7;
  color: #d97706;
}

.badge-called {
  background-color: #d1fae5;
  color: #059669;
}

.badge-uncalled {
  background-color: #f3f4f6;
  color: #6b7280;
}

/* ============ ALERTS ============ */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.alert-success {
  background-color: #dcfce7;
  color: #166534;
  border-left: 4px solid var(--success);
}

.alert-error {
  background-color: #fee2e2;
  color: #991b1b;
  border-left: 4px solid var(--danger);
}

.alert-warning {
  background-color: #fef3c7;
  color: #92400e;
  border-left: 4px solid var(--warning);
}

.alert-info {
  background-color: #dbeafe;
  color: #0c2d6b;
  border-left: 4px solid var(--primary);
}

/* ============ FILTERS & SEARCH ============ */

.filters {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-group {
  flex: 1;
  min-width: 200px;
}

.filter-group label {
  margin-bottom: 4px;
}

.filter-group input,
.filter-group select {
  margin-bottom: 0;
}

/* ============ MODALS & DIALOGS ============ */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background-color: white;
  border-radius: var(--radius);
  padding: 24px;
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

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

.modal-header h2 {
  font-size: 20px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-light);
  transition: var(--transition);
}

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

.modal-footer {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  justify-content: flex-end;
}

/* ============ UTILITY CLASSES ============ */

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-muted {
  color: var(--text-light);
}

.text-small {
  font-size: 12px;
}

.mb-20 {
  margin-bottom: 20px;
}

.mt-20 {
  margin-top: 20px;
}

.gap-12 {
  gap: 12px;
}

.gap-20 {
  gap: 20px;
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-wrap {
  flex-wrap: wrap;
}

.bold {
  font-weight: 700;
}

.line-through {
  text-decoration: line-through;
  opacity: 0.6;
}

/* ============ LOADING STATE ============ */

.loading {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--neutral-border);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 0.6s linear infinite;
}

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

/* ============ EMPTY STATE ============ */

.empty-state {
  text-align: center;
  padding: 40px 20px;
}

.empty-state svg {
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-light);
  margin-bottom: 20px;
}

/* ============ MOBILE RESPONSIVE ============ */

@media (max-width: 768px) {
  .container {
    padding: 0 12px;
  }

  .header-content {
    padding: 12px 0;
  }

  .sidebar {
    display: none;
  }

  .logo {
    font-size: 18px;
  }

  .header-nav {
    gap: 12px;
  }

  .page-header h1 {
    font-size: 22px;
  }

  .card {
    padding: 16px;
  }

  .btn {
    padding: 8px 16px;
    font-size: 13px;
  }

  .filters {
    flex-direction: column;
  }

  .filter-group {
    min-width: auto;
  }

  table {
    font-size: 12px;
  }

  th, td {
    padding: 8px;
  }

  .table-actions {
    display: flex;
    gap: 6px;
  }

  .modal-content {
    max-width: 90%;
  }

  .header-nav {
    display: none;
  }

  .mobile-menu {
    display: flex;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .page-header h1 {
    font-size: 20px;
  }

  .card {
    padding: 12px;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .btn-small {
    width: auto;
  }

  .modal-footer {
    flex-direction: column;
  }

  .modal-footer .btn {
    width: 100%;
  }

  .filters {
    gap: 8px;
  }

  label {
    font-size: 13px;
  }

  input, textarea, select {
    font-size: 16px; /* Prevent zoom on iOS */
  }
}

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

.login-container {
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, #1e3a8a 100%);
  padding: 16px;
}

.login-box {
  background-color: white;
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
}

.login-box h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.login-box .subtitle {
  color: var(--text-light);
  margin-bottom: 30px;
  font-size: 14px;
}

.login-box .form-group {
  margin-bottom: 20px;
}

.login-box .btn-block {
  margin-top: 24px;
}

/* Dashboard specific styles */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--neutral-border);
  text-align: center;
}

.stat-card .value {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.stat-card .label {
  color: var(--text-light);
  font-size: 13px;
  font-weight: 600;
}

/* Action buttons in table */
.table-actions {
  display: flex;
  gap: 8px;
}

.table-actions .btn {
  padding: 6px 12px;
  font-size: 12px;
}
