:root {
  --bg: #060b14;
  --bg-soft: #0a1220;
  --panel: #0e1828;
  --panel-2: #121f33;
  --panel-3: #17263d;
  --border: #1c2c45;
  --border-strong: #29405f;
  --text: #e8f0fb;
  --text-dim: #c2d0e4;
  --muted: #8ba0bd;
  --muted-2: #647a99;
  --primary: #3b82f6;
  --primary-2: #60a5fa;
  --cyan: #22d3ee;
  --green: #34d399;
  --orange: #fbbf24;
  --red: #fb7185;
  --purple: #a78bfa;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Inter", "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1100px 560px at 82% -12%, rgba(59, 130, 246, 0.14), transparent 62%),
    radial-gradient(800px 500px at 8% 110%, rgba(34, 211, 238, 0.07), transparent 65%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  font-size: 0.92em;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.14);
  padding: 1px 5px;
  border-radius: 5px;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: #223650;
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-track {
  background: transparent;
}

.app {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 236px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 16px;
  background: linear-gradient(180deg, #0a1424 0%, #070d18 100%);
  border-right: 1px solid rgba(28, 44, 69, 0.85);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 10px 24px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #22d3ee);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.34);
}

.brand-logo svg {
  width: 20px;
  height: 20px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text strong {
  font-size: 15px;
  letter-spacing: 0.02em;
}

.brand-text span {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 9.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.nav-label {
  padding: 0 12px 9px;
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.12em;
}

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

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  height: 43px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  text-align: left;
  transition: 0.18s ease;
}

.nav-item:hover {
  color: var(--text-dim);
  background: rgba(59, 130, 246, 0.06);
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.20), rgba(59, 130, 246, 0.05));
  border-color: rgba(59, 130, 246, 0.24);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 11px;
  bottom: 11px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #3b82f6, #22d3ee);
}

.nav-ico {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  color: currentColor;
}

.nav-ico svg,
[data-icon] svg {
  width: 18px;
  height: 18px;
}

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 19px;
  padding: 0 6px;
  border-radius: 10px;
  display: none;
  align-items: center;
  justify-content: center;
  color: #fecdd3;
  background: rgba(251, 113, 133, 0.16);
  border: 1px solid rgba(251, 113, 133, 0.26);
  font-size: 10px;
  font-weight: 700;
}

.nav-badge.show {
  display: flex;
}

.sidebar-foot {
  margin-top: auto;
  padding: 0 4px;
}

.demo-card {
  padding: 13px;
  border: 1px solid rgba(28, 44, 69, 0.9);
  border-radius: 13px;
  background: rgba(18, 31, 51, 0.55);
}

.demo-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 600;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.10);
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.demo-card p {
  margin: 7px 0 9px;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.55;
}

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary-2);
  font-size: 11.5px;
  font-weight: 600;
}

.link-btn:hover {
  color: #93c5fd;
}

.version {
  padding: 14px 4px 0;
  color: #4e637f;
  font-size: 9.5px;
  text-align: center;
}

/* ---------- Main / topbar ---------- */

.main {
  width: calc(100% - 236px);
  margin-left: 236px;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 82px;
  padding: 16px 28px;
  background: rgba(6, 11, 20, 0.78);
  border-bottom: 1px solid rgba(28, 44, 69, 0.8);
  backdrop-filter: blur(16px);
}

.page-head {
  min-width: 190px;
}

.page-head h1 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.02em;
}

.page-head p {
  margin: 5px 0 0;
  color: var(--muted-2);
  font-size: 11.5px;
}

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.segmented {
  display: flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(14, 24, 40, 0.75);
}

.segmented button {
  height: 29px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.segmented button:hover {
  color: var(--text-dim);
}

.segmented button.active {
  color: #fff;
  background: #1d3555;
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.22);
}

.date-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-2);
}

