/* Workspace shell + project sidebar styles.
 * Kept separate so styles.css can stay at its 200-LOC budget. */

/* --- app shell (top bar + left rail + main) --- */
.app-shell {
  display: flex; flex: 1;
  max-width: 1400px; width: 100%;
  margin: 0 auto;
}
.app-shell main {
  flex: 1; padding: 32px 24px; max-width: none;
}
.left-rail {
  width: 200px; flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 24px 0;
  background: var(--bg-surface);
  display: flex; flex-direction: column;
}
.left-rail a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  border-left: 3px solid transparent;
  text-transform: none; letter-spacing: 0;
}
.left-rail a:hover { background: var(--bg-card); color: var(--text-primary); }
.left-rail a.active {
  color: var(--text-primary);
  background: var(--bg-card);
  border-left-color: var(--maestro);
}
.left-rail a .ico { font-size: 1rem; width: 20px; text-align: center; }
.left-rail a.external .ext { margin-left: auto; color: var(--text-muted); font-size: 0.8rem; }

/* --- workspace chip in the top bar --- */
.ws-chip {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 4px 12px; border: 1px solid var(--border);
  background: var(--bg-surface); color: var(--text-secondary);
}
.ws-chip:hover { border-color: var(--maestro); color: var(--text-primary); }
.ws-chip-label { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); }
.ws-chip-name  { font-size: 0.95rem; font-weight: 600; }

/* --- kanboard shell (project sidebar + main content area) --- */
.kanboard-shell { display: flex; gap: 20px; align-items: flex-start; }
.kanboard-main  { flex: 1; min-width: 0; }
.proj-sidebar {
  width: 200px; flex-shrink: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 12px 0;
  display: flex; flex-direction: column;
}
.proj-side-link {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  border-left: 3px solid transparent;
}
.proj-side-link:hover { background: var(--bg-card); color: var(--text-primary); }
.proj-side-link.active {
  background: var(--bg-card);
  color: var(--text-primary);
  border-left-color: var(--maestro);
}
.proj-side-link.mock { color: var(--text-muted); }
.proj-side-link.mock::after {
  content: "soon";
  margin-left: auto;
  font-size: 0.55rem;
  background: var(--bg-card); color: var(--text-muted);
  padding: 1px 5px;
  letter-spacing: 1px; text-transform: uppercase;
}
.proj-side-link .ico { font-size: 1rem; width: 20px; text-align: center; }

/* --- workspace tiles --- */
.ws-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.ws-tile {
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 18px; transition: background .15s, border-color .15s;
  color: inherit; text-decoration: none;
  display: block;
}
a.ws-tile:hover { background: var(--bg-card-hover); border-color: var(--maestro); }
.ws-tile-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }
.ws-tile-value { font-family: 'Playfair Display', serif; font-size: 2rem; margin: 4px 0; }
.ws-tile-sub   { font-size: 0.8rem; color: var(--text-secondary); }

/* --- responsive --- */
@media (max-width: 900px) {
  .app-shell { flex-direction: column; }
  .left-rail {
    width: 100%; flex-direction: row; overflow-x: auto;
    padding: 8px 0; border-right: none; border-bottom: 1px solid var(--border);
  }
  .left-rail a { border-left: none; border-bottom: 3px solid transparent; padding: 8px 14px; white-space: nowrap; }
  .left-rail a.active { border-left: none; border-bottom-color: var(--maestro); }
  .kanboard-shell { flex-direction: column; }
  .proj-sidebar {
    width: 100%; flex-direction: row; overflow-x: auto;
    padding: 6px 0;
  }
  .proj-side-link { border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
  .proj-side-link.active { border-left: none; border-bottom-color: var(--maestro); }
  .proj-side-link.mock::after { display: none; }
  .ws-chip { display: none; }
}

/* Acceptance-criteria editor — inputs sit outside .form-row so they need
   their own theming to match the dark surface; otherwise the criterion
   text reads black-on-near-black and looks empty. */
/* Acceptance-criteria editor (criteria_editor.js).
   Each row is a visible card with a span for the criterion text — clicking
   the span swaps it for an inline input. Progress bar at the top shows
   met/total + percent so the user can see how close a story is to done. */
.ac-progress { margin-bottom: 10px; }
.ac-progress-empty { color: var(--text-muted); font-size: .82rem; font-style: italic; }
.ac-progress-text { color: var(--text-primary); font-size: .82rem; margin-bottom: 4px; }
.ac-progress-text strong { color: var(--maestro); }
.ac-progress-bar { height: 6px; background: var(--bg-card); border-radius: 3px; overflow: hidden; }
.ac-progress-fill {
  height: 100%; background: var(--maestro);
  transition: width .25s ease;
}
.ac-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px;
  padding: 8px 10px; margin: 6px 0;
}
.ac-row.ac-met { background: rgba(82, 156, 110, 0.12); border-color: rgba(82, 156, 110, 0.4); }
.ac-row.ac-met .ac-text { text-decoration: line-through; color: var(--text-secondary); }
.ac-row input.ac-check { accent-color: var(--maestro); width: 18px; height: 18px; cursor: pointer; flex-shrink: 0; }
.ac-row .ac-text {
  flex: 1; min-width: 0; color: var(--text-primary); font-size: 0.92rem; line-height: 1.4;
  cursor: text; padding: 2px 4px; border-radius: 3px;
  word-break: break-word;
}
.ac-row .ac-text:hover { background: var(--bg-card-hover); }
.ac-row .ac-empty { color: var(--text-muted); font-style: italic; font-size: 0.85rem; }
.ac-row input.ac-text-input {
  flex: 1; min-width: 0;
  background: var(--bg-primary); border: 1px solid var(--maestro);
  color: var(--text-primary); padding: 4px 8px; font-size: 0.92rem; border-radius: 3px;
}
.ac-row input.ac-text-input:focus { outline: none; }
.ac-row .ac-rm {
  border: none; background: none; color: var(--error); cursor: pointer;
  font-size: 16px; line-height: 1; padding: 4px 8px; border-radius: 3px; flex-shrink: 0;
}
.ac-row .ac-rm:hover { background: rgba(220, 80, 80, 0.15); }
.ac-add-row { display: flex; gap: 8px; margin-top: 10px; }
.ac-add-row #ac-new {
  flex: 1; background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-primary); padding: 8px 10px; font-size: 0.9rem; border-radius: 4px;
}
.ac-add-row #ac-new:focus { outline: none; border-color: var(--maestro); }
.ac-tip { color: var(--text-muted); font-size: .72rem; display: block; margin-top: 6px; }

