/* 多公司版新增样式 */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 20% 0%, rgba(59, 130, 246, 0.18), transparent 60%),
    radial-gradient(800px 500px at 90% 100%, rgba(34, 211, 238, 0.10), transparent 65%),
    var(--bg);
}

.login-panel {
  width: min(430px, 100%);
  padding: 28px;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(18, 31, 51, 0.98), rgba(9, 17, 30, 0.98));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 28px;
}

.login-brand > div:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.login-brand strong {
  font-size: 16px;
}

.login-brand span {
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.login-panel h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.login-lead {
  margin: 8px 0 22px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}

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

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

.login-field input {
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: none;
  background: rgba(8, 16, 29, 0.8);
  color: var(--text);
  font-size: 13px;
  color-scheme: dark;
}

.login-field input:focus {
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.09);
}

.login-submit {
  width: 100%;
  height: 42px;
  margin-top: 4px;
}

.login-error {
  min-height: 18px;
  color: var(--red);
  font-size: 10.5px;
  line-height: 1.5;
}

.demo-accounts {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid rgba(34, 211, 238, 0.11);
  border-radius: 10px;
  background: rgba(34, 211, 238, 0.025);
}

.demo-accounts > strong {
  display: block;
  margin-bottom: 7px;
  color: var(--cyan);
  font-size: 10px;
}

.demo-accounts > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 0;
  color: var(--muted-2);
  font-size: 10px;
}

.demo-accounts code {
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.05);
}

