:root {
  --portal-bg: #eef3f9;
  --portal-surface: #ffffff;
  --portal-surface-soft: rgba(255, 255, 255, 0.88);
  --portal-border: #e5eaf2;
  --portal-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  --portal-text: #111827;
  --portal-muted: #667085;
  --portal-muted-soft: #98a2b3;
  --portal-sidebar: #0f172a;
  --portal-sidebar-strong: #111c34;
  --portal-sidebar-border: rgba(255, 255, 255, 0.08);
  --portal-accent: #5b5cf0;
  --portal-accent-soft: rgba(91, 92, 240, 0.12);
  --portal-blue: #3b82f6;
  --portal-green: #22c55e;
  --portal-amber: #f59e0b;
  --portal-red: #ef4444;
  --portal-ring: #dbe5ff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body.portal-body {
  min-height: 100vh;
  min-width: 1440px;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(91, 92, 240, 0.08), transparent 28%),
    radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.06), transparent 20%),
    var(--portal-bg);
  color: var(--portal-text);
  font-family: "Manrope", "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.portal-shell {
  min-height: 100vh;
  min-width: 1440px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.portal-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 16px;
  background:
    radial-gradient(circle at top left, rgba(108, 99, 255, 0.16), transparent 22%),
    linear-gradient(180deg, var(--portal-sidebar), var(--portal-sidebar-strong));
  color: #f8fbff;
  border-right: 1px solid var(--portal-sidebar-border);
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--portal-sidebar-border);
}

.portal-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ffffff, #d2dcff);
  color: #182750;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1rem;
}

.portal-brand-name {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.32rem;
  font-weight: 700;
}

.portal-brand-subtitle,
.portal-sidebar-label,
.portal-user-card span,
.portal-user-summary span,
.metric-label,
.muted-copy,
.portal-kicker,
.metric-delta,
.review-row-meta,
.context-list span,
.context-grid span,
.health-row span,
.activity-copy span,
.draft-panel-head span,
.review-stat-card em,
.hero-metric span,
.mini-summary-row span,
.performance-row span,
.chart-x-axis span,
.chart-y-axis span,
.mini-status-text {
  color: var(--portal-muted);
}

.portal-sidebar-label {
  margin: 0 8px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(226, 234, 255, 0.54);
}

.portal-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.portal-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  min-height: 44px;
  border-radius: 12px;
  color: rgba(240, 245, 255, 0.88);
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.portal-nav-link:hover,
.portal-nav-link.is-active {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.06));
  color: #ffffff;
  transform: translateX(1px);
}

.portal-nav-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  color: inherit;
}

.portal-nav-icon svg,
.metric-icon svg,
.channel-icon svg,
.module-icon svg,
.portal-button svg,
.portal-sidebar svg,
.portal-notification-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.portal-nav-badge {
  margin-left: auto;
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.portal-sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--portal-sidebar-border);
}

.portal-user-card,
.portal-user-summary {
  display: flex;
  align-items: center;
  gap: 10px;
}

.portal-user-card strong,
.portal-user-summary strong,
.customer-identity strong,
.activity-copy strong,
.mini-table-main strong {
  display: block;
}

.portal-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #7b68ff, #b191ff);
  color: #ffffff;
  font-weight: 800;
  font-size: 12px;
}

.portal-avatar-small {
  width: 34px;
  height: 34px;
}

.portal-avatar-large {
  width: 54px;
  height: 54px;
  font-size: 16px;
}

.portal-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.portal-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: max-content minmax(280px, 1fr) max-content;
  gap: 16px;
  align-items: center;
  padding: 14px 24px;
  min-height: 64px;
  background: rgba(239, 243, 249, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(17, 24, 39, 0.06);
}

.portal-topbar-left,
.portal-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.portal-workspace-chip,
.portal-keycap,
.score-chip,
.tag-pill,
.status-pill,
.priority-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  font-weight: 700;
}

.portal-workspace-chip {
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--portal-border);
  background: var(--portal-surface);
  box-shadow: 0 6px 16px rgba(24, 39, 75, 0.04);
  font-size: 14px;
}

.portal-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--portal-green);
}

.portal-topbar-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--portal-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
}

