/* ============================================================
   DP Smart Cards — Estilos globales
   panel.css cubre: panel de empresa + admin + tarjeta pública
   ============================================================ */

:root {
  --dp-color: #1a1a2e;
  --dp-radius: 14px;
  --dp-shadow: 0 4px 24px rgba(0,0,0,.10);
  --dp-border: #e5e7eb;
  --dp-bg: #f4f6fb;
  --dp-text: #1a1a2e;
  --dp-muted: #6b7280;
  --dp-success: #27ae60;
  --dp-error: #e74c3c;
  --dp-warning: #e67e22;
  --dp-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body { font-family: var(--dp-font); color: var(--dp-text); background: var(--dp-bg); }
a { color: inherit; text-decoration: none; }

/* ── Botones ─────────────────────────────────────────────── */
.dp-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 8px; font-size: 14px;
  font-weight: 500; cursor: pointer; border: 1.5px solid transparent;
  transition: opacity .15s, transform .1s; line-height: 1;
}
.dp-btn:hover { opacity: .88; }
.dp-btn:active { transform: scale(.97); }
.dp-btn-primary { background: var(--color, var(--dp-color)); color: #fff; }
.dp-btn-outline {
  background: #fff; color: var(--dp-text);
  border-color: var(--dp-border);
}
.dp-btn-outline:hover { border-color: #aaa; }
.dp-btn-sm { padding: 6px 13px; font-size: 13px; }
.dp-btn-lg { padding: 13px 28px; font-size: 15px; }
.dp-btn-block { width: 100%; justify-content: center; }

/* ── Alertas ─────────────────────────────────────────────── */
.dp-alert {
  padding: 12px 16px; border-radius: 8px;
  margin-bottom: 16px; font-size: 14px; font-weight: 500;
}
.dp-alert-success { background: #d4edda; color: #155724; border-left: 4px solid var(--dp-success); }
.dp-alert-error   { background: #fde8e8; color: #7b2020; border-left: 4px solid var(--dp-error);   }
.dp-alert-info    { background: #e8f4fd; color: #0c4a8a; border-left: 4px solid #2980b9; }

/* ═══════════════════════════════════════════════════════════
   PANEL — Navegación
   ═══════════════════════════════════════════════════════════ */
.dp-panel-nav {
  background: #fff; border-bottom: 1px solid var(--dp-border);
  position: sticky; top: 0; z-index: 100;
}
.dp-nav-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 0 24px; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
}
.dp-nav-brand { display: flex; align-items: center; gap: 10px; }
.dp-nav-logo {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--color, var(--dp-color));
  color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.dp-nav-name { font-weight: 600; font-size: 15px; }
.dp-nav-actions { display: flex; align-items: center; gap: 12px; }
.dp-nav-sub { font-size: 12px; color: var(--dp-muted); font-family: monospace; }

/* ── Panel Wrap ──────────────────────────────────────────── */
.dp-panel-wrap {
  max-width: 1100px; margin: 0 auto;
  padding: 32px 24px 60px;
}
.dp-panel-topbar {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 16px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.dp-panel-topbar h1 { font-size: 22px; font-weight: 700; }
.dp-subtitle { color: var(--dp-muted); font-size: 14px; margin-top: 2px; }
.dp-back-link { font-size: 13px; color: var(--dp-muted); display: block; margin-bottom: 4px; }
.dp-back-link:hover { color: var(--dp-text); }

/* ── Límite de plan ─────────────────────────────────────── */
.dp-limit-badge {
  background: #fef3cd; color: #856404;
  padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 500;
}
.dp-plan-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 24px;
}
.dp-plan-track {
  flex: 1; height: 6px; background: var(--dp-border);
  border-radius: 999px; overflow: hidden;
}
.dp-plan-fill { height: 100%; border-radius: 999px; transition: width .4s; }
.dp-plan-bar span { font-size: 13px; color: var(--dp-muted); white-space: nowrap; }

/* ── Grid de tarjetas ────────────────────────────────────── */
.dp-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.dp-card-item {
  background: #fff; border-radius: var(--dp-radius);
  border: 1px solid var(--dp-border); overflow: hidden;
  transition: box-shadow .2s;
}
.dp-card-item:hover { box-shadow: var(--dp-shadow); }
.dp-card-item-photo {
  width: 100%; height: 140px; overflow: hidden; background: var(--dp-bg);
  display: flex; align-items: center; justify-content: center;
}
.dp-card-item-photo img {
  width: 100%; height: 100%; object-fit: cover;
}
.dp-card-item-placeholder {
  width: 70px; height: 70px; border-radius: 50%;
  background: var(--color, var(--dp-color)); color: #fff;
  font-size: 28px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.dp-card-item-info { padding: 14px 16px 8px; }
.dp-card-item-info h3 { font-size: 16px; font-weight: 600; }
.dp-card-item-pos { font-size: 13px; color: var(--dp-muted); margin-top: 2px; }
.dp-card-item-tel { font-size: 13px; color: var(--dp-muted); margin-top: 2px; }
.dp-card-item-actions {
  padding: 10px 14px 14px;
  display: flex; flex-wrap: wrap; gap: 6px;
}

/* ── Estado vacío ────────────────────────────────────────── */
.dp-empty-state {
  text-align: center; padding: 60px 20px;
  background: #fff; border-radius: var(--dp-radius);
  border: 1px dashed var(--dp-border);
}
.dp-empty-icon { font-size: 48px; margin-bottom: 12px; }
.dp-empty-state h2 { font-size: 20px; margin-bottom: 8px; }
.dp-empty-state p { color: var(--dp-muted); margin-bottom: 20px; }

/* ═══════════════════════════════════════════════════════════
   EDITOR DE TARJETA — Layout 2 columnas
   ═══════════════════════════════════════════════════════════ */
.dp-editor-wrap { max-width: 1100px; }
.dp-editor-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 28px;
  align-items: start;
}
@media (max-width: 768px) {
  .dp-editor-layout { grid-template-columns: 1fr; }
  .dp-editor-preview-col { display: none; }
}

/* ── Secciones del formulario ────────────────────────────── */
.dp-form-section {
  background: #fff; border-radius: var(--dp-radius);
  border: 1px solid var(--dp-border);
  padding: 22px; margin-bottom: 16px;
}
.dp-form-section h3 {
  font-size: 14px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--dp-muted); margin-bottom: 16px;
}
.dp-form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
@media (max-width: 540px) { .dp-form-grid { grid-template-columns: 1fr; } }
.dp-field { display: flex; flex-direction: column; gap: 5px; }
.dp-field.dp-full { grid-column: 1 / -1; }
.dp-field label { font-size: 13px; font-weight: 600; color: #374151; }
.dp-field input {
  padding: 9px 12px; border-radius: 8px;
  border: 1.5px solid var(--dp-border); font-size: 14px;
  transition: border-color .15s; background: #fff;
}
.dp-field input:focus { outline: none; border-color: var(--color, var(--dp-color)); }
.dp-field-hint { font-size: 12px; color: var(--dp-muted); }
.dp-file-input { display: none; }

/* ── Upload de foto ──────────────────────────────────────── */
.dp-photo-upload { display: flex; gap: 20px; align-items: flex-start; }
.dp-photo-preview {
  width: 110px; height: 110px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0; border: 2px solid var(--dp-border);
  background: var(--dp-bg);
}
.dp-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.dp-photo-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px; color: var(--dp-muted);
}
.dp-photo-placeholder svg { width: 32px; height: 32px; }
.dp-photo-placeholder span { font-size: 11px; }
.dp-photo-controls { display: flex; flex-direction: column; gap: 8px; justify-content: center; }

/* ── Acciones del formulario ─────────────────────────────── */
.dp-form-actions {
  display: flex; gap: 10px; align-items: center;
  padding: 20px 0 8px;
}

/* ── Vista previa ────────────────────────────────────────── */
.dp-preview-sticky { position: sticky; top: 80px; }
.dp-preview-label { font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--dp-muted); margin-bottom: 12px; }
.dp-preview-phone {
  width: 220px; background: #111; border-radius: 28px;
  padding: 12px; box-shadow: 0 8px 32px rgba(0,0,0,.25);
}
.dp-preview-screen {
  background: #fff; border-radius: 18px; overflow: hidden;
}
.dp-mini-card {}
.dp-mini-header {
  height: 80px; display: flex; align-items: flex-end;
  justify-content: center; padding-bottom: 0;
  transition: background .3s;
}
.dp-mini-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(255,255,255,.2); border: 3px solid #fff;
  transform: translateY(32px); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px; font-weight: 700;
}
.dp-mini-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dp-mini-body { padding: 40px 12px 14px; text-align: center; }
.dp-mini-name { font-size: 13px; font-weight: 700; }
.dp-mini-pos  { font-size: 11px; color: var(--dp-muted); margin-top: 2px; }
.dp-mini-co   { font-size: 11px; color: var(--dp-muted); margin-top: 1px; }
.dp-mini-btns { display: flex; gap: 6px; justify-content: center; margin-top: 10px; }
.dp-mini-btn  {
  font-size: 10px; padding: 4px 8px; border-radius: 5px;
  color: #fff; font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════
   LOGIN
   ═══════════════════════════════════════════════════════════ */
.dp-login-body {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f4f6fb 0%, #e8eaf6 100%);
}
.dp-login-wrap { width: 100%; max-width: 420px; padding: 20px; }
.dp-login-card {
  background: #fff; border-radius: 18px;
  padding: 36px 32px; box-shadow: var(--dp-shadow);
}
.dp-login-header { text-align: center; margin-bottom: 28px; }
.dp-login-logo {
  width: 64px; height: 64px; border-radius: 16px;
  background: var(--dp-color); color: #fff;
  font-size: 22px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.dp-login-header h1 { font-size: 20px; font-weight: 700; }
.dp-login-header p { font-size: 13px; color: var(--dp-muted); margin-top: 4px; }
.dp-login-form { display: flex; flex-direction: column; gap: 16px; }
.dp-login-footer { margin-top: 20px; text-align: center; font-size: 13px; color: var(--dp-muted); }
.dp-toggle-pw {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  font-size: 12px; color: var(--dp-muted); padding: 4px 6px;
}

/* ═══════════════════════════════════════════════════════════
   TARJETA PÚBLICA
   ═══════════════════════════════════════════════════════════ */
.dp-card-body {
  background: var(--dp-bg); min-height: 100vh;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 0 0 40px;
}
.dp-card-wrapper { width: 100%; max-width: 420px; }
.dp-card {
  background: #fff;
  border-radius: 0 0 var(--dp-radius) var(--dp-radius);
  overflow: hidden;
  box-shadow: var(--dp-shadow);
}

/* Encabezado de la tarjeta */
.dp-card-header {
  height: 130px; display: flex; align-items: flex-end;
  justify-content: center; padding-bottom: 0;
  transition: background .4s;
}
.dp-avatar-ring {
  width: 100px; height: 100px; border-radius: 50%;
  border: 4px solid #fff; background: rgba(255,255,255,.15);
  transform: translateY(50px); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.dp-avatar { width: 100%; height: 100%; object-fit: cover; }
.dp-avatar-placeholder {
  background: rgba(255,255,255,.3);
  color: #fff; font-size: 36px; font-weight: 700;
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}

/* Cuerpo de la tarjeta */
.dp-card-body {
  padding: 64px 24px 24px; text-align: center;
}
.dp-name { font-size: 22px; font-weight: 700; }
.dp-position { font-size: 15px; color: var(--dp-muted); margin-top: 4px; }
.dp-company { font-size: 14px; color: var(--dp-muted); font-weight: 500; }

/* Botones de acción rápida */
.dp-actions {
  display: flex; gap: 10px; justify-content: center;
  margin: 22px 0; flex-wrap: wrap;
}
.dp-action-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 11px 18px; border-radius: 10px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: opacity .15s, transform .1s;
  border: none;
}
.dp-action-btn svg { width: 17px; height: 17px; }
.dp-action-btn:hover { opacity: .88; }
.dp-action-btn:active { transform: scale(.96); }
.dp-call     { background: #e8f5e9; color: #1b5e20; }
.dp-whatsapp { background: #e8f5e9; color: #1b5e20; }
.dp-download { color: #fff; }

/* Lista de contacto */
.dp-contact-list { text-align: left; display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }
.dp-contact-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px; background: var(--dp-bg);
  font-size: 14px; transition: background .15s;
}
.dp-contact-item:hover { background: #e9ecef; }
.dp-contact-icon {
  width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.dp-contact-icon svg { width: 16px; height: 16px; color: #fff; }

/* Redes sociales */
.dp-socials {
  display: flex; gap: 10px; justify-content: center; margin: 20px 0;
}
.dp-social-btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .15s, transform .1s;
}
.dp-social-btn svg { width: 20px; height: 20px; color: #fff; }
.dp-social-btn:hover { opacity: .85; transform: scale(1.08); }

/* QR */
.dp-qr-section { margin: 24px 0 8px; text-align: center; }
.dp-qr-label { font-size: 12px; color: var(--dp-muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.dp-qr-img { width: 140px; height: 140px; border-radius: 10px; border: 1px solid var(--dp-border); }
.dp-share-btn {
  display: block; margin: 12px auto 0;
  background: var(--dp-bg); border: 1.5px solid var(--dp-border);
  padding: 8px 20px; border-radius: 8px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background .15s;
}
.dp-share-btn:hover { background: #e5e7eb; }

/* Footer */
.dp-card-footer {
  text-align: center; padding: 14px;
  font-size: 12px; color: var(--dp-muted);
  border-top: 1px solid var(--dp-border);
}

/* ═══════════════════════════════════════════════════════════
   SUPER ADMIN (wp-admin)
   ═══════════════════════════════════════════════════════════ */
.dp-admin-wrap { max-width: 1100px; }
.dp-admin-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 16px 0 20px; flex-wrap: wrap; gap: 10px;
}
.dp-admin-header h1 { font-size: 22px; }
.dp-admin-table { border-radius: 10px !important; overflow: hidden; }
.dp-admin-table th { background: #f9fafb !important; font-size: 13px; }
.dp-admin-table td { font-size: 13px; vertical-align: middle; }
.dp-admin-form { max-width: 700px; }
.dp-form-section { margin-bottom: 24px; }
.dp-form-section h3 { margin-bottom: 14px; font-size: 15px; }
.dp-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dp-form-grid label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.dp-form-grid input, .dp-form-grid select { width: 100%; padding: 8px 10px; border-radius: 6px; border: 1px solid #ddd; }
.dp-form-grid small { font-size: 12px; color: #666; margin-top: 3px; display: block; }
