/* BoardVault design system — calm, high-trust, professional */
@import url("https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,500;8..60,600;8..60,700&family=IBM+Plex+Sans:wght@400;500;600&display=swap");

:root {
  --ink: #142033;
  --ink-soft: #3d4a5c;
  --muted: #6b778a;
  --line: #d8dee8;
  --paper: #f6f4ef;
  --paper-2: #efeae1;
  --surface: #ffffff;
  --accent: #1f4b6e;
  --accent-hover: #163852;
  --success: #1f6b4a;
  --danger: #8b2e2e;
  --warn: #8a5a12;
  --shadow: 0 1px 2px rgba(20, 32, 51, 0.06), 0 8px 24px rgba(20, 32, 51, 0.06);
  --radius: 6px;
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --nav-w: 240px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #e8eef5 0%, transparent 60%),
    radial-gradient(900px 400px at 100% 0%, #ebe4d6 0%, transparent 55%),
    var(--paper);
  min-height: 100vh;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.55rem 1rem;
  font: 500 0.925rem/1.2 var(--font-body);
  cursor: pointer;
  text-decoration: none !important;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.btn-secondary:hover { border-color: var(--ink-soft); }
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: transparent;
}
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.85rem; }

.flash-wrap {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.925rem;
}
.flash.success { border-color: #b7d7c7; background: #eef7f2; color: var(--success); }
.flash.error { border-color: #e0bdbd; background: #faf2f2; color: var(--danger); }
.flash.info { border-color: #c5d2e0; background: #f2f6fa; color: var(--accent); }

.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.landing-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
}
.brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none !important;
  letter-spacing: -0.03em;
}
.brand span { color: var(--accent); }
.hero {
  flex: 1;
  display: grid;
  align-items: center;
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
  width: 100%;
  gap: 2rem;
  grid-template-columns: 1.1fr 0.9fr;
}
@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; }
}
.hero-copy h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  margin: 0 0 1rem;
  max-width: 14ch;
}
.hero-copy p {
  font-size: 1.125rem;
  color: var(--ink-soft);
  max-width: 42ch;
  margin: 0 0 1.75rem;
}
.hero-cta { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.hero-panel {
  background:
    linear-gradient(160deg, rgba(31, 75, 110, 0.92), rgba(20, 32, 51, 0.95));
  color: #f4f7fb;
  border-radius: 12px;
  padding: 2rem;
  min-height: 320px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.hero-panel h2 {
  color: #fff;
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}
.hero-panel p { margin: 0; color: #c9d5e3; }
.trust-row {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 1.5rem 2rem 3rem;
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--line);
}

.app-shell {
  display: grid;
  grid-template-columns: var(--nav-w) 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--ink);
  color: #d7dee8;
  padding: 1.25rem 1rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand { color: #fff; font-size: 1.35rem; padding: 0 0.5rem; }
.sidebar .brand span { color: #9ec0dc; }
.org-chip {
  margin: 0 0.5rem;
  padding: 0.65rem 0.75rem;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius);
  font-size: 0.85rem;
}
.org-chip strong { display: block; color: #fff; font-weight: 500; }
.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.15rem;
}
.nav-list a {
  display: block;
  color: #c5cedb;
  text-decoration: none !important;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.925rem;
}
.nav-list a:hover,
.nav-list a.active {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.sidebar-footer {
  margin-top: auto;
  padding: 0 0.5rem;
  font-size: 0.85rem;
  color: #8b97a8;
}
.sidebar-footer a { color: #c5cedb; }

.main {
  padding: 1.5rem 2rem 3rem;
  max-width: 1100px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.topbar h1 { margin: 0; font-size: 1.75rem; }
.search-form {
  display: flex;
  gap: 0.5rem;
}
.search-form input {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  min-width: 200px;
  font: inherit;
  background: var(--surface);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem;
}
.panel + .panel { margin-top: 1rem; }
.panel h2 {
  margin: 0 0 0.85rem;
  font-size: 1.2rem;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .main { padding: 1rem; }
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.925rem;
}
.table th,
.table td {
  text-align: left;
  padding: 0.65rem 0.4rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.table th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--paper-2);
  color: var(--ink-soft);
}
.badge.published { background: #e5f3eb; color: var(--success); }
.badge.draft { background: #f5edd9; color: var(--warn); }
.badge.unread { background: #e4eef7; color: var(--accent); }

.form-stack {
  display: grid;
  gap: 1rem;
  max-width: 520px;
}
.form-stack label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 500;
}
.form-stack input,
.form-stack select,
.form-stack textarea {
  font: inherit;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}
.form-stack textarea { min-height: 120px; resize: vertical; }
.form-stack .hint { font-weight: 400; color: var(--muted); font-size: 0.8rem; }
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400 !important;
}

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 2rem;
}
.auth-card h1 {
  margin: 0 0 0.25rem;
  font-size: 1.75rem;
}
.auth-card .sub {
  color: var(--muted);
  margin: 0 0 1.5rem;
}
.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 1.25rem 0;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.meta { color: var(--muted); font-size: 0.875rem; }
.stack { display: grid; gap: 0.75rem; }
.row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.muted { color: var(--muted); }
.empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.message {
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--accent);
  background: #f7f9fc;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.message .meta { margin-bottom: 0.35rem; }

.viewer-frame {
  width: 100%;
  min-height: 70vh;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.stat {
  padding: 1rem;
  background: var(--paper);
  border-radius: var(--radius);
}
.stat .num {
  font-family: var(--font-display);
  font-size: 1.75rem;
  display: block;
}
.stat .label { color: var(--muted); font-size: 0.85rem; }

.plan-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.25rem;
  background: #fff;
}
.plan-card.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan-card h3 { margin: 0 0 0.35rem; }
.plan-card .price {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin: 0.5rem 0 1rem;
}
