/* =====================================================================
   DedicaQR — Sprint 14 CSS
   Multi-Currency + Revenue Share + SIFEN
   ===================================================================== */

:root {
  --dqr-brand: #C9184A;
  --dqr-pink:  #FFB3C1;
  --dqr-gold:  #D4A24C;
  --dqr-bg:    #FFF8F5;
  --dqr-ink:   #1a1a1a;
  --dqr-muted: #6b6b6b;
  --dqr-line:  #ececec;
}

/* =====================================================================
   CURRENCY SWITCHER (público)
   ===================================================================== */

.currency-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: white;
  border: 1px solid var(--dqr-line);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
}
.currency-switcher label {
  font-weight: 700;
  color: var(--dqr-brand);
  margin: 0;
  cursor: pointer;
}
.currency-switcher select {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 4px 6px;
  font-size: 13px;
  color: var(--dqr-ink);
  outline: none;
}

.currency-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--dqr-bg);
  border: 1px solid var(--dqr-line);
  font-size: 12px;
  font-weight: 600;
  color: var(--dqr-ink);
}

/* Precio destacado */
.price-display {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.price-display .price-main {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--dqr-brand);
}
.price-display .price-original {
  font-size: 0.85rem;
  color: var(--dqr-muted);
  text-decoration: line-through;
}
.price-display .price-approx {
  font-size: 0.75rem;
  color: var(--dqr-muted);
  font-style: italic;
}

/* =====================================================================
   ADMIN — Revenue Share
   ===================================================================== */

.rev-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 16px 0 32px;
}
.rev-card {
  background: white;
  border: 1px solid var(--dqr-line);
  border-radius: 12px;
  padding: 18px 20px;
  position: relative;
}
.rev-card-currency {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--dqr-brand);
  margin-bottom: 8px;
}
.rev-card-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 4px 0;
  border-bottom: 1px dashed #f3f3f3;
}
.rev-card-row:last-of-type { border-bottom: 0; }
.rev-card-row span { color: var(--dqr-muted); }
.rev-card-foot {
  margin-top: 10px;
  font-size: 12px;
  color: var(--dqr-muted);
  text-align: right;
}

.rev-table th { background: var(--dqr-bg); }

/* =====================================================================
   ADMIN — Exchange Rates
   ===================================================================== */

.adm-fx-table code { font-size: 13px; color: var(--dqr-brand); }

/* =====================================================================
   ADMIN — SIFEN
   ===================================================================== */

.sifen-status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid transparent;
}
.sifen-status-draft     { background: #f4f4f4; color: #555;    border-color: #ddd; }
.sifen-status-signed    { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.sifen-status-sent      { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.sifen-status-approved  { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.sifen-status-rejected  { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.sifen-status-cancelled { background: #e5e7eb; color: #374151; border-color: #d1d5db; }
.sifen-status-inutilized{ background: #fef2f2; color: #7f1d1d; border-color: #fecaca; }

.sifen-env-test  { background: #fef3c7; color: #92400e; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.sifen-env-prod  { background: #d1fae5; color: #065f46; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; }

.sifen-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 16px 0 28px;
}
.sifen-status-cell {
  background: white;
  border: 1px solid var(--dqr-line);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sifen-status-cell strong { font-size: 1.6rem; color: var(--dqr-ink); }

.sifen-invoice-card {
  background: white;
  border: 1px solid var(--dqr-line);
  border-radius: 12px;
  padding: 24px;
  margin: 16px 0;
}

.sifen-kv {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 18px;
}
.sifen-kv td {
  padding: 6px 10px;
  border-bottom: 1px solid #f5f5f5;
  font-size: 14px;
}
.sifen-kv td:first-child {
  color: var(--dqr-muted);
  width: 35%;
  font-weight: 600;
}
.sifen-kv tr.sifen-total td {
  border-top: 2px solid var(--dqr-brand);
  border-bottom: 0;
  padding-top: 10px;
  font-size: 1.1rem;
}
.sifen-kv code {
  font-size: 12px;
  word-break: break-all;
}

.sifen-events-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sifen-events-timeline li {
  background: white;
  border-left: 3px solid var(--dqr-brand);
  padding: 10px 14px;
  margin-bottom: 6px;
  font-size: 13px;
  border-radius: 0 6px 6px 0;
}
.sifen-event-type {
  font-weight: 700;
  color: var(--dqr-brand);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}
.sifen-event-time {
  color: var(--dqr-muted);
  margin-left: 12px;
}
.sifen-event-http {
  margin-left: 12px;
  background: var(--dqr-bg);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
}
.sifen-events-timeline details { margin-top: 6px; }
.sifen-events-timeline summary { cursor: pointer; color: var(--dqr-brand); font-size: 12px; }

.sifen-xml-pre {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 14px;
  border-radius: 6px;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.5;
  max-height: 500px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.adm-grid-2-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 640px) { .adm-grid-2-inner { grid-template-columns: 1fr; } }

/* Re-aprovechamiento de badges de status existentes */
.badge-locked   { background: #fef3c7; color: #92400e; }
.badge-settled  { background: #d1fae5; color: #065f46; }
.badge-disputed { background: #fee2e2; color: #991b1b; }
