/* Stiluri pentru cont, autentificare, Support Center, notificari si widgetul de Live Chat. */

/* Atributul hidden invinge orice display setat din clase. */
[hidden] {
  display: none !important;
}

/* ---------- Formulare ---------- */
.field {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
  text-align: left;
}

.field__label {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.field__input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  transition: border-color var(--t-fast), background-color var(--t-fast);
}

textarea.field__input {
  resize: vertical;
  min-height: 0;
}

.field__input:focus {
  outline: none;
  border-color: var(--violet);
  background: rgba(139, 92, 255, 0.08);
}

.field__input::placeholder {
  color: var(--text-dim);
}

select.field__input {
  appearance: none;
  cursor: pointer;
}

.form-error {
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 77, 106, 0.4);
  border-radius: var(--radius-sm);
  background: rgba(255, 77, 106, 0.12);
  color: #ff9eae;
  font-size: var(--fs-sm);
}

.form-ok {
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid rgba(66, 220, 163, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(66, 220, 163, 0.1);
  color: #7ae6bf;
  font-size: var(--fs-sm);
}

.field-error {
  margin: 8px 0 0;
  color: #ff9eae;
  font-size: var(--fs-sm);
}

/* ---------- Formularul de solicitare: carduri de selectie ---------- */
.intake {
  display: grid;
  gap: 24px;
  margin-bottom: 22px;
}

.intake__intro {
  margin: 4px 0 18px;
  padding: 12px 16px;
  border-left: 3px solid var(--violet);
  border-radius: var(--radius-sm);
  background: rgba(139, 92, 255, 0.07);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.intake__group .field {
  margin-bottom: 0;
}

.intake__group > .field__label {
  display: block;
  margin-bottom: 10px;
}

.intake__hint {
  margin: -4px 0 12px;
  color: var(--text-dim);
  font-size: var(--fs-xs);
}

.choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.choices--contact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.choice {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  text-align: center;
  transition: border-color var(--t-fast), background-color var(--t-fast), color var(--t-fast),
    transform var(--t-fast) var(--ease), box-shadow var(--t);
}

.choice:hover {
  border-color: rgba(139, 92, 255, 0.5);
  color: var(--text);
  transform: translateY(-2px);
}

.choice.is-locked {
  opacity: 0.4;
  cursor: not-allowed;
}

.choice.is-locked:hover {
  border-color: var(--border-strong);
  color: inherit;
  transform: none;
}

.choice.is-selected {
  border-color: var(--violet);
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--violet), 0 12px 30px -18px rgba(139, 92, 255, 0.9);
}

.choice__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 1.2rem;
  transition: background-color var(--t-fast), color var(--t-fast);
}

.choice.is-selected .choice__icon {
  background: var(--gradient);
  color: #fff;
}

.choice__label {
  font-size: var(--fs-sm);
  font-weight: 600;
}

.choice--wide {
  flex-direction: row;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  text-align: left;
}

.choice__body {
  display: grid;
  gap: 6px;
  justify-items: start;
  min-width: 0;
}

.choice--wide .choice__label {
  color: var(--text);
  font-size: var(--fs-base);
}

.choice__text {
  color: var(--text-muted);
  font-size: var(--fs-xs);
  line-height: 1.5;
}

.choice__badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border: 1px solid rgba(139, 92, 255, 0.4);
  border-radius: var(--radius-pill);
  background: rgba(139, 92, 255, 0.12);
  color: #c9b8ff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.choice__badge .icon {
  width: 1em;
  height: 1em;
}

/* Campurile care apar dinamic ocupa tot randul si intra cu o animatie scurta */
.intake__reveal {
  grid-column: 1 / -1;
  animation: chat-in 0.25s var(--ease);
}

@media (max-width: 560px) {
  .choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .choices--contact {
    grid-template-columns: 1fr;
  }
}

/* Camp-capcana pentru roboti: invizibil pentru oameni */
.hp-field {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Butoanele din antetul paginilor de cont raman pe un singur rand (meniul-sertar din sections.css le pune pe coloana) */
[data-mount="session-actions"] {
  flex-direction: row;
  align-items: center;
}

/* Antetul paginilor de cont pe ecrane inguste: butoane compacte, pe un singur rand */
@media (max-width: 560px) {
  [data-mount="session-actions"] {
    flex-wrap: nowrap;
    gap: 6px;
  }

  [data-mount="session-actions"] .btn {
    min-height: 38px;
    padding: 0 12px;
    font-size: var(--fs-xs);
  }

  [data-mount="session-actions"] .bell {
    width: 38px;
    height: 38px;
  }
}

/* ---------- Pagini de aplicatie (cont, admin, autentificare) ---------- */
.app-main {
  min-height: 100vh;
  padding: calc(var(--header-h) + 32px) 0 64px;
}

.auth-card {
  max-width: 440px;
  margin: 6vh auto 0;
  padding: 36px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow);
}