/* Right-click context menu — shared by kan-cards and project tiles.
   Lives in sidebar.css because styles.css is at the 200-line cap. */
.ctx-menu {
  position: fixed; z-index: 250; min-width: 180px; max-width: 260px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 6px; box-shadow: 0 6px 24px rgba(0,0,0,.35);
  padding: 4px 0; margin: 0; list-style: none; font-size: .85rem;
  color: var(--text-primary);
}
.ctx-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; cursor: pointer; user-select: none;
}
.ctx-item:hover { background: var(--bg-primary); }
.ctx-item.danger { color: var(--error, #ef4444); }
.ctx-item.disabled { color: var(--text-muted); cursor: not-allowed; }
.ctx-item .ctx-ic { width: 16px; text-align: center; opacity: .85; }
.ctx-item .ctx-lbl { flex: 1; }
.ctx-item .ctx-caret { opacity: .6; }

/* corey-coder training-progress dual banner (US-049) — owner-only strip
   above the workspace tiles. Smooth color transitions feel live. */
.corey-banner {
  display: block; width: 100%; min-height: 56px; padding: 14px;
  margin: 0 0 12px 0; font-family: 'JetBrains Mono', monospace;
  color: white; transition: background-color .35s ease;
}
.corey-banner.red    { background: var(--error, #dc2626); }
.corey-banner.yellow { background: #d97706; }
.corey-banner.green  { background: var(--success, #16a34a); }
.corey-banner-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; background: transparent; border: none; color: inherit;
  cursor: pointer; padding: 0; font: inherit; text-align: left;
}
.corey-banner-label { font-size: .95rem; font-weight: 600; }
.corey-banner-meta  { font-size: .75rem; opacity: .85; }
.corey-banner-meta a { color: inherit; text-decoration: underline; }
.corey-banner-detail { margin-top: 8px; font-size: .75rem; opacity: .92; line-height: 1.45; }
.corey-banner-repos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.corey-banner-repos span { background: rgba(255,255,255,.18); padding: 2px 6px; border-radius: 3px; }
@keyframes corey-pulse-red {
  0%, 100% { background-color: var(--error, #dc2626); }
  50%      { background-color: #7f1d1d; }
}
.corey-banner.red.flashing { animation: corey-pulse-red 1.2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .corey-banner.red.flashing { animation: none; } }

/* corey-coder test page (US-050) — owner-only test view + banner link. */
.corey-banner a.banner-link { color: white; text-decoration: underline; }
.corey-banner .banner-info { cursor: help; opacity: .8; margin-left: 4px; }
.test-row { display: grid; grid-template-columns: 1fr; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--border); font-family: ui-monospace, monospace; font-size: 0.85rem; }
.test-row.scored-pass { border-left: 4px solid var(--success, #16a34a); padding-left: 8px; }
.test-row.scored-fail { border-left: 4px solid var(--error); padding-left: 8px; }
.test-row.unscored    { border-left: 4px solid var(--text-muted); padding-left: 8px; opacity: 0.85; }
.test-row .sandbox-bonus { display: inline-block; background: gold; color: black; padding: 2px 6px; border-radius: 3px; font-size: 0.7rem; margin-left: 6px; }

/* Project tile wrapper — keeps the trash icon overlaid on the card. */
.project-tile { position: relative; }
.project-del {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  background: transparent; border: 1px solid transparent;
  color: var(--text-muted); width: 26px; height: 26px;
  border-radius: 4px; cursor: pointer; font-size: .9rem; line-height: 1;
}
.project-tile:hover .project-del { color: var(--error, #ef4444); border-color: var(--border); }
.project-del:hover { background: var(--bg-primary); }