.portal-topbar-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--portal-text);
  font-size: 14px;
}

.portal-keycap {
  min-width: 22px;
  justify-content: center;
  padding: 3px 7px;
  background: #f3f6fc;
  color: var(--portal-muted);
  border: 1px solid var(--portal-border);
  font-size: 11px;
}

.portal-button,
.portal-notification {
  border: 1px solid var(--portal-border);
  background: var(--portal-surface);
  color: var(--portal-text);
  border-radius: 12px;
  height: 44px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(24, 39, 75, 0.04);
  cursor: pointer;
}

.portal-button:hover,
.portal-notification:hover {
  transform: translateY(-1px);
}

.portal-button-primary {
  background: linear-gradient(135deg, var(--portal-accent), #7c66ff);
  color: #ffffff;
  border-color: transparent;
}

.portal-button-ghost {
  background: rgba(255, 255, 255, 0.72);
}

.portal-notification {
  position: relative;
  width: 44px;
  padding: 0;
  display: grid;
  place-items: center;
}

.portal-notification-icon {
  width: 16px;
  height: 16px;
  color: var(--portal-muted);
}

.portal-notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--portal-red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.portal-content {
  padding: 24px;
}

.portal-content-inner {
  width: 100%;
}

.portal-view {
  display: none;
}

.portal-view.is-active {
  display: block;
}

.portal-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.portal-page-header h1,
.customer-hero h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 32px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.portal-page-header p {
  margin: 6px 0 0;
  max-width: 56rem;
  color: var(--portal-muted);
  font-size: 14px;
}

.portal-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.portal-header-actions {
  display: flex;
  gap: 10px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.metric-card,
.portal-card,
.review-stat-card,
.customer-hero {
  border: 1px solid var(--portal-border);
  border-radius: 16px;
  background: var(--portal-surface-soft);
  box-shadow: var(--portal-shadow);
  backdrop-filter: blur(14px);
}

.metric-card {
  min-height: 112px;
  padding: 14px 16px;
}

.metric-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.metric-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--portal-accent);
  background: var(--portal-accent-soft);
}

.metric-icon-good {
  color: var(--portal-green);
  background: rgba(34, 197, 94, 0.12);
}

.metric-label {
  font-size: 12px;
  font-weight: 700;
}

