:root {
  --bg: #0f1115;
  --bg-elevated: #171a21;
  --bg-card: #1c1f28;
  --border: #2a2e39;
  --text: #eef0f4;
  --text-dim: #9aa1b1;
  --accent: #7c9bff;
  --accent-dim: #5570cc;
  --danger: #e5657a;
  --success: #6fd7a0;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f7fb;
    --bg-elevated: #ffffff;
    --bg-card: #ffffff;
    --border: #e3e5ec;
    --text: #1b1d24;
    --text-dim: #6b7080;
    --accent: #4c63d2;
    --accent-dim: #3a4cab;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

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

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 24px;
  padding: 0 8px;
}
.brand:hover { text-decoration: none; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  color: var(--text-dim);
  padding: 8px 10px;
  border-radius: var(--radius);
  font-size: 0.92rem;
}
.side-nav a:hover, .side-nav a.active { background: var(--bg-card); color: var(--text); text-decoration: none; }

.side-nav-kinds { margin-top: 18px; display: flex; flex-direction: column; gap: 2px; }
.side-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); padding: 0 10px; margin-bottom: 4px; }
.side-nav-kinds a { color: var(--text-dim); padding: 6px 10px; border-radius: var(--radius); font-size: 0.88rem; }
.side-nav-kinds a:hover { background: var(--bg-card); text-decoration: none; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
}

.plan-pill {
  align-self: flex-start;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.plan-ultimate { color: #e8c46b; border-color: #e8c46b55; }
.plan-pro { color: #8fb8ff; border-color: #8fb8ff55; }
.plan-standard { color: #8fd6b0; border-color: #8fd6b055; }

.app-main { flex: 1; padding: 32px 40px; max-width: 1100px; }

h1, h2, h3 { line-height: 1.25; }
h1 { font-size: 1.7rem; margin: 0 0 6px; }
h2 { font-size: 1.25rem; }
.subtitle { color: var(--text-dim); margin: 0 0 24px; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}

textarea, input[type=text], input[type=email], input[type=password], input[type=date], select {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  width: 100%;
}
textarea:focus, input:focus, select:focus { outline: 2px solid var(--accent-dim); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  padding: 9px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dim); }
.btn-danger { color: var(--danger); }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.capture-box textarea { min-height: 160px; margin-bottom: 12px; resize: vertical; }
.capture-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.72rem; background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-dim); }
.badge-todo { color: #ffb066; border-color: #ffb06655; }
.badge-note { color: #8fb8ff; border-color: #8fb8ff55; }
.badge-data { color: #b48fff; border-color: #b48fff55; }
.badge-high { color: var(--danger); border-color: #e5657a55; }
.badge-medium { color: #e8c46b; border-color: #e8c46b55; }
.badge-low { color: var(--text-dim); }

.note-row { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; background: var(--bg-card); }
.note-row-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.note-title { font-weight: 600; font-size: 1rem; }
.note-content-preview { color: var(--text-dim); font-size: 0.88rem; }
.note-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.note-actions { display: flex; gap: 6px; }

.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filter-bar select, .filter-bar input { width: auto; min-width: 140px; }

.flash-stack { position: fixed; top: 14px; right: 14px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.flash { padding: 10px 16px; border-radius: var(--radius); background: var(--bg-card); border: 1px solid var(--border); box-shadow: 0 4px 20px rgba(0,0,0,0.25); }
.flash-error { border-color: var(--danger); color: var(--danger); }
.flash-success { border-color: var(--success); color: var(--success); }

/* Public marketing site */
.public-nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 40px; border-bottom: 1px solid var(--border); }
.public-nav .links { display: flex; gap: 22px; align-items: center; }
.public-footer { border-top: 1px solid var(--border); padding: 30px 40px; color: var(--text-dim); font-size: 0.85rem; margin-top: 60px; }
.hero { padding: 90px 40px; text-align: center; max-width: 780px; margin: 0 auto; }
.hero h1 { font-size: 2.6rem; margin-bottom: 16px; }
.hero p { color: var(--text-dim); font-size: 1.1rem; margin-bottom: 28px; }
.section { padding: 60px 40px; max-width: 1000px; margin: 0 auto; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-top: 30px; }
.price-card { text-align: center; }
.price-card .price { font-size: 2rem; font-weight: 700; margin: 10px 0; }
.prose { max-width: 760px; margin: 0 auto; padding: 40px; line-height: 1.7; }
.prose h2 { margin-top: 34px; }

/* Quick capture floating widget */
#quick-capture-fab {
  position: fixed; bottom: 24px; right: 24px; width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent); color: #fff; border: none; font-size: 1.3rem; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3); z-index: 900;
}
.qc-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; z-index: 950; }
.qc-modal.hidden { display: none; }
.qc-modal-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; width: 92%; max-width: 560px; }
.qc-modal-card textarea { min-height: 120px; }
.qc-modal-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.qc-status { color: var(--text-dim); font-size: 0.85rem; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .app-main { padding: 20px; }
  .grid-2 { grid-template-columns: 1fr; }
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 0.88rem; }

.checkbox-row { display: flex; align-items: center; gap: 8px; }
.muted { color: var(--text-dim); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 10px; align-items: center; }
.usage-bar-track { background: var(--bg-elevated); border-radius: 999px; height: 8px; overflow: hidden; border: 1px solid var(--border); }
.usage-bar-fill { background: var(--accent); height: 100%; }
