/* ── Cards ── */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--color-text);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-accent);
}

/* ── Tables ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.data-table th {
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--color-bg);
}

.data-table tbody tr:hover {
  background: #fafbfc;
}

.data-table-sm th,
.data-table-sm td {
  padding: 8px 12px;
}

.col-id { width: 48px; color: var(--color-text-muted); font-family: var(--font-mono); }
.col-room { min-width: 160px; }
.col-platform { width: 80px; }
.col-messages { width: 80px; text-align: right; }
.col-date { width: 140px; }
.col-action { width: 64px; text-align: center; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  background: var(--color-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}

.btn:hover {
  background: #1e4f5c;
  text-decoration: none;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.badge-platform {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.badge-model {
  background: var(--color-accent-light);
  color: #8a6d4b;
}

.badge-tokens {
  background: #eef2f7;
  color: #5a6672;
  font-family: var(--font-mono);
}

.badge-time {
  background: #e0ede4;
  color: var(--color-success);
}

/* ── Meta Badges ── */
.meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

/* ── Analysis Header ── */
.analysis-header {
  margin-bottom: 8px;
}

.analysis-header .page-title {
  margin-bottom: 12px;
}

/* ── Tags ── */
.topic-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
}

.tag-blue   { background: var(--color-info); color: #fff; }
.tag-green  { background: var(--color-success); color: #fff; }
.tag-gold   { background: var(--color-warning); color: #fff; }
.tag-purple { background: #7d3c98; color: #fff; }
.tag-red    { background: var(--color-danger); color: #fff; }

/* ── Overview ── */
.overview {
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-text);
}

/* ── Item Lists ── */
.item-list {
  list-style: none;
}

.list-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}

.list-item:last-child {
  border-bottom: none;
}

.item-number {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.item-body p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.item-meta {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* ── Subsection ── */
.subsection {
  margin-top: 16px;
}

.subsection:first-child {
  margin-top: 0;
}

.sub-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Link List ── */
.link-list {
  list-style: none;
}

.link-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.link-item:last-child {
  border-bottom: none;
}

.link-url {
  font-size: 13px;
  font-weight: 500;
  word-break: break-all;
}

.link-sender {
  font-size: 12px;
  color: var(--color-text-muted);
}

.link-title {
  font-size: 12px;
  color: var(--color-text);
  font-weight: 500;
}

/* ── Stats ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.stat-item {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.stat-item .stat-label {
  display: block;
  font-size: 11px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.stat-item .stat-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary);
}

/* ── Participant Tags ── */
.participant-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.participant-tag {
  background: var(--color-bg);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--color-text);
}

/* ── Bar Chart ── */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bar-label {
  width: 100px;
  font-size: 12px;
  color: var(--color-text);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}

.bar-track {
  flex: 1;
  height: 20px;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--color-info);
  border-radius: var(--radius-sm);
  transition: width 0.3s ease;
}

.bar-fill.bar-top {
  background: var(--color-accent);
}

.bar-value {
  width: 60px;
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: right;
  flex-shrink: 0;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--color-text-muted);
}

.empty-state p {
  font-size: 16px;
  margin-bottom: 8px;
}

.empty-hint {
  font-size: 13px;
  color: #a0a0a0;
}

.empty {
  color: var(--color-text-muted);
  font-style: italic;
  padding: 16px 0;
}

/* ── Settings Form ── */
.settings-form {
  max-width: 480px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: var(--font-base);
  color: var(--color-text);
  background: var(--color-surface);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-light);
}

.form-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.form-actions {
  margin-top: 24px;
}

/* ── Bulk Toolbar ── */
.bulk-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.bulk-select-all {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
}

.bulk-select-all input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ── Danger Button ── */
.btn-danger {
  background: var(--color-danger);
  color: #fff;
}

.btn-danger:hover {
  background: #b03a2e;
  text-decoration: none;
}

/* ── Analysis Checkbox ── */
.analysis-check {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ── Responsive ── */
@media (max-width: 720px) {
  .card {
    padding: 16px;
  }

  .bar-label {
    width: 80px;
  }

  .col-action .btn.btn-sm:not(:last-child) {
    display: none;
  }
}
