@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg: #0d0d0d;
  --bg2: #161616;
  --bg3: #1e1e1e;
  --border: #2a2a2a;
  --accent: #FFC533;
  --accent-dark: #e6b02e;
  --purple: #6010C6;
  --purple-light: rgba(96,16,198,0.15);
  --text: #e8e8e8;
  --text-muted: #888;
  --danger: #ff4757;
  --warning: #ffa502;
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  min-height: 100vh;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* HEADER */
.header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.logo img {
  height: 44px;
  width: auto;
  display: block;
}

.logo-sub {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  border-left: 1px solid var(--border);
  padding-left: 14px;
}

/* CARDS */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

.card h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 18px;
}

/* FORM */
.form-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 160px;
}

.form-group--small { flex: 0 0 100px; }
.form-group--btn { flex: 0 0 auto; }

label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

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

/* BUTTONS */
.btn {
  padding: 10px 18px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.btn--primary {
  background: var(--purple);
  color: #fff;
}
.btn--primary:hover { background: #7a1fd4; }
.btn--primary:disabled { background: #2a2a2a; color: #555; cursor: not-allowed; }

.btn--outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn--outline:hover { border-color: var(--accent); color: var(--accent); }

.btn--gerar {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 6px 12px;
  font-size: 12px;
  white-space: nowrap;
}
.btn--gerar:hover { background: var(--accent); color: #000; }
.btn--gerar:disabled { border-color: var(--border); color: var(--text-muted); cursor: not-allowed; }

.btn--copy {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 10px;
  font-size: 12px;
}
.btn--copy:hover { border-color: var(--accent); color: var(--accent); }

.btn--whatsapp {
  background: #25D366;
  color: #fff;
  margin-top: 8px;
  justify-content: center;
  font-size: 13px;
}
.btn--whatsapp:hover { background: #1da851; }

/* STATUS BAR */
.status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--bg3);
  border-radius: 6px;
  border-left: 3px solid var(--accent);
  color: var(--accent);
  font-size: 13px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ACTIONS BAR */
.actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding: 0 4px;
}

#total-label {
  font-size: 12px;
  color: var(--text-muted);
}

.actions-bar__buttons {
  display: flex;
  gap: 8px;
}

/* TABLE */
.card--table { padding: 0; overflow: hidden; }

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: var(--bg3);
}

th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}

tbody tr:hover { background: var(--bg3); }
tbody tr:last-child td { border-bottom: none; }

.empty-row td {
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
}

/* PRIORIDADE BADGES */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge--alta { background: rgba(255,71,87,0.15); color: var(--danger); }
.badge--media { background: rgba(255,165,2,0.15); color: var(--warning); }
.badge--baixa { background: rgba(255,197,51,0.15); color: var(--accent); }

/* PROBLEMAS — texto completo com quebra de linha */
.problemas-cell {
  max-width: 280px;
  white-space: normal;
  word-break: break-word;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

/* CAMPOS EXTRAS NA TABELA */
.contato-cell {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.8;
}

/* LINKS */
a.link {
  color: var(--accent);
  text-decoration: none;
  font-size: 12px;
}
a.link:hover { text-decoration: underline; }

/* MODAL */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal.hidden { display: none; }

.modal-box, .modal-content {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 640px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
}
.modal-close:hover { color: var(--text); }

.modal-box h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
  padding-right: 30px;
}

.mensagem-bloco {
  margin-bottom: 20px;
}

.mensagem-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  line-height: 1.6;
}

/* HIDDEN */
.hidden { display: none !important; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .form-row { flex-direction: column; }
  .form-group--small, .form-group--btn { flex: 1; }
}

/* HEADER USER INFO */
.header-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-user .username {
  font-size: 13px;
  color: var(--text-muted);
}

.header-user .btn--admin {
  font-size: 12px;
  padding: 5px 10px;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 5px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
}
.header-user .btn--admin:hover { background: var(--accent); color: #000; }

.header-user .btn--logout {
  font-size: 12px;
  padding: 5px 10px;
}
