/* ═══════════════════════════════════════════════════════
   FACTURA MAYA PRO – CSS Completo v5.0
   Compatible: WordPress · Tema Astra · Hostinger
   ═══════════════════════════════════════════════════════ */

/* ─── VARIABLES ───────────────────────────────────────── */
:root {
  --fmp-bg:          #f1f5f9;
  --fmp-surface:     #ffffff;
  --fmp-surface2:    #f8fafc;
  --fmp-border:      #e2e8f0;
  --fmp-navy:        #1e3a5f;
  --fmp-navy2:       #0f172a;
  --fmp-blue:        #2563eb;
  --fmp-accent:      #2563eb;
  --fmp-sky:         #0ea5e9;
  --fmp-green:       #16a34a;
  --fmp-green-bg:    #f0fdf4;
  --fmp-red:         #dc2626;
  --fmp-red-bg:      #fef2f2;
  --fmp-yellow:      #ca8a04;
  --fmp-yellow-bg:   #fefce8;
  --fmp-orange:      #ea580c;
  --fmp-text:        #0f172a;
  --fmp-text2:       #334155;
  --fmp-text3:       #64748b;
  --fmp-text4:       #94a3b8;
  --fmp-radius:      12px;
  --fmp-radius-sm:   8px;
  --fmp-shadow:      0 2px 12px rgba(0,0,0,.07);
  --fmp-shadow-md:   0 4px 24px rgba(0,0,0,.1);
  --fmp-shadow-lg:   0 8px 40px rgba(0,0,0,.14);
  --fmp-font:        'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --fmp-trans:       0.18s ease;
}

[data-tema="dark"], .fmp-app.dark {
  --fmp-bg:        #0f172a;
  --fmp-surface:   #1e293b;
  --fmp-surface2:  #1a2744;
  --fmp-border:    #334155;
  --fmp-text:      #f1f5f9;
  --fmp-text2:     #cbd5e1;
  --fmp-text3:     #94a3b8;
  --fmp-text4:     #64748b;
}

/* ─── RESET / BASE ────────────────────────────────────── */
.fmp-app *, .fmp-admin-wrapper * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
.fmp-app, .fmp-admin-wrapper {
  font-family: var(--fmp-font);
  font-size: 14px;
  color: var(--fmp-text);
  background: var(--fmp-bg);
  min-height: 100vh;
  line-height: 1.6;
}

/* ─── LAYOUT ──────────────────────────────────────────── */
.fmp-layout {
  display: flex;
  min-height: 100vh;
}
.fmp-sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--fmp-navy2);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
  transition: transform var(--fmp-trans);
}
.fmp-sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.fmp-sidebar-logo .brand {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.3px;
}
.fmp-sidebar-logo .brand span { color: #60a5fa; }
.fmp-sidebar-logo .version {
  font-size: 10px;
  color: rgba(255,255,255,.3);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 2px;
}
.fmp-nav { flex: 1; padding: 12px 0; }
.fmp-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,.7);
  cursor: pointer;
  border-radius: 0;
  transition: all var(--fmp-trans);
  font-size: 13.5px;
  font-weight: 500;
  border-left: 3px solid transparent;
  text-decoration: none;
}
.fmp-nav-item:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
}
.fmp-nav-item.active {
  background: rgba(37,99,235,.2);
  color: #fff;
  border-left-color: #2563eb;
}
.fmp-nav-item .ico { font-size: 16px; width: 20px; text-align: center; }
.fmp-nav-group-label {
  padding: 14px 20px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
}
.fmp-sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 12px;
  color: rgba(255,255,255,.3);
}
.fmp-main {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.fmp-topbar {
  background: var(--fmp-surface);
  border-bottom: 1px solid var(--fmp-border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 6px rgba(0,0,0,.04);
}
.fmp-topbar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--fmp-text);
}
.fmp-topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.fmp-content {
  padding: 24px;
  flex: 1;
}
.fmp-badge-timbres {
  background: var(--fmp-navy);
  color: #fff;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
}
.fmp-badge-plan {
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ─── CARDS ───────────────────────────────────────────── */
.fmp-card {
  background: var(--fmp-surface);
  border: 1px solid var(--fmp-border);
  border-radius: var(--fmp-radius);
  box-shadow: var(--fmp-shadow);
  overflow: hidden;
}
.fmp-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--fmp-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.fmp-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--fmp-text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.fmp-card-body { padding: 20px; }
.fmp-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.fmp-stat-card {
  background: var(--fmp-surface);
  border: 1px solid var(--fmp-border);
  border-radius: var(--fmp-radius);
  padding: 18px;
  box-shadow: var(--fmp-shadow);
}
.fmp-stat-card .label {
  font-size: 11px;
  font-weight: 600;
  color: var(--fmp-text3);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 6px;
}
.fmp-stat-card .value {
  font-size: 28px;
  font-weight: 800;
  color: var(--fmp-text);
  line-height: 1;
}
.fmp-stat-card .sub {
  font-size: 11px;
  color: var(--fmp-text4);
  margin-top: 4px;
}
.fmp-stat-card.green  { border-left: 4px solid var(--fmp-green);  }
.fmp-stat-card.blue   { border-left: 4px solid var(--fmp-blue);   }
.fmp-stat-card.yellow { border-left: 4px solid var(--fmp-yellow); }
.fmp-stat-card.red    { border-left: 4px solid var(--fmp-red);    }
.fmp-stat-card.navy   { border-left: 4px solid var(--fmp-navy);   }

/* ─── FORMULARIOS ─────────────────────────────────────── */
.fmp-form-group { margin-bottom: 16px; }
.fmp-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--fmp-text2);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.fmp-label .req { color: var(--fmp-red); margin-left: 2px; }
.fmp-input, .fmp-select, .fmp-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--fmp-border);
  border-radius: var(--fmp-radius-sm);
  background: var(--fmp-surface);
  color: var(--fmp-text);
  font-size: 14px;
  font-family: var(--fmp-font);
  transition: border-color var(--fmp-trans), box-shadow var(--fmp-trans);
  outline: none;
  line-height: 1.5;
}
.fmp-input:focus, .fmp-select:focus, .fmp-textarea:focus {
  border-color: var(--fmp-blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.fmp-input.error { border-color: var(--fmp-red); background: var(--fmp-red-bg); }
.fmp-input-wrap { position: relative; }
/* Ojo de contraseña */
.fmp-eye-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--fmp-text3);
  font-size: 16px;
  padding: 4px;
  line-height: 1;
}
.fmp-eye-btn:hover { color: var(--fmp-blue); }
.fmp-input-wrap .fmp-input { padding-right: 40px; }
.fmp-textarea { min-height: 96px; resize: vertical; }
.fmp-select { cursor: pointer; }
.fmp-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fmp-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.fmp-field-error { color: var(--fmp-red); font-size: 11px; margin-top: 4px; }

