:root {
  /* Dark Mode (Default) */
  --bg-color: #181920;
  --text-primary: #e0e0e0;
  --text-heading: #ffffff;
  --container-bg: #200437;
  --container-alt-bg: #2a0545;
  --container-hover-bg: #350a4f;
  --input-bg: #351551;
  --input-focus-bg: #2a0545;
  --border-color: rgba(255, 255, 255, 0.1);
  --border-input: rgba(255, 255, 255, 0.2);
  --placeholder-color: rgba(255, 255, 255, 0.6);
  --shadow-color: rgba(0, 0, 0, 0.2);
  --header-gradient: linear-gradient(90deg, #23233a 0%, #7b0051 100%);
  --link-color: #3498db;
  --link-hover-color: #2980b9;
  --link-hover-bg: #ecf0f1;
  --text-on-purple: #f0f0f0;
}

[data-theme="light"] {
  --bg-color: #f4f7f6;
  --text-primary: #ffffff;
  --text-heading: #7b0051;
  --container-bg: #2a0545;
  --container-alt-bg: #350a4f;
  --container-hover-bg: #451066;
  --input-bg: #351551;
  --input-focus-bg: #2a0545;
  --border-color: rgba(0, 0, 0, 0.08);
  --border-input: rgba(0, 0, 0, 0.15);
  --placeholder-color: rgba(255, 255, 255, 0.6);
  --shadow-color: rgba(0, 0, 0, 0.05);
  --header-gradient: linear-gradient(90deg, #23233a 0%, #7b0051 100%);
  --link-color: #2176ae;
  --link-hover-color: #0d47a1;
  --link-hover-bg: #e3f2fd;
  --text-on-purple: #f0f0f0;
}


/* Estilos para o ClickCall - Lista de Contatos */

body {
  font-family: sans-serif;
  margin: 0;
  background-color: var(--bg-color);
  color: var(--text-primary);
  transition: background-color 0.3s, color 0.3s;
}

.main-content {
  padding: 20px;
}

/* Em telas grandes, reservar espaço à direita para o box de chamadas perdidas */
@media (min-width: 1000px) {
  body {
    margin-right: 360px;
    /* 320px box + 40px gap */
  }
}

h2 {
  color: var(--text-heading);
  margin-bottom: 20px;
  text-align: center;
}

label {
  display: block;
  margin-bottom: 10px;
  font-weight: bold;
  color: var(--text-primary);
}


input[type="file"] {
  display: inline-block;
  margin: 0;
  padding: 6px 12px;
  border: 1px dashed rgba(255, 255, 255, 0.3) !important;
  border-radius: 22px;
  background-color: #200437 !important;
  color: transparent !important;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 13px;
  height: 42px;
  box-sizing: border-box;
  width: 135px !important;
  overflow: hidden;
  white-space: nowrap;
}

/* Override for the hidden input inside custom wrapper */
.custom-file-wrapper input[type="file"] {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  opacity: 0 !important;
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  min-width: 0 !important;
  display: block !important;
}

/* Wrapper Hover Effects mimicking the original input hover */
/* Wrapper for Custom File Input */
/* Wrapper for Custom File Input */
/* IPBX Custom File Uploader */
.ipbx-file-wrapper {
  display: inline-flex !important;
  align-items: center;
  background-color: var(--input-bg);
  border: 1px dashed var(--border-input);
  border-radius: 22px;
  height: 42px;
  padding: 0 6px 0 0;
  box-sizing: border-box;
  vertical-align: middle;
  min-width: 150px !important;
  max-width: 150px !important;
  overflow: hidden;
  transition: all 0.3s ease;
  margin-right: 10px;
}

.ipbx-file-wrapper:hover {
  border-color: #2980b9;
  background-color: var(--input-focus-bg);
  max-width: 400px !important;
  box-shadow: 0 4px 12px rgba(41, 128, 185, 0.3);
}

.ipbx-file-btn {
  background-color: #4a0e2e;
  color: white;
  border-radius: 12px;
  padding: 0 16px;
  height: 28px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  margin: 6px;
  flex-shrink: 0;
  border: none;
}

.ipbx-file-btn:hover {
  background-color: #661a44;
}

.ipbx-file-label {
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
  padding-right: 8px;
  cursor: default;
}

#upload {
  display: none !important;
}


table {
  border-collapse: collapse;
  width: 100%;
  margin-top: 20px;
  background-color: var(--container-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px var(--shadow-color);
}

th,
td {
  border: 1px solid var(--border-color);
  padding: 12px;
  text-align: left;
  color: var(--text-on-purple);
  background-color: var(--container-bg);
}

tr:nth-child(even) td {
  background-color: var(--container-alt-bg);
}

tr:hover td {
  background-color: var(--container-hover-bg);
  transition: background-color 0.3s ease;
}

thead tr {
  background: var(--header-gradient);
  color: white;
}

th {
  background: transparent;
  color: white;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 14px;
  border: 1px solid var(--border-input);
}

td {
  background-color: var(--container-bg);
  color: var(--text-on-purple);
  border-bottom: 1px solid var(--border-color);
}

tr:nth-child(even) td {
  background-color: var(--container-alt-bg);
}

tr:hover td {
  background-color: var(--container-hover-bg);
  transition: background-color 0.3s ease;
}

a {
  color: #3498db;
  text-decoration: none;
  font-weight: bold;
  padding: 5px 10px;
  border-radius: 3px;
  transition: all 0.3s ease;
}

a:hover {
  color: #2980b9;
  background-color: #ecf0f1;
  text-decoration: none;
}

.call-button {
  display: inline-block;
  padding: 8px 16px;
  background-color: #27ae60;
  color: white !important;
  border-radius: 5px;
  transition: all 0.3s ease;
}

.call-button:hover {
  background-color: #229954 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.no-data {
  color: #95a5a6;
  font-style: italic;
}

.empty-state {
  text-align: center;
  color: #7f8c8d;
  font-style: italic;
  padding: 40px !important;
}

/* Mensagens de feedback */
.message {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 5px;
  color: white;
  font-weight: bold;
  z-index: 1000;
  animation: slideIn 0.3s ease;
  max-width: 300px;
}

.message-success {
  background-color: #27ae60;
}

.message-error {
  background-color: #e74c3c;
}

.message-warning {
  background-color: #f39c12;
}

.message-loading {
  background-color: #3498db;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Animações para as linhas da tabela */
.contact-row {
  transition: all 0.3s ease;
}

.contact-row:hover {
  background-color: #350a4f;
  transform: none;
}

/* Responsividade */
@media (max-width: 768px) {
  body {
    margin: 0;
  }

  table {
    font-size: 14px;
  }

  th,
  td {
    padding: 8px;
  }

  h2 {
    font-size: 20px;
  }
}

/* Botão padrão amigável */
button,
.add-contact-btn,
.export-btn,
.save-btn,
.cancel-btn,
.delete-btn,
.modal-btn-confirm,
.modal-btn-cancel,
.pagination-controls button,
.client-code-btn {
  background: var(--input-bg);
  color: var(--text-primary);
  border: none;
  border-radius: 22px;
  padding: 0 20px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  margin: 0 4px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(44, 62, 80, 0.07);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  box-sizing: border-box;
}

button:hover,
.add-contact-btn:hover,
.export-btn:hover,
.save-btn:hover,
.cancel-btn:hover,
.delete-btn:hover,
.modal-btn-confirm:hover,
.modal-btn-cancel:hover,
.pagination-controls button:hover {
  background: #e0e7ef;
  color: #1a2230;
  box-shadow: 0 4px 16px rgba(44, 62, 80, 0.13);
}

button:disabled,
.pagination-controls button:disabled {
  background: #f3f6fa;
  color: #b0b8c1;
  cursor: not-allowed;
  box-shadow: none;
}

/* Botão Remover (vermelho suave) */
.delete-btn {
  background: #ffeaea;
  color: #d7263d;
  font-weight: 600;
}

.delete-btn:hover {
  background: #ffd6d6;
  color: #a81c2a;
}

/* Botão Salvar (verde suave) */
.save-btn {
  background: #e6f9ed;
  color: #1e824c;
  font-weight: 600;
}

.save-btn:hover {
  background: #c8f2da;
  color: #145c32;
}

/* Botão Cancelar (cinza) */
.cancel-btn,
.modal-btn-cancel {
  background: #f3f6fa;
  color: #7b8a99;
}

.cancel-btn:hover,
.modal-btn-cancel:hover {
  background: #e0e7ef;
  color: #2d3a4a;
}

/* Botão Exportar */
.export-btn {
  background: #1e3a66;
  /* Azul escuro */
  color: #fff;
  border: 1px solid #2d4d82;
  font-weight: 600;
}

.export-btn:hover {
  background: #2d4d82;
  color: #fff;
  box-shadow: 0 4px 12px rgba(30, 58, 102, 0.4);
}

/* Botão Adicionar Contato */
.add-contact-btn {
  background: #4a0e2e;
  /* Roxo escuro */
  color: #fff;
  border: 1px solid #661a44;
  font-weight: 600;
}

.add-contact-btn:hover {
  background: #661a44;
  color: #fff;
  box-shadow: 0 4px 12px rgba(74, 14, 46, 0.4);
}

/* Botão de paginação */
.pagination-controls button {
  min-width: 90px;
}

.pagination-controls span {
  margin: 0 10px;
  font-weight: 500;
  color: #ffffff;
}

/* Select amigável */
select,
.per-page-select,
.export-select {
  border-radius: 18px;
  padding: 7px 16px;
  font-size: 15px;
  border: 1px solid var(--border-input);
  background: var(--container-bg);
  color: #ffffff;
  margin: 0 4px;
  outline: none;
  transition: border 0.2s;
}

select:focus,
.per-page-select:focus,
.export-select:focus {
  border: 1.5px solid #2176ae;
}

/* Toast amigável */
.toast {
  position: fixed;
  top: 30px;
  right: 30px;
  min-width: 220px;
  max-width: 350px;
  padding: 16px 24px 16px 48px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 500;
  color: #fff;
  background: rgba(44, 62, 80, 0.95);
  box-shadow: 0 6px 32px rgba(44, 62, 80, 0.18);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-20px);
  transition: opacity 0.3s, transform 0.3s;
  display: flex;
  align-items: center;
}

.toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.toast-success {
  background: #27ae60;
}

.toast-error {
  background: #e74c3c;
}

.toast-warning {
  background: #f39c12;
  color: #fff;
}

.toast-info {
  background: #2176ae;
}

.toast::before {
  content: '';
  display: inline-block;
  width: 22px;
  height: 22px;
  margin-right: 16px;
  margin-left: -32px;
  background-size: contain;
  background-repeat: no-repeat;
}

.toast-success::before {
  background-image: url('data:image/svg+xml;utf8,<svg fill="white" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M16.707 5.293a1 1 0 00-1.414 0L8 12.586 4.707 9.293a1 1 0 00-1.414 1.414l4 4a1 1 0 001.414 0l8-8a1 1 0 000-1.414z"/></svg>');
}

.toast-error::before {
  background-image: url('data:image/svg+xml;utf8,<svg fill="white" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10 18a8 8 0 100-16 8 8 0 000 16zm-1-4h2v2h-2v-2zm0-8h2v6h-2V6z"/></svg>');
}

.toast-warning::before {
  background-image: url('data:image/svg+xml;utf8,<svg fill="white" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M8.257 3.099c.765-1.36 2.72-1.36 3.485 0l6.516 11.591c.75 1.334-.213 2.987-1.742 2.987H3.483c-1.53 0-2.492-1.653-1.742-2.987L8.257 3.1zM11 14a1 1 0 11-2 0 1 1 0 012 0zm-1-2a1 1 0 01-1-1V9a1 1 0 112 0v2a1 1 0 01-1 1z"/></svg>');
}

.toast-info::before {
  background-image: url('data:image/svg+xml;utf8,<svg fill="white" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M18 10A8 8 0 11 2 10a8 8 0 0116 0zm-7-4a1 1 0 10-2 0 1 1 0 002 0zm-1 2a1 1 0 00-1 1v4a1 1 0 002 0v-4a1 1 0 00-1-1z"/></svg>');
}

/* Modal amigável */
.modal-confirm-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(44, 62, 80, 0.35);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-confirm {
  background: var(--container-bg);
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(44, 62, 80, 0.18);
  padding: 32px 32px 24px 32px;
  min-width: 320px;
  max-width: 95vw;
  text-align: center;
  font-size: 17px;
  color: var(--text-primary);
  font-weight: 500;
}

.modal-confirm-msg {
  margin-bottom: 24px;
  font-size: 18px;
  color: var(--text-primary);
}

.modal-confirm-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.modal-btn-confirm {
  background: #27ae60;
  color: #fff;
  font-weight: 600;
  border-radius: 22px;
  padding: 8px 28px;
  font-size: 16px;
}

.modal-btn-confirm:hover {
  background: #219150;
}

.modal-btn-cancel {
  background: #f3f6fa;
  color: #7b8a99;
  font-weight: 600;
  border-radius: 22px;
  padding: 8px 28px;
  font-size: 16px;
}

.modal-btn-cancel:hover {
  background: #e0e7ef;
  color: #2d3a4a;
}

#ipbx-toolbar {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 8px;
  margin-bottom: 24px;
  width: 100%;
  overflow-x: auto;
  padding: 4px 0;
}

#ipbx-toolbar .clear-all-btn {
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  font-size: 1.2rem !important;
  margin: 0 !important;
  background-color: #d32f2f !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(211, 47, 47, 0.3) !important;
}

