.button {
  border: 1px solid transparent;
  border-radius: var(--radius);
  min-height: 40px;
  padding: 10px 14px;
  font-weight: 780;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  user-select: none;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.button-primary {
  background: var(--accent);
  color: white;
}

.button-primary:hover {
  background: var(--accent-dark);
}

.button-secondary {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
}

.button-secondary:hover {
  border-color: #b8c4d4;
  box-shadow: var(--shadow-soft);
}

.skeleton-line,
.skeleton-number,
.skeleton-dot,
.skeleton-avatar,
.skeleton-pill,
.skeleton-input,
.skeleton-toggle,
.skeleton-button {
  position: relative;
  overflow: hidden;
  display: block;
  background: linear-gradient(90deg, #e9eef5 0%, #f7f9fc 48%, #e6edf5 100%);
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.15s ease-in-out infinite;
}

.sidebar .skeleton-line,
.sidebar .skeleton-dot,
.sidebar .skeleton-avatar,
.sidebar .skeleton-pill,
.sidebar .skeleton-input,
.sidebar .skeleton-toggle,
.sidebar .skeleton-button {
  background: linear-gradient(90deg, rgba(255,255,255,.08), rgba(255,255,255,.20), rgba(255,255,255,.08));
  background-size: 220% 100%;
}

.skeleton-line {
  width: 100%;
  height: 10px;
  border-radius: 999px;
}

.skeleton-line-strong {
  width: 76%;
  height: 13px;
}

.skeleton-line-mid {
  width: 58%;
}

.skeleton-line-short {
  width: 34%;
}

.skeleton-number {
  width: 54px;
  height: 32px;
  border-radius: 7px;
  margin-top: 12px;
}

.skeleton-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.skeleton-avatar {
  border-radius: var(--radius);
}

.skeleton-pill {
  width: 74px;
  height: 24px;
  border-radius: 999px;
}

.skeleton-input {
  width: 84px;
  height: 36px;
  border-radius: var(--radius);
}

.skeleton-toggle {
  width: 38px;
  height: 22px;
  border-radius: 999px;
}

.skeleton-button {
  width: 88px;
  height: 36px;
  border-radius: var(--radius);
}

.loading-stack {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.skeleton-card {
  border-top-color: #d7e0eb;
}

.skeleton-table td .skeleton-line + .skeleton-line {
  margin-top: 7px;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 120% 0;
  }

  100% {
    background-position: -120% 0;
  }
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  font-size: 22px;
  color: var(--muted);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-soft);
}

.compact-panel {
  box-shadow: none;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

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

.metric-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-soft);
  min-height: 118px;
  display: grid;
  align-content: space-between;
  border-top: 3px solid var(--accent);
}

.metric-card.metric-success {
  border-top-color: var(--success);
}

.metric-card.metric-warning {
  border-top-color: var(--warning);
}

.metric-card.metric-primary {
  border-top-color: var(--primary);
}

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

.metric-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.metric-value {
  margin-top: 8px;
  font-size: 32px;
  line-height: 1;
  font-weight: 900;
}

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

.metric-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--panel-muted);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

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

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

.status-available {
  background: var(--success);
}

.status-busy {
  background: var(--warning);
}

.status-pause {
  background: var(--accent);
}

.status-offline {
  background: #98a2b3;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  background: white;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 0 16px;
}

.filter-chip {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 760;
  color: var(--muted);
}

.filter-chip.active {
  background: var(--accent-soft);
  border-color: #8ce7b5;
  color: #087547;
}

.details-list {
  display: grid;
  gap: 14px;
  margin: 20px 0 0;
}

.details-list div {
  display: grid;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.details-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.details-list dt {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 850;
  letter-spacing: .08em;
}

.details-list dd {
  margin: 0;
  font-weight: 760;
}

.agent-row {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

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

.agent-row-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.agent-person {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.agent-person div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.agent-person strong,
.agent-person span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-person span {
  color: var(--muted);
  font-size: 12px;
}

.agent-count {
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
}

.agent-progress {
  height: 7px;
  border-radius: 999px;
  background: #edf2f7;
  overflow: hidden;
}

.agent-progress span {
  display: block;
  height: 100%;
  width: var(--progress, 0%);
  background: var(--accent);
}

.empty-copy {
  color: var(--muted);
  margin: 0;
}

dialog {
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  width: min(92vw, 480px);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(15, 23, 42, .55);
}

.dialog-form {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

th,
td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

td input[type="number"] {
  max-width: 92px;
}


/* V1.18D · Avatares internos */
.avatar-shell {
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
}

.avatar-shell .avatar-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.avatar-shell [data-avatar-image] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.agent-load-avatar-wrap {
  position: relative;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
}

.agent-load-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(145deg, #0f8b66, #075985);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  border: 2px solid var(--panel);
}

.agent-load-presence {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border: 2px solid var(--panel);
  border-radius: 999px;
  background: #64748b;
}

.agent-load-presence.status-available { background: #22c55e; }
.agent-load-presence.status-busy { background: #f59e0b; }
.agent-load-presence.status-pause { background: #a78bfa; }
.agent-load-presence.status-offline { background: #64748b; }


/* V1.18D.1 · Componentes más consistentes */
.button {
  transition:
    transform .14s ease,
    background-color .14s ease,
    border-color .14s ease,
    color .14s ease,
    box-shadow .14s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button:disabled,
.button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .58;
  transform: none;
}

.icon-button {
  transition: background-color .14s ease, border-color .14s ease, color .14s ease;
}

.panel,
.metric-card {
  border-radius: 16px;
}

.metric-card {
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.metric-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(6, 28, 61, .08);
}

.status-badge,
.filter-chip {
  min-height: 30px;
}

.filter-chip {
  transition: background-color .14s ease, border-color .14s ease, color .14s ease;
}

dialog {
  overflow: hidden;
  border: 1px solid var(--border);
}

dialog::backdrop {
  backdrop-filter: blur(3px);
}

th {
  font-weight: 850;
}

@media (prefers-reduced-motion: reduce) {
  .button,
  .metric-card {
    transition: none;
  }

  .button:hover,
  .metric-card:hover {
    transform: none;
  }
}
