@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-tertiary: #1a1a1a;
  --bg-card: #141414;

  --text-primary: #fafafa;
  --text-secondary: #a1a1a1;
  --text-muted: #666666;

  --accent: #fafafa;
  --accent-hover: #d4d4d4;

  --border: #2a2a2a;
  --border-hover: #3a3a3a;

  --success: #22c55e;
  --stripe: #635BFF;
  --square: #3E4348;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.navbar .container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-badge {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.25rem 0.6rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.back-link {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* Dashboard */
.dashboard {
  padding: 6rem 0 3rem;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.header-left h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.date-range {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.date-range label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.date-range select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.date-range select:focus {
  outline: none;
  border-color: var(--border-hover);
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.kpi-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
}

.kpi-icon svg {
  width: 24px;
  height: 24px;
}

.revenue-icon {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.bookings-icon {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.avg-icon {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
}

.tips-icon {
  background: rgba(236, 72, 153, 0.15);
  color: #ec4899;
}

.kpi-content {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

/* Payment Sources */
.payment-sources {
  margin-bottom: 2rem;
}

.payment-sources h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.source-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.source-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
}

.source-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stripe-logo {
  width: 50px;
  height: auto;
}

.square-logo {
  width: 24px;
  height: 24px;
  border-radius: 4px;
}

.source-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.source-amount {
  font-size: 1.75rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 0.25rem;
}

.source-percent {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.source-card.stripe {
  border-color: rgba(99, 91, 255, 0.3);
}

.source-card.stripe .source-amount {
  color: #635BFF;
}

.source-card.pos .source-amount {
  color: var(--text-primary);
}

.integration-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border-left: 3px solid var(--stripe);
}

/* Charts */
.charts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
}

.chart-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.chart-card canvas {
  max-height: 250px;
}

/* Transactions */
.transactions-section {
  margin-bottom: 2rem;
}

.transactions-section h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

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

.transactions-table th,
.transactions-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  font-size: 0.85rem;
}

.transactions-table th {
  background: var(--bg-tertiary);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

.transactions-table td {
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
}

.transactions-table tbody tr:hover {
  background: var(--bg-tertiary);
}

.source-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
}

.source-badge.stripe {
  background: rgba(99, 91, 255, 0.2);
  color: #635BFF;
}

.source-badge.pos {
  background: rgba(62, 67, 72, 0.3);
  color: var(--text-secondary);
}

.amount-cell {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  color: var(--success) !important;
}

/* Demo Notice */
.demo-notice {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
}

.demo-notice p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s;
}

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

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

/* Footer */
.footer {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}

.footer .container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

.footer a:hover {
  color: var(--text-primary);
}

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

/* Responsive */
@media (max-width: 1024px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .charts-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .source-cards {
    grid-template-columns: 1fr;
  }

  .table-container {
    overflow-x: auto;
  }

  .transactions-table {
    min-width: 600px;
  }
}

@media (max-width: 480px) {
  .kpi-card {
    flex-direction: column;
    text-align: center;
  }

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

  .back-link {
    width: 100%;
    margin-top: 0.5rem;
  }
}