#ipbx-toolbar .btn-howto-upload {
  padding: 0 24px !important;
}

.search-input {
  flex: 1 1 200px;
  min-width: 120px;
  max-width: 200px;
  padding: 10px 16px;
  font-size: 14px;
  border: 1.5px solid #ffffff;
  border-radius: 22px;
  background: var(--input-bg);
  color: #ffffff;
  margin: 0;
  box-shadow: 0 2px 12px var(--shadow-color);
  outline: none;
  transition: all 0.2s;
  height: 42px;
  box-sizing: border-box;
}

.search-input:focus {
  border: 1.5px solid #ffffff;
  background: var(--input-focus-bg);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

@media (max-width: 800px) {
  #ipbx-toolbar {
    flex-wrap: wrap !important;
  }
}

/* Styled Input for Table (Add/Edit) - Matches Search Bar */
.styled-input {
  width: 95%;
  /* Fit within cell with some padding */
  padding: 6px 12px;
  font-size: 14px;
  border: 1.5px solid #ffffff;
  border-radius: 18px;
  /* Slightly smaller radius for table inputs */
  background: var(--input-bg);
  color: #ffffff;
  margin: 0;
  box-shadow: 0 1px 4px var(--shadow-color);
  outline: none;
  transition: all 0.2s;
  height: 32px;
  /* Compact height for table */
  box-sizing: border-box;
}

.styled-input:focus {
  border: 1.5px solid #ffffff;
  background: var(--input-focus-bg);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

/* Ensure placeholder is visible */
.styled-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}


/* Paginação alinhada e seletor à direita */
.pagination-controls {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-top: 18px;
  min-height: 48px;
  gap: 10px;
}

.pagination-controls .per-page-wrapper {
  display: flex;
  align-items: center;
  margin-left: auto;
}

@media (max-width: 600px) {
  .pagination-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .pagination-controls .per-page-wrapper {
    margin-left: 0;
    justify-content: flex-end;
  }
}

.banner-borda {
  border: none;
  border-radius: 0;
  padding: 10px 20px;
  margin: 0;
  max-width: none;
  background: transparent;
  box-shadow: none;
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.banner-borda h2 {
  margin: 0;
  background: none;
  color: var(--text-heading) !important;
  /* Follows theme heading color */
  font-size: 2.2rem;
  font-weight: bold;
  text-align: center;
  padding: 10px 0;
  border-bottom: none;
  border-radius: 0;
  letter-spacing: 1px;
  text-shadow: none;
}

/* Global vertical align for table cells */
#contactsTable th,
#contactsTable td {
  vertical-align: top;
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #444;
}

#contactsTable th:nth-child(6),
#contactsTable td.td-acao {
  width: 110px;
  min-width: 110px;
  max-width: 110px;
  text-align: center;
  white-space: nowrap;
}

#contactsTable td.td-acao {
  text-align: center;
  padding: 8px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  vertical-align: middle;
}

.action-wrapper {
  display: flex;
  flex-direction: row;
  gap: 4px;
  align-items: center;
  justify-content: center;
  height: 100%;
}


#contactsTable th:nth-child(1),
#contactsTable td:nth-child(1) {
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

#contactsTable th:nth-child(2),
#contactsTable td:nth-child(2) {
  white-space: nowrap;
  min-width: 110px;
}

#contactsTable th:nth-child(4),
#contactsTable td:nth-child(4) {
  white-space: nowrap;
  min-width: 125px;
}

#contactsTable th:nth-child(7),
#contactsTable td.td-observacao {
  min-width: 100px;
  max-width: 200px;
  width: auto;
  cursor: pointer;
}

#contactsTable td.td-observacao.editing {
  max-width: none;
  white-space: normal;
}

/* Estilo para o texto de observação quando NÃO está editando */
.obs-view {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  padding: 4px 0;
  cursor: pointer;
}

.td-observacao textarea.obs-textarea {
  width: 95% !important;
  min-width: 95% !important;
  box-sizing: border-box;
  display: block;
  background: var(--input-bg) !important;
  color: #ffffff !important;
  border: 1.5px solid var(--border-input);
  border-radius: 18px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  box-shadow: 0 1px 4px var(--shadow-color);
  transition: all 0.2s;
}

.td-observacao textarea.obs-textarea:focus {
  border: 1.5px solid #ffffff !important;
  background: var(--input-focus-bg) !important;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.td-observacao textarea.obs-textarea::placeholder {
  color: rgba(255, 255, 255, 0.7) !important;
  opacity: 1;
}

/* Old body rule removed */

/* Watermark removed */

/* Esconder scrollbar do modal completamente */
.modal-confirm-bg ::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* Firefox e IE/Edge */
.modal-confirm-bg {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* Botão Baixar Tabela Padrão */
#download-template-btn:hover {
  background: linear-gradient(90deg, #3498db 60%, #2176ae 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(33, 118, 174, 0.25) !important;
}

/* Checkbox customizada para 'Já liguei' */
.checkbox-done {
  width: 28px;
  height: 28px;
  accent-color: #7b0051;
  border-radius: 8px;
  border: 2px solid #7b0051;
  background: var(--input-bg);
  box-shadow: 0 2px 8px rgba(123, 0, 81, 0.10);
  transition: box-shadow 0.2s, border-color 0.2s, background 0.2s;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  position: relative;
  vertical-align: middle;
}

.checkbox-done:checked {
  background: linear-gradient(120deg, #7b0051 60%, #c8007e 100%);
  border-color: #c8007e;
  box-shadow: 0 4px 16px rgba(123, 0, 81, 0.18);
}

.checkbox-done:checked::after {
  content: '';
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4.5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  border-radius: 2px;
  transform: translate(-50%, -50%) rotate(45deg);
  opacity: 1;
  animation: checkmark-stroke 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes checkmark-stroke {
  0% {
    width: 0;
    height: 0;
    opacity: 0;
  }

  50% {
    width: 4.5px;
    height: 0;
    opacity: 1;
  }

  100% {
    width: 4.5px;
    height: 9px;
    opacity: 1;
  }
}

.checkbox-done:hover {
  box-shadow: 0 4px 16px rgba(123, 0, 81, 0.18);
  border-color: #c8007e;
}

/* Botão de Gravação - Ícone verde minimalista */
.gravar-btn {
  background: #27ae60;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.4rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(39, 174, 96, 0.25);
  padding: 0;
  line-height: 1;
}

.gravar-btn:hover {
  background: #229954;
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(39, 174, 96, 0.35);
}

.gravar-btn:active {
  transform: scale(0.95);
}

/* Coluna de Gravação */
.td-gravacao {
  width: 80px;
  min-width: 80px;
  text-align: center;
  vertical-align: middle;
}

/* Cards de Gravação no Modal */
.gravacao-card {
  transition: all 0.3s ease;
}

.gravacao-card:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15) !important;
}

/* Player de Áudio Simples Customizado */
.simple-audio-player {
  margin-bottom: 20px;
}

.simple-audio-player input[type="range"] {
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.2);
  height: 4px;
  border-radius: 2px;
  outline: none;
  appearance: none;
}

/* Slider horizontal (barra de progresso) */
.simple-audio-player input[type="range"][orient="horizontal"],
.simple-audio-player input[type="range"]:not([orient="vertical"]) {
  width: 100%;
  height: 4px;
}

/* Slider vertical (volume) */
.simple-audio-player input[type="range"][orient="vertical"] {
  width: 80px;
  height: 50px;
  writing-mode: bt-lr;
  -webkit-appearance: slider-vertical;
  appearance: slider-vertical;
  direction: rtl;
}

/* Para Firefox - slider vertical */
.simple-audio-player input[type="range"][orient="vertical"]::-moz-range-track {
  width: 80px;
  height: 50px;
}

.simple-audio-player input[type="range"][orient="vertical"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
}

/* Volume Control Horizontal Pequeno */
.volume-control-container {
  display: flex;
  align-items: center;
  gap: 6px;
}

.volume-control-container .volume-slider {
  width: 60px;
  height: 4px;
  cursor: pointer;
}

.simple-audio-player input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: rgba(123, 0, 81, 0.8);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
}

