:root {
  --ink: #0f1b2d;
  --ink-soft: #5a6b80;
  --line: #e2e8f0;
  --bg: #f7f9fc;
  --card: #ffffff;
  --brand: #0f4c5c;
  --brand-bright: #2a9d8f;
  --bot: #2a9d8f;
  --humano: #e76f51;
  --danger: #c1432b;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 27, 45, 0.06), 0 8px 24px rgba(15, 27, 45, 0.05);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-bright); }

.wrap { max-width: 920px; margin: 0 auto; padding: 24px; }

/* ---------- Login ---------- */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 380px;
  padding: 32px;
}
.brand-mark {
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--brand);
  margin-bottom: 4px;
}
.brand-mark span { color: var(--brand-bright); }
.login-sub { color: var(--ink-soft); font-size: 0.9rem; margin-bottom: 24px; }

label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; margin-top: 14px; }
input, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus { outline: 2px solid var(--brand-bright); outline-offset: 1px; border-color: transparent; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 20px;
  padding: 11px 16px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn:hover { background: #0c3d49; }
.btn.secondary { background: #fff; color: var(--brand); border: 1px solid var(--line); width: auto; margin-top: 0; padding: 8px 14px; }
.btn.secondary:hover { background: var(--bg); }
.btn.small { width: auto; margin-top: 0; padding: 7px 14px; font-size: 0.85rem; }

.msg { font-size: 0.85rem; margin-top: 14px; padding: 10px 12px; border-radius: 8px; display: none; }
.msg.error { display: block; background: #fdecea; color: var(--danger); }
.msg.ok { display: block; background: #e7f5f1; color: var(--brand); }

/* ---------- Header ---------- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; padding-top: 16px; padding-bottom: 16px; }
.topbar .who { font-size: 0.85rem; color: var(--ink-soft); }

/* ---------- Cards / lists ---------- */
h2 { font-size: 1.1rem; letter-spacing: -0.01em; margin-bottom: 4px; }
.section-sub { color: var(--ink-soft); font-size: 0.88rem; margin-bottom: 18px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 22px;
}

.contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.contact-row:last-child { border-bottom: none; }
.contact-phone { font-weight: 600; font-variant-numeric: tabular-nums; }
.contact-meta { font-size: 0.78rem; color: var(--ink-soft); }

/* ---------- Toggle bot/humano ---------- */
.toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg);
}
.toggle button {
  border: none;
  background: transparent;
  padding: 7px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  color: var(--ink-soft);
  transition: all 0.15s ease;
}
.toggle button.active-bot { background: var(--bot); color: #fff; }
.toggle button.active-humano { background: var(--humano); color: #fff; }

/* ---------- Tables / inline forms ---------- */
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-top: 6px; }
.inline-form .field { flex: 1; min-width: 160px; }
.inline-form label { margin-top: 0; }

.list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem;
}
.list-item:last-child { border-bottom: none; }
.pill { font-size: 0.72rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--bg); color: var(--ink-soft); }

.empty { color: var(--ink-soft); font-size: 0.9rem; padding: 20px 0; text-align: center; }
.tabs { display: flex; gap: 8px; margin-bottom: 22px; }
.tab { padding: 8px 16px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 600; font-size: 0.88rem; color: var(--ink-soft); }
.tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }
