/* TMS redesign PREVIEW — layered on global.css + dashboard.css, same tokens (green on near-black).
   Layout: fixed sidebar with six sections · trail bar · cards that wrap to one column on phones. */

.pv-flag { color: var(--amber); font-weight: 600; letter-spacing: .04em; }

/* Sidebar: six sections, roomier than the old flat list */
.pv-nav { padding: 6px 8px; display: grid; gap: 2px; }
.pv-nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; cursor: pointer; }
.pv-nav-icon { width: 18px; text-align: center; color: var(--green-200); }
.pv-back-classic { display: block; font-size: 11px; color: var(--text-faint); margin-bottom: 10px; text-decoration: none; }
.pv-back-classic:hover { color: var(--text-primary); text-decoration: underline; }

/* Content column: trail bar above the area the tool screens draw into */
.pv-col { margin-left: 220px; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pv-main { margin-left: 0; min-height: 0; flex: 1; }
.pv-crumb { display: flex; align-items: center; gap: 8px; padding: 12px 28px; font-size: 13px; color: var(--text-muted);
            border-bottom: var(--border); background: var(--bg-surface); position: sticky; top: 0; z-index: 5; }
.pv-crumb[hidden] { display: none; }
.pv-crumb a { color: var(--green-200); text-decoration: none; font-weight: 600; }
.pv-crumb a:hover { text-decoration: underline; }
.pv-crumb-sep { color: var(--text-faint); }

/* Cards */
.pv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-bottom: 28px; }
.pv-card { display: flex; flex-direction: column; gap: 8px; text-align: left; min-width: 0;
           background: var(--bg-card); border: var(--border-mid); border-radius: var(--radius-lg); padding: 16px 16px 14px;
           color: var(--text-primary); font: inherit; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.pv-card:hover { border-color: var(--green-200); background: var(--bg-hover); transform: translateY(-1px); }
.pv-card:focus-visible { outline: 2px solid var(--green-200); outline-offset: 2px; }
.pv-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pv-card-title { font-size: 15px; font-weight: 600; }
.pv-card-desc { font-size: 13px; line-height: 1.45; color: var(--text-secondary); flex: 1; }
.pv-card-go { font-size: 12px; color: var(--green-200); font-weight: 600; }
.pv-chip { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.pv-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; box-sizing: border-box; }
.pv-dot-off { border: 1.5px solid var(--text-muted); }

@media (prefers-reduced-motion: reduce) { .pv-card { transition: none; } .pv-card:hover { transform: none; } }

/* Tool comments panel (admins), under every tool screen. */
.pv-comments { margin: 0 28px 28px; padding: 18px 20px; border: var(--border-mid); border-radius: var(--radius-lg); background: var(--bg-card); }
.pv-comments[hidden] { display: none; }
.tc-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.tc-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.tc-form { margin: 12px 0 14px; }
.tc-form textarea { width: 100%; box-sizing: border-box; resize: vertical; }
.tc-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.tc-count { font-size: 11px; color: var(--text-faint); }
.tc-item { padding: 10px 0; border-top: var(--border); }
.tc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.tc-meta strong { color: var(--text-secondary); }
.tc-body { margin-top: 4px; font-size: 13px; color: var(--text-primary); white-space: pre-wrap; overflow-wrap: anywhere; }
.tc-empty { font-size: 12px; color: var(--text-muted); padding: 6px 0; }

/* Phones: menu becomes a top bar (logo + TEST/PROD, then the six sections as a swipeable row),
   content full width below it. */
@media (max-width: 760px) {
  .app { flex-direction: column; }
  .sidebar { position: static; width: 100%; min-width: 0; bottom: auto; overflow: visible;
             border-right: none; border-bottom: var(--border); }
  .sidebar-logo { padding-bottom: 8px; }
  .env-toggle { margin: 0 16px 8px; width: auto; box-sizing: border-box; }
  .pv-nav { display: flex; overflow-x: auto; gap: 6px; padding: 4px 16px 10px; scrollbar-width: none; }
  .pv-nav-item { flex: none; padding: 8px 12px; font-size: 13px; white-space: nowrap; border: var(--border); }
  .sidebar-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; }
  .pv-back-classic { margin: 0; }
  .pv-col { margin-left: 0; }
  .pv-crumb { padding: 10px 16px; position: static; }
  .pv-main { padding: 20px 16px; min-height: 0; }
  .pv-comments { margin: 0 16px 20px; padding: 14px; }
  .pv-grid { grid-template-columns: 1fr; }
}
