/* ===========================================
   WORKSPACE MODULE STYLES
   Follows candidlabs design system conventions.
   =========================================== */

/* ── Layout ───────────────────────────────── */

.ws-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .ws-layout {
    grid-template-columns: 1fr;
  }
  .ws-sidebar {
    position: static !important;
  }
}

/* ── Sidebar ──────────────────────────────── */

.ws-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  height: fit-content;
  position: sticky;
  top: 100px;
}

.ws-sidebar-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding: 8px 12px;
  background: rgba(27, 112, 139, 0.08);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-primary);
}

.ws-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 4px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}

.ws-nav-link {
  display: block;
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 4px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font-body);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.ws-nav-btn:hover {
  background: rgba(27, 112, 139, 0.06);
  color: var(--text-primary);
}

.ws-nav-link:hover {
  background: rgba(27, 112, 139, 0.06);
  color: var(--text-primary);
}

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

.ws-nav-link.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.ws-nav-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

/* ── Section panels ───────────────────────── */

.ws-section {
  display: none;
}

.ws-section.active {
  display: block;
  animation: ws-fade-in 0.18s ease;
}

.ws-module-shell {
  min-width: 0;
}

.ws-module-shell .tool-layout {
  max-width: none;
  margin: 0;
}

@keyframes ws-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Portal card ──────────────────────────── */

.ws-portal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 40px 48px;
  max-width: 640px;
}

.ws-portal-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: rgba(27, 112, 139, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 20px;
  border: 1px solid rgba(27, 112, 139, 0.18);
}

.ws-portal-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.2;
}

.ws-portal-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 28px;
}

.ws-portal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.ws-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 99px;
  background: rgba(27, 112, 139, 0.08);
  color: var(--color-primary);
  border: 1px solid rgba(27, 112, 139, 0.16);
  letter-spacing: 0.02em;
}

.ws-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.ws-open-btn:hover {
  background: var(--color-accent);
  transform: translateY(-1px);
}

.ws-open-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ── Panel header ─────────────────────────── */

.ws-panel-header {
  margin-bottom: 28px;
}

.ws-panel-header h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.ws-panel-header p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.ws-feedback-block {
  margin-top: 8px;
}

.ws-feedback-description,
.ws-feedback-empty {
  margin: 0 0 16px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.ws-feedback-table {
  margin-top: 4px;
}

.ws-feedback-table th:first-child,
.ws-feedback-table td:first-child {
  white-space: nowrap;
  width: 92px;
}

.ws-feedback-table th:nth-child(2),
.ws-feedback-table td:nth-child(2) {
  width: 220px;
  text-align: center;
}

.ws-feedback-empty-row {
  text-align: center;
  color: var(--text-secondary);
}

.ws-feedback-submitter-cell {
  font-weight: 500;
}

.ws-feedback-detail-text {
  color: var(--text-primary);
  line-height: 1.5;
}

.ws-feedback-detail-meta {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.ws-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: rgba(27, 112, 139, 0.1);
  color: var(--color-primary);
}

.ws-status-reviewed,
.ws-status-actioned,
.ws-status-resolved {
  background: rgba(34, 197, 94, 0.14);
  color: #166534;
}

.ws-status-dismissed,
.ws-status-blocked {
  background: rgba(239, 68, 68, 0.14);
  color: #991b1b;
}

.ws-overview-stack {
  display: grid;
  gap: 24px;
}

.ws-overview-block {
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

.ws-overview-block:first-child {
  padding-top: 0;
  border-top: 0;
}

.ws-section-kicker {
  margin-bottom: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.ws-overview-block h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.ws-overview-block p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

.ws-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.ws-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}

.ws-kpi-number {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 2px;
}

.ws-kpi-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.ws-bullet-list {
  margin: 0;
  padding-left: 20px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.ws-bullet-list li + li {
  margin-top: 6px;
}
