/* Frinter shared design system */
:root {
  --bg: #fbfaf7;
  --bg-soft: #f5f3ee;
  --surface: #ffffff;
  --ink: #1a1f2c;
  --ink-soft: #4a5360;
  --ink-muted: #8a8f9c;
  --line: #e8e6df;
  --line-soft: #f0eee8;

  /* Brand category colors */
  --growth: #5a8a7a;        /* Flourishing / Growth - sage */
  --growth-soft: #e6efe9;
  --growth-tint: #f3f7f3;

  --relations: #a06a7a;      /* Relationships - mauve */
  --relations-soft: #f1e3e7;
  --relations-tint: #f8eef1;

  --deep: #c9a574;           /* Deep Work - warm sand */
  --deep-soft: #f3e7d2;
  --deep-tint: #faf3e6;

  --accent-blue: #e8efff;
  --accent-blue-ink: #4a5fb8;
  --accent-purple: #f0eaf5;
  --accent-pink: #fbe9ee;

  --warning-bg: #fdf6e3;
  --warning-ink: #8a6d3b;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --shadow-sm: 0 1px 2px rgba(20, 25, 40, 0.04), 0 1px 1px rgba(20, 25, 40, 0.03);
  --shadow: 0 4px 16px rgba(20, 25, 40, 0.05), 0 1px 3px rgba(20, 25, 40, 0.04);
  --shadow-lg: 0 18px 50px rgba(20, 25, 40, 0.10), 0 4px 12px rgba(20, 25, 40, 0.05);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Poppins", -apple-system, BlinkMacSystemFont, sans-serif;

  /* Aliases for Blog & App compatibility */
  --uix-bg: var(--bg);
  --uix-bg-soft: var(--bg-soft);
  --uix-surface: var(--surface);
  --uix-line: var(--line);
  --uix-line-soft: var(--line-soft);
  --uix-ink: var(--ink);
  --uix-ink-soft: var(--ink-soft);
  --uix-ink-muted: var(--ink-muted);
  --uix-growth: var(--growth);
  --uix-relationships: var(--relationships);
  --uix-deep-work: var(--deep);
  --uix-deep-work-soft: var(--deep-soft);
  --uix-relationships-soft: var(--relationships-soft);
  --uix-font-display: var(--font-display);
  --uix-font-sans: var(--font-sans);
  --uix-shadow-sm: var(--shadow-sm);
  --uix-shadow: var(--shadow);
  --uix-radius-sm: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ==== Sidebar (used on all signed-in pages) ==== */
.app-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  box-sizing: border-box;
}
.sb-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--ink);
  padding: 6px 10px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.sb-brand .dot { color: var(--growth); }

.sb-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
  transition: all 0.15s ease;
}
.sb-item svg { width: 16px; height: 16px; stroke-width: 1.5; flex-shrink: 0; }
.sb-item:hover { background: var(--bg-soft); color: var(--ink); }
.sb-item.active {
  background: var(--bg-soft);
  color: var(--ink);
  font-weight: 600;
}

.sb-foot {
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sb-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
}
.sb-user:hover { background: var(--bg-soft); }
.sb-user img {
  width: 28px; height: 28px;
  border-radius: 999px;
  object-fit: cover;
}
.sb-user .name { font-size: 13px; font-weight: 600; flex: 1; }
.sb-user .caret { color: var(--ink-muted); display: inline-flex; }
.sb-foot-icons {
  display: flex;
  gap: 6px;
  padding: 0 8px;
}
.sb-foot-ico {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: var(--bg-soft);
  font-size: 14px;
  color: var(--ink-soft);
}
.sb-foot-ico svg { width: 14px; height: 14px; }

/* ==== Page shell ==== */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 48px 80px;
}
.app-main { min-width: 0; }
.app-main .page { padding: 32px 48px 80px; max-width: 1080px; }

/* ==== Cards ==== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 24px; }
.card-pad-lg { padding: 32px; }

/* ==== Buttons ==== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--ink);
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.btn-dark {
  background: var(--ink);
  color: white;
  border: none;
}
.btn-dark:hover { background: #2a3140; }
.btn-primary {
  background: var(--growth);
  color: white;
  border: none;
}
.btn-primary:hover { background: #4a7a6c; }
.btn-frint {
  background: linear-gradient(90deg, var(--relations), var(--deep));
  color: white;
  border: none;
}
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn svg { width: 16px; height: 16px; }

/* ==== Page titles ==== */
.page-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 8px 0 6px;
}
.page-sub {
  color: var(--ink-muted);
  font-size: 14px;
  margin: 0 0 24px;
}

/* ==== Footer ==== */
.app-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  margin-top: 48px;
}
.app-footer .gradient-strip {
  height: 14px;
  background: linear-gradient(90deg, var(--deep), var(--relations));
}
.app-footer .footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 48px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 48px;
}
.app-footer h4 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  text-transform: uppercase;
  margin: 0 0 16px;
}
.app-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.app-footer ul a { color: var(--ink-soft); font-size: 14px; }
.app-footer ul a:hover { color: var(--growth); }
.app-footer .brand-block .brand-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.app-footer .brand-block p {
  color: var(--ink-muted);
  font-size: 13px;
  margin: 8px 0 0;
}

/* ==== Toast ==== */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  min-width: 240px;
}
.toast .swatch {
  width: 32px; height: 32px;
  border-radius: 999px;
  background: conic-gradient(var(--growth), var(--deep), var(--relations), var(--growth));
  flex-shrink: 0;
}
.toast .title { font-weight: 700; font-size: 13px; }
.toast .body { font-size: 12px; color: var(--ink-muted); }

/* ==== Feedback tab ==== */
.feedback-tab {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: var(--growth-soft);
  color: var(--growth);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  padding: 10px 8px;
  border-radius: 8px 0 0 8px;
  writing-mode: vertical-rl;
  border: 1px solid var(--line);
  border-right: none;
  z-index: 50;
}

/* utility */
.row { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.muted { color: var(--ink-muted); }
.center { text-align: center; }
