/* ================================
   FONTS
   ================================ */
@import url('https://use.typekit.net/ccm4yhw.css');

/* ================================
   RESET & BASE STYLES
   ================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Brand Colors */
  --color-dark: rgba(45, 44, 43, 1);
  --color-teal: rgba(59, 106, 121, 1);
  --color-navy: rgba(12, 34, 59, 1);
  --color-blue: rgba(22, 99, 187, 1);
  --color-charcoal: rgba(45, 44, 43, 1);
  --color-gray: rgba(152, 152, 152, 1);
  --color-dark-gray: rgba(85, 85, 85, 1);
  --color-light-gray: rgba(235, 235, 235, 1);
  --color-white: rgba(255, 255, 255, 1);
  --color-off-white: rgba(246, 246, 246, 1);
  
  /* Semantic Colors */
  --primary: var(--color-teal);
  --primary-dark: var(--color-navy);
  --secondary: var(--color-teal);
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: var(--color-blue);
  
  --bg-light: var(--color-off-white);
  --bg-white: var(--color-white);
  --text-primary: var(--color-dark);
  --text-secondary: var(--color-gray);
  --border: var(--color-light-gray);
  
  /* Shadows - Professional depth */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.08);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  
  /* Spacing Scale */
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  
  --sidebar-width: 260px;
  
  /* Typography Scale */
  --font-size-xs: clamp(0.75rem, 0.75rem + 0vw, 0.75rem);
  --font-size-sm: clamp(0.87rem, 0.862rem + 0.04vw, 0.9rem);
  --font-size-base: clamp(1rem, 0.98rem + 0.1vw, 1.08rem);
  --font-size-md: clamp(1.16rem, 1.124rem + 0.18vw, 1.3rem);
  --font-size-lg: clamp(1.33rem, 1.272rem + 0.29vw, 1.56rem);
  --font-size-xl: clamp(1.54rem, 1.458rem + 0.41vw, 1.87rem);
  
  /* Heading Scale */
  --font-size-h1: clamp(2.42rem, 1.972rem + 2.24vw, 4.21rem);
  --font-size-h2: clamp(1.97rem, 1.672rem + 1.49vw, 3.16rem);
  --font-size-h3: clamp(1.6rem, 1.408rem + 0.96vw, 2.37rem);
  --font-size-h4: clamp(1.3rem, 1.18rem + 0.6vw, 1.78rem);
  --font-size-h5: clamp(1.06rem, 0.992rem + 0.34vw, 1.33rem);
  --font-size-h6: clamp(0.86rem, 0.824rem + 0.18vw, 1rem);
}

body {
  font-family: "greycliff-cf", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg-light);
  color: var(--text-primary);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "greycliff-cf", 'Proxima Nova', 'Avenir', 'Helvetica Neue', 'Arial', sans-serif;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  text-transform: uppercase;
}

h1 {
  font-size: var(--font-size-h1);
}

h2 {
  font-size: var(--font-size-h2);
}

h3 {
  font-size: var(--font-size-h3);
}

h4 {
  font-size: var(--font-size-h4);
}

h5 {
  font-size: var(--font-size-h5);
}

h6 {
  font-size: var(--font-size-h6);
}

p, span, div, a, button, input, textarea, select {
  font-family: "greycliff-cf", 'Proxima Nova', 'Avenir', 'Helvetica Neue', 'Arial', sans-serif;
  font-size: var(--font-size-base);
}

/* ================================
   LOGIN PAGE
   ================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-light);
}

.login-container {
  width: 100%;
  max-width: 420px;
  padding: var(--space-lg);
}

.login-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2xl);
  border: 1px solid var(--border);
}

.logo {
  text-align: center;
  margin-bottom: 32px;
}

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

.subtitle {
  color: var(--text-secondary);
  font-size: 14px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  transition: all 0.2s ease;
  background: var(--bg-white);
  font-family: inherit;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
  border-color: var(--text-secondary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(22, 99, 187, 0.1);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.form-footer {
  text-align: center;
  margin-top: 16px;
}

.link-muted {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
}

.link-muted:hover {
  color: var(--primary);
}

.login-footer {
  text-align: center;
  margin-top: var(--space-lg);
  color: var(--text-secondary);
  font-size: 14px;
}

/* ================================
   BUTTONS
   ================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

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

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

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-white);
  color: var(--text-primary);
  border: 2px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-light);
  border-color: var(--text-secondary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

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

.btn-success:hover:not(:disabled) {
  background: var(--primary-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

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

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-text {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
  box-shadow: none;
}

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

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
  box-shadow: none;
}

.btn-outline:hover:not(:disabled) {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn-icon:hover {
  background: var(--bg-light);
  border-color: var(--primary);
}

.btn-block {
  width: 100%;
}

/* ================================
   ALERTS & MESSAGES
   ================================ */