.simple-audio-player input[type="range"]::-webkit-slider-thumb:hover {
  background: rgba(123, 0, 81, 1);
}

.simple-audio-player input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: rgba(123, 0, 81, 0.8);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
}

.simple-audio-player input[type="range"]::-moz-range-thumb:hover {
  background: rgba(123, 0, 81, 1);
}

.simple-audio-player select {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
}

.simple-audio-player select:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.simple-audio-player select option {
  background: rgba(40, 40, 60, 0.95);
  color: #fff;
}

/* Container de Gravações com Scroll */
#gravacoes-container {
  max-height: 60vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE e Edge */
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

/* Esconder scrollbar completamente */
#gravacoes-container::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* Card de gravação responsivo */
.gravacao-card {
  box-sizing: border-box !important;
  max-width: 100% !important;
  overflow: hidden !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
}

.gravacao-card * {
  max-width: 100%;
  box-sizing: border-box;
}

/* --- Missed Call Box Styles --- */
.missed-calls-container {
  position: fixed;
  /* Mais para baixo para não cobrir o header/botões */
  right: 20px;
  width: 320px;
  background-color: var(--container-bg);
  /* Fundo roxo escuro solicitado */
  border-radius: 12px;
  box-shadow: 0 4px 16px var(--shadow-color);
  z-index: 9990;
  overflow: hidden;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  /* Increased max-height */
}

.missed-calls-header {
  background: #e91e63;
  /* Pink/Magenta */
  color: white;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.missed-calls-title {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
  color: #fff;
}

.missed-calls-btns {
  display: flex;
  align-items: center;
  gap: 12px;
}

#show-history-btn {
  background: #592611 !important;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white !important;
  transition: transform 0.2s, background 0.2s;
}

#show-history-btn:hover {
  background: #6d2f15 !important;
  transform: translateY(-2px);
}

#show-history-btn .btn-icon {
  font-size: 20px;
  line-height: 1;
  margin-bottom: 2px;
}

#show-history-btn .btn-text {
  font-size: 10px;
  font-weight: 500;
  text-transform: capitalize;
}

#clear-missed-calls {
  background: #c2185b !important;
  color: #333;
  /* Icon color in design */
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: transform 0.2s, background 0.2s;
}

#clear-missed-calls:hover {
  background: #ad1457 !important;
  transform: scale(1.05);
}

#missed-calls-list {
  overflow-y: auto;
  max-height: 600px;
  /* Increased height */
  background: var(--container-bg);
  /* Match container */
}

.missed-call-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.2s;
  cursor: pointer;
  color: var(--text-on-purple);
}

.missed-call-item:last-child {
  border-bottom: none;
}

.missed-call-item:hover {
  background-color: var(--container-hover-bg);
  /* Hover roxo levemente mais claro */
}

.missed-call-info {
  display: flex;
  flex-direction: column;
}

.missed-call-number {
  font-weight: bold;
  color: var(--text-on-purple);
  /* Texto branco */
  font-size: 16px;
}

.missed-call-time {
  font-size: 12px;
  color: #bbb;
  /* Cinza claro */
  margin-top: 2px;
}

.missed-call-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.missed-call-close {
  background: transparent;
  color: #999;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 2px;
  line-height: 1;
  min-width: unset;
  box-shadow: none;
}

.missed-call-close:hover {
  color: #d7263d;
  background: transparent;
  box-shadow: none;
}

.missed-calls-container.hidden {
  display: none;
}

/* --- Returned Status Styles --- */
.missed-call-item.returned {
  background-color: rgba(39, 174, 96, 0.15);
  border-left: 4px solid #27ae60;
}

