﻿:root {
  --bg: #f7f4ef;
  --ink: #1b1b1f;
  --muted: #6b6f7a;
  --accent: #0a7f6f;
  --accent-2: #d58b28;
  --card: #ffffff;
  --border: rgba(10, 20, 30, 0.12);
  --shadow: 0 14px 40px rgba(16, 24, 40, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans SC", "Noto Serif SC", serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #fef4e1 0%, #f7f4ef 45%, #eef4f2 100%);
}

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 28px 60px;
}

.detail-page {
  max-width: 1400px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 18px 22px;
  border-radius: var(--radius);
  background: linear-gradient(120deg, #ffffff 0%, #f8f0e6 70%);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  animation: fadeUp 0.7s ease-out both;
}

.title-block h1 {
  font-family: "Noto Serif SC", serif;
  font-size: 30px;
  margin: 0 0 8px;
  letter-spacing: 1px;
}

.title-block p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.actions {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-top: 6px;
  flex-wrap: wrap;
}

.ghost-btn,
.primary-btn {
  border: none;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}

.ghost-btn {
  background: transparent;
  border: 1px dashed var(--accent);
  color: var(--accent);
}

.primary-btn {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 20px rgba(10, 127, 111, 0.25);
}

.primary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.upload-status {
  font-size: 12px;
  color: var(--muted);
  padding-left: 6px;
}

.metrics {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  padding: 16px;
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.08);
  animation: fadeUp 0.7s ease-out both;
}

.metric-card.clickable {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card.clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(16, 24, 40, 0.12);
}

.metric-card:nth-child(2) { animation-delay: 0.05s; }
.metric-card:nth-child(3) { animation-delay: 0.1s; }
.metric-card:nth-child(4) { animation-delay: 0.15s; }
.metric-card:nth-child(5) { animation-delay: 0.2s; }
.metric-card:nth-child(6) { animation-delay: 0.25s; }

.metric-value {
  font-size: 26px;
  font-weight: 700;
}

.metric-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.content {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 20px;
}

.content.single {
  grid-template-columns: 1fr;
}

.main-panel {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 18px 18px 8px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-header h2 {
  margin: 0;
  font-size: 18px;
}

.panel-sub {
  font-size: 12px;
  color: var(--muted);
}

.panel-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.filter-card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.08);
  padding: 6px 10px;
  position: relative;
  display: inline-block;
}

.filter-summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #111827;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-summary::-webkit-details-marker {
  display: none;
}

.filter-summary::after {
  content: "▾";
  color: var(--muted);
  font-size: 12px;
}

.filter-card[open] .filter-summary::after {
  content: "▴";
}

.filter-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 14px 28px rgba(16, 24, 40, 0.14);
  border-radius: 12px;
  padding: 8px;
  display: grid;
  gap: 6px;
  z-index: 20;
}

.filter-card:not([open]) .filter-menu {
  display: none;
}

.filter-option {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #1f2937;
  cursor: pointer;
  text-align: left;
}

.filter-option.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}

th, td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col-name {
  width: 220px;
}

.col-score {
  width: 90px;
  text-align: center;
}

.nowrap {
  white-space: nowrap;
}

th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.empty-row td {
  text-align: center;
  color: var(--muted);
  padding: 28px 10px;
}

.tag {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: #f1f4f6;
}

.tag.elite {
  background: #fef3d4;
  color: #a56210;
}

.tag.normal {
  background: #e9f7f1;
  color: #0a7f6f;
}

.tag.tier-elite {
  background: #fef3d4;
  color: #a56210;
}

.tag.tier-high {
  background: #dbeafe;
  color: #1d4ed8;
}

.tag.tier-mid {
  background: #e9f7f1;
  color: #0a7f6f;
}

.tag.tier-low {
  background: #fee2e2;
  color: #b91c1c;
}

.status {
  font-weight: 600;
}

.btn-small {
  background: #111827;
  color: #fff;
  border: none;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  cursor: pointer;
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.btn-small:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.side-card {
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.1);
  padding: 16px;
}

.side-card h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.side-card ul,
.side-card ol {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}

.steps {
  list-style: none;
  padding-left: 0;
  display: grid;
  gap: 10px;
}

