/* ============================================================
   panels.css — Symmetry AI · Right context panel views
   ============================================================ */

/* ── Panel shell ─────────────────────────────────────────── */
#right-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: 56px;
  border-bottom: 1px solid var(--color-border-dark);
  flex-shrink: 0;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--color-text-light);
  flex: 1;
}

.panel-close-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.panel-close-btn:hover {
  background: rgba(255,255,255,0.07);
  color: var(--color-text-light);
}

#right-panel-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ── Panel views ─────────────────────────────────────────── */
.panel-view {
  display: none;
  padding: 16px;
  height: 100%;
}

.panel-view.active {
  display: block;
}

/* ── Audit trail ─────────────────────────────────────────── */
#panel-audit {
  padding: 0;
}

#panel-audit.active {
  display: flex;
  flex-direction: column;
}

.audit-filter-bar {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border-dark);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.audit-filter-chip {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-dark);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
  font-family: var(--font-body);
}

.audit-filter-chip:hover {
  background: rgba(255,255,255,0.06);
  color: var(--color-text-light);
}

.audit-filter-chip.active {
  background: rgba(192,53,75,0.12);
  border-color: rgba(192,53,75,0.4);
  color: #F08090;
}

.audit-list {
  padding: 12px 0;
  flex: 1;
  overflow-y: auto;
}

.audit-entry {
  padding: 11px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background var(--transition-fast);
}

.audit-entry:last-child {
  border-bottom: none;
}

.audit-entry:hover {
  background: rgba(255,255,255,0.03);
}

.audit-entry-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.audit-entry-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text-muted);
}

.audit-entry-vertical {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.03em;
}

.audit-entry-vertical.fund-accounting { background: rgba(45,212,191,0.12); color: #2DD4BF; }
.audit-entry-vertical.transfer-agency { background: rgba(96,165,250,0.12);  color: #60A5FA; }
.audit-entry-vertical.operations      { background: rgba(251,191,36,0.12);  color: #FBBF24; }
.audit-entry-vertical.middle-office   { background: rgba(249,115,22,0.12);  color: #F97316; }
.audit-entry-vertical.compliance      { background: rgba(192,53,75,0.12);   color: #F08090; }
.audit-entry-vertical.system          { background: rgba(255,255,255,0.06); color: rgba(248,249,251,0.5); }

.audit-entry-entity {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: rgba(62, 95, 133, 0.18);
  color: #7BA7D0;
  letter-spacing: 0.02em;
}

.audit-entry-status {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
}

.audit-entry-status.success  { background: rgba(52,211,153,0.12); color: #34D399; }
.audit-entry-status.pending  { background: rgba(251,191,36,0.12); color: #FBBF24; }
.audit-entry-status.error    { background: rgba(192,53,75,0.12);  color: #F08090; }

.audit-entry-actor {
  font-size: 11px;
  font-weight: 500;
  color: rgba(248,249,251,0.65);
  margin-bottom: 2px;
}

.audit-entry-action {
  font-size: 12px;
  color: rgba(248,249,251,0.85);
  line-height: 1.4;
}

/* ── Workflow panel ──────────────────────────────────────── */
#panel-workflow {
  padding: 0;
}

#panel-workflow.active {
  display: flex;
  flex-direction: column;
}

.workflow-meta {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border-dark);
  flex-shrink: 0;
}

.workflow-meta-id {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text-muted);
  margin-bottom: 3px;
}

.workflow-meta-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-light);
}

.workflow-steps-list {
  padding: 16px;
  flex: 1;
  overflow-y: auto;
}

.workflow-step-card {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  transition: border-color var(--transition-base);
}

.workflow-step-card.active {
  border-color: rgba(62,95,133,0.5);
  background: rgba(62,95,133,0.08);
}

.workflow-step-card.complete {
  border-color: rgba(52,211,153,0.25);
}

.workflow-step-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.step-card-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-card-icon.pending  i { color: var(--color-text-muted); }
.step-card-icon.active   i { color: #7BA7D0; }
.step-card-icon.complete i { color: #34D399; }

.workflow-step-card-label {
  font-size: 12px;
  font-weight: 500;
  color: rgba(248,249,251,0.85);
  flex: 1;
}

.workflow-step-card-ts {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text-muted);
}

.workflow-step-card-detail {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-left: 26px;
}

/* ── Document preview panel ──────────────────────────────── */
#panel-document {
  padding: 0;
  overflow-y: auto;
}

#panel-document.active {
  display: block;
}

.doc-preview {
  padding: 16px;
}

.doc-header {
  margin-bottom: 20px;
}

.doc-header-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.doc-fund-name {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--color-text-light);
  margin-bottom: 2px;
}