.metric-value {
  font-family: "Space Grotesk", sans-serif;
  font-size: 30px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.metric-delta {
  margin-top: 9px;
  font-size: 12px;
  font-weight: 600;
}

.metric-delta-good {
  color: var(--portal-green);
}

.metric-delta-neutral {
  color: var(--portal-muted);
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.span-8 {
  grid-column: span 8;
}

.span-4 {
  grid-column: span 4;
}

.overview-card,
.review-conversation-card,
.review-column,
.context-card {
  padding: 16px;
}

.portal-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.portal-card-head h2,
.portal-card-head h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.15;
}

.portal-card-head p {
  margin: 4px 0 0;
}

.chart-card {
  min-height: 370px;
}

.chart-stage {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.chart-y-axis {
  height: 272px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-top: 4px;
  font-size: 11px;
}

.chart-plot {
  position: relative;
}

.chart-grid-lines {
  position: absolute;
  inset: 6px 0 26px 0;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  pointer-events: none;
}

.chart-grid-lines span {
  border-top: 1px solid #edf1f7;
}

.stacked-bars {
  position: relative;
  z-index: 1;
  height: 246px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 2px 0;
}

.stacked-bar {
  flex: 1 1 0;
  max-width: 18px;
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
}

.bar-segment {
  display: block;
  border-radius: 4px;
}

.bar-web {
  background: linear-gradient(180deg, #5f96ff, #2f6ef6);
}

.bar-email {
  background: linear-gradient(180deg, #a184ff, #6d5cff);
}

.bar-sms {
  background: linear-gradient(180deg, #7ada9b, #2fc76e);
}

.chart-x-axis {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 8px;
  font-size: 11px;
}

.chart-legend {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--portal-muted);
  font-size: 12px;
}

.chart-legend strong {
  color: var(--portal-text);
}

.legend-dot,
.activity-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  margin-right: 6px;
}

.legend-web,
.legend-blue,
.activity-dot-info {
  background: var(--portal-blue);
}

.legend-email,
.legend-accent,
.activity-dot-accent {
  background: var(--portal-accent);
}

.legend-sms,
.legend-good,
.activity-dot-good {
  background: var(--portal-green);
}

.legend-amber,
.activity-dot-warn {
  background: var(--portal-amber);
}

.legend-red {
  background: var(--portal-red);
}

.queue-list,
.channel-list,
.intent-list,
.activity-list,
.context-list,
.review-table,
.performance-list,
.mini-table {
  display: flex;
  flex-direction: column;
}

.queue-row,
.channel-row,
.intent-row,
.activity-row,
.context-list > div,
.health-row,
.performance-row,
.mini-table-row {
  display: grid;
  align-items: center;
  gap: 10px;
}

.queue-row {
  grid-template-columns: 1fr auto auto;
  min-height: 44px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(17, 24, 39, 0.07);
  font-size: 13px;
}

.queue-row strong,
.intent-row strong,
.performance-value,
.donut-legend-row strong {
  font-size: 13px;
}

.channel-row {
  grid-template-columns: 1fr auto;
  min-height: 48px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(17, 24, 39, 0.07);
  font-size: 13px;
}

.channel-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.channel-icon {
  width: 16px;
  height: 16px;
  color: var(--portal-muted);
}

.channel-status,
.score-chip,
.tag-pill,
.status-pill,
.priority-pill {
  padding: 5px 10px;
  font-size: 11px;
  line-height: 1;
}

.channel-status-good,
.status-pill-good {
  color: #15803d;
  background: rgba(34, 197, 94, 0.12);
}

.channel-status-muted,
.status-pill-neutral {
  color: var(--portal-muted);
  background: rgba(102, 112, 133, 0.1);
}

.status-pill-high,
.review-stat-card-high,
.priority-pill-high {
  color: #c2410c;
  background: rgba(249, 115, 22, 0.14);
}

.health-panel {
  display: grid;
  grid-template-columns: 144px 1fr;
  gap: 16px;
  align-items: center;
}

.health-ring {
  width: 132px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--portal-green) 0 87%, #dfe8f5 87% 100%);
  padding: 10px;
}

.health-ring-inner {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  text-align: center;
}

.health-ring-inner strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 28px;
  line-height: 1;
}

.health-ring-inner span {
  font-size: 11px;
  color: var(--portal-muted);
}

.health-row {
  grid-template-columns: 1fr auto;
  min-height: 34px;
  font-size: 13px;
}

.health-progress {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #dde7f5;
  margin-top: 10px;
}

.health-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #54c77e, #20b568);
}

.intent-row {
  grid-template-columns: 1.3fr minmax(90px, 1fr) auto;
  min-height: 40px;
  padding: 7px 0;
  font-size: 13px;
}

.intent-bar {
  height: 6px;
  border-radius: 999px;
  background: #dfe7f8;
  overflow: hidden;
}

.intent-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7fa8ff, #4b82ff);
}

.activity-row {
  grid-template-columns: auto 1fr auto;
  min-height: 56px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(17, 24, 39, 0.07);
  font-size: 13px;
}

.review-stat-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.review-stat-card {
  padding: 14px 16px;
}

.review-stat-card strong {
  display: block;
  margin: 6px 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 30px;
  line-height: 1;
}

.review-stat-card-accent {
  border-color: rgba(91, 92, 240, 0.18);
  box-shadow: 0 12px 28px rgba(91, 92, 240, 0.12);
}

.review-layout {
  display: grid;
  grid-template-columns: minmax(330px, 0.9fr) minmax(520px, 1.5fr) minmax(280px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.review-list-column {
  min-height: 65vh;
}

.review-row {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
}

.review-row + .review-row {
  margin-top: 6px;
}

.review-row.is-selected {
  border-color: rgba(91, 92, 240, 0.26);
  background: rgba(91, 92, 240, 0.07);
}

.review-row-top,
.draft-actions,
.tag-row,
.portal-card-head,
.customer-hero-main,
.customer-hero-side,
.mini-summary-row,
.donut-layout {
  display: flex;
}

.review-row-top {
  justify-content: space-between;
  gap: 12px;
}

.review-row-summary {
  margin: 6px 0;
  color: var(--portal-muted);
  font-size: 13px;
}

.review-row-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
}

.priority-pill-low {
  color: #15803d;
  background: rgba(34, 197, 94, 0.12);
}

.priority-pill-medium {
  color: #b45309;
  background: rgba(245, 158, 11, 0.16);
}

.review-center {
  min-width: 0;
}

.conversation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.72fr);
  gap: 16px;
  align-items: start;
}

