/* ===== БАЗА: светлая тема Thunderbird ===== */
* { box-sizing: border-box; }
:root {
  --bg-top: #dbeafe;          /* светло-голубое небо */
  --bg-bottom: #f0f9ff;       /* почти белый */
  --panel: rgba(255,255,255,0.75);  /* стеклянная карточка */
  --panel-solid: #ffffff;
  --panel-2: #f1f5f9;
  --accent: #2c5c9e;          /* глубокий синий (кнопки) */
  --accent-hover: #244a82;
  --accent-soft: #e0edff;
  --danger: #dc3545;          /* малиновый / красный */
  --text: #1e293b;            /* графитовый */
  --muted: #64748b;           /* серый текст */
  --border: rgba(148,163,184,0.25);
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --radius: 16px;
  --shadow: 0 4px 20px rgba(15,23,42,0.06);
}

html, body { margin: 0; padding: 0; height: 100%; }

body {
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

/* ===== КНОПКИ ===== */
button {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  transition: background .15s ease, transform .05s ease;
  box-shadow: 0 2px 8px rgba(44,92,158,0.25);
}
button:hover { background: var(--accent-hover); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

/* ===== ПОЛЯ ВВОДА ===== */
input, textarea {
  font: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  width: 100%;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(44,92,158,0.12);
}
input::placeholder { color: var(--muted); }

/* ===== КАРТОЧКИ ===== */
.card {
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

/* ===== СООБЩЕНИЯ ЧАТА ===== */
.msg {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 16px;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 15px;
}
.msg.client {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg.operator {
  align-self: flex-start;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

/* ===== СТАТУСЫ (светофор) ===== */
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.online { background: var(--green); box-shadow: 0 0 0 3px rgba(34,197,94,0.2); }
.dot.busy { background: var(--yellow); box-shadow: 0 0 0 3px rgba(234,179,8,0.2); }
.dot.offline { background: var(--red); box-shadow: 0 0 0 3px rgba(239,68,68,0.15); }

/* контрастное выделение текста в сообщениях чата */
.msg.client::selection,
.msg.client ::selection {
  background: #fde68a;
  color: #1e293b;
}
.msg.operator::selection,
.msg.operator ::selection {
  background: #2c5c9e;
  color: #ffffff;
}