.login-foot {
  margin-top: 18px;
  color: var(--muted-2);
  font-size: 9px;
  text-align: center;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(14, 24, 40, 0.55);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #dbeafe;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.55), rgba(34, 211, 238, 0.35));
  font-size: 12px;
  font-weight: 700;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.user-meta strong {
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

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

.company-context {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 9px;
  background: rgba(59, 130, 246, 0.07);
  font-size: 10.5px;
}

.company-context b {
  color: var(--text-dim);
}

.company-context code {
  color: var(--cyan);
}

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 600;
}

.role-badge.platform { color: #fde68a; background: rgba(251, 191, 36, 0.12); }
.role-badge.company { color: #bfdbfe; background: rgba(59, 130, 246, 0.12); }
.role-badge.sales { color: #a7f3d0; background: rgba(52, 211, 153, 0.10); }

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

.platform-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 13px;
  border: 1px solid rgba(251, 191, 36, 0.18);
  border-radius: 10px;
  background: rgba(251, 191, 36, 0.04);
  color: var(--muted);
  font-size: 10.5px;
}

.platform-banner b {
  color: #fde68a;
}

.platform-banner .btn {
  margin-left: auto;
}

.status.pool { color: var(--muted); background: rgba(139, 160, 189, 0.09); }
.status.not_called { color: #93c5fd; background: rgba(59, 130, 246, 0.11); }
.status.no_answer { color: #fecdd3; background: rgba(251, 113, 133, 0.12); }
.status.short { color: #fde68a; background: rgba(251, 191, 36, 0.11); }
.status.effective { color: #a7f3d0; background: rgba(52, 211, 153, 0.10); }
.status.missed { color: #fecdd3; background: rgba(251, 113, 133, 0.14); }
.status.closed { color: var(--muted); background: rgba(139, 160, 189, 0.09); }
.status.disabled { color: var(--muted); background: rgba(139, 160, 189, 0.09); }

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

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 9px;
  background: rgba(139, 160, 189, 0.09);
  color: var(--muted);
}

.tag.red { color: #fecdd3; background: rgba(251, 113, 133, 0.10); }
.tag.orange { color: #fde68a; background: rgba(251, 191, 36, 0.10); }
.tag.blue { color: #bfdbfe; background: rgba(59, 130, 246, 0.10); }
.tag.green { color: #a7f3d0; background: rgba(52, 211, 153, 0.10); }

.allocation-card {
  margin-bottom: 12px;
  padding: 16px 18px;
  border: 1px solid rgba(59, 130, 246, 0.20);
  border-radius: var(--radius);
  background:
    radial-gradient(500px 160px at 100% 0, rgba(59, 130, 246, 0.10), transparent 70%),
    linear-gradient(180deg, rgba(17, 29, 48, 0.96), rgba(10, 19, 33, 0.96));
}

.allocation-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.allocation-head h2 {
  margin: 0;
  font-size: 14px;
}

.allocation-head p {
  margin: 3px 0 0;
  color: var(--muted-2);
  font-size: 10px;
}

.pool-number {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
}

.pool-number b {
  color: #fde68a;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.allocation-grid {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 110px 110px minmax(120px, 1fr) auto;
  gap: 9px;
  align-items: end;
}

.allocation-grid .field {
  margin-bottom: 0;
}

.allocation-grid .field input,
.allocation-grid .field select {
  height: 34px;
  font-size: 11px;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
}

.check-line input {
  accent-color: var(--primary);
}

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

.lead-phone b {
  color: var(--text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.lead-phone small {
  color: var(--muted-2);
  font-size: 9.5px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

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

.lead-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: wrap;
}

.lead-actions .text-btn {
  white-space: nowrap;
}

.overdue-text {
  color: var(--red);
}

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

.company-table .company-name {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.company-table .company-name b {
  color: var(--text);
  font-size: 12px;
}

.company-table .company-name small {
  color: var(--muted-2);
  font-size: 9.5px;
}

.company-table .company-code {
  display: inline-flex;
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.08);
  font-size: 9px;
}

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

.company-kpis .kpi-card {
  min-height: 96px;
}

.device-token {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted-2);
  font-size: 9.5px;
}

.device-token code {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.settings-strip .field {
  margin: 0;
}

.settings-strip .field input {
  height: 34px;
}

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

.modal-form .field {
  margin-bottom: 11px;
}

.modal-form textarea {
  min-height: 80px;
}

.hint-list {
  margin: 8px 0 0;
  padding-left: 16px;
  color: var(--muted-2);
  font-size: 9.5px;
  line-height: 1.7;
}

.import-drop {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 13px;
  border: 1px dashed rgba(59, 130, 246, 0.3);
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.03);
}

.import-drop input[type="file"] {
  max-width: 100%;
  color: var(--muted);
  font-size: 10px;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  margin: 12px 0;
}

.preview-stat {
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(8, 16, 29, 0.5);
}

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

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

.preview-stat.good b { color: var(--green); }
.preview-stat.bad b { color: var(--red); }
.preview-stat.warn b { color: var(--orange); }

.table-note {
  margin: 8px 2px 0;
  color: var(--muted-2);
  font-size: 9.5px;
}

.empty-page {
  padding: 70px 20px;
  text-align: center;
  color: var(--muted-2);
  font-size: 12px;
}

.role-note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted-2);
  font-size: 10px;
}

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

.bar-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: 72px 1fr 55px;
  gap: 9px;
  align-items: center;
}

.bar-row span {
  color: var(--muted-2);
  font-size: 9.5px;
}

.bar-row b {
  color: var(--text-dim);
  font-size: 10px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bar-track {
  height: 6px;
  border-radius: 4px;
  background: #17263d;
  overflow: hidden;
}

.bar-track i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #3b82f6, #22d3ee);
}

.bar-track.red i { background: linear-gradient(90deg, #fb7185, #f43f5e); }
.bar-track.orange i { background: linear-gradient(90deg, #fbbf24, #f97316); }
.bar-track.green i { background: linear-gradient(90deg, #34d399, #22d3ee); }

@media (max-width: 1180px) {
  .allocation-grid {
    grid-template-columns: minmax(140px, 1fr) 100px 100px minmax(110px, 1fr);
  }
  .allocation-grid .btn {
    grid-column: span 4;
  }
  .company-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .user-box {
    display: none;
  }
  .company-context {
    order: 3;
    width: 100%;
  }
  .settings-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .preview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .allocation-grid {
    grid-template-columns: 1fr 1fr;
  }
  .allocation-grid .field:first-child {
    grid-column: span 2;
  }
  .allocation-grid .btn {
    grid-column: span 2;
  }
  .form-row-3 {
    grid-template-columns: 1fr;
  }
  .preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .company-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .settings-strip {
    grid-template-columns: 1fr 1fr;
  }
  .lead-table thead {
    display: none;
  }
  .lead-table,
  .lead-table tbody,
  .lead-table tr,
  .lead-table td {
    display: block;
    width: 100%;
  }
  .lead-table tr {
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(10, 19, 33, 0.72);
  }
  .lead-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;
  }
  .lead-table td::before {
    content: attr(data-label);
    flex: 0 0 64px;
    color: var(--muted-2);
    font-size: 9.5px;
    padding-top: 2px;
  }
  .lead-table td:last-child {
    display: block;
    margin-top: 6px;
    padding-top: 9px !important;
    border-top: 1px dashed rgba(28, 44, 69, 0.7);
  }
  .lead-table td:last-child::before {
    display: block;
    margin-bottom: 6px;
  }
  .lead-table .lead-actions {
    justify-content: flex-start;
  }
  .lead-table .lead-phone {
    align-items: flex-end;
    text-align: right;
  }
  .lead-table .lead-phone small {
    max-width: 190px;
  }
  .filter-row .search-box {
    max-width: none;
    flex: 1 1 100%;
  }
  .filter-row select {
    flex: 1;
    min-width: 0;
  }
  .top-actions {
    gap: 6px;
  }
}

@media (max-width: 480px) {
  .login-panel {
    padding: 20px;
  }
  .login-panel h1 {
    font-size: 21px;
  }
  .demo-accounts > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }
  .company-kpis {
    grid-template-columns: 1fr 1fr;
  }
  .preview-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.grid-2,
.grid-2 > *,
.card {
  min-width: 0;
}

.allocation-grid {
  grid-template-columns: minmax(150px, 1.2fr) 96px 96px minmax(120px, 1fr) 104px auto;
}

@media (max-width: 1180px) {
  .allocation-grid {
    grid-template-columns: minmax(140px, 1fr) 100px 100px minmax(110px, 1fr);
  }
  .allocation-grid .check-line {
    grid-column: span 2;
  }
  .allocation-grid .btn {
    grid-column: span 2;
  }
}

@media (max-width: 720px) {
  .allocation-grid {
    grid-template-columns: 1fr 1fr;
  }
  .allocation-grid .field:first-child,
  .allocation-grid .check-line,
  .allocation-grid .btn {
    grid-column: span 2;
  }
}

.task-target-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 13px;
}

.target-row {
  display: grid;
  grid-template-columns: minmax(70px, 1fr) 74px;
  gap: 4px 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid rgba(28, 44, 69, 0.7);
  border-radius: 9px;
  background: rgba(8, 16, 29, 0.4);
}

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

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

.target-row input {
  width: 100%;
  height: 30px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 7px;
  outline: none;
  background: rgba(8, 16, 29, 0.8);
  color: var(--text);
  font-size: 12px;
  text-align: right;
  color-scheme: dark;
}

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

.target-note {
  grid-column: span 2;
  color: var(--muted-2);
  font-size: 9px;
}

.tag.pink {
  color: #fbcfe8;
  background: rgba(244, 114, 182, 0.12);
}
