/* ============================================================
   CLIENTES – Estilos específicos
   ============================================================ */

/* ---- Stats ---- */
#stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-icon.blue   { background: #eff6ff; color: var(--primary); }
.stat-icon.green  { background: #ecfdf5; color: var(--success); }
.stat-icon.orange { background: #fff7ed; color: #f97316; }
.stat-icon.purple { background: #f5f3ff; color: #7c3aed; }

.stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--gray-800);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--gray-400);
  font-weight: 500;
}

/* ---- Toolbar ---- */
#toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}

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

#search-input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  background: var(--white);
  color: var(--gray-800);
  outline: none;
  transition: var(--transition);
}

#search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,.1);
}

#filter-tipo {
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  background: var(--white);
  color: var(--gray-800);
  cursor: pointer;
  outline: none;
  min-width: 160px;
}

/* ---- Table ---- */
#table-wrap {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

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

thead {
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
}

thead th {
  padding: 14px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.8);
  letter-spacing: .4px;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--transition);
}

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

tbody td {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--gray-800);
  vertical-align: middle;
}

.td-num {
  font-size: 11px;
  color: var(--gray-400);
  font-weight: 600;
}

.td-name { font-weight: 600; }

.td-contact {
  font-size: 12px;
  line-height: 1.7;
  color: var(--gray-600);
}

.td-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
  white-space: nowrap;
}

.td-credit { font-weight: 700; color: var(--success); }

.td-actions { white-space: nowrap; }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
}

.btn-view { background: var(--primary-light); color: var(--primary); }
.btn-view:hover { background: var(--primary); color: var(--white); }

.btn-delete { background: #fff0f0; color: var(--danger); margin-left: 6px; }
.btn-delete:hover { background: var(--danger); color: var(--white); }

/* ---- States ---- */
.state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 20px;
  gap: 14px;
  color: var(--gray-400);
  font-size: 15px;
}

.state-box i { font-size: 40px; }

/* ---- Paginação ---- */
#pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 40px;
}

#page-info {
  font-size: 14px;
  color: var(--gray-600);
  font-weight: 500;
}

/* ---- Modal ---- */
#modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 999;
  padding: 20px;
  backdrop-filter: blur(4px);
}

#modal-overlay.hidden { display: none; }

#modal-box {
  background: var(--white);
  border-radius: 20px;
  padding: 36px;
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  animation: fadeSlide .3s ease;
}

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: var(--gray-100);
  border: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--gray-600);
  font-size: 15px;
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}

.modal-close:hover { background: var(--danger); color: var(--white); }

#modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--primary-light);
}

.modal-section {
  margin-bottom: 20px;
}

.modal-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--gray-400);
  margin-bottom: 10px;
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 20px;
}

.modal-field label {
  font-size: 11px;
  color: var(--gray-400);
  display: block;
  margin-bottom: 2px;
}

.modal-field span {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-800);
}

.modal-field.full { grid-column: span 2; }

/* ---- Responsivo ---- */
@media (max-width: 900px) {
  #stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  #stats-grid { grid-template-columns: repeat(2, 1fr); }
  #table-wrap { overflow-x: auto; }
  table { min-width: 640px; }
  #modal-box { padding: 24px 20px; }
  .modal-grid { grid-template-columns: 1fr; }
  .modal-field.full { grid-column: span 1; }
}

@media (max-width: 420px) {
  #stats-grid { grid-template-columns: 1fr; }
}
