/* cert.css - contactos estilo dashboard premium */

:root{
  --bg-1: #07111f;
  --bg-2: #0c1729;
  --bg-3: #12233a;

  --glass: rgba(255,255,255,0.08);
  --glass-2: rgba(255,255,255,0.12);
  --panel: rgba(14, 25, 43, 0.78);
  --panel-2: rgba(17, 32, 54, 0.92);
  --panel-solid: #0f1c30;

  --text: #edf4ff;
  --text-2: #c8d7ee;
  --muted: #8ea2c2;
  --muted-2: #6f84a6;

  --line: rgba(255,255,255,0.08);
  --line-2: rgba(255,255,255,0.14);

  --primary: #5b8cff;
  --primary-2: #7a5cff;
  --primary-3: #4fd1ff;

  --success: #29d3a1;
  --warning: #ffbe5c;
  --danger: #ff6b7a;

  --badge-company-bg: rgba(91, 140, 255, 0.16);
  --badge-company-bd: rgba(91, 140, 255, 0.34);
  --badge-company-tx: #cfe0ff;

  --badge-person-bg: rgba(41, 211, 161, 0.14);
  --badge-person-bd: rgba(41, 211, 161, 0.32);
  --badge-person-tx: #c7fff0;

  --badge-parent-bg: rgba(255, 190, 92, 0.14);
  --badge-parent-bd: rgba(255, 190, 92, 0.30);
  --badge-parent-tx: #ffe6b8;

  --shadow-sm: 0 10px 30px rgba(0,0,0,0.18);
  --shadow-md: 0 20px 60px rgba(0,0,0,0.28);
  --shadow-lg: 0 28px 80px rgba(0,0,0,0.34);

  --radius-xs: 12px;
  --radius-sm: 16px;
  --radius: 22px;
  --radius-lg: 28px;
}

*{
  box-sizing: border-box;
}

html, body{
  min-height: 100%;
}

body{
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 0% 0%, rgba(91,140,255,0.20) 0%, transparent 30%),
    radial-gradient(circle at 100% 0%, rgba(79,209,255,0.14) 0%, transparent 26%),
    radial-gradient(circle at 50% 100%, rgba(122,92,255,0.16) 0%, transparent 30%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 45%, var(--bg-3) 100%);
  line-height: 1.45;
}

/* =========================
   LAYOUT
   ========================= */

.container{
  max-width: 1480px;
  margin: 0 auto;
  padding: 2% 0%;
}

/* =========================
   TOPBAR
   ========================= */

.topbar{
  position: static;
  z-index: 1000;
  margin-bottom: 20px;
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.04) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-md);
}

.title{
  font-size: 30px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.20);
}

/* =========================
   CARDS / PANELS
   ========================= */

.card{
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(20,35,59,0.95) 0%, rgba(13,24,40,0.96) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card::before{
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,0.28), rgba(255,255,255,0.04));
  pointer-events: none;
}

.search-card{
  padding: 18px;
  margin-bottom: 16px;
}

.result-card{
  padding: 16px 18px;
  margin-bottom: 18px;
}

/* =========================
   TEXT UTILS
   ========================= */

.muted{
  color: var(--muted);
}

.small{
  font-size: 12px;
}

.empty{
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
}

/* =========================
   ROWS
   ========================= */

.row{
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@media (min-width: 760px){
  .row{
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.left{
  min-width: 0;
}

.right{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.result-card h3{
  margin: 0 0 4px 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

/* =========================
   PILL
   ========================= */

.pill{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

/* =========================
   SEARCHBAR
   ========================= */

.searchbar{
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: end;
}

@media (max-width: 860px){
  .searchbar{
    grid-template-columns: 1fr;
  }
}

label{
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--muted);
}

input[type=text],
input[type=date],
select,
textarea{
  width: 100%;
  min-height: 56px;
  padding: 15px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.04) 100%);
  color: #fff;
  outline: none;
  font-size: 15px;
  transition: transform .12s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

input[type=text]::placeholder,
textarea::placeholder{
  color: #88a0c3;
}

input[type=text]:focus,
input[type=date]:focus,
select:focus,
textarea:focus{
  border-color: rgba(91,140,255,0.58);
  box-shadow:
    0 0 0 4px rgba(91,140,255,0.12),
    0 10px 28px rgba(26, 58, 118, 0.28);
  transform: translateY(-1px);
}

.help{
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(91,140,255,0.18);
  background: rgba(91,140,255,0.08);
  color: #bfd1f7;
  font-size: 12px;
}

/* =========================
   BUTTONS
   ========================= */

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 18px;
  border-radius: 18px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .01em;
  transition: transform .08s ease, box-shadow .16s ease, border-color .16s ease, opacity .16s ease, background .16s ease;
}

.btn:hover{
  opacity: 1;
  transform: translateY(-1px);
}

.btn:active{
  transform: translateY(1px);
}

.btn-primary{
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 52%, var(--primary-3) 100%);
  box-shadow:
    0 12px 30px rgba(91,140,255,0.28),
    inset 0 1px 0 rgba(255,255,255,0.16);
}

.btn-primary:hover{
  box-shadow:
    0 18px 34px rgba(91,140,255,0.34),
    inset 0 1px 0 rgba(255,255,255,0.20);
}

.btn-secondary{
  color: #eaf2ff;
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.btn-secondary:hover{
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.18);
}

/* =========================
   PAGINATION
   ========================= */

.pagination{
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* =========================
   CONTACTOS ESTILO TABLA MODERNA
   ========================= */

.contacts-sheet-wrap{
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.09);
  background:
    linear-gradient(180deg, rgba(18,31,52,0.96) 0%, rgba(11,22,37,0.98) 100%);
  box-shadow: var(--shadow-md);
}

.contacts-sheet-wrap::before{
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-2) 50%, var(--primary-3) 100%);
  z-index: 2;
}

