/* Project Manager Dashboard — global styles
   Palette derived from ~/projects/projects-dashboard/template.html */

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

:root {
  --bg: #0f0f13;
  --panel: #14141c;
  --panel-2: #16161f;
  --border: #1e1e2a;
  --border-2: #2e2e3e;
  --text: #e2e2e8;
  --text-dim: #8b8ba0;
  --text-mute: #6b6b85;
  --text-fade: #55556a;
  --accent: #a78bfa;
  --accent-soft: #c9b3ff;
  --accent-bg: #1a1525;
  --danger: #f87171;
  --success: #4ade80;
}

html { color-scheme: dark; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a { color: inherit; }
code { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 0.85em; color: var(--accent-soft); }

.flash {
  position: fixed; top: 1rem; left: 50%; transform: translateX(-50%);
  z-index: 100; padding: 0.6rem 1rem; border-radius: 8px;
  border: 1px solid var(--border-2); font-size: 0.85rem;
}
.flash-notice { background: #1a2a1a; color: var(--success); border-color: #2a4a2a; }
.flash-alert  { background: #2a1414; color: var(--danger);  border-color: #5a1a1a; }

/* ─── Header ─────────────────────────────────────────────────────────── */
header.app-header {
  padding: 2rem 2.5rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 1rem;
}
header.app-header .brand-col { display: flex; flex-direction: column; gap: 0.25rem; }
header.app-header .crumb {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em;
  color: var(--text-mute); text-decoration: none; transition: color 0.15s;
}
header.app-header .crumb:hover { color: var(--accent); }
header.app-header a.logo {
  font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em;
  color: #fff; text-decoration: none; transition: opacity 0.15s;
}
header.app-header a.logo:hover { opacity: 0.85; }
header.app-header a.logo span { color: var(--accent); }
header.app-header .badge {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--border); color: var(--accent);
  border: 1px solid var(--border-2);
  padding: 0.25rem 0.6rem; border-radius: 999px;
}
header.app-header .nav { margin-left: auto; display: flex; gap: 1.4rem; align-items: center; font-size: 0.85rem; color: var(--text-mute); }
header.app-header .nav a { text-decoration: none; transition: color 0.15s; }
header.app-header .nav a:hover { color: var(--accent); }
header.app-header .nav .me { color: var(--text-fade); font-size: 0.75rem; }

.container { max-width: 1440px; margin: 0 auto; padding: 2.5rem; }

/* ─── Bookmarks ──────────────────────────────────────────────────────── */
.bookmarks { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1.5rem; }
.bookmarks a {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1rem;
  background: linear-gradient(180deg, #1a1a27 0%, var(--panel-2) 100%);
  border: 1px solid var(--border-2); border-radius: 10px;
  color: var(--text); text-decoration: none;
  font-size: 0.85rem; font-weight: 500;
  transition: all 0.15s;
}
.bookmarks a:hover { border-color: var(--accent); color: #fff; transform: translateY(-1px); }
.bookmarks a .bm-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.bookmarks a .bm-label { color: var(--text-dim); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; margin-right: 0.2rem; }

/* ─── Pitch ─────────────────────────────────────────────────────────── */
.pitch {
  margin-bottom: 2.5rem;
  padding: 1.6rem 1.8rem;
  background: linear-gradient(180deg, var(--panel-2) 0%, var(--panel) 100%);
  border: 1px solid var(--border); border-radius: 14px;
}
.pitch h1 { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; color: #fff; margin-bottom: 0.5rem; }
.pitch p, .pitch div { font-size: 0.9rem; color: var(--text-dim); line-height: 1.55; max-width: 760px; }
.pitch p + p { margin-top: 0.6rem; }

/* ─── TODOs ─────────────────────────────────────────────────────────── */
.todos {
  margin-bottom: 2.5rem;
  padding: 1.4rem 1.6rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
}
.todos-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.9rem; }
.todos h2 { font-size: 0.9rem; font-weight: 700; color: #fff; letter-spacing: -0.01em; margin-right: auto; }
.todos-tabs { display: flex; gap: 0.3rem; }
.todos-tab {
  font: inherit; font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 0.35rem 0.7rem; border-radius: 6px;
  border: 1px solid var(--border-2); background: transparent;
  color: var(--text-mute); cursor: pointer; transition: all 0.15s;
  text-decoration: none;
}
.todos-tab:hover { color: var(--accent-soft); border-color: #3a3a4e; }
.todos-tab.active { color: var(--accent); border-color: var(--accent); background: var(--accent-bg); }
.todos-tab .badge {
  display: inline-block; margin-left: 0.4rem; padding: 0 0.4rem;
  background: var(--border); color: var(--text-dim); border-radius: 999px; font-size: 0.65rem;
}
.todos-tab.active .badge { background: #2a2640; color: var(--accent-soft); }
.todos-add { display: flex; gap: 0.5rem; margin-bottom: 0.7rem; }
.todos-add input[type="text"] {
  flex: 1; font: inherit; font-size: 0.85rem;
  padding: 0.55rem 0.7rem;
  background: #0f0f15; color: var(--text);
  border: 1px solid var(--border-2); border-radius: 7px;
  outline: none; transition: border-color 0.15s;
}
.todos-add input[type="text"]:focus { border-color: var(--accent); }
.todos-add button {
  font: inherit; font-size: 0.78rem; font-weight: 600;
  padding: 0 1rem;
  background: #2a1f3f; color: var(--accent-soft);
  border: 1px solid #3a2f5a; border-radius: 7px;
  cursor: pointer; transition: all 0.15s;
}
.todos-add button:hover { background: #3a2f5a; color: #fff; }
.todos-list {
  list-style: none; max-height: 460px; overflow-y: auto;
  padding-right: 0.4rem;
  scrollbar-width: thin; scrollbar-color: var(--border-2) transparent;
}
.todos-list::-webkit-scrollbar { width: 6px; }
.todos-list::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
.todos-empty {
  padding: 1.2rem 0.7rem;
  color: var(--text-fade); font-size: 0.82rem;
  font-style: italic; text-align: center;
}
.todo-row {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 0.6rem; border-radius: 6px;
  border: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s;
}
.todo-row:hover { background: #1a1a25; border-color: #2a2a36; }
.todo-row.sortable-ghost { opacity: 0.4; background: var(--accent-bg); }
.todo-row .handle {
  color: #3e3e52; cursor: grab; font-size: 0.95rem;
  line-height: 1; padding: 0 0.15rem; user-select: none;
  transition: color 0.15s;
}
.todo-row:hover .handle { color: var(--text-mute); }
.todo-row .handle:active { cursor: grabbing; }
.todo-row .text {
  flex: 1; font-size: 0.86rem; color: var(--text);
  line-height: 1.4; word-break: break-word; cursor: text;
}
.todo-row.deleted .text, .todo-row.done .text { color: var(--text-mute); text-decoration: line-through; }
.todo-row .check {
  appearance: none;
  width: 16px; height: 16px; flex-shrink: 0;
  border: 1px solid #3a3a4e; border-radius: 4px;
  background: var(--panel); cursor: pointer;
  display: grid; place-items: center;
  transition: border-color 0.12s, background 0.12s;
}
.todo-row .check:hover { border-color: var(--accent); }
.todo-row .check:checked { background: var(--accent); border-color: var(--accent); }
.todo-row .check:checked::after {
  content: "✓"; color: var(--panel);
  font-size: 0.75rem; font-weight: 700; line-height: 1;
}
.todo-row .text-edit {
  flex: 1; font: inherit; font-size: 0.86rem;
  padding: 0.3rem 0.5rem;
  background: #0f0f15; color: var(--text);
  border: 1px solid var(--accent); border-radius: 5px; outline: none;
}
.todo-check-form, .todo-edit-form { display: contents; }
.todo-edit-form[hidden] { display: none; }
.todo-row[data-editing="1"] .text { display: none; }
.todo-row .actions { display: flex; gap: 0.3rem; opacity: 0; transition: opacity 0.12s; }
.todo-row:hover .actions, .todo-row.editing .actions { opacity: 1; }
.todo-row .actions button, .todo-row .actions a {
  font: inherit; font-size: 0.7rem; font-weight: 600;
  padding: 0.3rem 0.55rem; background: transparent;
  color: var(--text-dim); border: 1px solid var(--border-2);
  border-radius: 5px; cursor: pointer; transition: all 0.15s;
  text-decoration: none;
}
.todo-row .actions button:hover, .todo-row .actions a:hover { color: #fff; border-color: var(--accent); }
.todo-row .actions .danger:hover { color: var(--danger); border-color: #5a1a1a; background: #2a1414; }

/* ─── Runbook (.startup) ────────────────────────────────────────────── */
.startup {
  margin-bottom: 2.5rem;
  padding: 1.4rem 1.6rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
}
.startup h2 { font-size: 0.9rem; font-weight: 700; color: #fff; margin-bottom: 0.3rem; letter-spacing: -0.01em; }
.startup p.sub { font-size: 0.78rem; color: var(--text-mute); margin-bottom: 1rem; }
.startup .step-label {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent); margin: 0.9rem 0 0.45rem;
}
.startup .step-label:first-of-type { margin-top: 0; }
.cmd {
  position: relative;
  background: #0c0c10;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 0.55rem 2.2rem 0.55rem 0.7rem;
  margin-bottom: 0.4rem;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem; line-height: 1.5;
  color: #d4d4e0; white-space: pre; overflow-x: auto;
}
.cmd:last-child { margin-bottom: 0; }
.cmd .copy-btn {
  position: absolute; top: 0.35rem; right: 0.35rem;
  background: var(--border); border: 1px solid var(--border-2);
  color: var(--text-dim); border-radius: 5px;
  padding: 0.15rem 0.4rem;
  font-size: 0.65rem; font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.cmd .copy-btn:hover { background: #2a2640; color: var(--text); border-color: var(--accent); }
.cmd .copy-btn.copied { color: var(--success); border-color: #1a2a1a; background: #1a2a1a; }

/* ─── Tech stack ─────────────────────────────────────────────────────── */
.section-title {
  font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: #555568; margin-bottom: 1rem;
}
.stack {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.6rem; margin-bottom: 2.5rem;
}
.stack .pill {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.7rem 0.9rem; font-size: 0.8rem;
}
.stack .pill strong { color: var(--text); display: block; font-weight: 600; margin-bottom: 0.15rem; }
.stack .pill span { color: var(--text-mute); font-size: 0.7rem; }

/* ─── Documents ──────────────────────────────────────────────────────── */
.docs-list { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 2.5rem; }
.doc-row {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 1rem 1.4rem;
  display: flex; align-items: center; gap: 1rem;
  text-decoration: none; color: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.doc-row:hover { border-color: var(--accent); background: #1a1a26; }
.doc-row .doc-icon { font-size: 1.2rem; flex-shrink: 0; }
.doc-row .doc-info { flex: 1; }
.doc-row .doc-name { font-size: 0.9rem; font-weight: 600; color: #c4c4d4; }
.doc-row .doc-meta { font-size: 0.75rem; color: var(--text-fade); margin-top: 0.15rem; }
.doc-row .doc-arrow { color: #3a3a50; font-size: 1rem; transition: color 0.15s; }
.doc-row:hover .doc-arrow { color: var(--accent); }

/* ─── Footer ─────────────────────────────────────────────────────────── */
footer.app-footer {
  padding: 2rem 2.5rem; border-top: 1px solid var(--border);
  color: var(--text-fade); font-size: 0.75rem; text-align: center;
}
footer.app-footer a { color: var(--accent); text-decoration: none; }
footer.app-footer a:hover { text-decoration: underline; }

/* ─── Workspace (project list) ───────────────────────────────────────── */
.workspace-cards { display: flex; flex-direction: column; gap: 0.9rem; max-width: 720px; }
.workspace-cards .card-slot {
  position: relative;
  border-radius: 12px;
  transition: opacity 0.12s, box-shadow 0.12s;
}
.workspace-cards .card-slot.sortable-ghost { opacity: 0.4; }
.workspace-cards .card-slot .drag-handle {
  position: absolute;
  top: 12px; left: -22px;
  font-size: 1rem; line-height: 1;
  color: var(--text-fade); cursor: grab;
  padding: 4px 6px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  user-select: none;
  z-index: 2;
}
.workspace-cards .card-slot:hover .drag-handle { opacity: 0.8; }
.workspace-cards .card-slot .drag-handle:hover { color: var(--accent); opacity: 1; }
.workspace-cards .card-slot .drag-handle:active { cursor: grabbing; }
.workspace-cards .card {
  display: block;
  text-decoration: none;
  background: #1e2330;
  border: 1px solid #2d3348;
  border-radius: 12px;
  padding: 1.1rem 1.3rem;
  transition: border-color 0.15s, transform 0.15s;
}
.workspace-cards .card:hover { border-color: #6366f1; transform: translateY(-2px); }
.workspace-cards .card-label { font-size: 1.15rem; font-weight: 700; letter-spacing: 0.02em; color: var(--accent); margin-bottom: 0.4rem; }
.workspace-cards .card-desc { font-size: 0.82rem; color: #64748b; line-height: 1.5; }
.workspace-cards .card-url  { margin-top: 0.7rem; font-size: 0.7rem; color: #475569; font-family: "SF Mono", monospace; }

.add-project-link {
  display: inline-block; margin-top: 0.5rem;
  font-size: 0.78rem; color: var(--text-mute); text-decoration: none;
  padding: 0.5rem 0.8rem; border: 1px dashed var(--border-2); border-radius: 8px;
}
.add-project-link:hover { color: var(--accent); border-color: var(--accent); }

/* ─── Forms ──────────────────────────────────────────────────────────── */
.form-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.6rem 1.8rem; margin-bottom: 1.5rem;
}
.form-card h3 { font-size: 0.85rem; font-weight: 700; color: #fff; margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 0.08em; }
.form-card .field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 1rem; }
.form-card label { font-size: 0.72rem; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.05em; }
.form-card input[type="text"], .form-card input[type="url"], .form-card input[type="email"], .form-card input[type="password"], .form-card textarea, .form-card select {
  font: inherit; font-size: 0.88rem;
  padding: 0.55rem 0.7rem;
  background: #0f0f15; color: var(--text);
  border: 1px solid var(--border-2); border-radius: 7px;
  outline: none; transition: border-color 0.15s;
}
.form-card input:focus, .form-card textarea:focus { border-color: var(--accent); }
.form-card textarea { min-height: 80px; font-family: "SF Mono", Menlo, monospace; }
.form-card .actions { display: flex; gap: 0.6rem; margin-top: 1rem; }
.btn {
  display: inline-block; font: inherit; font-size: 0.82rem; font-weight: 600;
  padding: 0.55rem 1rem; background: #2a1f3f; color: var(--accent-soft);
  border: 1px solid #3a2f5a; border-radius: 7px; cursor: pointer;
  text-decoration: none; transition: all 0.15s;
}
.btn:hover { background: #3a2f5a; color: #fff; }
.btn-secondary { background: transparent; color: var(--text-dim); border-color: var(--border-2); }
.btn-secondary:hover { color: #fff; border-color: var(--accent); background: transparent; }

/* ─── Nested forms ──────────────────────────────────────────────────── */
.nested-row {
  position: relative;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  padding: 0.9rem 1rem 0.6rem;
  margin-bottom: 0.6rem;
  background: #0f0f15;
}
.nested-row[hidden] { display: none; }
.nested-row .nested-remove {
  position: absolute; top: 0.55rem; right: 0.55rem;
  font-size: 0.7rem; padding: 0.25rem 0.55rem;
}
.nested-row .field { margin-bottom: 0.55rem; }
.nested-section { padding: 1.1rem 1.1rem 0.8rem; }
.nested-section .nested-sub {
  margin-top: 0.6rem; padding: 0.7rem 0.9rem;
  background: #14141c; border: 1px solid var(--border);
  border-radius: 7px;
}
.nested-section .nested-sub-label {
  font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--accent); margin-bottom: 0.5rem;
}
.nested-step {
  background: #0c0c10;
  margin-bottom: 0.4rem; padding: 0.7rem 0.8rem 0.4rem;
}
.nested-grid {
  display: grid; gap: 0.5rem 0.7rem; margin-bottom: 0.4rem;
}
.nested-grid.bookmark-grid { grid-template-columns: minmax(80px, 120px) 1fr 1.5fr; }
.nested-grid.stack-grid    { grid-template-columns: minmax(120px, 1fr) 1fr 1.4fr; }
.nested-grid.doc-grid      { grid-template-columns: 60px 1fr 1.5fr 2fr; }
.nested-grid .field { margin-bottom: 0; }
@media (max-width: 800px) {
  .nested-grid.bookmark-grid, .nested-grid.stack-grid, .nested-grid.doc-grid {
    grid-template-columns: 1fr;
  }
}
.nested-actions { margin-top: 0.6rem; }

/* ─── Auth ──────────────────────────────────────────────────────────── */
.auth-shell { display: grid; place-items: center; min-height: 100vh; padding: 2rem; }
.auth-card { width: 100%; max-width: 360px; }