.conversation-main,
.conversation-side {
  min-width: 0;
}

.conversation-header-card,
.conversation-thread-card,
.conversation-detail-card {
  padding: 16px;
}

.conversation-thread-card,
.conversation-detail-card {
  margin-top: 16px;
}

.conversation-header-grid {
  display: grid;
  grid-template-columns: 1.45fr repeat(5, minmax(110px, 1fr));
  gap: 14px;
  align-items: center;
}

.conversation-person {
  display: flex;
  align-items: center;
  gap: 14px;
}

.conversation-person span,
.conversation-meta-block span,
.thread-head span,
.thread-head time,
.detail-list span,
.suggestion-box span {
  color: var(--portal-muted);
}

.conversation-meta-block {
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding-left: 14px;
  border-left: 1px solid rgba(17, 24, 39, 0.06);
  font-size: 12px;
}

.conversation-meta-block strong {
  font-size: 13px;
}

.sla-text {
  color: #d14343;
}

.thread-day-divider {
  margin-bottom: 14px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--portal-muted);
}

.conversation-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.thread-message {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
}

.thread-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #6f7cff, #8f71ff);
}

.thread-message-customer .thread-avatar {
  background: linear-gradient(135deg, #98a2b3, #c4cad7);
}

.thread-message-system .thread-avatar {
  background: linear-gradient(135deg, #47b2bf, #56cad7);
}

.thread-message-draft .thread-avatar {
  background: linear-gradient(135deg, #6f56f8, #ab7dff);
}

.thread-bubble {
  padding: 14px 15px;
  border-radius: 14px;
  border: 1px solid rgba(17, 24, 39, 0.07);
  background: rgba(255, 255, 255, 0.88);
}

.thread-message-agent .thread-bubble,
.thread-message-draft .thread-bubble {
  background: linear-gradient(180deg, rgba(248, 246, 255, 0.96), rgba(243, 241, 255, 0.92));
}

.thread-message-system .thread-bubble {
  background: linear-gradient(180deg, rgba(243, 251, 253, 0.96), rgba(237, 248, 251, 0.94));
}

.thread-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
}

.thread-head strong {
  color: var(--portal-text);
}

.thread-head time {
  margin-left: auto;
}

.thread-body {
  font-size: 14px;
  line-height: 1.65;
  color: #1d2939;
}

.detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.detail-tab {
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--portal-muted);
  font-size: 13px;
  font-weight: 700;
}

.detail-tab.is-active {
  color: var(--portal-accent);
  background: rgba(91, 92, 240, 0.08);
  border-color: rgba(91, 92, 240, 0.16);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.detail-panel {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(17, 24, 39, 0.07);
  background: rgba(255, 255, 255, 0.72);
}

.detail-panel h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.detail-list {
  display: flex;
  flex-direction: column;
}

.detail-list > div {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(17, 24, 39, 0.07);
  font-size: 13px;
}

.context-bullet-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  color: var(--portal-muted);
  font-size: 13px;
  line-height: 1.55;
}

.suggestion-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(91, 92, 240, 0.12);
  background: linear-gradient(180deg, rgba(246, 244, 255, 0.96), rgba(240, 238, 255, 0.92));
}

.stacked-action-buttons {
  display: grid;
  gap: 10px;
}

.message-panel,
.review-notice,
.draft-panel,
.proposed-action-card {
  border: 1px solid rgba(17, 24, 39, 0.07);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  padding: 14px;
}

.message-panel-head,
.draft-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.review-notice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 16px 0;
}

.review-notice-warning {
  background: rgba(245, 158, 11, 0.1);
}