/* Upload drag-drop */
.fmp-upload-zone {
  border: 2px dashed var(--fmp-border);
  border-radius: var(--fmp-radius-sm);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--fmp-trans);
  color: var(--fmp-text3);
  font-size: 13px;
}
.fmp-upload-zone:hover, .fmp-upload-zone.dragover {
  border-color: var(--fmp-blue);
  background: rgba(37,99,235,.04);
  color: var(--fmp-blue);
}
.fmp-upload-zone .ico { font-size: 28px; margin-bottom: 8px; }

/* ─── BOTONES ─────────────────────────────────────────── */
.fmp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--fmp-radius-sm);
  border: none;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--fmp-trans);
  font-family: var(--fmp-font);
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
.fmp-btn:disabled { opacity: .5; cursor: not-allowed; }
.fmp-btn-primary {
  background: linear-gradient(135deg, var(--fmp-navy), var(--fmp-blue));
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,.3);
}
.fmp-btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #162c4a, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37,99,235,.4);
}
.fmp-btn-success {
  background: linear-gradient(135deg, #15803d, var(--fmp-green));
  color: #fff;
  box-shadow: 0 2px 8px rgba(22,163,74,.3);
}
.fmp-btn-success:hover:not(:disabled) {
  background: linear-gradient(135deg, #14532d, #15803d);
  transform: translateY(-1px);
}
.fmp-btn-danger  { background: var(--fmp-red);    color: #fff; }
.fmp-btn-warning { background: var(--fmp-yellow);  color: #fff; }
.fmp-btn-ghost {
  background: transparent;
  border: 1.5px solid var(--fmp-border);
  color: var(--fmp-text2);
}
.fmp-btn-ghost:hover { border-color: var(--fmp-blue); color: var(--fmp-blue); }
.fmp-btn-sm { padding: 6px 12px; font-size: 12px; }
.fmp-btn-lg { padding: 13px 28px; font-size: 15px; }
.fmp-btn-full { width: 100%; }
.fmp-btn-icon { padding: 8px; border-radius: var(--fmp-radius-sm); }

/* ─── TABLA ───────────────────────────────────────────── */
.fmp-table-wrap { overflow-x: auto; border-radius: var(--fmp-radius); }
.fmp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--fmp-surface);
}
.fmp-table th {
  background: var(--fmp-surface2);
  padding: 10px 14px;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--fmp-text3);
  text-align: left;
  border-bottom: 1px solid var(--fmp-border);
  white-space: nowrap;
}
.fmp-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--fmp-border);
  color: var(--fmp-text2);
  vertical-align: middle;
}
.fmp-table tr:last-child td { border-bottom: none; }
.fmp-table tr:hover td { background: var(--fmp-surface2); }
.fmp-table .rfc { font-family: 'Courier New', monospace; font-weight: 700; font-size: 12px; }
.fmp-table .uuid { font-family: 'Courier New', monospace; font-size: 10px; color: var(--fmp-text3); }

/* ─── BADGES ──────────────────────────────────────────── */
.fmp-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.fmp-badge-green  { background: var(--fmp-green-bg);  color: var(--fmp-green);  }
.fmp-badge-red    { background: var(--fmp-red-bg);    color: var(--fmp-red);    }
.fmp-badge-yellow { background: var(--fmp-yellow-bg); color: var(--fmp-yellow); }
.fmp-badge-blue   { background: #eff6ff;              color: var(--fmp-blue);   }
.fmp-badge-gray   { background: #f1f5f9;              color: var(--fmp-text3);  }

/* ─── ALERTAS ─────────────────────────────────────────── */
.fmp-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--fmp-radius-sm);
  font-size: 13px;
  line-height: 1.5;
}
.fmp-alert-success { background: var(--fmp-green-bg);  color: #15803d; border: 1px solid #bbf7d0; }
.fmp-alert-error   { background: var(--fmp-red-bg);    color: #991b1b; border: 1px solid #fecaca; }
.fmp-alert-warn    { background: var(--fmp-yellow-bg); color: #92400e; border: 1px solid #fde68a; }
.fmp-alert-info    { background: #eff6ff;              color: #1e40af; border: 1px solid #bfdbfe; }

/* ─── MODAL ───────────────────────────────────────────── */
.fmp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
  animation: fmpFadeIn .15s ease;
}
@keyframes fmpFadeIn { from { opacity: 0; } to { opacity: 1; } }
.fmp-modal {
  background: var(--fmp-surface);
  border-radius: var(--fmp-radius);
  box-shadow: var(--fmp-shadow-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: fmpSlideUp .18s ease;
}
@keyframes fmpSlideUp { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.fmp-modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--fmp-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.fmp-modal-title { font-size: 16px; font-weight: 700; }
.fmp-modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 20px; color: var(--fmp-text3);
  line-height: 1; padding: 4px;
  border-radius: 6px;
}
.fmp-modal-close:hover { color: var(--fmp-red); background: var(--fmp-red-bg); }
.fmp-modal-body    { padding: 20px; }
.fmp-modal-footer  { padding: 16px 20px; border-top: 1px solid var(--fmp-border); display: flex; gap: 10px; justify-content: flex-end; }

/* ─── TABS ────────────────────────────────────────────── */
.fmp-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--fmp-border);
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.fmp-tabs::-webkit-scrollbar { display: none; }
.fmp-tab {
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fmp-text3);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all var(--fmp-trans);
  font-family: var(--fmp-font);
  display: flex;
  align-items: center;
  gap: 6px;
}
.fmp-tab:hover { color: var(--fmp-blue); }
.fmp-tab.active { color: var(--fmp-blue); border-bottom-color: var(--fmp-blue); }

/* ─── LOADER / SPINNER ────────────────────────────────── */
.fmp-spinner {
  width: 20px; height: 20px;
  border: 3px solid rgba(255,255,255,.3);
  border-top: 3px solid #fff;
  border-radius: 50%;
  animation: fmpSpin 0.8s linear infinite;
  display: inline-block;
}
.fmp-spinner-dark {
  border-color: var(--fmp-border);
  border-top-color: var(--fmp-blue);
}
@keyframes fmpSpin { to { transform: rotate(360deg); } }
.fmp-loading-bar {
  height: 3px;
  background: linear-gradient(90deg, var(--fmp-blue), var(--fmp-sky));
  border-radius: 2px;
  animation: fmpLoadBar 1.5s ease-in-out infinite;
  margin-bottom: 16px;
}
@keyframes fmpLoadBar { 0%,100%{width:0;opacity:0} 50%{width:100%;opacity:1} }

/* ─── AUTENTICACIÓN ───────────────────────────────────── */
.fmp-auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #0f172a 100%);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.fmp-auth-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Ccircle cx='30' cy='30' r='1'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.fmp-auth-box {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
  position: relative;
}
.fmp-auth-header {
  background: linear-gradient(135deg, #0f172a, #1e3a5f);
  padding: 30px 32px 26px;
  text-align: center;
}
.fmp-auth-logo  { font-size: 26px; font-weight: 800; color: #fff; letter-spacing: -.5px; }
.fmp-auth-logo span { color: #60a5fa; }
.fmp-auth-sub { font-size: 11px; color: rgba(255,255,255,.4); margin-top: 3px; letter-spacing: 1.2px; text-transform: uppercase; }
.fmp-auth-body { padding: 28px 32px; }
.fmp-auth-tabs { display: flex; border-bottom: 2px solid #e2e8f0; margin-bottom: 22px; }
.fmp-auth-tab {
  flex: 1; text-align: center; padding: 9px;
  font-size: 13px; font-weight: 700;
  cursor: pointer; color: #94a3b8;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .15s;
  background: none; border-top: none; border-left: none; border-right: none;
  font-family: var(--fmp-font);
}
.fmp-auth-tab.active { color: #1e3a5f; border-bottom-color: #1e3a5f; }
.fmp-turnstile-wrap { display: flex; justify-content: center; margin: 12px 0; }
.fmp-codigo-inputs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 16px 0;
}
.fmp-codigo-input {
  width: 46px; height: 56px;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  border: 2px solid var(--fmp-border);
  border-radius: 10px;
  font-family: 'Courier New', monospace;
  color: var(--fmp-navy);
  transition: border-color .15s, box-shadow .15s;
  background: var(--fmp-surface);
}
.fmp-codigo-input:focus {
  border-color: var(--fmp-blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
  outline: none;
}
.fmp-timer { text-align: center; font-size: 12px; color: var(--fmp-red); font-weight: 700; margin: 8px 0; }
.fmp-auth-footer {
  padding: 16px 32px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
}

/* ─── FACTURA FORM ────────────────────────────────────── */
.fmp-fact-form { max-width: 900px; margin: 0 auto; }
.fmp-resumen-fiscal {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border: 1px solid #bae6fd;
  border-radius: var(--fmp-radius);
  padding: 18px 20px;
  margin-top: 16px;
}
.fmp-resumen-row {
  display: flex; justify-content: space-between;
  align-items: center; padding: 5px 0;
  font-size: 14px; border-bottom: 1px solid rgba(186,230,253,.5);
}
.fmp-resumen-row:last-child { border-bottom: none; }
.fmp-resumen-row.total {
  font-size: 20px; font-weight: 800;
  color: var(--fmp-navy); margin-top: 8px; padding-top: 10px;
  border-top: 2px solid #93c5fd;
  border-bottom: none;
}
.fmp-resumen-row .label { color: var(--fmp-text3); }
.fmp-resumen-row .ret   { color: var(--fmp-red); }
.fmp-resumen-row .iva   { color: var(--fmp-blue); }
.fmp-base-legal {
  font-size: 10px; color: var(--fmp-text4);
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid rgba(186,230,253,.5);
  line-height: 1.6;
}
.fmp-ia-bar {
  display: flex; gap: 10px;
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
  border-radius: var(--fmp-radius);
  padding: 14px 16px;
  margin-bottom: 20px;
  align-items: center;
}
.fmp-ia-bar input {
  flex: 1; border: none; background: rgba(255,255,255,.15);
  color: #fff; padding: 10px 14px; border-radius: 8px;
  font-size: 14px; font-family: var(--fmp-font);
}
.fmp-ia-bar input::placeholder { color: rgba(255,255,255,.5); }
.fmp-ia-bar input:focus { outline: none; background: rgba(255,255,255,.2); }
.fmp-69b-warn {
  background: #7f1d1d; color: #fca5a5;
  border-radius: var(--fmp-radius-sm);
  padding: 12px 16px; font-size: 13px;
  margin: 10px 0; display: flex; gap: 8px;
  align-items: flex-start;
}

/* ─── SIDEBAR MÓVIL TOGGLE ────────────────────────────── */
.fmp-menu-toggle {
  display: none;
  background: var(--fmp-navy);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: var(--fmp-radius-sm);
  cursor: pointer;
  font-size: 18px;
}

/* ─── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 900px) {
  .fmp-sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .fmp-sidebar.open {
    transform: none;
    box-shadow: var(--fmp-shadow-lg);
  }
  .fmp-main        { margin-left: 0; }
  .fmp-menu-toggle { display: inline-flex; }
  .fmp-stats-grid  { grid-template-columns: repeat(2, 1fr); }
  .fmp-grid-3      { grid-template-columns: 1fr 1fr; }
  .fmp-content     { padding: 16px; }
  .fmp-modal       { max-width: 100%; }
}
@media (max-width: 540px) {
  .fmp-stats-grid  { grid-template-columns: 1fr 1fr; }
  .fmp-grid-2, .fmp-grid-3 { grid-template-columns: 1fr; }
  .fmp-auth-body   { padding: 20px; }
  .fmp-auth-header { padding: 22px 20px 18px; }
  .fmp-auth-box    { border-radius: 12px; }
  .fmp-table th, .fmp-table td { padding: 8px 10px; }
  .fmp-resumen-row { font-size: 13px; }
  .fmp-resumen-row.total { font-size: 17px; }
  .fmp-topbar      { padding: 0 14px; }
}

/* ─── ASTRA OVERRIDE ──────────────────────────────────── */
.fmp-app a, .fmp-admin-wrapper a {
  color: inherit; text-decoration: none;
}
.fmp-app button, .fmp-admin-wrapper button {
  font-family: var(--fmp-font);
}
/* evitar que Astra rompa el layout */
.fmp-layout { width: 100%; }
.ast-container .fmp-app,
.entry-content .fmp-app { max-width: 100%; }

/* ─── UTILIDADES ──────────────────────────────────────── */
.fmp-flex   { display: flex; }
.fmp-flex-c { display: flex; align-items: center; }
.fmp-gap-2  { gap: 8px; }
.fmp-gap-3  { gap: 12px; }
.fmp-mb-3   { margin-bottom: 12px; }
.fmp-mb-4   { margin-bottom: 16px; }
.fmp-mb-6   { margin-bottom: 24px; }
.fmp-mt-4   { margin-top: 16px; }
.fmp-text-sm{ font-size: 12px; }
.fmp-text-xs{ font-size: 11px; }
.fmp-text-muted { color: var(--fmp-text3); }
.fmp-fw-7   { font-weight: 700; }
.fmp-fw-8   { font-weight: 800; }
.fmp-mono   { font-family: 'Courier New', monospace; }
.fmp-hidden { display: none !important; }
.fmp-center { text-align: center; }

/* ═══════════════════════════════════════════════════════
   MODO EMBED — panel incrustado dentro del Escritorio WP
   Neutraliza el layout de pantalla completa para que el
   panel llene el área de contenido de WordPress en vez de
   descuadrarse y dejar espacio en blanco.
   ═══════════════════════════════════════════════════════ */
#fmp-root.fmp-embed {
  display: block;
  min-height: 0;
  margin: 12px 20px 24px 2px;
  border: 1px solid var(--fmp-border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--fmp-bg);
  box-shadow: 0 1px 10px rgba(0,0,0,.05);
}
.fmp-embed .fmp-app,
.fmp-embed.fmp-admin-wrapper { min-height: 0; }
.fmp-embed .fmp-layout      { min-height: 0; }

/* Barra lateral del plugin: de fija a columna normal */
.fmp-embed .fmp-sidebar {
  position: static;
  height: auto;
  min-height: 0;
  width: 210px;
  min-width: 210px;
  align-self: stretch;
}
.fmp-embed .fmp-main {
  margin-left: 0;
  min-height: 0;
  min-width: 0;
}
.fmp-embed .fmp-topbar { position: static; }
.fmp-embed .fmp-content { min-height: 420px; }

/* En modo embed no se cierra sesión desde aquí (no hay PIN) */
.fmp-embed #fmp-btn-logout,
.fmp-embed #fmp-admin-logout { display: none; }

/* Selector de vista (Admin / Individual / Multimisor) */
.fmp-embed-switch {
  display: inline-flex;
  gap: 4px;
  background: var(--fmp-bg);
  border: 1px solid var(--fmp-border);
  border-radius: 10px;
  padding: 3px;
}
.fmp-embed-btn {
  border: 0;
  background: transparent;
  color: var(--fmp-text2, #64748b);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--fmp-trans);
}
.fmp-embed-btn:hover { background: rgba(37,99,235,.08); color: var(--fmp-text); }
.fmp-embed-btn.active {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 1px 4px rgba(37,99,235,.35);
}

/* Responsivo: en pantallas chicas la barra lateral se apila arriba */
@media (max-width: 900px) {
  .fmp-embed .fmp-layout { flex-direction: column; }
  .fmp-embed .fmp-sidebar { width: 100%; min-width: 0; }
  .fmp-embed-switch { flex-wrap: wrap; }
}

/* ═══════════════════════════════════════════════════════
   PUENTE MOTOR ↔ FACTURADOR — sello de nivel, marca, tablas
   ═══════════════════════════════════════════════════════ */
.fmp-sidebar-logo .brand-row { display:flex; align-items:center; gap:10px; }
.fmp-brand-logo { object-fit:contain; border-radius:8px; flex-shrink:0; }

/* Sello de nivel del plan (PREMIUM / EMPRESARIAL / …) */
.fmp-tier-chip{
  display:inline-flex; align-items:center; gap:6px;
  font-size:11px; font-weight:800; letter-spacing:.08em;
  padding:3px 10px; border-radius:999px; line-height:1.6;
  color:#fff; background:var(--fmp-accent);
  box-shadow:0 1px 4px rgba(0,0,0,.18);
}
.fmp-sidebar-logo .fmp-tier-chip{ margin-top:8px; }

/* Acento por plan: el botón primario y bordes usan --fmp-accent */
.fmp-btn-primary{ background:var(--fmp-accent); border-color:var(--fmp-accent); }
.fmp-app[data-tier="4"] .fmp-btn-primary{ box-shadow:0 2px 10px rgba(184,134,11,.35); }

/* Tarjetas de plan (Mi Plan) */
.fmp-plan-card{ border-top:3px solid var(--fmp-accent); }
.fmp-plan-card.is-current{ outline:2px solid var(--fmp-accent); outline-offset:-2px; }

/* Tabla comparativa */
.fmp-compare{ width:100%; border-collapse:collapse; font-size:13px; }
.fmp-compare th, .fmp-compare td{
  padding:9px 10px; text-align:center; border-bottom:1px solid var(--fmp-border);
}
.fmp-compare thead th{
  background:var(--fmp-surface2); color:var(--fmp-text2);
  font-size:11px; text-transform:uppercase; letter-spacing:.04em; position:sticky; top:0;
}
.fmp-compare tbody tr:hover{ background:var(--fmp-surface2); }

/* Checkbox label de herramientas fiscales */
.fmp-check{ display:flex; align-items:center; gap:8px; font-size:13px; color:var(--fmp-text2); cursor:pointer; }
.fmp-check input{ width:16px; height:16px; accent-color:var(--fmp-accent); }

/* Selector de plan en el previsualizador embebido (WordPress) */
.fmp-embed-plan{
  font-size:12px; padding:5px 8px; border-radius:8px;
  border:1px solid var(--fmp-border); background:var(--fmp-surface);
  color:var(--fmp-text); max-width:230px;
}

/* ════════════════════════════════════════════════════════════════════
   FMP · SISTEMA DE TEMAS v9.5.0 — "personalidad del facturador"
   ───────────────────────────────────────────────────────────────────
   4 experiencias visuales completas (no solo color): tipografía de
   acento, fondos con textura, sombras, formas y aura de cada tema.
   Se activan con  [data-fmp-tema="..."]  en #fmp-root (lo pone el JS y
   también puede forzarlo el admin desde WordPress).

   maya   → Verde/oro institucional (marca Factura Maya). Profesional.
   aurora → Índigo/cian vibrante con degradados (como el dashboard demo).
   solar  → Cálido ámbar/coral, energético y creativo.
   noche  → Oscuro premium verde/oro sobre negro. Elegante/pro.
   ════════════════════════════════════════════════════════════════════ */

/* Transición suave al cambiar de tema */
.fmp-app, .fmp-admin-wrapper,
.fmp-app *, .fmp-admin-wrapper * {
  transition: background-color .35s ease, border-color .35s ease, color .25s ease, box-shadow .35s ease;
}

/* ── Capa de ambiente: se pinta detrás del contenido pero sobre el fondo ── */
[data-fmp-tema] { position: relative; }
[data-fmp-tema]::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: var(--fmp-ambient, transparent);
  opacity: var(--fmp-ambient-op, 0);
  transition: opacity .5s ease;
}
[data-fmp-tema] > * { position: relative; z-index: 1; }

/* ══════════ TEMA 1 · MAYA (verde/oro institucional) ══════════ */
[data-fmp-tema="maya"] {
  --fmp-bg:        #eef2ef;
  --fmp-surface:   #ffffff;
  --fmp-surface2:  #f5f8f5;
  --fmp-border:    #dce5df;
  --fmp-navy:      #0E3B2E;
  --fmp-navy2:     #0b2c22;
  --fmp-blue:      #C9A24B;
  --fmp-accent:    #0E3B2E;
  --fmp-sky:       #1f7a4d;
  --fmp-green:     #16794a;
  --fmp-text:      #16221d;
  --fmp-text2:     #35473f;
  --fmp-text3:     #6a7d73;
  --fmp-radius:    14px;
  --fmp-shadow:    0 2px 14px rgba(14,59,46,.10);
  --fmp-shadow-md: 0 6px 26px rgba(14,59,46,.14);
  --fmp-ambient:   radial-gradient(1100px 500px at 88% -8%, rgba(201,162,75,.16), transparent 60%),
                   radial-gradient(900px 460px at -6% 108%, rgba(14,59,46,.12), transparent 60%);
  --fmp-ambient-op: 1;
  --fmp-side-grad: linear-gradient(180deg,#0E3B2E,#0b2c22);
  --fmp-side-accent: #E4C778;
  --fmp-chip-grad: linear-gradient(90deg,#0E3B2E,#1f7a4d);
}
[data-fmp-tema="maya"] .fmp-card-title,
[data-fmp-tema="maya"] .fmp-topbar-title { letter-spacing:.2px; }

/* ══════════ TEMA 2 · AURORA (índigo/cian vibrante) ══════════ */
[data-fmp-tema="aurora"] {
  --fmp-bg:        #0d1226;
  --fmp-surface:   #161d3d;
  --fmp-surface2:  #1b2450;
  --fmp-border:    #2b3670;
  --fmp-navy:      #10163a;
  --fmp-navy2:     #0a0f28;
  --fmp-blue:      #6366f1;
  --fmp-accent:    #818cf8;
  --fmp-sky:       #22d3ee;
  --fmp-green:     #34d399;
  --fmp-text:      #eef1ff;
  --fmp-text2:     #c3cafe;
  --fmp-text3:     #8f9bd6;
  --fmp-text4:     #6b76ad;
  --fmp-radius:    16px;
  --fmp-shadow:    0 2px 18px rgba(0,0,0,.4);
  --fmp-shadow-md: 0 8px 34px rgba(99,102,241,.28);
  --fmp-ambient:   radial-gradient(900px 520px at 82% -10%, rgba(129,140,248,.34), transparent 58%),
                   radial-gradient(820px 520px at -8% 40%, rgba(34,211,238,.22), transparent 60%),
                   radial-gradient(760px 500px at 60% 118%, rgba(217,70,239,.22), transparent 62%);
  --fmp-ambient-op: 1;
  --fmp-side-grad: linear-gradient(180deg,#1a2250,#10163a);
  --fmp-side-accent: #22d3ee;
  --fmp-chip-grad: linear-gradient(90deg,#6366f1,#22d3ee);
}
[data-fmp-tema="aurora"] .fmp-card {
  background: linear-gradient(160deg, rgba(129,140,248,.08), rgba(34,211,238,.03)), var(--fmp-surface);
  border-color: #2b3670;
}
[data-fmp-tema="aurora"] .fmp-btn-primary {
  background: linear-gradient(90deg,#6366f1,#22d3ee) !important; border:none !important; color:#fff !important;
}
[data-fmp-tema="aurora"] .fmp-topbar { backdrop-filter: blur(8px); }

/* ══════════ TEMA 3 · SOLAR (ámbar/coral cálido, creativo) ══════════ */
[data-fmp-tema="solar"] {
  --fmp-bg:        #fdf6ee;
  --fmp-surface:   #fffdfa;
  --fmp-surface2:  #fdf1e3;
  --fmp-border:    #f0dcc4;
  --fmp-navy:      #7c2d12;
  --fmp-navy2:     #601f0c;
  --fmp-blue:      #ea580c;
  --fmp-accent:    #ea580c;
  --fmp-sky:       #f59e0b;
  --fmp-green:     #ca8a04;
  --fmp-text:      #3b1e0e;
  --fmp-text2:     #6b3f22;
  --fmp-text3:     #9a6b45;
  --fmp-radius:    18px;
  --fmp-shadow:    0 3px 16px rgba(234,88,12,.12);
  --fmp-shadow-md: 0 8px 30px rgba(234,88,12,.18);
  --fmp-ambient:   radial-gradient(1000px 520px at 86% -10%, rgba(245,158,11,.28), transparent 58%),
                   radial-gradient(900px 480px at -8% 106%, rgba(234,88,12,.16), transparent 60%);
  --fmp-ambient-op: 1;
  --fmp-side-grad: linear-gradient(180deg,#9a3412,#7c2d12);
  --fmp-side-accent: #fbbf24;
  --fmp-chip-grad: linear-gradient(90deg,#ea580c,#f59e0b);
}
[data-fmp-tema="solar"] .fmp-btn-primary {
  background: linear-gradient(90deg,#ea580c,#f59e0b) !important; border:none !important; color:#fff !important;
}

/* ══════════ TEMA 4 · NOCHE (oscuro premium verde/oro) ══════════ */
[data-fmp-tema="noche"] {
  --fmp-bg:        #0a0f0d;
  --fmp-surface:   #12211b;
  --fmp-surface2:  #16281f;
  --fmp-border:    #244034;
  --fmp-navy:      #0E3B2E;
  --fmp-navy2:     #071310;
  --fmp-blue:      #C9A24B;
  --fmp-accent:    #E4C778;
  --fmp-sky:       #34d399;
  --fmp-green:     #34d399;
  --fmp-text:      #eaf3ee;
  --fmp-text2:     #b9cec3;
  --fmp-text3:     #7d9488;
  --fmp-text4:     #5b6f64;
  --fmp-radius:    14px;
  --fmp-shadow:    0 2px 16px rgba(0,0,0,.5);
  --fmp-shadow-md: 0 8px 32px rgba(201,162,75,.2);
  --fmp-ambient:   radial-gradient(950px 520px at 84% -10%, rgba(201,162,75,.2), transparent 56%),
                   radial-gradient(820px 500px at -6% 108%, rgba(52,211,153,.12), transparent 60%);
  --fmp-ambient-op: 1;
  --fmp-side-grad: linear-gradient(180deg,#0E3B2E,#071310);
  --fmp-side-accent: #E4C778;
  --fmp-chip-grad: linear-gradient(90deg,#0E3B2E,#C9A24B);
}
[data-fmp-tema="noche"] .fmp-btn-primary {
  background: linear-gradient(90deg,#C9A24B,#E4C778) !important; border:none !important; color:#2a1f05 !important; font-weight:800;
}

/* ── Aplicación transversal de las variables de tema al shell ──
   (funciona para los 4 temas usando las vars --fmp-side-grad, etc.) */
[data-fmp-tema] .fmp-sidebar { background: var(--fmp-side-grad, var(--fmp-navy)); }
[data-fmp-tema] .fmp-sidebar-logo .brand span,
[data-fmp-tema] .fmp-nav-item.active .ico { color: var(--fmp-side-accent, #60a5fa); }
[data-fmp-tema] .fmp-nav-item.active {
  background: rgba(255,255,255,.12);
  box-shadow: inset 3px 0 0 var(--fmp-side-accent, #60a5fa);
}
[data-fmp-tema] .fmp-tier-chip { background: var(--fmp-chip-grad); color:#fff; border:none; }
[data-fmp-tema] .fmp-card {
  border-radius: var(--fmp-radius);
  box-shadow: var(--fmp-shadow);
}
[data-fmp-tema] .fmp-card:hover { box-shadow: var(--fmp-shadow-md); }
[data-fmp-tema] .fmp-stat-card {
  border-radius: var(--fmp-radius);
  background: linear-gradient(150deg, color-mix(in srgb, var(--fmp-accent) 8%, var(--fmp-surface)), var(--fmp-surface));
}

/* ── Selector de temas (menú de la luna) ── */
.fmp-tema-menu {
  position: absolute; top: 52px; right: 12px; z-index: 9999;
  background: var(--fmp-surface); border: 1px solid var(--fmp-border);
  border-radius: 16px; box-shadow: var(--fmp-shadow-lg, 0 10px 40px rgba(0,0,0,.2));
  padding: 12px; width: 300px; display: none;
}
.fmp-tema-menu.open { display: block; animation: fmpTemaIn .22s ease; }
@keyframes fmpTemaIn { from{opacity:0;transform:translateY(-8px)} to{opacity:1;transform:none} }
.fmp-tema-menu h5 {
  margin: 2px 4px 10px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--fmp-text3); font-weight: 800;
}
.fmp-tema-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.fmp-tema-op {
  cursor: pointer; border: 2px solid var(--fmp-border); border-radius: 13px;
  padding: 10px; text-align: left; background: var(--fmp-surface2);
  transition: transform .15s ease, border-color .15s ease;
}
.fmp-tema-op:hover { transform: translateY(-2px); }
.fmp-tema-op.sel { border-color: var(--fmp-accent); }
.fmp-tema-op .swatch { height: 34px; border-radius: 9px; margin-bottom: 7px; position: relative; overflow: hidden; }
.fmp-tema-op .swatch::after {
  content:""; position:absolute; right:6px; bottom:6px; width:14px; height:14px; border-radius:50%;
  background:var(--sw-accent); box-shadow:0 0 0 2px rgba(255,255,255,.6);
}
.fmp-tema-op .nm { font-size: 12.5px; font-weight: 800; color: var(--fmp-text); }
.fmp-tema-op .ds { font-size: 10.5px; color: var(--fmp-text3); margin-top: 1px; }
.fmp-tema-op.sel .nm::after { content:" ✓"; color: var(--fmp-green); }
.fmp-tema-lock { font-size:11px;color:var(--fmp-text3);margin-top:10px;padding:8px 10px;background:var(--fmp-surface2);border-radius:10px;line-height:1.4 }
