/* ============================================================
   Datum Design System
   Extracted from BeautyWise dashboards. Shared across all pages.
   ============================================================ */

/* ---- Tokens ---- */
:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --ink: #1e293b;
  --ink2: #475569;
  --ink3: #94a3b8;
  --ink4: #cbd5e1;
  --rule: #e2e8f0;
  --rule2: #f1f5f9;
  --hover: #f8fafc;

  --accent: #4f46e5;
  --accent-light: #6366f1;
  --accent-dark: #3730a3;
  --accent-bg: #eef2ff;

  --red: #dc2626;
  --green: #059669;
  --amber: #d97706;
  --purple: #9333ea;

  /* Platform colors (defaults, overridden per-brand via config) */
  --bk: #D4A800;
  --zp: #6B2280;
  --sw: #E66A00;
  --amz: #FF9900;
  --nk: #FC2779;

  /* Brand color (set by core.js) */
  --brand-color: #4f46e5;
  --brand-color-light: #4f46e520;
  --brand-color-mid: #4f46e580;
  --plat-color: #4f46e5;
  --plat-color-light: #4f46e520;

  /* Typography */
  --serif: 'DM Serif Display', Georgia, serif;
  --sans: 'Questrial', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', monospace;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.1);

  /* Radii */
  --radius: 8px;
  --radius-lg: 12px;
}

/* ---- Reset ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink2);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ---- Navigation ---- */
#dp-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
.dp-nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 54px;
}
.dp-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.dp-nav-platforms {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
}
.dp-nav-plat {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink2);
  text-decoration: none;
  transition: all .15s;
}
.dp-nav-plat:hover { background: var(--rule2); }
.dp-nav-active { background: var(--rule2); color: var(--ink); }
.dp-nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dp-nav-pages {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}
.dp-nav-page {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--ink3);
  text-decoration: none;
  transition: all .15s;
}
.dp-nav-page:hover { background: var(--rule2); color: var(--ink2); }
.dp-page-active { background: var(--accent-bg); color: var(--accent); font-weight: 600; }

/* ---- Layout ---- */
.dp-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 28px 48px;
}

/* ---- Cards ---- */
.dp-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 16px;
}
.dp-card-title {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink);
  margin-bottom: 4px;
}
.dp-card-sub {
  font-size: 12px;
  color: var(--ink3);
  margin-bottom: 16px;
}

/* ---- KPI Cards ---- */
.dp-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.dp-kpi {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px;
}
.dp-kpi-label {
  font-size: 11px;
  color: var(--ink3);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}
.dp-kpi-value {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}
.dp-kpi-change {
  font-size: 11px;
}

/* ---- Hero Gradient ---- */
.dp-hero {
  background: linear-gradient(135deg, var(--brand-color), var(--plat-color));
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  color: #fff;
  margin-bottom: 20px;
}
.dp-hero h2 {
  font-family: var(--serif);
  font-size: 22px;
  margin-bottom: 4px;
}
.dp-hero .dp-hero-sub {
  font-size: 13px;
  opacity: .85;
  margin-bottom: 16px;
}
.dp-hero .dp-kpi-row { margin-bottom: 0; }
.dp-hero .dp-kpi {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.2);
  backdrop-filter: blur(4px);
}
.dp-hero .dp-kpi-label { color: rgba(255,255,255,.7); }
.dp-hero .dp-kpi-value { color: #fff; }
.dp-hero .dp-kpi-change { color: rgba(255,255,255,.8); }

/* ---- Tables ---- */
.dp-tbl-wrap {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow-x: auto;
}
.dp-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.dp-tbl th {
  background: var(--rule2);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--ink);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .6px;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
.dp-tbl td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
}
.dp-tbl tr:last-child td { border-bottom: none; }
.dp-tbl tr:hover td { background: var(--rule2); }
.dp-tbl .mono {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
}

/* ---- Explore Cards ---- */
.dp-explore-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.dp-explore-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px;
  text-decoration: none;
  color: var(--ink2);
  transition: all .15s;
}
.dp-explore-card:hover {
  border-color: var(--plat-color);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.dp-explore-card .ec-icon { font-size: 20px; margin-bottom: 8px; }
.dp-explore-card .ec-title { font-weight: 600; font-size: 13px; color: var(--ink); margin-bottom: 4px; }
.dp-explore-card .ec-desc { font-size: 11px; color: var(--ink3); }

/* ---- Buttons ---- */
.dp-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--rule);
  background: var(--card);
  color: var(--ink2);
  text-decoration: none;
  transition: all .15s;
}
.dp-btn:hover { border-color: var(--accent); color: var(--accent); box-shadow: var(--shadow-sm); }
.dp-btn svg { width: 16px; height: 16px; }
.dp-btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.dp-btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79,70,229,.25);
}
.dp-btn-danger { color: var(--red); border-color: var(--rule); }
.dp-btn-danger:hover { background: rgba(220,38,38,.06); border-color: var(--red); }

/* ---- Badges ---- */
.dp-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
}
.dp-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.dp-badge-green { background: rgba(5,150,105,.08); color: var(--green); }
.dp-badge-amber { background: rgba(217,119,6,.08); color: var(--amber); }
.dp-badge-red { background: rgba(220,38,38,.08); color: var(--red); }
.dp-badge-purple { background: rgba(147,51,234,.08); color: var(--purple); }

/* ---- Form Elements ---- */
.dp-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  transition: border .2s;
}
.dp-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.dp-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ---- Upload Card ---- */
.dp-upload {
  border: 2px dashed var(--rule);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  position: relative;
}
.dp-upload:hover { border-color: var(--accent); background: var(--accent-bg); }
.dp-upload.has-file { border-color: var(--green); border-style: solid; background: rgba(5,150,105,.03); }
.dp-upload input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dp-upload-icon { font-size: 28px; margin-bottom: 8px; color: var(--ink4); }
.dp-upload-text { font-size: 13px; color: var(--ink3); }
.dp-upload-file { font-size: 12px; color: var(--green); font-weight: 600; margin-top: 8px; }

/* ---- Chart Containers ---- */
.dp-chart-wrap {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}
.dp-chart-title {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 12px;
}

/* ---- Section ---- */
.dp-section {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}
.dp-section-head {
  padding: 20px 24px 0;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.dp-section-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}
.dp-section h3 {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink);
  margin-bottom: 3px;
}
.dp-section .dp-section-desc {
  font-size: 12px;
  color: var(--ink3);
}
.dp-section-body { padding: 18px 24px 24px; }

/* ---- Footer ---- */
.dp-footer {
  text-align: center;
  padding: 16px;
  font-size: 11px;
  color: var(--ink3);
  border-top: 1px solid var(--rule);
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .dp-nav-inner { gap: 12px; padding: 0 12px; }
  .dp-nav-platforms { gap: 2px; }
  .dp-nav-plat { padding: 6px 8px; font-size: 11px; }
  .dp-explore-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .dp-nav-inner { flex-wrap: wrap; height: auto; padding: 8px 12px; }
  .dp-nav-platforms { border: none; overflow-x: auto; }
  .dp-nav-pages { width: 100%; overflow-x: auto; }
  .dp-wrap { padding: 16px 12px 40px; }
  .dp-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .dp-explore-grid { grid-template-columns: 1fr; }
  .dp-hero { padding: 20px; }
}
