:root {
  --bg: #0c1118;
  --surface: #151c28;
  --surface2: #1c2636;
  --border: #2a3548;
  --text: #e8eef7;
  --muted: #8b9cb3;
  --accent: #22d3ee;
  --accent-dim: #0891b2;
  --danger: #f87171;
  --ok: #34d399;
  --warn: #fbbf24;
  --font: "Segoe UI", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: radial-gradient(120% 80% at 50% 0%, #1a2332 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.45;
}

a {
  color: var(--accent);
}

#app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

.shell {
  min-height: calc(100vh - 3rem);
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 1.25rem;
}

.topbar h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.topbar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.pill {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1.35rem;
}

.card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.tab {
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  font-size: 0.88rem;
}

.tab:hover {
  border-color: var(--accent-dim);
}

.tab.on {
  background: linear-gradient(145deg, #164e63, #155e75);
  border-color: var(--accent);
}

label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0a0e14;
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}

.btn-primary {
  background: linear-gradient(145deg, #06b6d4, #0891b2);
  color: #042f2e;
}

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-danger {
  background: #7f1d1d;
  color: #fecaca;
}

.btn-ok {
  background: #065f46;
  color: #d1fae5;
}

.btn-tiny {
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 7px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.muted {
  color: var(--muted);
  font-size: 0.88rem;
}

.err {
  color: var(--danger);
  font-size: 0.88rem;
  margin: 0.35rem 0;
}

.success {
  color: var(--ok);
  font-size: 0.88rem;
}

.login-grid {
  max-width: 400px;
  margin: 2rem auto;
}

.login-brand {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-brand span {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--accent);
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
}

.field {
  margin-bottom: 0.85rem;
}

.field-password .field-pw-input-wrap {
  position: relative;
}

.field-password .field-pw-input-wrap input {
  width: 100%;
  padding-right: 4.25rem;
  font-variant-numeric: tabular-nums;
}

.field-password .pw-gen-corner {
  position: absolute;
  right: 0.3rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}

.field-password .pw-gen-btn {
  display: block;
  margin: 0;
  font-size: 0.65rem;
  padding: 0.28rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface2) 0%, var(--surface) 100%);
  color: var(--accent);
  cursor: pointer;
  font-weight: 650;
  letter-spacing: 0.05em;
  line-height: 1.1;
  text-transform: uppercase;
  font-family: var(--font);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.field-password .pw-gen-btn:hover {
  background: var(--border);
  color: var(--text);
  border-color: var(--accent-dim);
}

.field-password .pw-gen-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

input.pw-mono {
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 0.86rem;
  letter-spacing: 0.02em;
}

.big-num {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.stats-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  color: var(--muted);
}

.stats-line strong {
  color: var(--text);
}

.work-grid {
  display: grid;
  grid-template-columns: 1fr minmax(200px, 250px);
  gap: 1rem;
  align-items: start;
}

.work-right-col {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-width: 0;
}

@media (max-width: 800px) {
  .work-grid {
    grid-template-columns: 1fr;
  }
}

.outcomes {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 1rem;
}

.outcome-btn {
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: none;
  font-weight: 650;
  cursor: pointer;
  color: #0a0e14;
}

.o-exito {
  background: #34d399;
}
.o-caliente {
  background: #fb923c;
}
.o-luego {
  background: #60a5fa;
}
.o-buzon {
  background: #a78bfa;
}

.recent-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.82rem;
  max-height: 200px;
  overflow-y: auto;
}

.recent-list li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.line-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 0.25rem;
}

.line-bar .on-air {
  background: rgba(6, 182, 212, 0.2);
  border-color: var(--accent);
  color: var(--accent);
  font-size: 0.78rem;
}

.hint-tiny {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
  margin: 0 0 0.75rem;
}

.work-notes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.work-notes label {
  margin-bottom: 0.15rem;
}

.work-notes textarea {
  min-height: 2.5rem;
  resize: vertical;
  max-height: 8rem;
}

.llamar-block {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  margin: 0.5rem 0 0.9rem;
  background: #0a1018;
}

.llamar-block h4 {
  margin: 0 0 0.5rem;
  font-size: 0.86rem;
  color: var(--accent);
  font-weight: 600;
}

.outcomes-locked {
  position: relative;
  opacity: 0.45;
  pointer-events: none;
}

.outcome-lock-banner {
  font-size: 0.82rem;
  color: var(--warn);
  margin: 0.35rem 0 0.5rem;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.outcome-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(5, 10, 18, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-box {
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.15rem 1.25rem 1.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.modal-box h4 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  color: var(--accent);
}

.modal-box .llamar-block {
  margin: 0;
  border-style: solid;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  justify-content: flex-end;
}

.msg-day-list {
  max-height: 55vh;
  overflow-y: auto;
  text-align: left;
}

.msg-day-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.65rem;
  background: #0a1018;
}

.msg-day-item .msg-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.msg-day-item .msg-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.9rem;
  line-height: 1.4;
}

.msg-day-item.msg-from-tirador {
  background: rgba(34, 211, 238, 0.14);
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.1);
}

