:root {
  --bg: #f3efe4;
  --panel: #ffffff;
  --ink: #1f1f1f;
  --accent: #0f766e;
  --muted: #6b7280;
  --danger: #b91c1c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top right, #e8f5f1, #f8f4ea 40%, #f3efe4 100%);
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid #d6d6d6;
  background: #ffffffcc;
  backdrop-filter: blur(8px);
}

.topbar h1 {
  margin: 0;
  font-size: 1.25rem;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.container {
  width: min(1220px, 100% - 32px);
  margin: 24px auto;
}

.panel {
  background: var(--panel);
  border: 1px solid #dedede;
  border-radius: 16px;
  padding: 24px;
}

.stack {
  display: grid;
  gap: 12px;
}

.inline-form {
  margin: 0;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border: 1px solid #c6c6c6;
  border-radius: 10px;
  padding: 10px 12px;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-secondary {
  background: #4b5563;
}

.result-grid,
.admin-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.result-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.channel-card {
  border: 1px solid #dedede;
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}

.channel-card h3 {
  margin-top: 0;
}

.status {
  min-height: 28px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-card {
  width: min(420px, 100%);
  background: #fff;
  padding: 20px;
  border-radius: 14px;
  border: 1px solid #d6d6d6;
}

.no-overlay {
  margin-inline: auto;
}

.error {
  color: var(--danger);
}

.muted {
  color: var(--muted);
}

.hidden {
  display: none;
}

.footer {
  text-align: center;
  color: var(--muted);
  padding: 16px;
}

.operator-page {
  --op-ink: #10253f;
  --op-muted: #4d6d93;
  --op-surface: rgba(255, 255, 255, 0.9);
  --op-surface-border: rgba(133, 177, 228, 0.7);
  --op-card-bg: linear-gradient(150deg, rgba(255, 255, 255, 0.95), rgba(233, 245, 255, 0.92));
  --op-card-border: rgba(109, 163, 223, 0.45);
  --op-card-shadow: 0 18px 32px rgba(27, 85, 145, 0.15);
  --op-button-bg: linear-gradient(180deg, #e9f5ff 0%, #d1e9ff 55%, #c3e2ff 100%);
  --op-button-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.8), 0 8px 14px rgba(43, 100, 167, 0.18);
  --op-button-text: #12385f;
  --op-button-border: rgba(90, 148, 214, 0.35);
  --op-pending: #1e75d3;
  --op-success: #0d9f6e;
  --op-error: #c53f4b;
  --op-warning: #b07c16;
  color: var(--op-ink);
  background:
    radial-gradient(1200px 540px at 80% -10%, rgba(95, 171, 255, 0.38), rgba(95, 171, 255, 0)),
    radial-gradient(900px 460px at -5% 0%, rgba(110, 231, 183, 0.28), rgba(110, 231, 183, 0)),
    linear-gradient(180deg, #ecf6ff 0%, #dceeff 45%, #d1e5fa 100%);
}

.operator-page[data-theme="night"] {
  --op-ink: #dceaff;
  --op-muted: #93aecb;
  --op-surface: rgba(12, 24, 44, 0.86);
  --op-surface-border: rgba(73, 110, 153, 0.75);
  --op-card-bg: linear-gradient(160deg, rgba(16, 30, 53, 0.95), rgba(20, 39, 67, 0.92));
  --op-card-border: rgba(78, 120, 168, 0.48);
  --op-card-shadow: 0 16px 34px rgba(2, 7, 16, 0.5);
  --op-button-bg: linear-gradient(180deg, #294f79 0%, #1b3f67 55%, #163458 100%);
  --op-button-shadow: inset 0 1px 1px rgba(193, 221, 255, 0.28), 0 8px 14px rgba(1, 9, 24, 0.48);
  --op-button-text: #e6f4ff;
  --op-button-border: rgba(95, 144, 199, 0.42);
  --op-pending: #65afff;
  --op-success: #36d399;
  --op-error: #ff7f8a;
  --op-warning: #f6c76a;
  color: var(--op-ink);
  background:
    radial-gradient(1200px 620px at 80% -10%, rgba(58, 124, 206, 0.35), rgba(58, 124, 206, 0)),
    radial-gradient(840px 520px at -5% 0%, rgba(76, 125, 185, 0.22), rgba(76, 125, 185, 0)),
    linear-gradient(180deg, #07111f 0%, #0c1c31 45%, #112540 100%);
}

.operator-page .topbar {
  border-bottom-color: rgba(111, 158, 212, 0.52);
  background: rgba(237, 247, 255, 0.7);
}

.operator-page[data-theme="night"] .topbar {
  border-bottom-color: rgba(63, 97, 136, 0.6);
  background: rgba(10, 20, 35, 0.62);
}

.operator-page .topbar h1 {
  color: var(--op-ink);
}

.operator-page .topbar .btn-secondary {
  color: var(--op-button-text);
  background: var(--op-button-bg);
  border: 1px solid var(--op-button-border);
  box-shadow: var(--op-button-shadow);
}

.operator-shell {
  border-radius: 28px;
  border: 1px solid var(--op-surface-border);
  background: var(--op-surface);
  backdrop-filter: blur(12px);
  box-shadow: 0 16px 30px rgba(24, 55, 92, 0.12);
}

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

.operator-head h2 {
  margin: 0;
  color: var(--op-ink);
  letter-spacing: 0.02em;
}

.operator-caption {
  margin: 8px 0 0;
  color: var(--op-muted);
}

.theme-block {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.theme-label {
  font-size: 0.8rem;
  color: var(--op-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.theme-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switcher {
  width: 72px;
  height: 34px;
  border-radius: 999px;
  position: relative;
  display: block;
  cursor: pointer;
  background: linear-gradient(180deg, #9fd2ff 0%, #5da8ef 100%);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.6), inset 0 -4px 10px rgba(20, 73, 130, 0.22);
  transition: background 0.25s ease;
}

.switcher__sun,
.switcher__moon {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transform: translateY(-50%);
}

.switcher__sun {
  left: 11px;
  background: #ffd86f;
  box-shadow: 0 0 10px rgba(255, 205, 95, 0.65);
}

.switcher__moon {
  right: 11px;
  background: #d7e5ff;
  box-shadow: inset -3px -2px 0 rgba(125, 150, 183, 0.6);
}

.switcher__circle {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff 0%, #d8ebff 100%);
  box-shadow: 0 6px 10px rgba(11, 55, 104, 0.28);
  transition: transform 0.25s ease;
}

.theme-toggle:checked + .switcher {
  background: linear-gradient(180deg, #3f5577 0%, #2a3e5d 100%);
}

.theme-toggle:checked + .switcher .switcher__circle {
  transform: translateX(38px);
  background: linear-gradient(180deg, #dbe9ff 0%, #93b0d7 100%);
}

.operator-form {
  margin-top: 20px;
  display: grid;
  gap: 10px;
}

.operator-form-row {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 10px;
}

.operator-form input {
  border-color: rgba(109, 163, 223, 0.5);
  background: rgba(255, 255, 255, 0.88);
  color: var(--op-ink);
}

.operator-page[data-theme="night"] .operator-form input {
  border-color: rgba(89, 131, 179, 0.65);
  background: rgba(16, 29, 49, 0.85);
  color: var(--op-ink);
}

.neo-btn {
  border-radius: 14px;
  border: 1px solid var(--op-button-border);
  color: var(--op-button-text);
  background: var(--op-button-bg);
  box-shadow: var(--op-button-shadow);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.neo-btn:hover:not(:disabled) {
  filter: brightness(1.02);
}

.neo-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.checked-phone {
  margin: 14px 0 6px;
  min-height: 20px;
  color: var(--op-muted);
}

.channel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.channel-card.fixed {
  min-height: 300px;
  border-radius: 18px;
  border: 1px solid var(--op-card-border);
  background: var(--op-card-bg);
  box-shadow: var(--op-card-shadow);
  padding: 18px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
}

.channel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.channel-head h3 {
  margin: 0;
  color: var(--op-ink);
}

.channel-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  border: 1px solid rgba(110, 153, 204, 0.5);
  color: var(--op-muted);
  background: rgba(232, 243, 255, 0.8);
  text-transform: uppercase;
}

.operator-page[data-theme="night"] .channel-pill {
  background: rgba(19, 37, 63, 0.86);
}

.pill-waiting {
  color: var(--op-muted);
}

.pill-pending {
  color: var(--op-pending);
  border-color: rgba(43, 124, 205, 0.45);
}

.pill-success {
  color: var(--op-success);
  border-color: rgba(31, 171, 120, 0.45);
}

.pill-error {
  color: var(--op-error);
  border-color: rgba(197, 63, 75, 0.45);
}

.pill-warning {
  color: var(--op-warning);
  border-color: rgba(176, 124, 22, 0.45);
}

.channel-body {
  display: grid;
  align-content: start;
  gap: 10px;
}

.status {
  margin: 0;
  min-height: 30px;
  color: var(--op-ink);
  font-size: 1.02rem;
  font-weight: 600;
}

.status-details {
  min-height: 46px;
  margin: 0;
  overflow-wrap: anywhere;
}

.channel-action {
  height: 46px;
}

.spinner {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px solid rgba(86, 141, 201, 0.3);
  border-top-color: var(--op-pending);
  animation: spin 0.8s linear infinite;
}

.operator-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.operator-actions .inline-form {
  margin: 0;
}

.operator-page .footer {
  color: var(--op-muted);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1100px) {
  .channel-grid,
  .result-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .operator-form-row {
    grid-template-columns: 1fr;
  }

  .operator-actions {
    flex-wrap: wrap;
  }
}