.contacts-sheet-scroll{
  width: 100%;
  overflow-x: auto;
  overflow-y: auto;
}

.contacts-sheet-scroll::-webkit-scrollbar{
  height: 12px;
  width: 12px;
}

.contacts-sheet-scroll::-webkit-scrollbar-track{
  background: rgba(255,255,255,0.03);
}

.contacts-sheet-scroll::-webkit-scrollbar-thumb{
  background: linear-gradient(180deg, rgba(91,140,255,0.45), rgba(79,209,255,0.45));
  border-radius: 999px;
}

.contacts-sheet{
  width: 100%;
  min-width: 1280px;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--text-2);
  font-size: 13px;
}

/* cabecera premium */
.contacts-sheet thead th{
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 16px 14px;
  text-align: left;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #cfe0ff;
  background:
    linear-gradient(180deg, rgba(22,38,63,0.98) 0%, rgba(16,29,48,0.98) 100%);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  border-right: 1px solid rgba(255,255,255,0.05);
  backdrop-filter: blur(12px);
}

/* celdas */
.contacts-sheet tbody td{
  padding: 14px 14px;
  vertical-align: middle;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  border-right: 1px solid rgba(255,255,255,0.04);
  background: transparent;
  line-height: 1.35;
  transition: background .14s ease, transform .10s ease;
}

/* zebra sutil */
.contacts-sheet tbody tr:nth-child(even) td{
  background: rgba(255,255,255,0.015);
}

/* hover moderno */
.contacts-sheet tbody tr:hover td{
  background: rgba(91,140,255,0.08);
}

/* nombre más potente */
.contacts-sheet tbody td.col-name{
  font-weight: 800;
  font-size: 14px;
  color: #ffffff;
  letter-spacing: -0.01em;
}

/* columnas más compactas */
.contacts-sheet .col-type,
.contacts-sheet .col-city,
.contacts-sheet .col-vat,
.contacts-sheet .col-phone,
.contacts-sheet .col-mobile{
  white-space: nowrap;
}

.contacts-sheet .col-email{
  word-break: break-word;
}

/* última columna sin borde */
.contacts-sheet thead th:last-child,
.contacts-sheet tbody td:last-child{
  border-right: 0;
}

/* última fila sin borde */
.contacts-sheet tbody tr:last-child td{
  border-bottom: 0;
}

/* vacío */
.cell-empty{
  color: var(--muted-2);
}

/* enlaces */
.contacts-sheet a{
  color: #d8e6ff;
  text-decoration: none;
  transition: color .14s ease, opacity .14s ease;
}

.contacts-sheet a:hover{
  color: #ffffff;
  text-decoration: underline;
}

/* =========================
   BADGES MODERNOS
   ========================= */

.sheet-badge{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .01em;
  white-space: nowrap;
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.sheet-badge.company{
  background: var(--badge-company-bg);
  border-color: var(--badge-company-bd);
  color: var(--badge-company-tx);
}

.sheet-badge.person{
  background: var(--badge-person-bg);
  border-color: var(--badge-person-bd);
  color: var(--badge-person-tx);
}

.sheet-badge.parent{
  background: var(--badge-parent-bg);
  border-color: var(--badge-parent-bd);
  color: var(--badge-parent-tx);
}

/* =========================
   MOBILE
   ========================= */

@media (max-width: 860px){
  .container{
    padding: 5%;
  }

  .topbar{
    padding: 16px;
    border-radius: 22px;
  }

  .title{
    font-size: 24px;
  }

  .search-card,
  .result-card{
    padding: 14px;
  }

  .btn{
    width: 100%;
  }

  .contacts-sheet{
    min-width: 1080px;
  }
}


/* =========================
   MOBILE: SOLO NOMBRE, TELÉFONO, MÓVIL, EMAIL
   ========================= */

@media (max-width: 640px){
  .contacts-sheet{
    min-width: 640px;
  }

  .contacts-sheet .col-select,
  .contacts-sheet .col-parent,
  .contacts-sheet .col-type,
  .contacts-sheet .col-city,
  .contacts-sheet .col-address,
  .contacts-sheet .col-vat,
  .contacts-sheet .col-tags{
    display: none;
  }

  .contacts-sheet thead .col-select,
  .contacts-sheet tbody .col-select,
  .contacts-sheet thead .col-parent,
  .contacts-sheet tbody .col-parent,
  .contacts-sheet thead .col-type,
  .contacts-sheet tbody .col-type,
  .contacts-sheet thead .col-city,
  .contacts-sheet tbody .col-city,
  .contacts-sheet thead .col-address,
  .contacts-sheet tbody .col-address,
  .contacts-sheet thead .col-vat,
  .contacts-sheet tbody .col-vat,
  .contacts-sheet thead .col-tags,
  .contacts-sheet tbody .col-tags{
    display: none;
  }

  .contacts-sheet thead th,
  .contacts-sheet tbody td{
    padding: 12px 10px;
  }

  .contacts-sheet .col-name{
    min-width: 180px;
  }

  .contacts-sheet .col-phone,
  .contacts-sheet .col-mobile,
  .contacts-sheet .col-email{
    min-width: 150px;
  }
}