
/* ── MagnifyPass SaaS — Global Styles ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --mp-accent:  #cefb00;
  --mp-sidebar: #17181a;
  --mp-bg:      #f4f5f7;
  --mp-card:    #ffffff;
  --mp-text:    #111827;
  --mp-muted:   #6b7280;
  --mp-border:  #e5e7eb;
  --mp-radius:  12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; font-size: 14px; }
body { background: var(--mp-bg); color: var(--mp-text); min-height: 100vh; }
a { text-decoration: none; color: inherit; }

/* ── Sidebar ── */
#mp-sidebar {
  position: fixed; top: 0; left: 0; width: 220px; height: 100vh;
  background: var(--mp-sidebar); display: flex; flex-direction: column;
  z-index: 100; border-right: 1px solid rgba(255,255,255,.06);
}
.mp-sidebar-logo {
  padding: 24px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.mp-sidebar-logo svg { width: 130px; height: auto; }

.mp-sidebar-section {
  font-size: 10px; font-weight: 600; letter-spacing: .08em;
  color: rgba(255,255,255,.25); text-transform: uppercase;
  padding: 16px 20px 6px;
}

nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.mp-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; margin: 2px 10px; border-radius: 8px;
  color: rgba(255,255,255,.55); font-size: 13.5px; font-weight: 500;
  transition: background .15s, color .15s; cursor: pointer;
}
.mp-nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.mp-nav-item.active {
  background: var(--mp-accent); color: var(--mp-sidebar); font-weight: 600;
}
.mp-nav-item.active .mp-nav-icon { opacity: 1; }
.mp-nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: .7; }
.mp-nav-item.active .mp-nav-icon { opacity: 1; }

.mp-sidebar-footer { padding: 12px 10px 20px; border-top: 1px solid rgba(255,255,255,.08); }
.mp-nav-logout { color: rgba(239,68,68,.7); }
.mp-nav-logout:hover { background: rgba(239,68,68,.12) !important; color: #ef4444; }
.mp-sidebar-sep { height: 1px; background: rgba(255,255,255,.08); margin: 6px 10px; }

/* ── Content ── */
#mp-content {
  margin-left: 220px;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
.mp-page { padding: 28px 32px; flex: 1; max-width: 1300px; }

/* ── Header ── */
.mp-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }
.mp-header h1 { font-size: 24px; font-weight: 700; }
.mp-header p  { font-size: 13px; color: var(--mp-muted); margin-top: 3px; }
.mp-header-actions { display: flex; gap: 10px; align-items: center; }

