:root {
  --mp-navy: #14213D;
  --mp-navy-light: #1F3157;
  --mp-orange: #F5A623;
  --mp-orange-dark: #E0941A;
  --mp-bg: #F4F6FB;
  --mp-card: #FFFFFF;
  --mp-text: #1B1F2A;
  --mp-muted: #6B7280;
  --mp-danger: #E0473A;
  --mp-success: #2CA86B;
  --mp-radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--mp-bg);
  color: var(--mp-text);
}

::selection { background: var(--mp-orange); color: var(--mp-navy); }

/* Caja de logo: hace que CUALQUIER logo subido por el negocio (proporción
   cuadrada, rectangular, fondo transparente u oscuro) se vea limpio y
   consistente en toda la interfaz. */
.mp-logo-box {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}
.mp-logo-box img { width: 100%; height: 100%; object-fit: contain; display: block; }

a { color: inherit; }

.mp-center-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

body:has(.mp-center-screen) {
  background:
    radial-gradient(circle at 12% 8%, rgba(245,166,35,.10) 0%, transparent 40%),
    radial-gradient(circle at 88% 92%, rgba(20,33,61,.06) 0%, transparent 45%),
    var(--mp-bg);
}

.mp-auth-card {
  background: var(--mp-card);
  width: 100%;
  max-width: 380px;
  border-radius: 20px;
  padding: 38px 32px 32px;
  box-shadow: 0 20px 50px rgba(20, 33, 61, 0.14);
  text-align: center;
  position: relative;
  border-top: 4px solid var(--mp-orange);
  animation: mp-card-in .5s cubic-bezier(.2,.8,.3,1);
}
@keyframes mp-card-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mp-auth-card .mp-logo-box {
  width: 96px;
  height: 96px;
  margin: 0 auto 10px;
  padding: 10px;
  box-shadow: 0 6px 18px rgba(20,33,61,.10);
  border: 1px solid #EEF0F5;
}

.mp-auth-card h1 {
  font-size: 20px;
  margin: 4px 0 2px;
  color: var(--mp-navy);
}

.mp-auth-card .tagline {
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--mp-orange-dark);
  font-weight: 600;
  margin-bottom: 24px;
}

.mp-field { text-align: left; margin-bottom: 16px; }
.mp-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--mp-navy);
  margin-bottom: 6px;
}
.mp-field input, .mp-field select, .mp-field textarea {
  width: 100%;
  padding: 11px 12px;
  border-radius: 8px;
  border: 1px solid #D8DDE6;
  font-size: 14px;
  background: #FAFBFD;
}
.mp-field input:focus, .mp-field select:focus, .mp-field textarea:focus {
  outline: none;
  border-color: var(--mp-orange);
  background: #fff;
}

.mp-btn {
  display: inline-block;
  width: 100%;
  padding: 12px;
  border-radius: 9px;
  border: none;
  background: var(--mp-navy);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
  text-align: center;
  text-decoration: none;
}
.mp-btn:hover { background: var(--mp-navy-light); box-shadow: 0 6px 16px rgba(20,33,61,.20); transform: translateY(-1px); }
.mp-btn:active { transform: translateY(0); }

.mp-btn-orange { background: var(--mp-orange); color: var(--mp-navy); }
.mp-btn-orange:hover { background: var(--mp-orange-dark); box-shadow: 0 6px 16px rgba(224,148,26,.30); }

.mp-btn-danger { background: var(--mp-danger); }
.mp-btn-outline { background: transparent; border: 1px solid var(--mp-navy); color: var(--mp-navy); }
.mp-btn-outline:hover { background: rgba(20,33,61,.06); }

.mp-alert {
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
  text-align: left;
  animation: mp-card-in .3s ease;
}
.mp-alert-error { background: #FDEDEC; color: #B3261E; border: 1px solid #F6C6C2; }
.mp-alert-success { background: #E9F8EF; color: #1B7A45; border: 1px solid #BFE9CF; }
.mp-alert-info { background: #EAF1FF; color: #1E4FA0; border: 1px solid #C8DAFA; }

.mp-link-row { margin-top: 16px; font-size: 13px; color: var(--mp-muted); }
.mp-link-row a { color: var(--mp-orange-dark); font-weight: 600; text-decoration: none; }

/* --- Layout de paneles (admin general y panel de cuenta) --- */
.mp-shell { display: flex; min-height: 100vh; }
.mp-sidebar {
  width: 236px;
  background: linear-gradient(180deg, var(--mp-navy) 0%, var(--mp-navy-light) 100%);
  color: #fff;
  padding: 24px 16px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.mp-sidebar .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; padding: 0 6px; }
.mp-sidebar .brand .mp-logo-box {
  width: 40px; height: 40px; padding: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,.18);
}
.mp-sidebar .brand span { font-weight: 800; font-size: 16.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.2; }
.mp-sidebar hr.mp-sep { border: none; border-top: 1px solid rgba(255,255,255,.10); margin: 10px 6px 14px; }
.mp-sidebar nav { flex: 1; }
.mp-sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  color: #C9D2E3;
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 3px;
  transition: background .12s, color .12s, transform .12s;
}
.mp-sidebar nav a .ico { width: 18px; text-align: center; opacity: .9; flex-shrink: 0; }
.mp-sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; transform: translateX(2px); }
.mp-sidebar nav a.active {
  background: linear-gradient(90deg, rgba(245,166,35,.22), rgba(245,166,35,.06));
  color: #fff;
  box-shadow: inset 3px 0 0 var(--mp-orange);
}
.mp-sidebar nav a.nav-secondary { color: #93A0B8; font-size: 13px; margin-top: 8px; }
.mp-sidebar .logout { margin-top: 20px; }

.mp-main { flex: 1; padding: 28px 34px; }
.mp-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 10px;
}
.mp-topbar h1 { font-size: 22px; color: var(--mp-navy); margin: 0; }
.mp-topbar p.mp-sub { margin: 2px 0 0; color: var(--mp-muted); font-size: 13px; }
.mp-badge { padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; display: inline-block; }
.mp-badge-active { background: #E9F8EF; color: #1B7A45; }
.mp-badge-expired { background: #FDEDEC; color: #B3261E; }
.mp-badge-pending { background: #FFF6E5; color: #A5690E; }
.mp-badge-suspended { background: #EFEFEF; color: #555; }
.mp-badge-role { background: #EAF1FF; color: #1E4FA0; }
.mp-badge-low { background: #FFF1E8; color: #B3521E; }

.mp-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 26px; }
.mp-stat {
  background: #fff; border-radius: var(--mp-radius); padding: 18px 20px;
  box-shadow: 0 4px 14px rgba(20,33,61,.06);
  border-left: 3px solid var(--mp-orange);
  transition: transform .15s, box-shadow .15s;
}
.mp-stat:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(20,33,61,.10); }
.mp-stat .num { font-size: 26px; font-weight: 800; color: var(--mp-navy); }
.mp-stat .label { font-size: 12px; color: var(--mp-muted); text-transform: uppercase; letter-spacing: .5px; }

.mp-panel {
  background: #fff; border-radius: var(--mp-radius); padding: 22px;
  box-shadow: 0 4px 14px rgba(20,33,61,.06); margin-bottom: 20px;
  border: 1px solid #F0F2F7;
}
.mp-panel h2 { font-size: 16px; color: var(--mp-navy); margin-top: 0; }
.mp-panel + .mp-panel { margin-top: 0; }

table.mp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.mp-table th { text-align: left; padding: 10px 8px; color: var(--mp-muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; border-bottom: 2px solid #EEF0F5; }
table.mp-table td { padding: 10px 8px; border-bottom: 1px solid #EEF0F5; vertical-align: middle; }
table.mp-table tr:hover td { background: #FAFBFD; }

.mp-inline-form { display: inline-flex; gap: 6px; align-items: center; }
.mp-small-btn { padding: 6px 10px; font-size: 12px; border-radius: 7px; border: 1px solid #D8DDE6; background: #fff; cursor: pointer; text-decoration: none; color: var(--mp-text); transition: background .12s, border-color .12s; }
.mp-small-btn:hover { background: #F4F6FB; border-color: var(--mp-orange); }

/* Tarjeta de producto (usada en el selector rápido y catálogos) */
.mp-thumb {
  width: 36px; height: 36px; border-radius: 8px; object-fit: cover;
  border: 1px solid #E4E8F0; background: #fff;
}
.mp-thumb-empty {
  width: 36px; height: 36px; border-radius: 8px; background: #F3F5F9;
  border: 1px dashed #D8DDE6;
}

/* --- Candado de la clave de productos (rol vendedor) --- */
.mp-gate {
  background: linear-gradient(135deg, #FFF8EC 0%, #FFF 60%);
  border: 1px solid #F5D9A8;
  border-radius: var(--mp-radius);
  padding: 22px;
  margin-bottom: 20px;
}
.mp-gate .mp-gate-icon {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--mp-orange); color: var(--mp-navy);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; margin-bottom: 10px;
}
.mp-gate h2 { color: var(--mp-navy); margin-top: 0; }
.mp-gate form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.mp-gate .mp-field { margin-bottom: 0; flex: 1; min-width: 200px; }

@media (max-width: 800px) {
  .mp-shell { flex-direction: column; }
  .mp-sidebar { width: 100%; }
  .mp-main { padding: 18px; }
  .mp-gate form { flex-direction: column; align-items: stretch; }
}