.date-inputs input {
  width: 122px;
  height: 35px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: none;
  background: rgba(14, 24, 40, 0.75);
  color: var(--text-dim);
  font-size: 11.5px;
  color-scheme: dark;
}

.date-inputs input:focus {
  border-color: rgba(59, 130, 246, 0.55);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(14, 24, 40, 0.75);
  color: var(--muted);
  transition: 0.18s ease;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--panel-2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-2);
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: 0.18s ease;
}

.btn svg {
  width: 15px;
  height: 15px;
}

.btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
  transform: translateY(-1px);
}

.btn.primary {
  border-color: rgba(59, 130, 246, 0.5);
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  color: #fff;
  box-shadow: 0 7px 18px rgba(37, 99, 235, 0.26);
}

.btn.primary:hover {
  background: linear-gradient(180deg, #4b8df8, #2f6eed);
}

.btn.ghost {
  background: rgba(14, 24, 40, 0.5);
}

.btn.sm {
  min-height: 30px;
  padding: 0 10px;
  font-size: 11.5px;
  border-radius: 8px;
}

.btn.red {
  color: #fecdd3;
  border-color: rgba(251, 113, 133, 0.35);
  background: rgba(251, 113, 133, 0.10);
}

.btn.red:hover {
  background: rgba(251, 113, 133, 0.16);
}

.btn:disabled {
  opacity: 0.55;
  pointer-events: none;
}

.content {
  max-width: 1660px;
  padding: 18px 28px 52px;
  margin: 0 auto;
}

.range-line {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 2px 2px 15px;
  color: var(--muted-2);
  font-size: 11px;
}

.dot-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #3b506e;
}

/* ---------- KPI ---------- */

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

.kpi-card {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(18, 31, 51, 0.9), rgba(11, 21, 36, 0.9));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent, #3b82f6), transparent);
  opacity: 0.7;
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kpi-label {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.kpi-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  color: var(--accent, #60a5fa);
  background: color-mix(in srgb, var(--accent, #60a5fa) 12%, transparent);
}

.kpi-icon svg {
  width: 14px;
  height: 14px;
}

.kpi-value {
  margin-top: 9px;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

.kpi-value small {
  margin-left: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
}

.kpi-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  margin-top: 8px;
  color: var(--muted-2);
  font-size: 10px;
}

.delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted-2);
  white-space: nowrap;
}

.delta.up {
  color: var(--green);
}

.delta.down {
  color: var(--red);
}

.delta.bad {
  color: var(--red);
}

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

/* ---------- Cards / grid ---------- */

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.85fr);
  gap: 12px;
  margin-top: 12px;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(17, 29, 48, 0.92), rgba(10, 19, 33, 0.94));
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.13);
}

.chart-card,
.task-summary-card,
.missed-card,
.filter-card,
.table-card,
.devices-grid .card,
.guide-card {
  padding: 17px 18px;
}

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

.card-head h2,
.section-head h2 {
  margin: 0;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.card-sub {
  margin: 5px 0 0;
  color: var(--muted-2);
  font-size: 10.5px;
}

.legend {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--muted);
  font-size: 10px;
  padding-top: 2px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  display: inline-block;
}

