/* FloofChonkOS Revenue Dashboard Styles */
/* Design tokens match landing page: cream, ink, coral, plum, sage, gold */

:root {
  --ink: #1a1218;
  --cream: #fdf8f4;
  --blush: #f5e6d8;
  --coral: #e8845c;
  --plum: #6b3a5d;
  --sage: #8fa68a;
  --gold: #d4a853;
  --white: #ffffff;
  --muted: #9a8a9a;
  --border: #f0e4da;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
}

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

/* Nav */
.nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 48px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  height: 64px;
}
.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--plum);
  text-decoration: none;
  letter-spacing: -0.5px;
}
.logo span { color: var(--coral); }
.nav-links { display: flex; gap: 8px; }
.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 8px;
  transition: background 0.15s;
}
.nav-link:hover { background: var(--blush); }
.nav-link.active { background: var(--blush); color: var(--plum); }

/* Main */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 48px 80px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Page header */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.page-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--ink);
}
.page-subtitle {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 4px;
}

/* Period selector */
.period-selector {
  display: flex;
  gap: 4px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
}
.period-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 6px 14px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}
.period-btn:hover { background: var(--blush); color: var(--ink); }
.period-btn.active { background: var(--coral); color: var(--white); }

/* KPI grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.kpi-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: box-shadow 0.2s;
}
.kpi-card:hover { box-shadow: 0 4px 20px rgba(26, 18, 24, 0.08); }
.kpi-highlight { background: var(--plum); border-color: var(--plum); }
.kpi-highlight .kpi-label { color: rgba(255,255,255,0.7); }
.kpi-highlight .kpi-value { color: var(--white); }
.kpi-highlight .kpi-sub { color: rgba(255,255,255,0.5); }
.kpi-label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}
.kpi-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.5px;
}
.kpi-sub {
  font-size: 0.75rem;
  color: var(--muted);
}

/* Chart section */
.chart-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 32px;
}
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
}
.section-sub {
  font-size: 0.8125rem;
  color: var(--muted);
}
.section-link {
  font-size: 0.8125rem;
  color: var(--coral);
  text-decoration: none;
  font-weight: 500;
}
.section-link:hover { text-decoration: underline; }
.chart-wrap {
  position: relative;
  height: 240px;
}

/* Two column layout */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Card */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
}

/* Data table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.data-table th {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  padding: 0 0 12px;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.text-right { text-align: right; }
.text-revenue { font-weight: 600; color: var(--ink); }
.text-muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }
.loading-cell {
  text-align: center;
  color: var(--muted);
  padding: 24px 0 !important;
}

/* Product cell */
.product-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.product-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.product-name { font-weight: 500; }
.product-cat { font-size: 0.75rem; color: var(--muted); margin-top: 1px; }

/* Customer cell */
.customer-cell {}
.customer-name { font-weight: 500; }
.customer-email { font-size: 0.75rem; color: var(--muted); margin-top: 1px; }

/* Customer metrics grid */
.customer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.metric-item {
  background: var(--cream);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.metric-label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}
.metric-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.5px;
}

/* Responsive */
@media (max-width: 900px) {
  .main { padding: 24px 24px 60px; }
  .nav { padding: 0 24px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi-card { padding: 18px; }
  .kpi-value { font-size: 1.35rem; }
}