/* ===== MODALS — Modais base, formulários e sync ===== */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  padding: 2rem;
  overflow-y: auto;
}

.modal-overlay.open {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  margin: auto;
  overflow: hidden;
  animation: slideUpDetail 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface2);
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.modal-close {
  width: 32px;
  height: 32px;
  background: var(--surface3);
  border: 1px solid var(--border2);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.modal-close:hover {
  background: var(--border2);
  color: var(--text);
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.form-label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.form-optional {
  font-size: 0.6rem;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-display);
  opacity: 0.7;
}

.form-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0.15rem 0;
}

.form-divider::before,
.form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border2);
}

.form-input {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  color: var(--text);
  font-size: 0.88rem;
  font-family: var(--font-display);
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.form-input:focus {
  border-color: var(--accent);
}

.form-input:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

select.form-input {
  cursor: pointer;
}

.form-textarea {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  color: var(--text);
  font-size: 0.88rem;
  font-family: var(--font-display);
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

.form-textarea:focus {
  border-color: var(--accent);
}

.anydesk-toggle {
  display: flex;
  gap: 0.6rem;
}

.anydesk-option {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  font-size: 0.82rem;
  font-family: var(--font-display);
  color: var(--muted);
  transition: all 0.15s;
  flex: 1;
  justify-content: center;
}

.anydesk-option input[type="radio"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.anydesk-option:has(input:checked) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface);
}

.new-user-btn {
  background: var(--surface3);
  border: 1px dashed var(--border2);
  border-radius: 8px;
  color: var(--muted);
  padding: 0.55rem 1rem;
  font-size: 0.82rem;
  font-family: var(--font-display);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.new-user-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface2);
}

.btn-cancel {
  background: var(--surface3);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--muted);
  padding: 0.6rem 1.2rem;
  font-size: 0.85rem;
  font-family: var(--font-display);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cancel:hover {
  border-color: var(--accent3);
  color: var(--accent3);
}

.btn-save {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: white;
  padding: 0.6rem 1.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-save:hover {
  background: var(--accent2);
}

/* File upload */
.file-upload-btn {
  display: block;
  border: 1px dashed var(--border2);
  border-radius: 8px;
  padding: 0.75rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.file-upload-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.file-upload-btn input {
  display: none;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.5rem;
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface2);
  border-radius: 6px;
  padding: 0.4rem 0.7rem;
  font-size: 0.78rem;
  font-family: var(--font-mono);
}

.file-remove {
  cursor: pointer;
  color: var(--accent3);
}

/* Ticket type selector */
.ticket-type-selector {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.ticket-type-btn {
  flex: 1;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border2);
  border-radius: 10px;
  background: var(--surface2);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.ticket-type-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface);
}

.ticket-type-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}


/* ===== TEMA ESCURO — modals.css ===== */
body.dark-mode .modal-overlay {
  background: rgba(0, 0, 0, 0.65);
}

body.dark-mode .form-input,
body.dark-mode .form-textarea {
  color-scheme: dark;
}

body.dark-mode .ticket-type-btn.active {
  background: var(--accent);
  color: #fff;
}

/* ── Botões globais (btn-primary / btn-secondary) ── */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1.25rem;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--accent2);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 0.55rem 1.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.btn-secondary:hover {
  background: var(--surface3);
  border-color: var(--muted);
}

body.dark-mode .btn-primary {
  background: var(--accent);
}

body.dark-mode .btn-secondary {
  background: var(--surface2);
  border-color: var(--border2);
}

/* ── Botão de fechar do modal de intervenção ── */
#sla-intervir-modal .modal-close {
  font-size: 0.85rem;
}

/* ── Lista de usuários no modal de reatribuição ── */
#sla-intervir-userlist::-webkit-scrollbar {
  width: 4px;
}

#sla-intervir-userlist::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 2px;
}