.legend-dot.dial { background: #3b82f6; }
.legend-dot.effective { background: #fbbf24; }
.legend-dot.missed { background: #fb7185; }

.chart-wrap {
  height: 226px;
  margin-top: 14px;
}

.chart-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.chart-empty {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted-2);
  font-size: 11px;
}

/* task summary */

.task-summary {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 17px;
}

.donut {
  --p: 0;
  position: relative;
  width: 118px;
  height: 118px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--green) 0 calc(var(--p) * 1%), #1b2a40 calc(var(--p) * 1%) 100%);
  display: grid;
  place-items: center;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: #0d1929;
  border: 1px solid rgba(52, 211, 153, 0.10);
}

.donut-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.donut-inner strong {
  font-size: 24px;
  letter-spacing: -0.03em;
}

.donut-inner span {
  color: var(--muted-2);
  font-size: 9px;
}

.task-side {
  flex: 1;
  min-width: 0;
}

.task-facts {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-fact {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.task-fact i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted-2);
}

.task-fact.done i { background: var(--green); }
.task-fact.pending i { background: var(--primary-2); }
.task-fact.missed i { background: var(--red); }
.task-fact.ignored i { background: var(--muted-2); }

.task-fact b {
  margin-left: auto;
  color: var(--text-dim);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.task-summary-foot {
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid rgba(28, 44, 69, 0.75);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted-2);
  font-size: 10px;
}

.miss-badge {
  color: #fecdd3;
  background: rgba(251, 113, 133, 0.12);
  border: 1px solid rgba(251, 113, 133, 0.22);
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 10px;
}

/* ---------- Section / agents ---------- */

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 2px 11px;
}

.section-head p {
  margin: 5px 0 0;
  color: var(--muted-2);
  font-size: 10.5px;
}

.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 12px;
}

.agent-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(280px 140px at 100% 0, rgba(59, 130, 246, 0.07), transparent 70%),
    linear-gradient(180deg, rgba(17, 29, 48, 0.94), rgba(10, 19, 33, 0.96));
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.13);
  transition: 0.2s ease;
}

.agent-card:hover {
  border-color: rgba(59, 130, 246, 0.28);
  transform: translateY(-2px);
}

.agent-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  flex: 0 0 auto;
}

.agent-meta {
  min-width: 0;
  flex: 1;
}

.agent-name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
}

.agent-sub {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 10px;
}

.sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.10);
}

.sync-dot.off {
  background: var(--muted-2);
  box-shadow: none;
}

.agent-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 15px;
}

.agent-stat {
  padding: 8px 7px;
  border-radius: 9px;
  background: rgba(8, 16, 29, 0.55);
  border: 1px solid rgba(28, 44, 69, 0.65);
}

.agent-stat span {
  display: block;
  color: var(--muted-2);
  font-size: 9px;
  white-space: nowrap;
}

.agent-stat b {
  display: block;
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.agent-stat b.orange { color: var(--orange); }
.agent-stat b.red { color: var(--red); }
.agent-stat b.green { color: var(--green); }

.progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 13px;
}

.progress-label {
  color: var(--muted-2);
  font-size: 9.5px;
  white-space: nowrap;
}

.progress {
  flex: 1;
  height: 5px;
  border-radius: 4px;
  background: #1a2a41;
  overflow: hidden;
}

.progress > i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #34d399, #22d3ee);
}

