:root {
  --bg: #edf1f5;
  --panel: rgba(249, 251, 253, 0.92);
  --panel-strong: #ffffff;
  --ink: #18212d;
  --muted: #667386;
  --line: rgba(24, 33, 45, 0.1);
  --accent: #0b5fff;
  --accent-2: #0f8c74;
  --gold: #b58a34;
  --warn: #d28f2b;
  --danger: #b24646;
  --shadow: 0 28px 80px rgba(26, 42, 67, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Manrope", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(11, 95, 255, 0.14), transparent 24%),
    radial-gradient(circle at top right, rgba(181, 138, 52, 0.12), transparent 26%),
    linear-gradient(180deg, #f6f8fb 0%, #edf1f5 100%);
}

.overlay {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(18, 14, 12, 0.32);
  backdrop-filter: blur(12px);
  z-index: 20;
}

.overlay.visible {
  display: grid;
}

.login-card {
  width: min(420px, calc(100% - 32px));
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 28px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.subtitle.compact {
  margin-top: 0;
}

.error-text {
  min-height: 18px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

.shell {
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 24px;
  padding: 28px;
  border-radius: 32px;
  background:
    linear-gradient(135deg, rgba(11, 95, 255, 0.9), rgba(13, 37, 77, 0.96)),
    linear-gradient(180deg, #14396d, #0e2242);
  color: #f7fbff;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(247, 251, 255, 0.74);
  font-size: 12px;
}

h1, h2 {
  margin: 0;
  font-family: "Cormorant Garamond", "Times New Roman", serif;
}

h1 {
  font-size: clamp(40px, 6vw, 72px);
  line-height: 0.94;
}

.subtitle {
  margin: 12px 0 0;
  max-width: 740px;
  color: rgba(247, 251, 255, 0.84);
  font-size: 16px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.grid {
  display: grid;
  gap: 18px;
}

.cards {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 18px;
}

.two-columns {
  grid-template-columns: 1.2fr 1fr;
  margin-bottom: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(245, 248, 251, 0.9));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
}

.card .label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.card .value {
  margin-top: 8px;
  font-size: 34px;
  font-weight: 700;
}

.card .subvalue {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.button,
button,
select,
input,
textarea {
  font: inherit;
}

.button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

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

.button-primary {
  background: linear-gradient(135deg, var(--accent), #3f8cff);
  color: white;
  border-color: transparent;
}

.stack-form,
.inline-form {
  display: grid;
  gap: 12px;
}

.inline-form {
  grid-template-columns: 1.4fr 1fr 100px auto;
  margin-bottom: 16px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  padding: 12px 14px;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.operator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.operator-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.operator-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
}

.pill.available { color: var(--accent-2); background: rgba(15, 140, 116, 0.08); }
.pill.busy { color: var(--warn); background: rgba(210, 143, 43, 0.08); }
.pill.paused { color: var(--danger); background: rgba(178, 70, 70, 0.08); }
.pill.offline { color: var(--muted); background: rgba(102, 115, 134, 0.08); }

.operator-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.funnel-list {
  display: grid;
  gap: 12px;
}

.funnel-row {
  display: grid;
  gap: 6px;
}

.funnel-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(31, 29, 26, 0.08);
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.table-wrap {
  overflow: auto;
}

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

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: rgba(11, 95, 255, 0.05);
}

.case-detail {
  min-height: 320px;
  display: grid;
  gap: 16px;
}

.case-detail.empty {
  place-items: center;
  color: var(--muted);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.detail-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.88);
}

.detail-card .k {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.detail-card .v {
  margin-top: 6px;
  font-weight: 600;
}

.message-list,
.events-list {
  display: grid;
  gap: 10px;
}

.message,
.event {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.86);
}

.message header,
.event header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}

.detail-actions {
  display: grid;
  gap: 10px;
}

.detail-actions form {
  display: grid;
  gap: 10px;
}

@media (max-width: 980px) {
  .hero,
  .panel-head {
    align-items: start;
    flex-direction: column;
  }

  .two-columns {
    grid-template-columns: 1fr;
  }

  .inline-form,
  .detail-grid {
    grid-template-columns: 1fr;
  }
}