.doc-manager {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.doc-as-of {
  font-size: 11px;
  color: var(--color-text-muted);
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  display: inline-block;
}

/* Key metrics grid */
.doc-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}

.doc-metric-card {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.doc-metric-label {
  font-size: 10px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 3px;
}

.doc-metric-value {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--color-text-light);
  font-weight: 500;
}

.doc-metric-value.positive { color: #34D399; }

/* Section labels in doc */
.doc-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  margin-top: 20px;
}

.doc-section-label:first-of-type {
  margin-top: 0;
}

/* Holdings table in doc */
.doc-holdings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin-bottom: 4px;
}

.doc-holdings-table th {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: 5px 6px;
  text-align: left;
  border-bottom: 1px solid var(--color-border-dark);
}

.doc-holdings-table th:not(:first-child),
.doc-holdings-table td:not(:first-child) {
  text-align: right;
}

.doc-holdings-table td {
  padding: 7px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: rgba(248,249,251,0.8);
  vertical-align: middle;
}

.doc-holdings-table tr:last-child td {
  border-bottom: none;
}

.holding-name {
  font-size: 11px;
  color: rgba(248,249,251,0.85);
}

.holding-isin {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--color-text-muted);
}

.holding-weight {
  font-family: var(--font-mono);
  font-size: 11px;
}

/* Weight bar */
.weight-bar-cell {
  width: 60px;
}

.weight-bar {
  height: 3px;
  background: var(--color-border-dark);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 3px;
}

.weight-bar-fill {
  height: 100%;
  background: var(--color-navy);
  border-radius: 2px;
}

/* Monthly returns bar chart — CSS only */
.returns-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 80px;
  padding: 0 4px;
  margin-bottom: 4px;
}

.returns-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.returns-bar {
  width: 100%;
  background: var(--color-navy);
  border-radius: 2px 2px 0 0;
  transition: background var(--transition-fast);
  min-height: 3px;
}

.returns-bar:hover {
  background: #4E6F97;
}

.returns-bar-label {
  font-size: 9px;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}

.returns-bar-value {
  font-size: 9px;
  color: rgba(248,249,251,0.5);
  font-family: var(--font-mono);
  margin-bottom: 2px;
}

/* Disclaimer */
.doc-disclaimer {
  font-size: 10px;
  color: var(--color-text-muted);
  line-height: 1.5;
  padding-top: 16px;
  border-top: 1px solid var(--color-border-dark);
  margin-top: 16px;
}

/* ── Memory detail panel ─────────────────────────────────── */
#panel-memory {
  padding: 0;
}

#panel-memory.active {
  display: block;
}

.memory-detail-content {
  padding: 16px;
}

.memory-detail-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.memory-detail-category {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.memory-detail-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-muted);
}

.memory-detail-title {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--color-text-light);
  line-height: 1.4;
  margin-bottom: 14px;
}

.memory-detail-body {
  font-size: 13px;
  color: rgba(248,249,251,0.75);
  line-height: 1.6;
  margin-bottom: 16px;
}

.memory-detail-meta {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.memory-detail-meta-row {
  display: flex;
  gap: 8px;
  font-size: 11px;
  padding: 3px 0;
}

.memory-detail-meta-label {
  color: var(--color-text-muted);
  width: 64px;
  flex-shrink: 0;
}

.memory-detail-meta-value {
  color: rgba(248,249,251,0.8);
}

/* ── Notifications panel ─────────────────────────────────── */
#panel-notifications {
  padding: 0;
}

#panel-notifications.active {
  display: flex;
  flex-direction: column;
}

.notif-list {
  padding: 0;
  flex: 1;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border-dark);
  transition: background var(--transition-fast);
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-item:hover {
  background: rgba(255,255,255,0.03);
}

.notif-item.acknowledged {
  opacity: 0.5;
}

.notif-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notif-item-task-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-light);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-item-entity-chip {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: rgba(62,95,133,0.18);
  color: #7BA7D0;
  white-space: nowrap;
  flex-shrink: 0;
}

.notif-item-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.notif-item-message {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.45;
}

.notif-item-timestamp {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-muted);
}

.notif-item-link {
  font-size: 11px;
  color: var(--color-accent);
  text-decoration: none;
  align-self: flex-start;
  transition: text-decoration var(--transition-fast);
}

.notif-item-link:hover {
  text-decoration: underline;
}