.progress.orange > i {
  background: linear-gradient(90deg, #fbbf24, #f97316);
}

.progress.red > i {
  background: linear-gradient(90deg, #fb7185, #f43f5e);
}

.progress-num {
  color: var(--text-dim);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
}

.device-mini-list {
  margin-top: 13px;
  border-top: 1px solid rgba(28, 44, 69, 0.7);
  padding-top: 5px;
}

.device-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 2px;
  border-bottom: 1px dashed rgba(28, 44, 69, 0.55);
}

.device-mini:last-child {
  border-bottom: 0;
}

.device-mini-ico {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(59, 130, 246, 0.07);
}

.device-mini-ico svg {
  width: 14px;
  height: 14px;
}

.device-mini-main {
  flex: 1;
  min-width: 0;
}

.device-mini-name {
  color: var(--text-dim);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.device-mini-sub {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 9px;
}

.device-mini-miss {
  color: #fecdd3;
  font-size: 9.5px;
  white-space: nowrap;
}

.agent-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.tiny-note {
  color: var(--muted-2);
  font-size: 9.5px;
}

/* ---------- Tables ---------- */

.table-wrap {
  width: 100%;
  overflow: auto;
}

.table-wrap.compact {
  margin-top: 13px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  white-space: nowrap;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 9px 11px;
  color: var(--muted-2);
  background: #0d1929;
  border-bottom: 1px solid var(--border);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-align: left;
}

.data-table td {
  padding: 11px;
  border-bottom: 1px solid rgba(28, 44, 69, 0.62);
  color: var(--text-dim);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 0.15s ease;
}

.data-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.035);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table .right {
  text-align: right;
}

.data-table .num {
  font-variant-numeric: tabular-nums;
}

.data-table .strong {
  color: var(--text);
  font-weight: 600;
}

.data-table .muted {
  color: var(--muted-2);
  font-size: 10px;
}

.data-table .row-missed {
  background: rgba(251, 113, 133, 0.035);
}

.data-table .row-missed:hover {
  background: rgba(251, 113, 133, 0.06);
}

.data-table .two-line {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.data-table .two-line small {
  color: var(--muted-2);
  font-size: 9.5px;
}

.missed-table td {
  padding-top: 10px;
  padding-bottom: 10px;
}

.missed-table th:first-child,
.missed-table td:first-child {
  padding-left: 2px;
}

.missed-table th:last-child,
.missed-table td:last-child {
  padding-right: 2px;
}

.rate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 47px;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.rate.good {
  color: #a7f3d0;
  background: rgba(52, 211, 153, 0.10);
}

.rate.warn {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.10);
}

.rate.bad {
  color: #fecdd3;
  background: rgba(251, 113, 133, 0.11);
}

.rate.neutral {
  color: var(--muted);
  background: rgba(139, 160, 189, 0.08);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
}

.status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status.pending {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.11);
}

.status.done {
  color: #a7f3d0;
  background: rgba(52, 211, 153, 0.10);
}

.status.missed {
  color: #fecdd3;
  background: rgba(251, 113, 133, 0.12);
}

.status.ignored {
  color: var(--muted);
  background: rgba(139, 160, 189, 0.09);
}

.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  margin-left: 5px;
  border-radius: 9px;
  font-size: 9.5px;
  font-weight: 700;
  vertical-align: 2px;
}

.count-pill.red {
  color: #fecdd3;
  background: rgba(251, 113, 133, 0.13);
  border: 1px solid rgba(251, 113, 133, 0.20);
}

.count-pill.blue {
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.12);
}

.mini-cell {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 82px;
}

.mini-cell .progress {
  height: 4px;
}

.mini-cell span {
  color: var(--muted-2);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  min-width: 30px;
  text-align: right;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.icon-action {
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(14, 24, 40, 0.6);
  color: var(--muted);
  transition: 0.15s ease;
}

.icon-action svg {
  width: 13px;
  height: 13px;
}

.icon-action:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.text-btn {
  padding: 3px 4px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 10px;
}

.text-btn:hover {
  color: var(--primary-2);
}

.text-btn.danger:hover {
  color: var(--red);
}

.dial-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 27px;
  padding: 0 9px;
  border: 1px solid rgba(59, 130, 246, 0.34);
  border-radius: 7px;
  background: rgba(59, 130, 246, 0.13);
  color: #bfdbfe;
  font-size: 10px;
  font-weight: 600;
}

.dial-btn svg {
  width: 12px;
  height: 12px;
}

.dial-btn:hover {
  background: rgba(59, 130, 246, 0.22);
}

.phone-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.phone-cell b {
  color: var(--text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.phone-cell small {
  color: var(--muted-2);
  font-size: 9.5px;
}

.empty-state {
  padding: 44px 16px;
  color: var(--muted-2);
  font-size: 11.5px;
  text-align: center;
}

.empty-state.slim {
  padding: 22px 10px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-height: 38px;
  padding-top: 10px;
}

.pager button {
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(14, 24, 40, 0.7);
  color: var(--muted);
  font-size: 10.5px;
}

.pager button:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--border-strong);
}

.pager button.active {
  color: #fff;
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.18);
}