.error-message, .alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
}

.error-message {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-info {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.hidden {
  display: none !important;
}

/* ================================
   SPINNER
   ================================ */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ================================
   CARDS
   ================================ */
.card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.card-header h3 {
  margin: 0;
  font-size: var(--font-size-lg);
}

.card-body {
  padding: var(--space-lg);
}

.card-footer {
  padding: var(--space-lg);
  border-top: 1px solid var(--border);
  background: var(--bg-light);
}

/* Product Card Style */
.product-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all 0.3s ease;
}

.product-card:hover {
  box-shadow: var(--shadow-md);
}

.product-card-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--bg-light);
}

.product-card-content {
  padding: var(--space-md);
}

.product-card-title {
  font-size: var(--font-size-md);
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--text-primary);
}

.product-card-price {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: var(--space-sm);
}

/* Category Card with Image Overlay */
.category-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16/9;
  cursor: pointer;
  transition: all 0.3s ease;
}

.category-card:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

.category-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-lg);
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  color: white;
}

.category-card-title {
  font-size: var(--font-size-h4);
  font-weight: 700;
  color: white;
  margin: 0;
}

/* Stat Card */
.stat-card {
  background: var(--bg-white);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  text-align: center;
}

.stat-value {
  font-size: var(--font-size-h2);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: var(--space-xs);
}

.stat-label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

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

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
  font-size: 24px;
  color: var(--primary);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  position: relative;
}

.nav-item:hover {
  background: var(--bg-light);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--bg-light);
  color: var(--primary);
  border-left: 3px solid var(--primary);
}

.nav-item .icon {
  font-size: 18px;
}

.nav-item .badge {
  margin-left: auto;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content-header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.content-header h1 {
  font-size: 28px;
  font-weight: 700;
}

.header-actions {
  display: flex;
  gap: var(--space-sm);
}

.content-body {
  flex: 1;
  padding: var(--space-xl);
}

/* ================================
   STATS GRID
   ================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.stat-card.highlight {
  background: var(--primary);
  color: white;
  border: none;
}

.stat-icon {
  font-size: 40px;
}

.stat-content h3 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 4px;
}

.stat-content p {
  font-size: 14px;
  color: var(--text-secondary);
}

.stat-card.highlight .stat-content p {
  color: rgba(255, 255, 255, 0.9);
}

/* ================================
   SECTIONS
   ================================ */
.section {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.section-header h2 {
  font-size: 20px;
  font-weight: 600;
}

/* ================================
   BADGES
   ================================ */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-light);
  color: var(--text-secondary);
}

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

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

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

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

/* ================================
   LEADS GRID
   ================================ */
.leads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-lg);
}

.lead-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.lead-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.lead-card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 16px;
}

.lead-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.lead-meta {
  font-size: 13px;
  color: var(--text-secondary);
}

.lead-price {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

.lead-card-body {
  margin-bottom: 16px;
}

.lead-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  font-size: 14px;
}

.lead-info-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.lead-card-footer {
  display: flex;
  gap: var(--space-xs);
}

/* ================================
   MODAL
   ================================ */
.modal {
  display: none; /* Hidden by default */
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.5);
  padding: 20px;
}

.modal.is-open {
  display: flex !important; /* Use flex to center */
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: #fefefe;
  margin: auto;
  padding: 25px;
  border: 1px solid #888;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  width: 90%;
  max-width: 500px;
  position: relative;
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 24px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  padding: var(--space-lg);
}

.modal-footer {
  padding: var(--space-lg);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
}

/* ================================
   TABLE
   ================================ */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: var(--bg-light);
  border-bottom: 2px solid var(--primary);
}

th {
  padding: 12px 16px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 14px;
}

.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
  font-size: 14px;
}

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .leads-grid {
    grid-template-columns: 1fr;
  }
}




