/* ============================================================
   PR346A — Lily HQ Shell + Capabilities Tab + Skills Registry
   Build marker: pr346a-lily-hq:2026-06-19
   TradeRail brand: Primary Orange #FF6B00, Dark #1A1A2E
   Lily advisory bar: purple #7C3AED
   Sidebar: desktop only (hidden below 768px)
   No emoji — text characters only for warnings
============================================================ */

/* ── Root container (mirrors Command Center pattern) ───────────────────────── */
#tr346-lily-hq-root {
  display: none;
  position: fixed;
  top: var(--nav-h, 48px);
  left: 16.5rem;
  right: 0;
  bottom: 0;
  z-index: 200;
  overflow-y: auto;
  background: #f5f6f8;
}

body.pui1b-collapsed #tr346-lily-hq-root {
  left: 3.5rem;
  transition: left 300ms ease;
}

@media (max-width: 767px) {
  body[data-tr-role]:not([data-tr-role="field_tech"]).pui1b-mounted #tr346-lily-hq-root {
    left: 3.5rem !important;
  }
  body[data-tr-role="field_tech"].pui1b-mounted #tr346-lily-hq-root {
    left: 0 !important;
  }
  #tr346-lily-hq-root {
    left: 3.5rem !important;
  }
}

/* ── Reset / base ──────────────────────────────────────────────────────────── */
.tr346-lily-hq-shell *,
.tr346-lily-hq-shell *::before,
.tr346-lily-hq-shell *::after {
  box-sizing: border-box;
}

.tr346-lily-hq-shell {
  font-family: 'Barlow', 'Segoe UI', sans-serif;
  font-size: 14px;
  color: #1A1A2E;
  background: #f5f6f8;
  min-height: 100%;
  padding: 0 0 48px;
}

/* ── Page header ───────────────────────────────────────────────────────────── */
.tr346-page-header {
  padding: 20px 24px 12px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

.tr346-page-title {
  font-family: 'Barlow Condensed', 'Barlow', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: #1A1A2E;
  margin: 0 0 2px;
  letter-spacing: 0.01em;
}

.tr346-page-subtitle {
  font-size: 13px;
  color: #6b7280;
  font-weight: 400;
  margin: 0;
}

/* ── Tab ribbon ────────────────────────────────────────────────────────────── */
.tr346-tab-ribbon {
  display: flex;
  align-items: flex-end;
  background: #ffffff;
  border-bottom: 2px solid #e5e7eb;
  padding: 0 24px;
  gap: 0;
}

.tr346-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
  outline: none;
  letter-spacing: 0.01em;
}

.tr346-tab:hover {
  color: #FF6B00;
}

.tr346-tab--active {
  color: #FF6B00;
  font-weight: 700;
  border-bottom-color: #FF6B00;
}

/* ── Tab content area ──────────────────────────────────────────────────────── */
.tr346-tab-content {
  padding: 20px 24px;
  max-width: 1280px;
}

/* ── Lily advisory / insight bar ────────────────────────────────────────────── */
.tr346-lily-bar {
  background: rgba(124, 58, 237, 0.06);
  border-left: 4px solid #7C3AED;
  border-radius: 4px;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.tr346-lily-bar-main {
  margin-bottom: 4px;
  line-height: 1.5;
}

.tr346-lily-label {
  color: #7C3AED;
  font-weight: 700;
  margin-right: 6px;
}

.tr346-lily-text {
  color: #1A1A2E;
  font-size: 14px;
}

.tr346-lily-disclaimer {
  font-size: 11px;
  color: #9ca3af;
  font-style: italic;
  line-height: 1.4;
}

/* ── Summary strip ─────────────────────────────────────────────────────────── */
.tr346-summary-strip {
  display: flex;
  gap: 14px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.tr346-stat-tile {
  background: #ffffff;
  border-radius: 8px;
  padding: 14px 18px;
  flex: 1;
  min-width: 120px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
  border-top: 3px solid #e5e7eb;
  text-align: center;
}

.tr346-stat-tile--active {
  border-top-color: #22c55e;
}

.tr346-stat-tile--available {
  border-top-color: #6b7280;
}

.tr346-stat-tile--new {
  border-top-color: #FF6B00;
}

.tr346-stat-tile--incomplete {
  border-top-color: #f59e0b;
}

.tr346-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #1A1A2E;
  line-height: 1;
  margin-bottom: 4px;
}

.tr346-stat-tile--active .tr346-stat-value {
  color: #16a34a;
}

.tr346-stat-tile--new .tr346-stat-value,
.tr346-stat-tile--incomplete .tr346-stat-value {
  color: #FF6B00;
}

.tr346-stat-label {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
  white-space: nowrap;
}

/* ── Skill card grid ───────────────────────────────────────────────────────── */
.tr346-skill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 1024px) {
  .tr346-skill-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .tr346-skill-grid {
    grid-template-columns: 1fr;
  }
  .tr346-tab-content {
    padding: 16px;
  }
}

