:root {
  --nav: #102e36;
  --ink: #15383f;
  --muted: #667a7e;
  --accent: #087e8b;
  --line: #dce6e8;
  --canvas: #f3f7f8;
  --white: #fff;
  --danger: #b03232;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font:
    16px/1.65 system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 600;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
input,
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #bdcdd0;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 46px;
}
input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid #60c9d0;
  outline-offset: 2px;
}
label {
  display: grid;
  gap: 6px;
  margin-bottom: 17px;
  font-size: 14px;
  font-weight: 600;
}
input[type="checkbox"] {
  width: 22px;
  min-height: 22px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 30px;
  margin-bottom: 8px;
  line-height: 1.4;
}
h2 {
  font-size: 23px;
}
h3 {
  font-size: 18px;
}
.primary {
  background: var(--accent);
  color: #fff;
}
.ghost {
  background: transparent;
  color: inherit;
  border: 1px solid var(--line);
}
.danger {
  background: #fff0f0;
  color: var(--danger);
}
.muted,
small {
  color: var(--muted);
}
.eyebrow,
.nav-label {
  font-size: 13px;
  letter-spacing: 0.03em;
}
.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: #0a8d98;
  border-radius: 14px;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
}
.login-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
.login-card {
  width: min(440px, 90%);
  margin: auto;
  padding: 45px 20px;
}
.login-card .brand-mark {
  margin-bottom: 25px;
}
.login-card .primary {
  width: 100%;
}
.login-aside {
  background: var(--nav);
  color: #fff;
  padding: 14vh 10%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-aside h2 {
  font-size: clamp(30px, 3.5vw, 54px);
  line-height: 1.5;
  margin: 28px 0;
}
.outline-tag {
  border: 1px solid #5e929c;
  border-radius: 30px;
  padding: 6px 20px;
  width: max-content;
  font-size: 14px;
}
.illustration-text {
  font-size: 22px;
  line-height: 2.8;
  border-top: 1px solid #39545b;
  margin-top: 38px;
  padding-top: 25px;
  color: #8ed4da;
}
.sidebar {
  position: fixed;
  inset: 0 0 0 auto;
  width: 248px;
  background: var(--nav);
  color: #dfedef;
  padding: 30px 18px;
  display: flex;
  flex-direction: column;
  overflow: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 12px 38px;
}
.brand b {
  font-size: 26px;
}
.brand small {
  display: block;
  color: #aac2c8;
  font-size: 12px;
}
.nav-label {
  color: #90adb4;
  padding: 0 14px;
}
.sidebar nav {
  display: grid;
  gap: 5px;
}
.nav-button {
  text-align: right;
  background: none;
  color: #c2d7db;
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 15px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.nav-button.active {
  background: #24505a;
  color: #fff;
  border-right: 3px solid #76dbe1;
}
.nav-button:hover {
  background: #204550;
}
.nav-number {
  font: 12px monospace;
  color: #83abb4;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 28px 12px 0;
  display: grid;
  gap: 8px;
}
.sidebar-bottom small {
  color: #a5c1c7;
}
.sidebar-bottom .ghost {
  border-color: #456068;
  font-size: 13px;
  margin-top: 8px;
}
main {
  margin-right: 248px;
  padding: 35px 38px;
  max-width: 1800px;
}
header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 28px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 26px;
}
.stat {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
}
.stat:first-child {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.stat span {
  display: block;
  font-size: 14px;
}
.stat strong {
  font-size: 38px;
  line-height: 1.7;
}
.stat small {
  display: block;
}
.stat:first-child small {
  color: #c9f0f0;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 24px;
  overflow: hidden;
}
.panel-heading {
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  gap: 16px;
}
.panel-heading h2,
.panel-heading p {
  margin: 0;
}
.toolbar {
  display: flex;
  gap: 10px;
  padding: 18px 24px;
  background: #fcfefe;
  flex-wrap: wrap;
}
.toolbar input {
  max-width: 300px;
}
.toolbar select {
  width: auto;
  max-width: 230px;
}
.table-scroll {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  white-space: nowrap;
}
th {
  font-size: 13px;
  background: #f8fafb;
  color: var(--muted);
  padding: 14px 20px;
  font-weight: 600;
}
td {
  padding: 16px 20px;
  border-top: 1px solid #edf1f2;
  font-size: 14px;
}
td button {
  font-size: 13px;
  padding: 6px 10px;
  margin: 2px;
}
tr:hover td {
  background: #fbfdfd;
}
.badge {
  padding: 4px 11px;
  background: #e1f4ef;
  color: #17664f;
  font-size: 13px;
  border-radius: 6px;
  display: inline-block;
}
.badge.cancelled,
.badge.failed,
.badge.unknown {
  color: #a13232;
  background: #ffeded;
}
.badge.human,
.badge.pending {
  color: #895c13;
  background: #fff4dc;
}
.empty {
  padding: 55px 25px;
  text-align: center;
  color: var(--muted);
}
.empty h3 {
  color: var(--ink);
}
.split {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 22px;
}
.callout {
  padding: 22px;
  background: #e7f4f6;
  border-right: 4px solid var(--accent);
  border-radius: 8px;
  margin-bottom: 22px;
}
.error {
  color: var(--danger);
  white-space: pre-wrap;
}
#notice {
  padding: 12px 18px;
  background: #e2f1ef;
  border: 1px solid #a1cfc8;
  border-radius: 8px;
  margin-bottom: 20px;
}
footer {
  font-size: 12px;
  color: var(--muted);
  padding-top: 25px;
}
dialog {
  width: min(650px, 94vw);
  max-height: 90vh;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  color: var(--ink);
}
dialog::backdrop {
  background: #102e3699;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
}
.modal-header h2 {
  margin: 0;
}
.icon-button {
  background: #eef4f5;
  font-size: 24px;
  padding: 2px 12px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}
.slot-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-height: 300px;
  overflow: auto;
}
.slot-list button {
  background: #edf6f7;
  border: 1px solid #a7cdd2;
  text-align: right;
  font-size: 14px;
}
.chat-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 550px;
}
.chat-list {
  border-left: 1px solid var(--line);
  padding: 10px;
  max-height: 700px;
  overflow: auto;
}
.conversation {
  display: block;
  width: 100%;
  text-align: right;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 18px 12px;
}
.conversation.active {
  background: #eaf5f5;
}
.conversation small {
  display: block;
}
.chat-pane {
  padding: 24px;
}
.messages {
  height: 350px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
  background: #f4f8f9;
  padding: 20px;
  border-radius: 8px;
}
.bubble {
  white-space: pre-wrap;
  background: white;
  border: 1px solid var(--line);
  padding: 12px 16px;
  border-radius: 10px;
  max-width: 85%;
  align-self: flex-start;
  font-size: 15px;
  overflow-wrap: anywhere;
}
.bubble.out {
  background: #dff1f1;
  align-self: flex-end;
}
.bubble small {
  display: block;
  font-size: 12px;
  margin-top: 7px;
}
.pagination {
  display: flex;
  justify-content: space-between;
  padding: 18px 24px;
  border-top: 1px solid var(--line);
}
.settings-form {
  padding: 24px;
  max-width: 600px;
}
.loading {
  padding: 40px;
  color: var(--muted);
}
[hidden] {
  display: none !important;
}
@media (max-width: 1100px) {
  main {
    padding: 26px 22px;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .header-actions span {
    display: none;
  }
  .split {
    grid-template-columns: 1fr;
  }
  .sidebar {
    width: 210px;
  }
  main {
    margin-right: 210px;
  }
}
@media (max-width: 720px) {
  .login-wrap {
    grid-template-columns: 1fr;
  }
  .login-aside {
    display: none;
  }
  .sidebar {
    position: static;
    width: 100%;
    padding: 15px;
  }
  .brand {
    margin: 0 0 15px;
  }
  .nav-label {
    display: none;
  }
  .sidebar nav {
    display: flex;
    overflow: auto;
  }
  .nav-button {
    white-space: nowrap;
  }
  .nav-number {
    display: none;
  }
  .sidebar-bottom {
    padding: 12px 0 0;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .sidebar-bottom .ghost {
    margin: 0;
    margin-right: auto;
  }
  .sidebar-bottom small {
    display: none;
  }
  main {
    margin: 0;
    padding: 22px 15px;
  }
  header {
    align-items: flex-start;
  }
  h1 {
    font-size: 24px;
  }
  .header-actions button {
    padding: 9px;
    font-size: 13px;
  }
  .stats {
    gap: 10px;
  }
  .stat {
    padding: 16px;
  }
  .stat strong {
    font-size: 30px;
  }
  .panel-heading {
    padding: 17px;
  }
  .toolbar {
    padding: 14px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .chat-layout {
    grid-template-columns: 1fr;
  }
  .chat-list {
    max-height: 190px;
    border-bottom: 1px solid var(--line);
  }
  .chat-pane {
    padding: 15px;
  }
  .slot-list {
    grid-template-columns: 1fr;
  }
  dialog {
    padding: 20px;
  }
  .bubble {
    max-width: 95%;
  }
}
