/* ========================================================================
   contactos.domatigroup.com — shared styles
   Mirrors landing-domatigroup palette + spacing for visual consistency.
   ======================================================================== */

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

:root {
  --orange: #F39B26;
  --orange-dark: #D4831A;
  --orange-light: #FFB54D;
  --orange-pale: #FFF4E3;
  --blue-darker: #0F3A6B;
  --blue-dark: #1E5FA5;
  --blue: #2C7CB8;
  --blue-light: #4FA8DD;
  --blue-pale: #E8F2FB;
  --bg: #F7FAFC;
  --bg-soft: #FAFCFE;
  --surface: #FFFFFF;
  --text: #0F1B2E;
  --text-soft: #5A7A8F;
  --text-mute: #94A3B8;
  --border: #E2E8F0;
  --border-strong: #CBD5E0;
  --whatsapp: #25D366;
  --danger: #DC2626;
  --success: #16A34A;
  --shadow-sm: 0 1px 3px rgba(15, 27, 46, 0.04), 0 1px 2px rgba(15, 27, 46, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 58, 107, 0.08), 0 2px 4px rgba(15, 58, 107, 0.04);
  --shadow-lg: 0 24px 48px rgba(15, 58, 107, 0.14), 0 8px 16px rgba(15, 58, 107, 0.08);
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }

/* ─── Header ─── */
.topbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  color: var(--blue-darker);
  font-size: 17px;
  letter-spacing: -0.01em;
}
.brand img { height: 32px; width: auto; }
.brand-back {
  font-size: 13px;
  color: var(--text-soft);
  padding: 6px 12px;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}
.brand-back:hover { background: var(--blue-pale); color: var(--blue-dark); }

/* ─── Container ─── */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* ─── Hero text ─── */
.page-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(243, 155, 38, 0.10);
  color: var(--orange-dark);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.page-title {
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 800;
  color: var(--blue-darker);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 10px;
}
.page-subtitle {
  font-size: 15px;
  color: var(--text-soft);
  margin-bottom: 32px;
}

/* ─── Contact list (linktree style on /) ─── */
.contact-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}
.contact-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--blue-light);
}
.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--blue-pale);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--blue-dark);
  font-size: 18px;
  letter-spacing: -0.02em;
  border: 2px solid var(--border);
}
.contact-info { flex: 1; min-width: 0; }
.contact-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contact-meta {
  font-size: 13px;
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contact-chip-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.contact-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--blue-pale);
  color: var(--blue-dark);
}
.contact-arrow {
  color: var(--text-mute);
  flex-shrink: 0;
  transition: transform 0.2s, color 0.2s;
}
.contact-card:hover .contact-arrow { transform: translateX(4px); color: var(--blue-dark); }

/* ─── Profile (single) ─── */
.profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 16px 24px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}
.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--blue-pale);
  border: 4px solid var(--surface);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 38px;
  color: var(--blue-dark);
  margin-bottom: 16px;
}
.profile-name {
  font-size: 26px;
  font-weight: 800;
  color: var(--blue-darker);
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.profile-cargo {
  font-size: 15px;
  color: var(--text-soft);
  margin-top: 4px;
}
.profile-departamento {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 12px;
  background: var(--blue-pale);
  color: var(--blue-dark);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}
.action {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  transition: all 0.2s;
}
.action:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.action-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.action-icon.whatsapp { background: rgba(37, 211, 102, 0.12); color: var(--whatsapp); }
.action-icon.email    { background: var(--orange-pale);          color: var(--orange-dark); }
.action-icon.phone    { background: var(--blue-pale);             color: var(--blue-dark); }
.action-icon.vcard    {
  background: linear-gradient(135deg, var(--blue-darker), var(--blue-dark));
  color: white;
}
.action-text { flex: 1; min-width: 0; }
.action-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.action-value {
  font-size: 15px;
  color: var(--text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.action.primary {
  background: linear-gradient(135deg, var(--blue-darker), var(--blue-dark));
  color: white;
  border: none;
  padding: 18px;
  margin-top: 4px;
  font-size: 16px;
  justify-content: center;
}
.action.primary:hover {
  box-shadow: 0 10px 28px rgba(30, 95, 165, 0.30);
}
.action.primary .action-icon {
  background: rgba(255, 255, 255, 0.18);
  color: white;
}
.action.primary .action-value { color: white; }
.action.primary .action-label { color: rgba(255, 255, 255, 0.7); }

/* ─── Empty / loading / error ─── */
.empty-state, .loading-state, .error-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-soft);
}
.empty-state-icon {
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  background: var(--blue-pale);
  color: var(--blue-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.error-state { color: var(--danger); }
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--blue-dark);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Footer ─── */
.page-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-mute);
  text-align: center;
}
.page-footer a { color: var(--text-soft); }
.page-footer a:hover { color: var(--blue-dark); }

/* ─── Admin ─── */
.admin-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}
.admin-login {
  max-width: 420px;
  margin: 48px auto;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  text-align: center;
}
.btn-google {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: white;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 20px;
}
.btn-google:hover { border-color: var(--blue-light); box-shadow: var(--shadow-md); }
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.admin-search {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
}
.admin-search:focus { outline: none; border-color: var(--blue-light); box-shadow: 0 0 0 3px var(--blue-pale); }
.admin-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--blue-pale);
  color: var(--blue-dark);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
.btn-link {
  background: none;
  border: none;
  color: var(--blue-dark);
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}
.btn-link:hover { text-decoration: underline; }

.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.admin-table th, .admin-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.admin-table th {
  background: var(--bg-soft);
  font-weight: 700;
  color: var(--text-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr.is-on { background: rgba(22, 163, 74, 0.04); }
.admin-row-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--blue-pale);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--blue-dark);
  font-size: 13px;
  margin-right: 10px;
  vertical-align: middle;
}
.admin-slug-input {
  width: 100%;
  max-width: 220px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}
.admin-slug-input:disabled { opacity: 0.5; background: var(--bg-soft); }
.admin-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.admin-toggle input { opacity: 0; width: 0; height: 0; }
.admin-toggle .slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--border-strong);
  transition: 0.2s;
  border-radius: 24px;
}
.admin-toggle .slider::before {
  position: absolute;
  content: '';
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background: white;
  transition: 0.2s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.admin-toggle input:checked + .slider { background: var(--success); }
.admin-toggle input:checked + .slider::before { transform: translateX(20px); }
.admin-action-btn {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-soft);
  transition: all 0.2s;
  margin-left: 6px;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.2;
}
.admin-action-btn:hover { border-color: var(--blue-light); color: var(--blue-dark); }
.admin-action-btn.preview { color: var(--blue-dark); border-color: var(--blue-light); }
.admin-table td:last-child { white-space: nowrap; min-width: 100px; text-align: right; }
.admin-saving { font-size: 11px; color: var(--text-mute); margin-left: 8px; }
.admin-saved  { font-size: 11px; color: var(--success); margin-left: 8px; }
.admin-error  { font-size: 11px; color: var(--danger); margin-left: 8px; }

/* ─── Responsive ─── */
@media (max-width: 680px) {
  .admin-table { font-size: 13px; }
  .admin-table th, .admin-table td { padding: 10px 8px; }
  .hide-mobile { display: none; }
  .profile-avatar { width: 100px; height: 100px; font-size: 32px; }
  .profile-name { font-size: 22px; }
}