/* ── Skill card ────────────────────────────────────────────────────────────── */
.tr346-skill-card {
  background: #ffffff;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
  border-left: 3px solid transparent;
  border-top: 3px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow 0.15s, transform 0.12s;
  position: relative;
}

.tr346-skill-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.13);
  transform: translateY(-2px);
}

.tr346-skill-card--active {
  border-left-color: #22c55e;
}

.tr346-skill-card--new {
  border-top-color: #FF6B00;
}

.tr346-skill-card--setup-incomplete {
  border-left-color: #FF6B00;
  border-top-color: transparent;
}

/* ── Card top row ──────────────────────────────────────────────────────────── */
.tr346-card-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ── Status badges ─────────────────────────────────────────────────────────── */
.tr346-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.5;
}

.tr346-status-badge--active {
  background: #22c55e;
  color: #ffffff;
}

.tr346-status-badge--available {
  background: #6b7280;
  color: #ffffff;
}

.tr346-status-badge--coming-soon {
  background: #3b82f6;
  color: #ffffff;
}

/* ── NEW badge ─────────────────────────────────────────────────────────────── */
.tr346-badge-new {
  display: inline-block;
  background: #FF6B00;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── Alert badge ───────────────────────────────────────────────────────────── */
.tr346-alert-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 0 5px;
  margin-left: auto;
}

/* ── Card body ─────────────────────────────────────────────────────────────── */
.tr346-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #1A1A2E;
  line-height: 1.3;
}

.tr346-card-desc {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
}

.tr346-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tr346-module-badge {
  display: inline-block;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.tr346-card-last-action {
  font-size: 12px;
  color: #9ca3af;
  font-style: italic;
  line-height: 1.4;
}

/* ── Setup warning ─────────────────────────────────────────────────────────── */
.tr346-setup-warning {
  background: rgba(255, 107, 0, 0.07);
  border: 1px solid rgba(255, 107, 0, 0.3);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #FF6B00;
  cursor: pointer;
}

.tr346-setup-warning:hover .tr346-setup-gaps {
  display: block;
}

.tr346-setup-gaps {
  margin-top: 6px;
}

.tr346-setup-gap {
  font-size: 11px;
  font-weight: 400;
  color: #b45309;
  line-height: 1.5;
  margin-top: 2px;
}

/* ── Confirm row ───────────────────────────────────────────────────────────── */
.tr346-confirm-row {
  background: #fef9f0;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.tr346-confirm-text {
  font-size: 12px;
  color: #92400e;
  flex: 1;
  min-width: 180px;
  line-height: 1.5;
}

/* ── Card actions ──────────────────────────────────────────────────────────── */
.tr346-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid #f3f4f6;
}

/* ── Toggle ────────────────────────────────────────────────────────────────── */
.tr346-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  outline: none;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
}

.tr346-toggle-track {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  background: #d1d5db;
  border-radius: 999px;
  transition: background 0.2s;
  flex-shrink: 0;
}

.tr346-toggle--on .tr346-toggle-track {
  background: #22c55e;
}

.tr346-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: left 0.2s;
}

.tr346-toggle--on .tr346-toggle-thumb {
  left: 18px;
}

.tr346-toggle-text {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #9ca3af;
  min-width: 22px;
}

.tr346-toggle--on .tr346-toggle-text {
  color: #16a34a;
}

.tr346-toggle-wrap.tr346-toggle-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tr346-toggle-label {
  font-size: 12px;
  color: #9ca3af;
  font-style: italic;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.tr346-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  outline: none;
  letter-spacing: 0.01em;
}

.tr346-btn--primary {
  background: #FF6B00;
  color: #ffffff;
  border-color: #FF6B00;
}

.tr346-btn--primary:hover {
  background: #e55f00;
  border-color: #e55f00;
}

.tr346-btn--secondary {
  background: #f3f4f6;
  color: #374151;
  border-color: #e5e7eb;
}

.tr346-btn--secondary:hover {
  background: #e5e7eb;
}

.tr346-btn--danger {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

.tr346-btn--danger:hover {
  background: #dc2626;
  border-color: #dc2626;
}

.tr346-btn--ghost {
  background: transparent;
  color: #6b7280;
  border-color: #d1d5db;
}

.tr346-btn--ghost:hover {
  background: #f3f4f6;
}

.tr346-detail-btn {
  margin-left: auto;
}

/* ── Detail panel overlay ──────────────────────────────────────────────────── */
.tr346-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 46, 0.45);
  z-index: 9000;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
}

