* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #111b21;
  color: #111;
  min-height: 100vh;
}

.layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px;
  flex-wrap: wrap;
}

/* ---------- Painel de contactos ---------- */
.contacts-panel {
  width: 300px;
  background: #202c33;
  border-radius: 16px;
  padding: 20px;
  color: #e9edef;
}

.contacts-panel h1 {
  font-size: 16px;
  margin: 0 0 8px;
}

.contacts-panel .hint {
  font-size: 12px;
  color: #8696a0;
  line-height: 1.5;
  margin: 0 0 16px;
}

.contacts-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
}

.contact-item:hover {
  background: #2a3942;
}

.contact-item.ativo {
  background: #2a3942;
  border-color: #00a884;
}

.contact-item .avatar {
  width: 34px;
  height: 34px;
  font-size: 13px;
}

.contact-item .contact-meta {
  overflow: hidden;
}

.contact-item .contact-nome {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-item .contact-numero {
  font-size: 11px;
  color: #8696a0;
}

.btn-primario,
.btn-secundario {
  font-size: 13px;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  width: 100%;
}

.btn-primario {
  background: #00a884;
  color: white;
}

.btn-secundario {
  background: #2a3942;
  color: #e9edef;
}

.btn-repor-tudo {
  margin-top: 8px;
  background: #3a1f1f;
  color: #ffb4b4;
}

.form-novo-contacto {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #2a3942;
}

.form-novo-contacto.hidden {
  display: none;
}

.form-novo-contacto input {
  background: #2a3942;
  border: 1px solid #3b4a54;
  color: #e9edef;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

.form-novo-contacto input::placeholder {
  color: #8696a0;
}

.cores-label {
  font-size: 11px;
  color: #8696a0;
  display: block;
  margin-bottom: 4px;
}

.seletor-cores {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.cor-opcao {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
}

.cor-opcao.selecionada {
  border-color: #fff;
}

.form-botoes {
  display: flex;
  gap: 8px;
}

/* ---------- Telemóvel ---------- */
.phone-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.phone {
  width: 375px;
  height: 700px;
  background: #efeae2;
  border-radius: 32px;
  border: 10px solid #0b0f12;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.phone-header {
  background: #005e54;
  color: white;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  background: #6b7280;
  flex-shrink: 0;
}

.header-info {
  flex: 1;
  min-width: 0;
}

.header-nome {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-numero {
  font-size: 12px;
  color: #cfe9e5;
}

.btn-limpar {
  background: none;
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.85;
}

.phone-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-image: linear-gradient(rgba(239, 234, 226, 0.9), rgba(239, 234, 226, 0.9));
}

.thread-empty {
  margin: auto;
  text-align: center;
  color: #8696a0;
  font-size: 13px;
  max-width: 220px;
}

.bubble-row {
  display: flex;
}

.bubble-row.eu {
  justify-content: flex-end;
}

.bubble-row.bot {
  justify-content: flex-start;
}

.bubble-row.sistema {
  justify-content: center;
}

.bubble {
  max-width: 75%;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.4;
  white-space: pre-wrap;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.bubble-row.eu .bubble {
  background: #d9fdd3;
  border-top-right-radius: 2px;
}

.bubble-row.bot .bubble {
  background: white;
  border-top-left-radius: 2px;
}

.bubble-row.sistema .bubble {
  background: #fef3c7;
  color: #92400e;
  font-size: 12px;
  text-align: center;
}

.bubble-hora {
  display: block;
  font-size: 10px;
  color: #667781;
  margin-top: 3px;
  text-align: right;
}

.phone-input-bar {
  display: flex;
  gap: 8px;
  padding: 10px;
  background: #f0f2f5;
}

.phone-input-bar input {
  flex: 1;
  border: none;
  border-radius: 20px;
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
}

.phone-input-bar button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #00a884;
  color: white;
  font-size: 16px;
  cursor: pointer;
}

.phone-input-bar button:disabled,
.phone-input-bar input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.status {
  color: #8696a0;
  font-size: 12px;
  margin-top: 12px;
  text-align: center;
  max-width: 375px;
}
