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

:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --nav-bg: #1e2433;
  --nav-text: #e0e4ef;
  --accent: #4a6cf7;
  --text: #2d3142;
  --muted: #6b7280;
  --border: #e2e8f0;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

nav {
  background: var(--nav-bg);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 52px;
}

nav a.brand {
  color: var(--nav-text);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  letter-spacing: .03em;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.25rem;
}

nav ul li a {
  color: var(--nav-text);
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  opacity: 0.8;
  transition: opacity .15s, background .15s;
}

nav ul li a:hover {
  opacity: 1;
  background: rgba(255,255,255,.1);
}

main {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.2rem; margin: 1.5rem 0 0.75rem; }

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
}

.badge {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.4;
}
.badge-open    { background: #e8f0fe; color: #1a56db; }
.badge-done    { background: #def7ec; color: #057a55; }
.badge-blocked { background: #fde8e8; color: #c81e1e; }
.badge-wip     { background: #fef3c7; color: #92400e; }

table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: .55rem .75rem;
  border-bottom: 1px solid var(--border);
}
th {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
tr:last-child td { border-bottom: none; }

.task-filters {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.task-filters input[type="search"] {
  flex: 1;
  min-width: 200px;
  padding: .45rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  outline-color: var(--accent);
}

.btn-group { display: flex; gap: .35rem; flex-wrap: wrap; }

.btn {
  padding: .3rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  font-size: .85rem;
  color: var(--muted);
}

.btn:hover { border-color: var(--accent); color: var(--accent); }

.btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.task-row { cursor: pointer; }
.task-row:hover td { background: #f0f4ff; }

.detail-row td { padding: 0; }

.task-detail {
  padding: .75rem 1.25rem;
  background: var(--bg);
  border-top: 1px solid var(--border);
  font-size: .9rem;
  line-height: 1.7;
}

.task-detail p { margin: .35rem 0; }
.task-detail .detail-label { font-weight: 600; color: var(--muted); font-size: .8rem;
  text-transform: uppercase; letter-spacing: .05em; margin-top: .75rem; }

/* Briefing page */
.briefing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.project-card .project-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.project-card h2 { margin: 0; font-size: 1.1rem; }

.project-desc { color: var(--muted); font-size: .9rem; margin: .25rem 0 .75rem; }

.orch-active { background: #d1fae5; color: #065f46; }

.status-row { display: flex; gap: .4rem; flex-wrap: wrap; margin: .75rem 0; }

.phase-progress { margin: .75rem 0; }

.phase-row { display: flex; align-items: center; gap: .5rem; margin: .3rem 0; }

.phase-label { font-size: .8rem; color: var(--muted); width: 60px; flex-shrink: 0; }

.phase-bar {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.phase-bar-fill { height: 100%; background: var(--accent); border-radius: 4px; }

.phase-fraction { font-size: .8rem; color: var(--muted); width: 40px; text-align: right; }

.section-label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 600;
  margin: .75rem 0 .25rem;
}

.ready-list, .recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: .9rem;
}

.ready-list li, .recent-list li {
  padding: .2rem 0;
  border-bottom: 1px solid var(--border);
}

.ready-list li:last-child, .recent-list li:last-child { border-bottom: none; }

.project-links { margin-top: 1rem; display: flex; gap: .5rem; }

.muted { color: var(--muted); }