.auth-card h1 {
  font-size: 1.6rem;
  margin-bottom: 6px;
}

.auth-card > p {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  margin-bottom: 24px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 24px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.03);
}

.auth-tabs button {
  padding: 9px 0;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: background-color var(--t-fast), color var(--t-fast);
}

.auth-tabs button.is-active {
  background: var(--gradient);
  color: #fff;
}

.auth-alt {
  margin-top: 18px;
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.auth-alt button,
.link-button {
  color: #b9a4ff;
  font: inherit;
  font-weight: 600;
}

.auth-alt button:hover,
.link-button:hover {
  text-decoration: underline;
}

/* ---------- Structura cont / admin ---------- */
.app-grid {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.app-nav {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.app-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-align: left;
  transition: background-color var(--t-fast), color var(--t-fast);
}

.app-nav button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.app-nav button.is-active {
  color: var(--text);
  background: var(--accent-soft);
}

.app-nav button .count {
  margin-left: auto;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--gradient);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
}

.panel {
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}

.panel + .panel {
  margin-top: 22px;
}

.panel h2 {
  font-size: 1.25rem;
  margin-bottom: 4px;
}

.panel .panel__sub {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  margin-bottom: 20px;
}

.page-title {
  font-size: var(--fs-h2);
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .app-grid {
    grid-template-columns: 1fr;
  }

  .app-nav {
    position: static;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }

  .app-nav button .count {
    margin-left: 6px;
  }
}

/* ---------- Statistici (dashboard) ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.stat {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.stat strong {
  display: block;
  font-size: 1.9rem;
  letter-spacing: -0.02em;
}

.stat span {
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

.stat.is-alert {
  border-color: rgba(255, 170, 70, 0.4);
}

.stat.is-alert strong {
  color: #ffc46b;
}

/* ---------- Liste de tickete / conversatii ---------- */
.rowlist {
  display: grid;
  gap: 10px;
}

.rowitem {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  text-align: left;
  transition: border-color var(--t-fast), transform var(--t-fast);
}

.rowitem:hover {
  border-color: rgba(139, 92, 255, 0.45);
  transform: translateY(-1px);
}

.rowitem__main {
  min-width: 0;
  flex: 1;
}

.rowitem__main strong {
  display: block;
  font-size: var(--fs-sm);
}

.rowitem__main span {
  display: block;
  overflow: hidden;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rowitem__dot {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--violet);
  box-shadow: 0 0 10px rgba(139, 92, 255, 0.9);
}

.rowitem time {
  flex: none;
  color: var(--text-dim);
  font-size: var(--fs-xs);
}

.empty {
  padding: 28px;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  text-align: center;
}

/* Eticheta de status */
.pill {
  flex: none;
  padding: 4px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.pill[data-status="nou"] { color: #8fb4ff; border-color: rgba(47, 125, 255, 0.5); background: rgba(47, 125, 255, 0.12); }
.pill[data-status="in_asteptare"],
.pill[data-status="waiting"] { color: #ffc46b; border-color: rgba(255, 170, 70, 0.45); background: rgba(255, 170, 70, 0.1); }
.pill[data-status="in_procesare"],
.pill[data-status="active"] { color: #b9a4ff; border-color: rgba(139, 92, 255, 0.5); background: rgba(139, 92, 255, 0.12); }
.pill[data-status="asteapta_plata"] { color: #ffd46b; border-color: rgba(255, 196, 70, 0.45); background: rgba(255, 196, 70, 0.1); }
.pill[data-status="plata_confirmata"] { color: #7ae6bf; border-color: rgba(66, 220, 163, 0.4); background: rgba(66, 220, 163, 0.1); }
.pill[data-status="activat"] { color: #7ae6bf; border-color: rgba(66, 220, 163, 0.55); background: rgba(66, 220, 163, 0.16); }
.pill[data-status="inchis"],
.pill[data-status="closed"] { color: var(--text-dim); }
.pill[data-status="anulat"] { color: #ff9eae; border-color: rgba(255, 77, 106, 0.4); background: rgba(255, 77, 106, 0.1); }

.pill[data-status="trial-pending"] { color: #ffc46b; border-color: rgba(255, 170, 70, 0.45); background: rgba(255, 170, 70, 0.1); }
.pill[data-status="trial-active"] { color: #7ae6bf; border-color: rgba(66, 220, 163, 0.55); background: rgba(66, 220, 163, 0.16); }
.pill[data-status="trial-expired"] { color: var(--text-dim); }
.pill[data-status="trial-rejected"] { color: #ff9eae; border-color: rgba(255, 77, 106, 0.4); background: rgba(255, 77, 106, 0.1); }

/* ---------- Perioada de proba ---------- */
.bullets {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
  padding-left: 20px;
  list-style: disc;
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin: 0 0 20px;
}

.facts > div {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.facts dt {
  color: var(--text-dim);
  font-size: var(--fs-xs);
}

.facts dd {
  margin: 4px 0 0;
  font-weight: 600;
}

.countdown {
  font-variant-numeric: tabular-nums;
}

.rowitem--static:hover {
  transform: none;
  border-color: var(--border);
}

.rowitem__actions {
  display: flex;
  flex: none;
  gap: 8px;
}

/* ---------- Firul de mesaje al unui ticket ---------- */
.thread {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.note {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.note--client {
  background: rgba(47, 125, 255, 0.1);
  border: 1px solid rgba(47, 125, 255, 0.25);
}

.note--admin {
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.note--internal {
  background: rgba(255, 196, 70, 0.07);
  border: 1px dashed rgba(255, 196, 70, 0.45);
}

.note__head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

.note__head strong {
  color: var(--text);
}

/* Mesaj trimis automat de platforma (nu de un operator) */
.note--system {
  background: rgba(139, 92, 255, 0.08);
  border: 1px dashed rgba(139, 92, 255, 0.45);
}

.note--system .note__head strong {
  color: var(--violet);
}

.note--internal .note__head strong {
  color: #ffc46b;
}

.timeline {
  margin-top: 14px;
  display: grid;
  gap: 6px;
  color: var(--text-dim);
  font-size: var(--fs-xs);
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  cursor: pointer;
}

.checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--violet);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.toolbar--center {
  align-items: center;
}

.toolbar__title {
  margin: 0;
  flex: 1;
}

.rowitem.is-selected {
  border-color: var(--violet);
}

.empty--center {
  margin: auto;
}

.back-row {
  margin-top: 18px;
}

.logo__suffix {
  padding-left: 12px;
  border-left: 1px solid var(--border-strong);
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
}

@media (max-width: 760px) {
  /* Pe ecrane inguste suffixul ar imbulzi butoanele din antet; titlul paginii spune oricum unde esti. */
  .logo__suffix { display: none; }
}

.toolbar .field__input {
  min-height: 42px;
  width: auto;
  flex: 1;
  min-width: 160px;
}

.toolbar select.field__input {
  flex: none;
  width: auto;
}

/* ---------- Clopotelul de notificari ---------- */
.bell-wrap {
  position: relative;
}

.bell {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--text-muted);
  transition: color var(--t-fast), border-color var(--t-fast);
}

.bell:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.35);
}

.bell__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 19px;
  padding: 1px 5px;
  border-radius: var(--radius-pill);
  background: var(--live);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
}

.bell-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 120;
  width: min(360px, calc(100vw - 32px));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.bell-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.bell-panel__clear {
  color: #b9a4ff;
  font-size: var(--fs-xs);
  font-weight: 600;
}

.bell-panel__list {
  max-height: 360px;
  overflow-y: auto;
}

.bell-item {
  display: grid;
  gap: 2px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-xs);
  transition: background-color var(--t-fast);
}

.bell-item:last-child {
  border-bottom: 0;
}

.bell-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.bell-item strong {
  font-size: var(--fs-sm);
}

.bell-item span {
  color: var(--text-muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.bell-item time {
  color: var(--text-dim);
}

.bell-item.is-unread {
  background: rgba(139, 92, 255, 0.07);
  box-shadow: inset 3px 0 0 var(--violet);
}

.bell-panel__empty {
  padding: 24px;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  text-align: center;
}

/* ---------- Widgetul de Live Chat ---------- */
.chat-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 140;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  box-shadow: var(--glow);
  transition: transform var(--t-fast) var(--ease);
}

.chat-fab:hover {
  transform: scale(1.06);
}

.chat-fab .icon {
  width: 1.5em;
  height: 1.5em;
}

.chat-fab__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  padding: 1px 6px;
  border: 2px solid var(--bg);
  border-radius: var(--radius-pill);
  background: var(--live);
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
}

.chat-panel {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: 140;
  display: flex;
  flex-direction: column;
  width: min(390px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 120px));
  height: min(560px, calc(100dvh - 120px));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

@media (max-width: 480px) {
  .chat-panel {
    right: 16px;
  }

  .chat-fab {
    right: 16px;
    bottom: 16px;
  }
}

.chat-panel__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(139, 92, 255, 0.18), rgba(47, 125, 255, 0.12));
}

.chat-panel__logo {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.chat-panel__title {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chat-presence-row {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

.chat-presence {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--text-dim);
}

.chat-presence.is-online {
  background: #42dca3;
  box-shadow: 0 0 8px rgba(66, 220, 163, 0.9);
  animation: pulse 2.2s ease-in-out infinite;
}

.chat-back,
.chat-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  color: var(--text-muted);
  transition: background-color var(--t-fast), color var(--t-fast);
}

.chat-back {
  transform: rotate(90deg);
}

.chat-back:hover,
.chat-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.chat-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.chat-start {
  padding: 20px;
  gap: 0;
  overflow-y: auto;
}

.chat-start .field__input {
  margin-bottom: 12px;
}

.chat-start__hint {
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.chat-list {
  padding: 14px;
}

.chat-list__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  gap: 8px;
  align-content: start;
  margin-bottom: 12px;
}

.chat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  text-align: left;
  transition: border-color var(--t-fast);
}

.chat-row:hover {
  border-color: rgba(139, 92, 255, 0.45);
}

.chat-row__status {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--text-dim);
}

.chat-row__status--waiting { background: #ffc46b; }
.chat-row__status--active { background: #42dca3; }

.chat-row__text {
  flex: 1;
  min-width: 0;
  display: grid;
}

.chat-row__text strong {
  font-size: var(--fs-sm);
}

.chat-row__text span {
  color: var(--text-dim);
  font-size: var(--fs-xs);
}

.chat-row__unread {
  flex: none;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--gradient);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
}

.chat-empty {
  padding: 24px 10px;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  text-align: center;
}

.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}

.chat-msg {
  max-width: 82%;
  animation: chat-in 0.22s var(--ease);
}

@keyframes chat-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.chat-msg--own {
  align-self: flex-end;
  text-align: right;
}

.chat-msg--other {
  align-self: flex-start;
}

.chat-msg--system {
  align-self: center;
  max-width: 94%;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  font-size: var(--fs-xs);
  text-align: center;
}

.chat-msg__bubble {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: var(--fs-sm);
  line-height: 1.45;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  max-width: 100%;
}

.chat-msg--own .chat-msg__bubble {
  border-bottom-right-radius: 5px;
  background: var(--gradient);
  color: #fff;
}

.chat-msg--other .chat-msg__bubble {
  border-bottom-left-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.chat-msg__meta {
  margin-top: 3px;
  color: var(--text-dim);
  font-size: 0.7rem;
}

.chat-msg__read {
  color: #8fb4ff;
  font-size: 0.68rem;
  font-weight: 600;
}

.chat-msg--pending {
  opacity: 0.65;
}

.chat-msg--failed .chat-msg__meta {
  color: #ff9eae;
}

.chat-typing {
  min-height: 18px;
  padding: 0 16px 4px;
  color: var(--text-dim);
  font-size: var(--fs-xs);
  font-style: italic;
}

.chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}

.chat-composer.is-closed {
  display: none;
}

.chat-input {
  flex: 1;
  max-height: 110px;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-sm);
  resize: none;
}

.chat-input:focus {
  outline: none;
  border-color: var(--violet);
}

.chat-send {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  transition: transform var(--t-fast);
}

.chat-send:hover {
  transform: scale(1.07);
}

.chat-state-toggle {
  padding: 9px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: var(--fs-xs);
  transition: color var(--t-fast);
}

.chat-state-toggle:hover {
  color: var(--text);
}

/* ---------- Consola de chat a operatorului ---------- */
.op-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.op-list {
  display: grid;
  gap: 8px;
  max-height: 70vh;
  overflow-x: hidden;
  overflow-y: auto;
}

.op-list > * {
  min-width: 0;
}

.op-list h3 {
  margin: 10px 2px 2px;
  color: var(--text-dim);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.op-chat {
  display: flex;
  flex-direction: column;
  height: 70vh;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  overflow: hidden;
}

.op-chat__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.op-chat__head strong {
  font-size: var(--fs-sm);
}

.op-chat__head .sub {
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

.op-chat__head .spacer {
  flex: 1;
}

.op-chat .chat-messages {
  background: var(--surface);
}

.btn--sm {
  min-height: 34px;
  padding: 0 14px;
  font-size: var(--fs-xs);
}

/* Canale de comunicare (Support Center): un panou pe canal, cu spatiu intre ele */
[data-mount="admin-view"] > .panel + .channel,
[data-mount="admin-view"] > .channel + .channel {
  margin-top: 16px;
}

.channel__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  font-size: var(--fs-lg, 1.125rem);
}

.channel__title .icon {
  width: 1.3em;
  height: 1.3em;
  color: var(--violet);
}

.channel form {
  display: grid;
  gap: 14px;
}

.channel form .form-error {
  margin: 0;
}

.channel form .btn {
  justify-self: start;
}

select.btn--sm {
  appearance: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 900px) {
  .op-grid {
    grid-template-columns: 1fr;
  }

  .op-list {
    max-height: 300px;
  }

  .op-chat {
    height: 60vh;
  }
}