.pager button:disabled {
  opacity: 0.35;
  cursor: default;
}

.pager .pager-info {
  margin-right: auto;
  color: var(--muted-2);
  font-size: 10px;
}

/* ---------- Filters / tabs ---------- */

.filter-card {
  margin-bottom: 12px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 210px;
  max-width: 360px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(8, 16, 29, 0.65);
  color: var(--muted-2);
}

.search-box svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-dim);
  font-size: 11.5px;
}

.search-box input::placeholder {
  color: #526987;
}

select {
  height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: none;
  background: rgba(8, 16, 29, 0.65);
  color: var(--text-dim);
  font-size: 11.5px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #647a99 50%), linear-gradient(135deg, #647a99 50%, transparent 50%);
  background-position: calc(100% - 13px) 14px, calc(100% - 9px) 14px;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  color-scheme: dark;
}

select:focus {
  border-color: rgba(59, 130, 246, 0.55);
}

.result-count {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 10.5px;
  white-space: nowrap;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 14px;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(28, 44, 69, 0.7);
  overflow-x: auto;
}

.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 37px;
  padding: 0 12px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.tab b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 17px;
  padding: 0 5px;
  border-radius: 9px;
  background: rgba(139, 160, 189, 0.09);
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.tab:hover {
  color: var(--text-dim);
}

.tab.active {
  color: var(--text);
}

.tab.active::after {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #3b82f6, #22d3ee);
}

.tab.active b {
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.15);
}

.head-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

/* ---------- Devices ---------- */

.devices-grid {
  grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.4fr);
  margin-top: 0;
}

.agent-list,
.device-list {
  margin-top: 13px;
}

.agent-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 1px solid rgba(28, 44, 69, 0.6);
}

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

.agent-list-main {
  flex: 1;
  min-width: 0;
}

.agent-list-name {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
}

.agent-list-sub {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 9.5px;
}

.agent-list-stats {
  color: var(--muted);
  font-size: 10px;
  text-align: right;
  line-height: 1.5;
}

.device-row {
  display: grid;
  grid-template-columns: minmax(110px, 1.1fr) minmax(100px, 0.8fr) 110px minmax(122px, 0.9fr);
  gap: 10px;
  align-items: center;
  padding: 10px 2px;
  border-bottom: 1px solid rgba(28, 44, 69, 0.6);
}

.device-row:last-child {
  border-bottom: 0;
}