.missed-call-item.returned .missed-call-number {
  color: #27ae60;
  text-decoration: line-through;
}

.missed-call-item.returned .missed-call-actions::before {
  content: "✓";
  color: #27ae60;
  font-weight: bold;
  margin-right: 8px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Modern Action Buttons */
.action-btn {
  width: 34px !important;
  height: 34px !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  border: none !important;
  font-size: 1.1rem !important;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  margin: 0 4px !important;
  line-height: 1 !important;
}

.action-btn:hover {
  transform: translateY(-2px) scale(1.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.action-btn:active {
  transform: scale(0.95);
}

/* Call Button - Green */
.call-button {
  background: #27ae60 !important;
  color: #fff !important;
}

.call-button:hover {
  background: #2ecc71 !important;
  box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4);
}

/* Edit Button - Blue/White Theme */
.edit-btn {
  background: var(--input-bg) !important;
  color: var(--text-primary) !important;
}

.edit-btn:hover {
  background: #ffffff !important;
  color: #2980b9 !important;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

/* Delete Button - Red */
.delete-btn {
  background: #c0392b !important;
  color: #fff !important;
}

.delete-btn:hover {
  background: #e74c3c !important;
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

/* Save Button - Green (Similar to Call) */
.save-btn {
  background: #27ae60 !important;
  color: #fff !important;
}

.save-btn:hover {
  background: #2ecc71 !important;
  box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4);
}

/* Cancel Button - Gray or Red (Distinct from Delete) */
.cancel-btn {
  background: #95a5a6 !important;
  color: #fff !important;
}

.cancel-btn:hover {
  background: #bdc3c7 !important;
  box-shadow: 0 4px 12px rgba(189, 195, 199, 0.4);
}

/* --- History Modal (Theme Supported) --- */
.history-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.85);
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

.history-content {
  background-color: var(--container-bg);
  padding: 20px;
  border-radius: 15px;
  width: 90%;
  max-width: 800px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px var(--shadow-color);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.history-header h3 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text-heading);
}

.close-history {
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  background: none;
  border: none;
  transition: color 0.2s;
}

.close-history:hover {
  color: var(--text-primary);
}

.history-table-container {
  overflow-y: auto;
  flex-grow: 1;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.history-table thead tr {
  background: var(--header-gradient);
  color: white;
}

.history-table th,
.history-table td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--container-bg);
  color: #ffffff;
}

.history-table th {
  background-color: transparent;
  color: #fff;
  font-weight: 600;
  position: sticky;
  top: 0;
}

.history-table tr:hover {
  background-color: var(--container-hover-bg);
}

/* --- Premium Theme Toggle Switch --- */
.theme-switch-wrapper {
  display: flex;
  align-items: center;
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 100;
}

.theme-switch {
  display: inline-block;
  height: 38px;
  position: relative;
  width: 74px;
}

.theme-switch input {
  display: none;
}

.slider {
  background-color: #2c3e50;
  bottom: 0;
  cursor: pointer;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  transition: .4s;
  border-radius: 34px;
  border: 2px solid var(--border-input);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

.slider:before {
  background-color: #fff;
  bottom: 4px;
  content: "";
  height: 26px;
  left: 4px;
  position: absolute;
  transition: .4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  width: 26px;
  border-radius: 50%;
  z-index: 2;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

input:checked+.slider {
  background-color: #3498db;
}

input:checked+.slider:before {
  transform: translateX(36px);
  background-color: #f1c40f;
}

.slider svg {
  position: absolute;
  width: 18px;
  height: 18px;
  top: 8px;
  z-index: 1;
  transition: .4s;
}

.sun-icon {
  left: 8px;
  color: #f1c40f;
  opacity: 0;
  transform: rotate(-90deg);
}

.moon-icon {
  right: 8px;
  color: #f1c40f;
  opacity: 1;
  transform: rotate(0deg);
}

input:checked+.slider .sun-icon {
  opacity: 1;
  transform: rotate(0deg);
}

input:checked+.slider .moon-icon {
  opacity: 0;
  transform: rotate(90deg);
}

/* Specific adjustment for Light Mode variables in the switch */
[data-theme="light"] .slider {
  background-color: #ecf0f1;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .slider:before {
  background-color: #fff;
}