.msg-day-item.msg-from-tirador .msg-meta {
  color: #7ee7f7;
}

.msg-day-item.msg-confirm-vivo {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.28), rgba(34, 211, 238, 0.2));
  border-color: rgba(45, 212, 191, 0.9);
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.35), 0 0 18px rgba(45, 212, 191, 0.18);
}

.msg-day-item.msg-confirm-vivo .msg-meta {
  color: #99f6e4;
  font-size: 0.9rem;
}

.msg-day-item.msg-confirm-vivo .msg-body {
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #e6fffb;
}

.msg-day-item.msg-inactive-vivo {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.28), rgba(185, 28, 28, 0.22));
  border-color: rgba(248, 113, 113, 0.95);
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.35), 0 0 18px rgba(239, 68, 68, 0.2);
}

.msg-day-item.msg-inactive-vivo .msg-meta {
  color: #fecaca;
  font-size: 0.9rem;
}

.msg-day-item.msg-inactive-vivo .msg-body {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #fff1f2;
}

.emp-pick {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  margin: 0.5rem 0 0.75rem;
  background: #0a0e14;
}

.emp-pick label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  cursor: pointer;
  color: var(--text);
  font-size: 0.88rem;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

table.data th,
table.data td {
  border: 1px solid var(--border);
  padding: 0.45rem 0.5rem;
  text-align: left;
}

table.data th {
  background: var(--surface2);
  color: var(--muted);
  font-weight: 600;
}

.mono {
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
}

.password-cell .pw {
  letter-spacing: 0.08em;
}

.pay-st {
  display: inline-block;
  padding: 0.18rem 0.46rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.pay-st.ok {
  background: rgba(16, 185, 129, 0.18);
  color: #86efac;
  border: 1px solid rgba(16, 185, 129, 0.45);
}

.pay-st.pend {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.small-actions .btn {
  padding: 0.25rem 0.45rem;
  font-size: 0.78rem;
}

.modal-box.modal-results-day {
  max-width: min(720px, 96vw);
  text-align: left;
}

.rs-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 0.4rem 0.75rem;
  margin-bottom: 0.9rem;
  font-size: 0.84rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: #0a1018;
  border: 1px solid var(--border);
}

.rs-scroll {
  max-height: min(58vh, 520px);
  overflow-y: auto;
  padding-right: 0.25rem;
}

.rs-section {
  margin-bottom: 1rem;
}

.rs-section:last-child {
  margin-bottom: 0;
}

.rs-heading {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0 0.2rem;
  border-bottom: 2px solid var(--border);
}

.rs-bar-exito {
  border-bottom-color: #34d399;
  color: #6ee7b7;
}
.rs-bar-caliente {
  border-bottom-color: #fb923c;
  color: #fdba74;
}
.rs-bar-luego {
  border-bottom-color: #60a5fa;
  color: #93c5fd;
}
.rs-bar-buzon {
  border-bottom-color: #a78bfa;
  color: #c4b5fd;
}

.rs-count {
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.9;
  font-variant-numeric: tabular-nums;
}

.rs-ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.rs-li {
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.86rem;
}

.rs-li:last-child {
  border-bottom: none;
}

.rs-li-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
}

.rs-phone {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.rs-name {
  color: var(--muted);
  font-size: 0.82rem;
}

.rs-time {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.78rem;
}

.rs-extra {
  margin-top: 0.2rem;
  font-size: 0.8rem;
  line-height: 1.35;
}

.rs-callback {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: #93c5fd;
}

.rs-empty {
  margin: 0.25rem 0 0;
  font-size: 0.84rem;
}

hr.listado-sep {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0 1.15rem;
}

.listado-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  margin-bottom: 0.35rem;
}

.listado-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
}

.lst-select {
  width: 100%;
  max-width: 32rem;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 0.9rem;
}

.queue-filter-card {
  margin: 0;
  padding: 0.6rem 0.65rem 0.5rem;
}

.qfilter-title {
  margin: 0 0 0.45rem;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #7dd3fc;
  line-height: 1.2;
}

.queue-filter-card .field-tight {
  margin: 0 0 0.4rem;
}

.queue-filter-card .field-tight label {
  font-size: 0.7rem;
  margin-bottom: 0.1rem;
}

.qfilter-select-compact {
  font-size: 0.8rem;
  max-width: 100% !important;
  padding: 0.3rem 0.4rem;
  min-height: 2rem;
}

.qfilter-radio-col {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.qfilter-radio-line {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  line-height: 1.2;
  cursor: pointer;
  margin: 0;
}

.qfilter-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.1rem 0 0.35rem;
}

.qfilter-modes {
  margin-bottom: 0.35rem !important;
}

.qfilter-npa {
  width: 100%;
  max-width: 100%;
  min-height: 3.4rem;
  max-height: 5.2rem;
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #0a1018;
  color: var(--text);
  padding: 0.2rem 0.25rem;
}

.limpieza-h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  color: var(--accent);
}

.limpieza-block {
  margin-bottom: 1rem;
}

.limpieza-block h3 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
  color: #fca5a5;
}

.limpieza-bad {
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: #f87171;
}