.tr346-detail-panel {
  background: #ffffff;
  width: 420px;
  max-width: 95vw;
  height: 100%;
  overflow-y: auto;
  box-shadow: -4px 0 24px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  animation: tr346SlideIn 0.22s ease;
}

@keyframes tr346SlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);   opacity: 1; }
}

/* ── Detail panel header ───────────────────────────────────────────────────── */
.tr346-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 18px 12px;
  border-bottom: 1px solid #e5e7eb;
  background: #fafafa;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 1;
}

.tr346-detail-header-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.tr346-detail-title {
  font-size: 16px;
  font-weight: 700;
  color: #1A1A2E;
  line-height: 1.3;
}

.tr346-pr-badge {
  display: inline-block;
  background: #1A1A2E;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.06em;
  align-self: flex-start;
}

.tr346-detail-close {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #6b7280;
  cursor: pointer;
  flex-shrink: 0;
  outline: none;
  transition: background 0.15s;
}

.tr346-detail-close:hover {
  background: #e5e7eb;
  color: #1A1A2E;
}

/* ── Detail panel body ─────────────────────────────────────────────────────── */
.tr346-detail-section {
  padding: 14px 18px;
  border-bottom: 1px solid #f3f4f6;
}

.tr346-detail-section:last-child {
  border-bottom: none;
}

.tr346-detail-section-title {
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}

.tr346-detail-desc {
  font-size: 13px;
  color: #374151;
  line-height: 1.6;
}

.tr346-detail-list {
  margin: 0;
  padding-left: 18px;
  color: #374151;
  font-size: 13px;
  line-height: 1.7;
}

.tr346-detail-list li {
  margin-bottom: 2px;
}

.tr346-detail-meta {
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 4px;
}

.tr346-detail-last-action {
  font-size: 13px;
  color: #374151;
  font-style: italic;
}

/* ── Detail panel setup section ────────────────────────────────────────────── */
.tr346-detail-setup {
  background: rgba(255, 107, 0, 0.04);
}

.tr346-setup-banner {
  background: rgba(255, 107, 0, 0.12);
  border: 1px solid rgba(255, 107, 0, 0.35);
  color: #FF6B00;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 5px;
  margin-bottom: 10px;
}

.tr346-setup-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  color: #FF6B00;
  font-weight: 600;
  text-decoration: none;
}

.tr346-setup-link:hover {
  text-decoration: underline;
}

.tr346-detail-notif-link {
  font-size: 13px;
  color: #6b7280;
  text-decoration: none;
  margin-left: 4px;
}

.tr346-detail-notif-link:hover {
  color: #1A1A2E;
  text-decoration: underline;
}

/* ── Detail panel actions ──────────────────────────────────────────────────── */
.tr346-detail-actions {
  padding: 16px 18px;
  display: flex;
  gap: 10px;
  border-top: 1px solid #e5e7eb;
  margin-top: auto;
  background: #fafafa;
  position: sticky;
  bottom: 0;
}

/* ── Placeholder tab content ───────────────────────────────────────────────── */
.tr346-placeholder {
  background: #ffffff;
  border-radius: 8px;
  padding: 48px 24px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}

.tr346-placeholder-title {
  font-size: 18px;
  font-weight: 700;
  color: #1A1A2E;
  margin-bottom: 10px;
}

.tr346-placeholder-msg {
  font-size: 14px;
  color: #9ca3af;
}

/* ── Demo panel ────────────────────────────────────────────────────────────── */
.tr346-demo-panel {
  background: #f5f6f8;
}

/* ── Sidebar — desktop only ────────────────────────────────────────────────── */
.tr346-sidebar {
  display: block;
}

@media (max-width: 767px) {
  .tr346-sidebar {
    display: none;
  }
  .tr346-detail-panel {
    width: 100%;
    max-width: 100%;
  }
  .tr346-summary-strip {
    gap: 8px;
  }
  .tr346-stat-tile {
    min-width: 100px;
    padding: 10px 12px;
  }
  .tr346-stat-value {
    font-size: 22px;
  }
}

/* ── Module group sections ─────────────────────────────────────────────────── */
.tr346-module-group {
  margin-bottom: 32px;
}

.tr346-module-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  background: #ffffff;
  border-top: 3px solid #FF6B00;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 16px;
}

.tr346-module-group-name {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #1A1A2E;
}

.tr346-module-group-count {
  font-size: 12px;
  color: #6b7280;
}
