/* ===================================================================
   Sistema de Gestão de Clientes - CSS Moderno e Responsivo
   Compatível com visualização direta no Antigravity e navegadores
   =================================================================== */

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-subtle: #eef2ff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --border-card: #e2e8f0;
  --border-focus: #6366f1;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-subtle: #fef2f2;
  --success: #10b981;
  --success-subtle: #ecfdf5;
  --radius-lg: 14px;
  --radius-md: 8px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

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

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  padding-bottom: 40px;
}

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

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-card);
  gap: 16px;
  flex-wrap: wrap;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.brand-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
}

.brand-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

/* Banner de Segurança & PDO */
.info-banner {
  background: #0f172a;
  color: #f1f5f9;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-md);
  flex-wrap: wrap;
}

.info-banner-text h4 {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-banner-text p {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}

.badge-pdo {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  padding: 2px 8px;
  border-radius: 4px;
}

/* Barra de Ações & Busca */
.toolbar {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  font-size: 13px;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  outline: none;
  transition: all 0.2s ease;
  background-color: #fff;
  font-family: inherit;
}

.search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

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

.btn-secondary {
  background: #f1f5f9;
  color: var(--text-main);
  border-color: var(--border-card);
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

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

.btn-icon {
  padding: 6px 10px;
  font-size: 12px;
  background: transparent;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon:hover {
  background: #f8fafc;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-icon.delete:hover {
  background: var(--danger-subtle);
  color: var(--danger);
  border-color: var(--danger);
}

/* Tabela de Clientes */
.card-table {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table-header-meta {
  padding: 12px 18px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

thead th {
  background: #f8fafc;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-card);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
}

tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: #f8fafc;
}

tbody td {
  padding: 13px 16px;
  color: var(--text-main);
  vertical-align: middle;
}

.td-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
  border: 1px solid #e2e8f0;
}

.td-nome {
  font-weight: 600;
  color: var(--text-main);
}

.td-email a {
  color: #475569;
  text-decoration: none;
  transition: color 0.15s;
}

.td-email a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.td-tel {
  font-family: 'JetBrains Mono', monospace;
  color: #475569;
}

.td-actions {
  text-align: right;
  white-space: nowrap;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-card);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s ease;
  overflow: hidden;
}

.modal-overlay.active .modal-box {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}

.modal-close:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.modal-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.form-input {
  padding: 9px 12px;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  font-size: 13px;
  outline: none;
  font-family: inherit;
  transition: all 0.15s ease;
}

.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.modal-footer {
  padding: 16px 22px;
  background: #f8fafc;
  border-top: 1px solid var(--border-card);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Toast */
.toast-msg {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  border: 1px solid #334155;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2000;
}

.toast-msg.show {
  transform: translateY(0);
  opacity: 1;
}

/* Responsividade */
@media (max-width: 640px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}