.review-notice ul {
  padding-left: 18px;
  margin: 10px 0 0;
}

.draft-panel {
  margin-bottom: 16px;
}

.draft-copy p {
  margin: 0 0 10px;
  line-height: 1.6;
  font-size: 14px;
}

.draft-actions {
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.context-card + .context-card {
  margin-top: 16px;
}

.customer-identity {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.context-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.context-grid div,
.context-list > div {
  padding: 10px 0;
  border-bottom: 1px solid rgba(17, 24, 39, 0.07);
  font-size: 13px;
}

.context-grid strong,
.context-list strong,
.hero-metric strong {
  display: block;
}

.tag-row {
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.tag-pill,
.score-chip {
  background: rgba(91, 92, 240, 0.1);
  color: #4840d8;
}

.customer-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 18px;
  margin-bottom: 16px;
}

.customer-hero-main {
  align-items: center;
  gap: 14px;
}

.customer-hero-side {
  gap: 10px;
}

.hero-metric {
  min-width: 140px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(17, 24, 39, 0.06);
}

.customer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.customer-span-two {
  grid-column: span 2;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.module-card {
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 255, 0.82));
  border: 1px solid rgba(17, 24, 39, 0.06);
}

.module-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--portal-accent);
  background: rgba(91, 92, 240, 0.1);
  margin-bottom: 14px;
}

.module-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.module-card p,
.message-panel p,
.review-notice p,
.proposed-action-card p,
.customer-hero p {
  margin: 0;
  color: var(--portal-muted);
  line-height: 1.6;
  font-size: 13px;
}

.mini-summary-row {
  gap: 18px;
  margin-bottom: 14px;
}

.mini-summary-row div {
  flex: 1;
  min-height: 58px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(17, 24, 39, 0.06);
  background: #f9fbff;
}

.mini-summary-row strong {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 24px;
  line-height: 1;
  margin-bottom: 6px;
}

.mini-table {
  gap: 8px;
}

.mini-table-row {
  grid-template-columns: 1.05fr 1fr auto;
  padding: 10px 0;
  border-bottom: 1px solid rgba(17, 24, 39, 0.07);
  font-size: 12px;
}

.mini-table-main span,
.mini-table-type {
  color: var(--portal-muted);
}

.mini-table-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.performance-list {
  gap: 2px;
}

.performance-row {
  grid-template-columns: 1fr auto;
  min-height: 48px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(17, 24, 39, 0.07);
}

.performance-row strong:first-child {
  font-size: 13px;
}

.performance-sparkline {
  margin-top: 16px;
  padding: 10px 0 0;
}

.performance-sparkline svg {
  width: 100%;
  height: 86px;
}

.performance-sparkline path {
  fill: none;
  stroke: #46b96f;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.performance-sparkline .sparkline-secondary {
  stroke: #92d7a9;
}

.donut-layout {
  align-items: center;
  gap: 18px;
}

.donut-chart {
  width: 168px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(
    var(--portal-green) 0 87%,
    var(--portal-blue) 87% 94%,
    var(--portal-amber) 94% 95%,
    var(--portal-red) 95% 100%
  );
  padding: 14px;
}

.donut-chart-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  text-align: center;
}

.donut-chart-inner strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 30px;
  line-height: 1;
}

.donut-chart-inner span {
  font-size: 11px;
  color: var(--portal-muted);
}

.donut-legend {
  flex: 1;
}

.donut-legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
  font-size: 12px;
}

.donut-legend-label {
  display: inline-flex;
  align-items: center;
  color: var(--portal-muted);
}

.spacious > div {
  padding: 12px 0;
}

@media (max-width: 1180px) {
  .portal-shell {
    grid-template-columns: 1fr;
  }

  .portal-topbar,
  .portal-page-header,
  .customer-hero,
  .customer-hero-side {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .metric-grid,
  .overview-grid,
  .customer-grid,
  .review-layout,
  .conversation-layout,
  .review-notice-grid,
  .health-panel,
  .module-grid,
  .review-stat-row,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .review-layout {
    display: grid;
  }

  .donut-layout {
    flex-direction: column;
    align-items: flex-start;
  }
}
