/* DP Secure — shared theme
   Palette derived from the Polar AI dashboard:
   green accent, light-green highlight, near-black actions, white surfaces */

:root {
  --green: #16a34a;
  --green-dark: #15803d;
  --green-soft: #e8f5ee;
  --green-soft-border: #cde6d8;
  --ink: #0f1115;
  --text: #1c2128;
  --text-muted: #6b7280;
  --line: #ececec;
  --line-soft: #f3f3f3;
  --surface: #ffffff;
  --bg: #fbfbfb;
  --sidebar-w: 248px;
  --topbar-h: 64px;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 17, 21, 0.04);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Layout shell ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "brand topbar"
    "sidebar main";
  min-height: 100vh;
}

/* ---------- Brand corner ---------- */
.brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 22px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.brand-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green);
  flex: 0 0 auto;
  box-shadow: 0 0 0 3px var(--green-soft);
}

.brand-name {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* ---------- Top bar ---------- */
.topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.search {
  flex: 1;
  max-width: 640px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 14px;
  background: var(--bg);
}

.topbar-spacer { flex: 1; }

.topbar-icons {
  display: flex;
  align-items: center;
  gap: 14px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--text-muted);
  cursor: pointer;
}
.icon-btn:hover { background: var(--line-soft); }

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
}

/* ---------- Sidebar ---------- */
.sidebar {
  grid-area: sidebar;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 14px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav-item:hover { background: var(--line-soft); }
.nav-item svg { flex: 0 0 auto; color: var(--text-muted); }

.nav-item.active {
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 600;
}
.nav-item.active svg { color: var(--green-dark); }

.sidebar-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.sidebar-footer .pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

/* ---------- Main ---------- */
.main {
  grid-area: main;
  padding: 36px 40px;
  overflow: auto;
}

.page-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.page-status .pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

h1.display {
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: 46px;
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: var(--ink);
  margin: 0 0 12px;
}

.lede {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 0 28px;
  line-height: 1.5;
}

/* ---------- Landing hero ---------- */
.hero {
  max-width: 720px;
}
.hero h1.display { font-size: 58px; }

.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 36px;
}

.card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  border-color: var(--green-soft-border);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(16, 17, 21, 0.06);
}
.card-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-dark);
  margin-bottom: 10px;
}
.card-title {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 26px;
  color: var(--ink);
  margin-bottom: 8px;
}
.card-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}
.card-arrow {
  margin-top: 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--green-dark);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---------- Campaign page / widget mount ---------- */
.campaign-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.widget-frame {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-height: calc(100vh - var(--topbar-h) - 220px);
  padding: 0;
  overflow: hidden;
}

/* When the embed hasn't loaded yet */
.widget-frame:empty::before {
  content: "Loading campaign…";
  display: grid;
  place-items: center;
  min-height: 320px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: var(--topbar-h) auto 1fr;
    grid-template-areas:
      "topbar"
      "sidebar"
      "main";
  }
  .brand { display: none; }
  .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 10px 14px;
  }
  .nav-label, .sidebar-footer { display: none; }
  .main { padding: 24px 18px; }
  .cards { grid-template-columns: 1fr; }
  .hero h1.display { font-size: 40px; }
  h1.display { font-size: 34px; }
}