.device-name {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.device-name .device-mini-ico {
  width: 28px;
  height: 28px;
}

.device-name b {
  display: block;
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.device-name small {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 9px;
}

.device-row select {
  width: 100%;
  height: 30px;
  font-size: 10.5px;
}

.device-stats {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.device-stats b {
  color: var(--text-dim);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.device-stats .miss {
  color: var(--red);
}

.device-state {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  color: var(--muted-2);
  font-size: 9.5px;
  white-space: nowrap;
}

.inline-form {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid rgba(28, 44, 69, 0.7);
}

.inline-form input {
  flex: 1;
  min-width: 0;
  height: 33px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  background: rgba(8, 16, 29, 0.65);
  color: var(--text-dim);
  font-size: 11px;
}

.inline-form input:focus {
  border-color: rgba(59, 130, 246, 0.55);
}

.device-form {
  flex-wrap: wrap;
}

.device-form input {
  flex: 1 1 140px;
}

.device-form select {
  flex: 0 0 130px;
  height: 33px;
}

.form-hint {
  margin: 10px 0 0;
  color: var(--muted-2);
  font-size: 9.5px;
  line-height: 1.65;
}

.guide-card {
  margin-top: 12px;
}

.guide-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.guide-step {
  display: flex;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(28, 44, 69, 0.65);
  border-radius: 10px;
  background: rgba(8, 16, 29, 0.35);
}

.guide-step b {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.14);
  font-size: 10px;
}

.guide-step strong {
  color: var(--text-dim);
  font-size: 10.5px;
}

.guide-step p {
  margin: 4px 0 0;
  color: var(--muted-2);
  font-size: 9.5px;
  line-height: 1.6;
}

/* ---------- Modals ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 7, 14, 0.72);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.16s ease;
}

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

.modal {
  width: min(760px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: #0b1524;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  animation: rise 0.18s ease;
}

.modal.small {
  width: min(440px, 100%);
}

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

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 15px;
  border-bottom: 1px solid var(--border);
}

.modal-head h2 {
  margin: 0;
  font-size: 16px;
}

.modal-head p {
  margin: 5px 0 0;
  color: var(--muted-2);
  font-size: 10.5px;
}

.modal-body {
  padding: 18px 20px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: rgba(8, 16, 29, 0.35);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.field > span {
  color: var(--muted);
  font-size: 10.5px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: none;
  background: rgba(8, 16, 29, 0.72);
  color: var(--text-dim);
  font-size: 11.5px;
  color-scheme: dark;
}

.field input,
.field select {
  height: 37px;
  padding: 0 10px;
}

.field textarea {
  resize: vertical;
  min-height: 150px;
  padding: 10px;
  line-height: 1.7;
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, "Microsoft YaHei", monospace;
  font-size: 11px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(59, 130, 246, 0.55);
}

.import-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.file-btn {
  position: relative;
  overflow: hidden;
}

.hint-box {
  margin-top: 13px;
  padding: 11px 12px;
  border: 1px solid rgba(34, 211, 238, 0.13);
  border-radius: 9px;
  background: rgba(34, 211, 238, 0.035);
}

.hint-box strong {
  color: var(--cyan);
  font-size: 10.5px;
}

.hint-box p {
  margin: 5px 0 0;
  color: var(--muted-2);
  font-size: 9.5px;
  line-height: 1.7;
}

.import-result {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 10.5px;
  line-height: 1.6;
}

.import-result.ok {
  color: #a7f3d0;
  border: 1px solid rgba(52, 211, 153, 0.18);
  background: rgba(52, 211, 153, 0.06);
}

.import-result.err {
  color: #fecdd3;
  border: 1px solid rgba(251, 113, 133, 0.18);
  background: rgba(251, 113, 133, 0.06);
}

/* ---------- Toast / loading ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 200;
  max-width: min(480px, calc(100vw - 32px));
  padding: 10px 15px;
  border: 1px solid rgba(59, 130, 246, 0.26);
  border-radius: 9px;
  background: rgba(15, 28, 47, 0.96);
  color: var(--text-dim);
  font-size: 11.5px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  transition: 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  border-color: rgba(251, 113, 133, 0.35);
  color: #fecdd3;
}

.loading {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  transition: opacity 0.25s ease;
}

.loading.hide {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(96, 165, 250, 0.2);
  border-top-color: #60a5fa;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Responsive ---------- */

@media (max-width: 1280px) {
  .date-inputs {
    display: none;
  }
  .content {
    padding-left: 20px;
    padding-right: 20px;
  }
  .topbar {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (max-width: 1080px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .task-summary-card {
    min-height: auto;
  }
  .task-summary {
    max-width: 520px;
  }
  .devices-grid {
    grid-template-columns: 1fr;
  }
  .page-head p {
    display: none;
  }
}

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

@media (max-width: 900px) {
  .app {
    flex-direction: column;
  }
  .sidebar {
    flex: 0 0 auto;
    position: static;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 12px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
  }
  .brand {
    padding: 0 14px 0 2px;
    flex: 0 0 auto;
  }
  .brand-text span,
  .nav-label,
  .sidebar-foot {
    display: none;
  }
  .nav {
    flex-direction: row;
    gap: 3px;
  }
  .nav-item {
    width: auto;
    height: 38px;
    padding: 0 10px;
    font-size: 11.5px;
  }
  .nav-item.active::before {
    display: none;
  }
  .nav-badge {
    display: none !important;
  }
  .main {
    width: 100%;
    margin-left: 0;
  }
  .topbar {
    position: static;
    flex-wrap: wrap;
    min-height: auto;
    gap: 11px;
  }
  .top-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .content {
    padding: 15px 14px 40px;
  }
  .agent-grid {
    grid-template-columns: 1fr;
  }
  .section-head {
    margin-top: 19px;
  }
}

@media (max-width: 640px) {
  .sidebar {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .brand {
    width: 100%;
    padding-bottom: 10px;
  }
  .nav {
    width: 100%;
    overflow-x: auto;
  }
  .nav-item {
    flex: 0 0 auto;
  }
  .topbar {
    padding: 13px 14px;
  }
  .page-head h1 {
    font-size: 18px;
  }
  .segmented {
    width: 100%;
  }
  .segmented button {
    flex: 1;
    padding: 0 6px;
  }
  .top-actions .btn.primary {
    margin-left: auto;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kpi-card {
    min-height: 104px;
    padding: 12px;
  }
  .kpi-value {
    font-size: 23px;
  }
  .chart-wrap {
    height: 190px;
  }
  .chart-card,
  .task-summary-card,
  .missed-card,
  .filter-card,
  .table-card,
  .devices-grid .card,
  .guide-card {
    padding: 14px 13px;
  }
  .task-summary {
    gap: 15px;
  }
  .donut {
    width: 98px;
    height: 98px;
  }
  .donut-inner strong {
    font-size: 20px;
  }
  .agent-stats {
    gap: 4px;
  }
  .agent-stat {
    padding: 7px 5px;
  }
  .agent-stat b {
    font-size: 13px;
  }
  .filter-row .search-box {
    max-width: none;
    flex: 1 1 100%;
  }
  .filter-row select {
    flex: 1;
    min-width: 0;
  }
  .result-count {
    margin-left: 0;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .modal-head,
  .modal-body,
  .modal-foot {
    padding-left: 14px;
    padding-right: 14px;
  }
  .device-row {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    padding: 10px 0;
  }
  .device-state {
    justify-content: flex-start;
  }
  .data-table {
    font-size: 10.5px;
  }
  .data-table th,
  .data-table td {
    padding: 9px 8px;
  }
}

@media (max-width: 720px) {
  .task-table thead {
    display: none;
  }
  .task-table,
  .task-table tbody,
  .task-table tr,
  .task-table td {
    display: block;
    width: 100%;
  }
  .task-table tr {
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(10, 19, 33, 0.72);
  }
  .task-table td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 0 !important;
    border: 0;
    white-space: normal;
    text-align: left !important;
  }
  .task-table td::before {
    content: attr(data-label);
    flex: 0 0 68px;
    color: var(--muted-2);
    font-size: 9.5px;
    padding-top: 2px;
  }
  .task-table td:last-child {
    display: block;
    margin-top: 6px;
    padding-top: 9px !important;
    border-top: 1px dashed rgba(28, 44, 69, 0.7);
  }
  .task-table td:last-child::before {
    display: block;
    margin-bottom: 6px;
  }
  .task-table .row-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .task-table .phone-cell b {
    font-size: 13px;
  }
  .task-table td > .two-line,
  .task-table td > .phone-cell {
    align-items: flex-end;
    text-align: right;
  }
  .task-table td > .rate {
    margin-left: auto;
  }
  .task-table .status {
    margin-top: 1px;
  }
  .task-table .empty-state {
    padding: 24px 8px;
  }
  .table-wrap {
    overflow-x: hidden;
  }
  .missed-table {
    font-size: 10.5px;
  }
  .missed-table th:nth-child(3),
  .missed-table td:nth-child(3) {
    display: none;
  }
}

@media (max-width: 720px) {
  .card-head {
    flex-wrap: wrap;
  }
  .card-head .legend {
    width: 100%;
    justify-content: flex-start;
    padding-top: 0;
  }
  .task-table td > * {
    min-width: 0;
  }
  .task-table .two-line span,
  .task-table .phone-cell b {
    overflow-wrap: anywhere;
  }
}

.threshold-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(28, 44, 69, 0.7);
}

.threshold-label {
  flex: 1;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.threshold-label b {
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
}

.threshold-label span {
  color: var(--muted-2);
  font-size: 9px;
}

.threshold-row input {
  width: 68px;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  background: rgba(8, 16, 29, 0.65);
  color: var(--text-dim);
  font-size: 11px;
  color-scheme: dark;
}

.threshold-row input:focus {
  border-color: rgba(59, 130, 246, 0.55);
}

.threshold-unit {
  color: var(--muted-2);
  font-size: 10px;
}

@media (max-width: 900px) {
  #btnImportSide {
    display: none;
  }
}

/* 意向客户跟进 */
.back-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  font-size: 11px;
  cursor: pointer;
}
.back-link:hover { color: var(--primary); }
.followup-head-tags { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.followup-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr);
  gap: 12px;
  margin-top: 12px;
  align-items: start;
}
.followup-main, .followup-side { min-width: 0; }
.followup-timeline { margin-top: 14px; border-left: 1px solid rgba(59, 130, 246, 0.28); padding-left: 14px; }
.followup-item { position: relative; padding: 0 0 18px 0; }
.followup-item:last-child { padding-bottom: 0; }
.followup-item::before {
  content: "";
  position: absolute;
  left: -19px;
  top: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.followup-item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 10px; }
.followup-item-head b { color: var(--text-dim); font-size: 11px; }
.followup-content { margin-top: 7px; color: var(--text-dim); line-height: 1.75; font-size: 11.5px; white-space: normal; overflow-wrap: anywhere; }
.followup-content.muted { color: var(--muted-2); }
.followup-audio { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.followup-audio audio { width: 100%; max-width: 420px; height: 34px; }
.followup-audio small, .followup-next { color: var(--muted-2); font-size: 9.5px; }
.followup-next { margin-top: 7px; }
.followup-calls { margin-top: 10px; display: flex; flex-direction: column; gap: 0; }
.followup-call { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid rgba(28, 44, 69, 0.55); font-size: 10.5px; }
.followup-call:last-child { border-bottom: 0; }
.followup-call span { flex: 1; color: var(--muted); }
.followup-call small { color: var(--muted-2); width: 48px; text-align: right; }
.good-text { color: var(--green); }
.followup-info { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.followup-info > div { display: flex; justify-content: space-between; gap: 12px; font-size: 10.5px; }
.followup-info span { color: var(--muted); }
.followup-info b { color: var(--text-dim); font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.followup-form-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.file-btn.disabled { opacity: 0.5; pointer-events: none; }
.followup-form-actions .file-btn { position: relative; overflow: hidden; }
.followup-table td { vertical-align: top; }
.overdue-text { color: var(--red); }
@media (max-width: 980px) {
  .followup-layout { grid-template-columns: 1fr; }
}
.followup-rounds { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 2px 0 12px; font-size: 10px; color: var(--muted); }
.round-btn { border: 1px solid var(--border); background: rgba(8, 16, 29, 0.65); color: var(--text-dim); border-radius: 8px; padding: 6px 9px; font-size: 10.5px; cursor: pointer; }
.round-btn:hover { border-color: rgba(59, 130, 246, 0.55); }
.round-btn.active { border-color: rgba(59, 130, 246, 0.7); background: rgba(59, 130, 246, 0.16); color: var(--primary); }
.followup-recordings { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.followup-recording { display: flex; flex-direction: column; gap: 4px; }
.followup-recording audio { width: 100%; max-width: 430px; height: 34px; }
.followup-recording small { color: var(--muted-2); font-size: 9.5px; }
