:root {
  --ink: #0f1c1a;
  --teal: #0b3d3a;
  --teal-deep: #062826;
  --mint: #7ee0c8;
  --gold: #f0c75e;
  --sand: #eef6f2;
  --fog: #d7e6e0;
  --white: #ffffff;
  --muted: rgba(15, 28, 26, 0.58);
  --line: rgba(15, 28, 26, 0.12);
  --ok: #0f766e;
  --warn: #b45309;
  --danger: #b42318;
  --panel: rgba(255, 255, 255, 0.92);
  --font-display: "Sora", "PingFang SC", sans-serif;
  --font-body: "Source Sans 3", "PingFang SC", "Microsoft YaHei", sans-serif;
  --sidebar: 232px;
  --shadow: 0 12px 32px rgba(6, 40, 38, 0.08);
}

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

html,
body {
  min-height: 100%;
}

body {
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 12% 8%, rgba(126, 224, 200, 0.28), transparent 28%),
    radial-gradient(circle at 88% 0%, rgba(240, 199, 94, 0.22), transparent 26%),
    linear-gradient(160deg, #e8f3ef 0%, #f5f8f6 45%, #eef2f0 100%);
  background-attachment: fixed;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1.5px solid var(--ink);
  border-radius: 11px;
  padding: 0.65rem 0.95rem;
  cursor: pointer;
  font-weight: 700;
  background: var(--white);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(6, 40, 38, 0.1);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: var(--teal);
  color: var(--gold);
  border-color: var(--teal);
}

.btn-primary:hover {
  background: var(--teal-deep);
}

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

.btn-sm {
  padding: 0.38rem 0.7rem;
  font-size: 0.84rem;
  border-radius: 9px;
}

.btn-channel {
  border-color: var(--fog);
  background: #f7fbf9;
  font-weight: 650;
}

.btn-channel:hover {
  border-color: var(--teal);
  background: #e8f7f2;
}

.shell {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 14px;
  background: linear-gradient(180deg, #0b3d3a 0%, #0a3238 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 8px 22px;
  font: 800 1.15rem/1 "Sora", sans-serif;
  letter-spacing: -0.04em;
}

.side-brand img {
  width: 34px;
  height: 34px;
}

.nav-btn {
  text-align: left;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  padding: 0.72rem 0.9rem;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 650;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-btn.active {
  background: rgba(240, 199, 94, 0.18);
  color: var(--gold);
}

.side-foot {
  margin-top: auto;
  padding: 14px 10px 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
}

.side-foot .email {
  color: rgba(255, 255, 255, 0.55);
  margin: 4px 0 10px;
  word-break: break-all;
}

.main {
  padding: 22px 28px 40px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.page-title {
  font: 800 1.65rem/1.15 "Sora", sans-serif;
  letter-spacing: -0.04em;
}

.page-desc {
  color: var(--muted);
  margin-top: 4px;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.search-input {
  min-width: 200px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  padding: 0.55rem 0.8rem;
  background: rgba(255, 255, 255, 0.85);
  outline: none;
}

.search-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(11, 61, 58, 0.1);
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(15, 28, 26, 0.08);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  animation: rise 0.35s ease both;
}

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

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

.stat {
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(232, 247, 242, 0.9));
  border: 1px solid rgba(15, 28, 26, 0.08);
}

.stat .label {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 650;
}

.stat .value {
  margin-top: 6px;
  font: 800 1.55rem/1.1 "Sora", sans-serif;
  letter-spacing: -0.03em;
}

.split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.section-head h2,
.panel h2 {
  font: 750 1.05rem/1.2 "Sora", sans-serif;
  letter-spacing: -0.02em;
}

.table-wrap {
  overflow: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

table.data th,
table.data td {
  text-align: left;
  padding: 0.72rem 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

table.data th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

table.data tr {
  cursor: pointer;
  transition: background 0.12s ease;
}

table.data tr:hover td {
  background: rgba(126, 224, 200, 0.12);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 750;
  background: #e8f3ef;
  color: var(--teal);
}

.badge-gold {
  background: rgba(240, 199, 94, 0.28);
  color: #8a5a00;
}

.badge-ok {
  background: #d1fae5;
  color: #065f46;
}

.badge-warn {
  background: #ffedd5;
  color: #9a3412;
}

.badge-muted {
  background: #eef2f0;
  color: #52635e;
}

.muted {
  color: var(--muted);
}

.mono {
  font-variant-numeric: tabular-nums;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}

.timeline-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.timeline-item .when {
  color: var(--muted);
  font-size: 0.8rem;
}

.timeline-item .channel {
  display: inline-block;
  margin-bottom: 4px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.field label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.85rem;
  font-weight: 650;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  padding: 0.65rem 0.8rem;
  background: #fbfdfc;
  outline: none;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(11, 61, 58, 0.1);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(6, 40, 38, 0.45);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fade 0.2s ease;
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  width: min(560px, 100%);
  max-height: min(88vh, 760px);
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  animation: rise 0.25s ease;
}

.modal h3 {
  font: 750 1.2rem/1.2 "Sora", sans-serif;
  margin-bottom: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.detail-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.detail-hero h1 {
  font: 800 1.7rem/1.15 "Sora", sans-serif;
  letter-spacing: -0.04em;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.channel-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.voice-box {
  border: 1.5px dashed #9bc9bb;
  border-radius: 14px;
  padding: 14px;
  background: #f4fbf8;
}

.voice-box.listening {
  border-color: var(--teal);
  background: #e6f7f1;
  box-shadow: 0 0 0 3px rgba(11, 61, 58, 0.08);
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 10px;
  overflow: auto;
  padding-bottom: 4px;
}

.pipe-col {
  min-width: 150px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
}

.pipe-col h3 {
  font-size: 0.82rem;
  margin-bottom: 8px;
  color: var(--muted);
}

.pipe-card {
  padding: 10px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  margin-bottom: 8px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.pipe-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.pipe-card strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

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

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--teal);
  color: #fff;
  font-weight: 650;
  box-shadow: var(--shadow);
  animation: rise 0.25s ease;
}

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

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

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

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

  .sidebar {
    position: relative;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 12px;
  }

  .side-brand {
    width: 100%;
    margin: 0 0 8px;
  }

  .side-foot {
    width: 100%;
    margin-top: 8px;
  }

  .main {
    padding: 16px;
  }

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

  .timeline-item {
    grid-template-columns: 1fr;
  }
}