.steps li {
  padding: 10px 12px;
  border-left: 3px solid var(--accent-2);
  background: #fff8ee;
  border-radius: 10px;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.modal-content {
  position: relative;
  z-index: 1;
  width: min(980px, 92vw);
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
  border: 1px solid rgba(15, 23, 42, 0.12);
  padding: 18px 20px 22px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.modal-body {
  padding-top: 14px;
  display: grid;
  gap: 16px;
  font-size: 13px;
  color: var(--ink);
}

.detail-section {
  background: #f9fafb;
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.detail-section h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #0f172a;
}

.detail-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  color: var(--ink);
}

.detail-grid span {
  color: var(--muted);
  margin-right: 6px;
}

.detail-block {
  white-space: pre-wrap;
  color: var(--muted);
  background: #ffffff;
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px dashed rgba(15, 23, 42, 0.12);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1080px) {
  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .actions {
    width: 100%;
    justify-content: flex-start;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

/* Detail page */
.detail-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 18px 22px;
}

.detail-title {
  font-family: "Noto Serif SC", serif;
  font-size: 26px;
  font-weight: 700;
}

.detail-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.detail-actions {
  display: flex;
  gap: 8px;
}

.detail-info {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.info-pill {
  background: #fff;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  padding: 10px 12px;
  display: grid;
  gap: 4px;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.info-pill span {
  font-size: 11px;
  color: var(--muted);
}

.info-pill strong {
  font-size: 13px;
  font-weight: 600;
}

.stage-timeline {
  margin-top: 18px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 12px 16px 14px;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.08);
}

.timeline-title {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.timeline-bar {
  display: flex;
  gap: 4px;
  align-items: stretch;
}

.timeline-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px;
  border-radius: 10px;
  color: #0f172a;
  font-size: 11px;
  min-width: 80px;
}

.timeline-item span {
  font-weight: 600;
}

.detail-main {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
}

.transcript-panel {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 520px;
}

.transcript-list {
  display: grid;
  gap: 10px;
  max-height: 560px;
  overflow: auto;
  padding-right: 6px;
}

.transcript-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  border: 1px solid transparent;
}

.transcript-item.sales {
  background: #f0fbf7;
}

.transcript-item.customer {
  background: #fff6e7;
}

.transcript-item.unknown {
  background: #eef2f7;
}
.transcript-item.active {
  border-color: #111827;
  box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.08);
}

.transcript-meta {
  min-width: 70px;
  font-size: 11px;
  color: var(--muted);
}

.transcript-bubble {
  font-size: 13px;
  color: #111827;
  line-height: 1.5;
}

.analysis-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.analysis-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.08);
  padding: 16px;
}

.analysis-card h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.analysis-grid {
  display: grid;
  gap: 10px;
  font-size: 12px;
}

.analysis-grid span {
  color: var(--muted);
  display: block;
  font-size: 11px;
}

.analysis-grid strong {
  font-size: 13px;
  font-weight: 600;
}

.insight-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  display: grid;
  gap: 6px;
}

@media (max-width: 1080px) {
  .detail-info {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .detail-main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .detail-info {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Assets page */
.assets-page {
  max-width: 1200px;
}

.assets-body {
  margin-top: 16px;
  display: grid;
  gap: 16px;
}

.assets-panel {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 18px;
}

.assets-panel .panel-header h2 {
  font-size: 19px;
}

.assets-panel.hidden {
  display: none;
}

.assets-list {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}

.assets-group {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 10px 12px;
  background: #fff;
}

.assets-group summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: #0f172a;
  list-style: none;
}

.assets-group summary::-webkit-details-marker {
  display: none;
}

.assets-group summary::after {
  content: "▾";
  float: right;
  color: var(--muted);
}

.assets-group[open] summary::after {
  content: "▴";
}

.assets-group .assets-list {
  margin-top: 10px;
}

.assets-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 12px 14px;
  background: #f8fafc;
  display: grid;
  gap: 6px;
}

.assets-card h4 {
  margin: 0;
  font-size: 13px;
}

.assets-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.assets-meta {
  font-size: 11px;
  color: var(--muted);
}

/* Login page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-shell {
  width: min(960px, 100%);
}

.login-card {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  padding: 28px;
  border-radius: 24px;
  background: linear-gradient(135deg, #ffffff 0%, #f8efe4 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.login-copy h1 {
  margin: 0 0 12px;
  font-family: "Noto Serif SC", serif;
  font-size: 34px;
  line-height: 1.2;
}

.login-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.login-eyebrow {
  margin-bottom: 10px !important;
  color: var(--accent);
  font-size: 12px !important;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.login-form {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.login-field {
  display: grid;
  gap: 8px;
}

.login-field span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.login-field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
  font-size: 14px;
  color: var(--ink);
}

.login-field input:focus {
  outline: 2px solid rgba(10, 127, 111, 0.15);
  border-color: rgba(10, 127, 111, 0.45);
}

.login-btn {
  width: 100%;
  justify-content: center;
}

.login-status {
  min-height: 18px;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 720px) {
  .detail-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .detail-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .login-card {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .login-copy h1 {
    font-size: 28px;
  }
}
