/* Shared styles for the manager UIs. Minimal chrome, keyboard-first. */
:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --border: #e5e4df;
  --text: #1f1d1a;
  --muted: #7a766f;

  --state-backlog: #9ca3af;    /* gray */
  --state-unstarted: #6b7280;  /* darker gray */
  --state-started: #3b82f6;    /* blue */
  --state-completed: #22c55e;  /* green */
  --state-canceled: #d1d5db;   /* faint */
  --state-overdue: #ef4444;    /* red */
  --state-duesoon: #f59e0b;    /* amber */

  --prio-urgent: #ef4444;
  --prio-high: #f59e0b;
  --prio-normal: #3b82f6;
  --prio-low: #9ca3af;
  --prio-none: #d1d5db;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}
a { color: inherit; }

header.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}
header.topbar h1 {
  font-size: 1rem;
  margin: 0;
  font-weight: 600;
}
header.topbar .spacer { flex: 1; }
header.topbar nav a {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  text-decoration: none;
  color: var(--muted);
}
header.topbar nav a.active {
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
}
header.topbar button {
  font: inherit;
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 4px;
  cursor: pointer;
}
header.topbar button:hover { background: var(--bg); }
header.topbar .status { color: var(--muted); font-size: 0.85rem; }

.center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  flex-direction: column;
  gap: 1rem;
}
.auth form { display: flex; gap: 0.5rem; }
.auth input {
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font: inherit;
  min-width: 18rem;
}

/* Issue pills shared across views */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  font-size: 0.78rem;
  line-height: 1.3;
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pill .dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.pill .id { font-weight: 600; }
.pill .title { color: var(--muted); }

.pill.overdue { background: #fef2f2; border-color: #fecaca; }
.pill.completed { background: #f0fdf4; border-color: #bbf7d0; opacity: 0.85; }
.pill.canceled { opacity: 0.5; text-decoration: line-through; }

/* Calendar-specific */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin: 1rem;
}
.cal-grid .weekday {
  padding: 0.5rem;
  background: var(--bg);
  font-weight: 500;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cal-grid .cell {
  background: var(--surface);
  padding: 0.375rem;
  min-height: 7rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  overflow: hidden;
}
.cal-grid .cell.outside { background: var(--bg); opacity: 0.55; }
.cal-grid .cell.today { background: #fff7e6; }
.cal-grid .cell .date {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.125rem;
}
.cal-grid .cell.today .date { color: #a16207; font-weight: 700; }
.cal-grid .cell .more {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: auto;
}

/* Gantt-specific */
.gantt {
  padding: 1rem;
  overflow-x: auto;
}
.gantt table {
  border-collapse: collapse;
  width: max-content;
  background: var(--surface);
}
.gantt th, .gantt td {
  border: 1px solid var(--border);
  padding: 0;
}
.gantt th.header {
  position: sticky;
  top: 0;
  background: var(--bg);
  padding: 0.4rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  text-align: left;
  z-index: 1;
}
.gantt th.row-label {
  position: sticky;
  left: 0;
  background: var(--bg);
  padding: 0.4rem 0.75rem;
  text-align: left;
  font-weight: 500;
  min-width: 10rem;
  z-index: 2;
}
.gantt td.day {
  width: 22px;
  height: 28px;
  vertical-align: middle;
}
.gantt td.day.weekend { background: #f5f5f2; }
.gantt td.day.today { background: #fff7e6; }
.gantt .bar {
  height: 16px;
  border-radius: 3px;
  background: var(--state-started);
  margin: 0 1px;
  position: relative;
  opacity: 0.9;
}
.gantt .bar.overdue { background: var(--state-overdue); }
.gantt .bar.completed { background: var(--state-completed); }
.gantt .bar.canceled { background: var(--state-canceled); }
.gantt .bar.backlog { background: var(--state-backlog); }
.gantt .bar .bar-label {
  position: absolute;
  left: 0.25rem;
  top: -1px;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  white-space: nowrap;
  pointer-events: none;
}