/* ── Badges ── */
.mp-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.mp-badge--activo  { background: rgba(206,251,0,.15); color: #5a7a00; }
.mp-badge--inactivo{ background: rgba(107,114,128,.12); color: #4b5563; }
.mp-badge--danger  { background: rgba(239,68,68,.12); color: #dc2626; }

/* ── Stat cards ── */
.mp-stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 20px; }
.mp-stat {
  padding: 20px 22px; border-radius: var(--mp-radius);
  background: var(--mp-card); border: 1px solid var(--mp-border);
  position: relative; overflow: hidden;
}
.mp-stat::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; border-radius: 3px 3px 0 0;
}
.mp-stat--lime::before   { background: #cefb00; }
.mp-stat--green::before  { background: #10b981; }
.mp-stat--blue::before   { background: #3b82f6; }
.mp-stat--gray::before   { background: #9ca3af; }
.mp-stat--teal::before   { background: #14b8a6; }
.mp-stat--purple::before { background: #8b5cf6; }
.mp-stat--orange::before { background: #f97316; }
.mp-stat--rose::before   { background: #f43f5e; }

.mp-stat-label { font-size: 12px; font-weight: 500; color: var(--mp-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.mp-stat-value { font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; margin-bottom: 8px; }
.mp-stat-badge { display: inline-flex; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 500; }
.mp-stat-badge--up  { background: rgba(16,185,129,.1); color: #059669; }
.mp-stat-badge--down{ background: rgba(239,68,68,.1); color: #dc2626; }
.mp-stat-badge--neu { background: rgba(107,114,128,.1); color: #6b7280; }

/* ── Charts ── */
.mp-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mp-chart-card {
  background: var(--mp-card); border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius); padding: 20px 22px;
}
.mp-chart-title { font-size: 14px; font-weight: 600; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }
.mp-chart-title span { font-size: 12px; font-weight: 400; color: var(--mp-muted); }
.mp-chart-wrap { position: relative; }
.mp-donut-legend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--mp-muted); margin-top: 12px; justify-content: center; }
.mp-donut-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ── Tables ── */
.mp-table-card { background: var(--mp-card); border: 1px solid var(--mp-border); border-radius: var(--mp-radius); overflow: hidden; }
.mp-table-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--mp-border); }
.mp-table-info { font-size: 12px; color: var(--mp-muted); }
.mp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mp-table th { padding: 10px 16px; text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--mp-muted); background: #f9fafb; border-bottom: 1px solid var(--mp-border); }
.mp-table td { padding: 12px 16px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
.mp-table tr:last-child td { border-bottom: none; }
.mp-table tr:hover td { background: #fafafa; }
.mp-tbl-user { display: flex; align-items: center; gap: 10px; }
.mp-tbl-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--mp-accent); color: var(--mp-sidebar); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.col-name { font-weight: 500; font-size: 13.5px; }
.mp-rank-num { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; font-size: 12px; font-weight: 700; background: #f3f4f6; color: var(--mp-muted); }
.mp-rank-num.top1 { background: #fef08a; color: #854d0e; }
.mp-rank-num.top2 { background: #e5e7eb; color: #374151; }
.mp-rank-num.top3 { background: #fed7aa; color: #9a3412; }
.mp-sello-bar { height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; width: 100px; }
.mp-sello-fill { height: 100%; background: var(--mp-accent); border-radius: 3px; transition: width .3s; }
.mp-empty { padding: 40px; text-align: center; color: var(--mp-muted); }

/* ── Forms ── */
.mp-form-section { background: var(--mp-card); border: 1px solid var(--mp-border); border-radius: var(--mp-radius); padding: 24px; margin-bottom: 20px; }
.mp-form-title { font-size: 15px; font-weight: 600; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--mp-border); }
.mp-form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mp-field { display: flex; flex-direction: column; gap: 5px; }
.mp-label { font-size: 12.5px; font-weight: 600; color: #374151; }
.mp-label .mp-optional { font-weight: 400; color: var(--mp-muted); }
.mp-input, .mp-select, .mp-textarea {
  padding: 9px 13px; border: 1.5px solid var(--mp-border); border-radius: 8px;
  font-family: inherit; font-size: 13.5px; color: var(--mp-text); background: #f9fafb;
  transition: border-color .15s, box-shadow .15s;
  outline: none; width: 100%;
}
.mp-input:focus, .mp-select:focus, .mp-textarea:focus {
  border-color: #b5e000; background: #fff;
  box-shadow: 0 0 0 3px rgba(206,251,0,.2);
}
.mp-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 20px; border-radius: 8px; font-family: inherit;
  font-size: 13.5px; font-weight: 600; cursor: pointer; border: none;
  transition: background .15s, transform .1s, box-shadow .15s;
}
.mp-btn--primary { background: var(--mp-accent); color: var(--mp-sidebar); }
.mp-btn--primary:hover { background: #b5e000; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(206,251,0,.3); }
.mp-btn--ghost { background: transparent; color: var(--mp-muted); border: 1.5px solid var(--mp-border); }
.mp-btn--ghost:hover { background: #f3f4f6; color: var(--mp-text); }
.mp-btn--danger { background: rgba(239,68,68,.1); color: #dc2626; }
.mp-btn--danger:hover { background: rgba(239,68,68,.2); }
.mp-alert { padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.mp-alert--success { background: rgba(206,251,0,.1); border: 1px solid rgba(206,251,0,.3); color: #3d5c00; }
.mp-alert--error   { background: #fef2f2; border: 1px solid #fca5a5; color: #b91c1c; }

/* ── Scanner ── */
.scanner-wrap { max-width: 480px; margin: 40px auto; }
.scanner-card { background: var(--mp-card); border-radius: 16px; padding: 32px; border: 1px solid var(--mp-border); }
.scanner-result { padding: 20px; border-radius: 12px; text-align: center; margin-top: 20px; display: none; }
.scanner-result.success { background: rgba(206,251,0,.1); border: 1px solid rgba(206,251,0,.4); }
.scanner-result.canje   { background: rgba(139,92,246,.1); border: 1px solid rgba(139,92,246,.4); }
.scanner-result.error   { background: #fef2f2; border: 1px solid #fca5a5; }
.scanner-nombre { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.scanner-sellos { font-size: 36px; font-weight: 800; font-variant-numeric: tabular-nums; }
#qr-reader { border-radius: 12px; overflow: hidden; }

/* ── Login ── */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #111218; padding: 24px; }
.login-card { width: 360px; background: #fff; border-radius: 16px; padding: 40px 36px 32px; box-shadow: 0 24px 60px rgba(0,0,0,.55); }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo svg { width: 140px; height: auto; }
.login-sub { font-size: 12px; color: var(--mp-muted); text-align: center; margin-top: 6px; }

/* ── Landing ── */
.landing-body { min-height: 100vh; background: #111218; display: flex; align-items: center; justify-content: center; padding: 24px; }
.landing-card { width: 100%; max-width: 420px; background: #1a1b1f; border-radius: 20px; padding: 36px; border: 1px solid rgba(255,255,255,.08); }
.landing-logo { text-align: center; margin-bottom: 28px; }
.landing-title { font-size: 22px; font-weight: 700; color: #fff; text-align: center; margin-bottom: 6px; }
.landing-sub   { font-size: 13px; color: rgba(255,255,255,.5); text-align: center; margin-bottom: 28px; }
.landing-input {
  width: 100%; padding: 11px 14px; border-radius: 10px;
  border: 1.5px solid rgba(255,255,255,.1); background: rgba(255,255,255,.06);
  color: #fff; font-family: inherit; font-size: 14px; margin-bottom: 12px; outline: none;
  transition: border-color .15s;
}
.landing-input:focus { border-color: #cefb00; background: rgba(255,255,255,.08); }
.landing-input::placeholder { color: rgba(255,255,255,.3); }
.landing-btn {
  width: 100%; padding: 13px; border-radius: 10px; border: none;
  background: #cefb00; color: #17181a; font-family: inherit; font-size: 15px;
  font-weight: 700; cursor: pointer; transition: background .15s, transform .1s;
  margin-top: 6px;
}
.landing-btn:hover { background: #b5e000; transform: translateY(-1px); }
.landing-result { margin-top: 20px; padding: 20px; border-radius: 12px; text-align: center; display: none; }
.landing-result.success { background: rgba(206,251,0,.08); border: 1px solid rgba(206,251,0,.2); }
.landing-result .pass-links { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.pass-link-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; border-radius: 10px; font-weight: 600; font-size: 14px;
  text-decoration: none; transition: opacity .15s;
}
.pass-link-btn:hover { opacity: .85; }
.pass-link-btn--apple  { background: #000; color: #fff; }
.pass-link-btn--google { background:#fff; border:1.5px solid #e8eaed; color:#3c4043; }

/* ── Superadmin ── */
.sa-comercio-card {
  background: var(--mp-card); border: 1px solid var(--mp-border); border-radius: var(--mp-radius);
  padding: 18px 20px; display: flex; align-items: center; justify-content: space-between;
}
.sa-comercio-name { font-weight: 600; font-size: 14px; }
.sa-comercio-meta { font-size: 12px; color: var(--mp-muted); margin-top: 2px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  #mp-sidebar { display: none; }
  #mp-content { margin-left: 0; }
  .mp-stats-grid { grid-template-columns: 1fr 1fr; }
  .mp-grid-2 { grid-template-columns: 1fr; }
  .mp-page { padding: 16px; }
}

/* ── Tabs ── */
.mp-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--mp-border); margin-bottom: 24px; }
.mp-tab { background: none; border: none; padding: 10px 20px; font-family: inherit; font-size: 13.5px; font-weight: 500; color: var(--mp-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: color .15s, border-color .15s; border-radius: 0; }
.mp-tab:hover { color: var(--mp-text); }
.mp-tab--active { color: var(--mp-text); font-weight: 600; border-bottom-color: var(--mp-accent); }
